Add JS files

This commit is contained in:
2025-05-12 15:45:17 +00:00
parent 7ddd15c4fa
commit 967007b0c7
3239 changed files with 1157078 additions and 0 deletions

View File

@@ -0,0 +1,134 @@
//START:
$(document).ready(
function() {
var checkgen;
// confirm exit
window.onbeforeunload = confirmExit;
// prevent submit by enter press
lockEnter();
// categories
getCategoriesList();
// searchProductInput change
$('#searchProductsInput').keyup(function() {
searchProducts();
});
$('#parent_id').on('inputchange',
function() {
$(".loading_panel").css("display", "block");
setTimeout(function() {
getParentInfo($("#parent_id").val(), 'Accounts');
}, 1000);
});
$("#kind").change(function() {
if($("#kind").val()=='import'){
$("#import_table").show(); $("#import_title").show();
}else{
$("#import_table").hide(); $("#import_title").hide();
}
});
DrawHeaders();
//("#register_date").prop("disabled", true);
$("#assigned_user_name").prop("disabled", true);
//$("#register_date_trigger").hide();
$("#import_table").hide();
$("#import_title").hide();
$("#btn_assigned_user_name").hide();
$("#btn_clr_assigned_user_name").hide();
if($("#kind").val()=='import'){
$("#import_table").show(); $("#import_title").show();
}else{
$("#import_table").hide(); $("#import_title").hide();
}
$(".loading_panel").css("display", "none");
if (($("#new_number").val() == true)
&& ($("#duplicate").val() != true)) {
checkgen=1;
} else if (($("#new_number").val() == true)
&& ($("#duplicate").val() == true)) {
checkgen=1;
getItems();
} else {
checkgen=0;
getItems();
}
$("#stock").change(function() {
$("#stock_id").val(($("#stock :selected").val()));
if(checkgen==1){
generateNumber();
}
});
if($("#stock_id").val()!='') {
$("#stock_id").val(($("#stock :selected").val()));
if(checkgen==1){
generateNumber();
}
}
// make pz from other doc
if ($("#out_id").val()
&& $("#out_module").val()) {
getItems2();
}
// handle setItems
setITEMS = function() {
var formname = 'EditView';
if (check_form_(formname) == true) {
SetTab('ITEMS');
checkProducts();
calculateTotal();
//disable stock change
$("#stock").prop("disabled", true);
}
};
});
// handle save
var check_form_ = check_form;
check_form = function(formname) {
if (confirm('Czy potwierdzić Dokument PZ?')) {
$("#status").val("accepted");
} else {
$("#status").val("registered");
}
window.onbeforeunload = null;
if (items.length == 0) {
alert("Brak produktów");
return false;
}
$(".loading_panel").css("display", "block");
$("#register_date").prop("disabled", false);
$("#assigned_user_name").prop("disabled", false);
$("#position_list").val(JSON.stringifyNoSecurity(items));
var check = checkProducts();
$(".loading_panel").css("display", "none");
if (check_form_(formname) == false || check == false) {
$("#register_date").prop("disabled", true);
$("#assigned_user_name").prop("disabled", true);
window.onbeforeunload = confirmExit;
$(".loading_panel").css("display", "none");
return false;
} else {
return true;
}
};
function confirmExit() {
return "";
}
function lockEnter() {
// prevent default
$(window).keydown(function(event) {
if (event.keyCode == 13 && $(":focus").prop('tagName')!='TEXTAREA') {
event.preventDefault();
return false;
}
});
}

View File

@@ -0,0 +1,7 @@
//START:
$(document).ready(
function() {
DrawHeaders();
getItems(false);
});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,114 @@
columns = new Array();
//define columns
//begin: number
columns[0] = {
'name' : 'number',
'label' : 'Lp.',
'width' : 4,
'content' : new Array(),
};
columns[0]['content'][0] = {'name' : '', 'type': 'text', 'readonly' : true};
//end: number
//begin: code
columns[1] = {
'name' : 'product_',
'label' : 'Kod',
'width' : 6,
'content' : new Array(),
};
columns[1]['content'][0] = {'name' : 'code', 'type': 'hidden', 'readonly' : true};
columns[1]['content'][1] = {'name' : 'id', 'type': 'hidden'};
columns[1]['content'][2] = {'name' : 'link', 'type': 'text', 'readonly' : true};
//end: code
//begin: name
columns[2] = {
'name' : 'name',
'label' : 'Nazwa',
'width' : 20,
'content' : new Array(),
};
columns[2]['content'][0] = {'name' : '', 'type': 'text'};
//end: name
//begin: quantity
columns[3] = {
'name' : 'quantity',
'label' : 'Ilość',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[3]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'onChange' : 'checkProducts();'};
//end: quantity
//begin: unit
columns[4] = {
'name' : 'unit_',
'label' : 'J.M.',
'width' : 5,
'content' : new Array(),
'align' : 'center',
};
columns[4]['content'][0] = {'name' : 'name', 'type': 'text','readonly' : true};
columns[4]['content'][1] = {'name' : 'id', 'type': 'hidden'};
//end: unit
//begin: price
columns[5] = {
'name' : 'price',
'label' : 'Cena',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[5]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true};
//end: price
//begin: total
columns[6] = {
'name' : 'total',
'label' : 'Wartość',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[6]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true};
//end: total
columns[7] = {
'name' : 'price_fk',
'label' : 'Cena<br>na FK',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[7]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'readonly' : false,'onChange' :''};
columns[8] = {
'name' : 'ecmvat_',
'label' : 'VAT (%)',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[8]['content'][0] = {'name' : 'name', 'type': 'text'};
columns[8]['content'][1] = {'name' : 'value', 'type': 'hidden'};
columns[8]['content'][2] = {'name' : 'id', 'type': 'hidden'};
columns[9] = {
'name' : 'palet',
'label' : 'Ilość<br>palet',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[9]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'readonly' : false,'onChange' :''};
columns[10] = {
'name' : 'clo',
'label' : 'Cło',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[10]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'readonly' : false,'onChange' :''};
columns[11] = {
'name' : 'waga',
'label' : 'Waga<br>Netto',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[11]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : false, 'readonly' : false,'onChange' :''};

View File

@@ -0,0 +1,134 @@
columns = new Array();
//define columns
//begin: number
columns[0] = {
'name' : 'number',
'label' : 'Lp.',
'width' : 4,
'content' : new Array(),
};
columns[0]['content'][0] = {'name' : '', 'type': 'text', 'readonly' : true};
//end: number
//begin: code
columns[1] = {
'name' : 'product_',
'label' : 'Kod',
'width' : 6,
'content' : new Array(),
};
columns[1]['content'][0] = {'name' : 'code', 'type': 'hidden', 'readonly' : true};
columns[1]['content'][1] = {'name' : 'id', 'type': 'hidden'};
columns[1]['content'][2] = {'name' : 'link', 'type': 'text', 'readonly' : true};
columns[1]['content'][3] = {'name' : 'category_id', 'type': 'hidden'};
//end: code
//begin: name
columns[2] = {
'name' : 'name',
'label' : 'Nazwa',
'width' : 20,
'content' : new Array(),
};
columns[2]['content'][0] = {'name' : '', 'type': 'text'};
//end: name
//begin: quantity
columns[3] = {
'name' : 'quantity',
'label' : 'Ilość',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[3]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());', 'precision' : '2'};
//end: quantity
//begin: price
columns[4] = {
'name' : 'price',
'label' : 'Cena',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[4]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'};
//end: price
//begin: unit
columns[5] = {
'name' : 'unit_',
'label' : 'J.M.',
'width' : 5,
'content' : new Array(),
'align' : 'center',
};
columns[5]['content'][0] = {'name' : 'name', 'type': 'text','readonly' : true};
columns[5]['content'][1] = {'name' : 'id', 'type': 'hidden'};
//end: unit
//begin: stock_state
columns[6] = {
'name' : 'stock_state',
'label' : 'Stan',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[6]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true,'readonly' : true};
//end: stock_state
//begin: options
columns[7] = {
'name' : 'price_fk',
'label' : 'Cena<br>na FK',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[7]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'readonly' : false, 'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'};
//end: price_start
//begin: ecmvat
columns[8] = {
'name' : 'ecmvat_',
'label' : 'VAT (%)',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[8]['content'][0] = {'name' : 'name', 'type': 'text'};
columns[8]['content'][1] = {'name' : 'value', 'type': 'hidden'};
columns[8]['content'][2] = {'name' : 'id', 'type': 'hidden'};
//end: ecmvat
//begin: total
columns[9] = {
'name' : 'total',
'label' : 'Wartość',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[9]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'readonly' : true};
columns[10] = {
'name' : 'palet',
'label' : 'Ilość<br>palet',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[10]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'readonly' : false, 'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'};
columns[11] = {
'name' : 'waga',
'label' : 'Waga<br>Netto',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[11]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'readonly' : false, 'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'};
columns[12] = {
'name' : 'clo',
'label' : 'Pole<br>dod.',
'width' : 5,
'content' : new Array(),
'align' : 'right',
};
columns[12]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'readonly' : false, 'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'};
columns[13] = {
'name' : 'options',
'label' : 'Opcje',
'width' : 3,
'content' : new Array(),
};