Add JS files
This commit is contained in:
259
modules/EcmStockDocOuts/javascript/Consignments.js
Executable file
259
modules/EcmStockDocOuts/javascript/Consignments.js
Executable file
@@ -0,0 +1,259 @@
|
||||
var checkProductIsConsignment = function() {
|
||||
var count = $('#' + itemsTable + '_T tr').length - 1; // -1 - thead row
|
||||
for (var index = 0; index != count; index++) {
|
||||
if ($('#product_is_consignment_' + index).val() == '1') {
|
||||
var f = $('#quantity_' + index).attr('onchange');
|
||||
f += 'showConsignmentsOptions(\'' + index + '\');';
|
||||
$('#quantity_' + index).attr('onchange', f);
|
||||
var f2 = $('#quantity_' + index).attr('onchange');
|
||||
if (!items[index].product_consignment_id || items[index].product_consignment_id=='')
|
||||
getConsignmentsDiv(index);
|
||||
}
|
||||
}
|
||||
$('#quantity_' + (count - 2)).focus();
|
||||
$('#quantity_' + (count - 2)).select();
|
||||
//addRowClickHandler();
|
||||
}
|
||||
|
||||
function addRowClickHandler() {
|
||||
$('#itemsTable').find('tr').click(function() {
|
||||
var count = $('#' + itemsTable + '_T tr').length - 1;
|
||||
for (var index = 0; index != count; index++) {
|
||||
if ($('#product_is_consignment_' + index).val() != '1')
|
||||
continue;
|
||||
var qty = UnformatNumber($('#quantity_' + index).val());
|
||||
var div_size = $('#consignments_div_' + index).size();
|
||||
// if (index == $(this).index() && div_size>0) continue;
|
||||
if (index == $(this).index() && qty > 0 && div_size == 0) {
|
||||
getInsertConsignmentsDiv(index);
|
||||
} else if (index != $(this).index() && qty > 0)
|
||||
$('#consignments_div_' + index).hide('slow', function() {
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var showConsignmentsOptions = function(index) {
|
||||
checkConsignments(index);
|
||||
if (items[index].product_is_consignment == '1')
|
||||
if (!items[index].product_consignment_id || items[index].product_consignment_id=='')
|
||||
getConsignmentsDiv(index);
|
||||
}
|
||||
|
||||
var getInsertConsignmentsDiv = function(index) {
|
||||
$('#consignments_div_' + index).remove(); // panel exists
|
||||
var part = '';
|
||||
if (items[index].product_consignment_part && items[index].product_consignment_part.length > 0)
|
||||
part = items[index].product_consignment_part;
|
||||
var container = $('#itemsTable_T > tbody').find('#name_' + index).parent()
|
||||
.parent();
|
||||
var div = $('<div></div>');
|
||||
div.attr('id', 'consignments_div_' + index);
|
||||
div.attr('name', 'consignments_div_' + index);
|
||||
div.css('float', 'left');
|
||||
div.css('text-align', 'left');
|
||||
div.css('border', '1px solid rgb(204,204,204)');
|
||||
div.css('padding', '3px');
|
||||
div.css('display', 'none');
|
||||
div.css('width', '90%');
|
||||
input = $('<input></input>');
|
||||
input.attr('id', 'consignment_part_no');
|
||||
input.keyup(function(event) {
|
||||
var t = $(event.target);
|
||||
$('#product_consignment_part_' + index).val(t.val());
|
||||
items[index].product_consignment_part = t.val();
|
||||
});
|
||||
input.css('width', '90%');
|
||||
input.val(part);
|
||||
div.append('Nr parti: ');
|
||||
div.append(input);
|
||||
container.html(div);
|
||||
div.show('slow');
|
||||
input.focus();
|
||||
}
|
||||
|
||||
var checkConsignments = function(index) {
|
||||
var qty = UnformatNumber($('#quantity_' + index).val());
|
||||
if (qty<0 && Math.abs(qty)>items[index].product_consignment_qty) {
|
||||
items[index].product_consignment_part='';
|
||||
items[index].product_consignment_id='';
|
||||
items[index].product_consignment_qty='';
|
||||
$('#product_consignment_part'+index).val('');
|
||||
$('#product_consignment_id'+index).val('');
|
||||
}
|
||||
}
|
||||
|
||||
var getConsignmentsDiv = function(index) {
|
||||
$('#consignments_div_' + index).remove(); // panel exists
|
||||
var prod_id = $('#itemsTable_T > tbody').find('#product_id_' + index).val();
|
||||
if (!prod_id || prod_id == "")
|
||||
return; // empty row
|
||||
var gcd = '#product_consignment_part_' + index;
|
||||
var gci = '#product_consignment_id_' + index;
|
||||
var container = $('#itemsTable_T > tbody').find('#name_' + index).parent()
|
||||
.parent();
|
||||
// if (handler.prev().attr('name') != 'vsbr') handler.before('<br
|
||||
// name="vsbr">'); //VerySpecialBR - first with name :)
|
||||
var qty = UnformatNumber($('#itemsTable_T > tbody').find(
|
||||
'#quantity_' + index).val());
|
||||
var div = $('<div></div>');
|
||||
div.attr('id', 'consignments_div_' + index);
|
||||
div.attr('name', 'consignments_div_' + index);
|
||||
div.css('float', 'left');
|
||||
div.css('text-align', 'left');
|
||||
div.css('border', '1px solid rgb(204,204,204)');
|
||||
div.css('padding', '3px');
|
||||
div.css('display', 'none');
|
||||
div.css('width', '90%');
|
||||
var qty = UnformatNumber($('#itemsTable_T > tbody').find(
|
||||
'#quantity_' + index).val());
|
||||
var prod_id = $('#itemsTable_T > tbody').find('#product_id_' + index).val();
|
||||
div.append('<table></table>');
|
||||
container.append(div);
|
||||
if (items[index].product_is_consignment == '1')
|
||||
div.append(getConsignments(prod_id, qty, $("#stock_id").val(), index));
|
||||
else
|
||||
div.append(getDocuments(prod_id, qty, $("#stock_id").val(), index));
|
||||
}
|
||||
var getDocuments = function(prod_id, qty, stock_id, index) {
|
||||
// AJAX call
|
||||
var a = jQuery
|
||||
.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?module=EcmStockDocCorrects&action=javahelper&to_pdf=1',
|
||||
data : {
|
||||
job : 'getConsignmentsDocs',
|
||||
prod_id : prod_id,
|
||||
stock_id : stock_id
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
});
|
||||
var consignments = $.parseJSON(a.responseText);
|
||||
var last = consignments.length - 1;
|
||||
var container = $('<table></table>');
|
||||
container.css('width', '100%');
|
||||
$.each(consignments, function(i, c) {
|
||||
var p = $('<p></p>');
|
||||
var tr = $('<tr></tr>');
|
||||
tr.css('width', '100%');
|
||||
var a = $('<a></a>');
|
||||
a.html(c.part_no);
|
||||
a.attr('index', index);
|
||||
if (c.availability >= Math.abs(qty)) {
|
||||
a.click(function(event) {
|
||||
var t = $(event.target);
|
||||
var index = t.attr('index');
|
||||
$('#product_consignment_id_' + index).val(c.operation_id)
|
||||
$('#product_consignment_part_' + index).val(c.part_no);
|
||||
$('#product_consignment_qty_' + index).val(c.availability);
|
||||
//$('#price_'+index).val(FormatNumber(c.price));
|
||||
//insert max qty
|
||||
$('#quantity_'+index).parent().append('<p style="text-align: right;" id="max_quantity_'+index+'">(Max: '+FormatNumber(c.availability,c.precision)+')</p>');
|
||||
$('#quantity_'+index).focus();
|
||||
items[index].product_consignment_id = c.operation_id;
|
||||
items[index].product_consignment_part = c.part_no;
|
||||
items[index].product_consignment_qty = c.availability;
|
||||
//calculateRow(index);
|
||||
var div = $('#consignments_div_' + index);
|
||||
div.hide('slow');
|
||||
});
|
||||
a.css('cursor', 'pointer');
|
||||
a.css('color', 'blue');
|
||||
} else
|
||||
a.css('color', 'red');
|
||||
var td = $('<td></td>');
|
||||
td.append(a);
|
||||
tr.append(td);
|
||||
var td = $('<td></td>');
|
||||
td.append(FormatNumber(c.availability,c.precision) + ' ' + c.unit);
|
||||
tr.append(td);
|
||||
var td = $('<td></td>');
|
||||
td.append(FormatNumber(c.price) + ' ' + c.currency + ' / ' + c.unit);
|
||||
tr.append(td);
|
||||
container.append(tr);
|
||||
});
|
||||
// show div
|
||||
$('#consignments_div_' + index).show('slow');
|
||||
return container;
|
||||
}
|
||||
|
||||
var getConsignments = function(prod_id, qty, stock_id, index) {
|
||||
// AJAX call
|
||||
var a = jQuery
|
||||
.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?module=EcmStockDocCorrects&action=javahelper&to_pdf=1',
|
||||
data : {
|
||||
job : 'getConsignments',
|
||||
prod_id : prod_id,
|
||||
stock_id : stock_id
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
});
|
||||
var consignments = $.parseJSON(a.responseText);
|
||||
var last = consignments.length - 1;
|
||||
var container = $('<table></table>');
|
||||
container.css('width', '100%');
|
||||
$.each(consignments, function(i, c) {
|
||||
var p = $('<p></p>');
|
||||
var tr = $('<tr></tr>');
|
||||
tr.css('width', '100%');
|
||||
var a = $('<a></a>');
|
||||
a.html(c.document_no);
|
||||
a.attr('index', index);
|
||||
if (c.availability >= Math.abs(qty)) {
|
||||
a.click(function(event) {
|
||||
var t = $(event.target);
|
||||
var index = t.attr('index');
|
||||
$('#product_consignment_id_' + index).val(c.operation_id)
|
||||
$('#product_consignment_part_' + index).val(c.part_no);
|
||||
$('#product_consignment_qty_' + index).val(c.availability);
|
||||
$('#price_'+index).val(FormatNumber(c.price));
|
||||
//insert max qty
|
||||
$('#quantity_'+index).parent().append('<p style="text-align: right;" id="max_quantity_'+index+'">(Max: '+FormatNumber(c.availability,c.precision)+')</p>');
|
||||
$('#quantity_'+index).focus();
|
||||
items[index].product_consignment_id = c.operation_id;
|
||||
items[index].product_consignment_part = c.part_no;
|
||||
items[index].product_consignment_qty = c.availability;
|
||||
//calculateRow(index);
|
||||
var div = $('#consignments_div_' + index);
|
||||
div.hide('slow');
|
||||
});
|
||||
a.css('cursor', 'pointer');
|
||||
a.css('color', 'blue');
|
||||
} else
|
||||
a.css('color', 'red');
|
||||
var td = $('<td></td>');
|
||||
td.append(a);
|
||||
tr.append(td);
|
||||
var td = $('<td></td>');
|
||||
td.append(c.part_no);
|
||||
tr.append(td);
|
||||
var td = $('<td></td>');
|
||||
td.append(FormatNumber(c.availability,c.precision) + ' ' + c.unit);
|
||||
tr.append(td);
|
||||
var td = $('<td></td>');
|
||||
td.append(FormatNumber(c.price) + ' ' + c.currency + ' / ' + c.unit);
|
||||
tr.append(td);
|
||||
container.append(tr);
|
||||
});
|
||||
// show div
|
||||
$('#consignments_div_' + index).show('slow');
|
||||
return container;
|
||||
}
|
||||
|
||||
function checkConsignmentsValues() {
|
||||
var count = items.length;//$('#' + itemsTable + '_T tr').length - 1; // -1 - thead row
|
||||
var NO_ERROR = true;
|
||||
for (var index = 0; index < count; index++) {
|
||||
if (items[index].product_is_consignment && items[index].product_is_consignment == '1') {
|
||||
var tmp = items[index].product_consignment_part;
|
||||
if (!tmp) tmp = '';
|
||||
if (tmp.length==0) NO_ERROR = false;
|
||||
}
|
||||
}
|
||||
return NO_ERROR;
|
||||
}
|
||||
187
modules/EcmStockDocOuts/javascript/EcmStockDocOuts.js
Executable file
187
modules/EcmStockDocOuts/javascript/EcmStockDocOuts.js
Executable file
@@ -0,0 +1,187 @@
|
||||
//START:
|
||||
$(document).ready(
|
||||
function () {
|
||||
$("#parent_name").attr("size", "70");
|
||||
$("#parent_name_copy").attr("size", "70");
|
||||
//change parent select button
|
||||
$("#btn_clr_parent_name").children().attr("src", "themes/default/images/id-ff-add.png");
|
||||
$("#btn_clr_parent_name").attr("title", "Dodaj");
|
||||
$("#btn_clr_parent_name").click(createAccount);
|
||||
|
||||
// parent info
|
||||
|
||||
var previousVal;
|
||||
var pollInterval = setInterval(function () {
|
||||
var val = $('#parent_id').val();
|
||||
if (val !== previousVal) {
|
||||
if ($('#parent_id').val() == '') return;
|
||||
$(".loading_panel").css("display", "block");
|
||||
setTimeout(function () {
|
||||
getParentInfo($("#parent_id").val(), 'Accounts');
|
||||
}, 1000);
|
||||
}
|
||||
previousVal = val;
|
||||
}, 500);
|
||||
|
||||
|
||||
//newProduct
|
||||
var previousVal2;
|
||||
var prodInterval = setInterval(function () {
|
||||
var val = $('#newProductId').val();
|
||||
if (val !== previousVal2) {
|
||||
if ($('#newProductId').val() == '') return;
|
||||
$(".loading_panel").css("display", "block");
|
||||
setTimeout(function () {
|
||||
AddProduct(items.length - 1, val);
|
||||
}, 500);
|
||||
}
|
||||
previousVal2 = val;
|
||||
}, 500);
|
||||
var checkgen;
|
||||
// confirm exit
|
||||
window.onbeforeunload = confirmExit;
|
||||
// prevent submit by enter press
|
||||
lockEnter();
|
||||
// categories
|
||||
getCategoriesList();
|
||||
$('#parent_id').on('inputchange',
|
||||
function () {
|
||||
$(".loading_panel").css("display", "block");
|
||||
setTimeout(function () {
|
||||
getParentInfo($("#parent_id").val(), 'Accounts');
|
||||
}, 1000);
|
||||
});
|
||||
$("#stock").change(function () {
|
||||
$("#stock_id").val(($("#stock :selected").val()));
|
||||
});
|
||||
DrawHeaders();
|
||||
|
||||
$("#assigned_user_name").prop("disabled", true);
|
||||
|
||||
$("#btn_assigned_user_name").hide();
|
||||
$("#btn_clr_assigned_user_name").hide();
|
||||
$(".loading_panel").css("display", "none");
|
||||
|
||||
if (($("#new_number").val() == true)
|
||||
&& ($("#duplicate").val() != true) && ($("#ecmsale").val() != true)) {
|
||||
var ecp = $("#ecommerce_products").val();
|
||||
if (ecp && ecp.length > 0) {
|
||||
loadECommerceProducts(ecp);
|
||||
}
|
||||
checkgen = 1;
|
||||
} else if (($("#new_number").val() == true)
|
||||
&& ($("#duplicate").val() == true)) {
|
||||
checkgen = 1;
|
||||
getItems();
|
||||
} else if (($("#new_number").val() == true)
|
||||
&& ($("#ecmsale").val() == true)) {
|
||||
checkgen = 1;
|
||||
getParentInfo($("#parent_id").val(), 'Accounts');
|
||||
|
||||
getItemsFromEcmSale();
|
||||
|
||||
} else {
|
||||
checkgen = 0;
|
||||
}
|
||||
|
||||
if (checkgen == 1) {
|
||||
$("#stock").change(function () {
|
||||
$("#stock_id").val(($("#stock :selected").val()));
|
||||
EcmDocumentNumberGenerator_getNumberTemplate('document_no', 'EcmStockDocOuts');
|
||||
checkProducts();
|
||||
});
|
||||
}
|
||||
if ($("#stock_id").val() != '') {
|
||||
$("#stock_id").val(($("#stock :selected").val()));
|
||||
if (checkgen == 1) {
|
||||
EcmDocumentNumberGenerator_getNumberTemplate('document_no', 'EcmStockDocOuts');
|
||||
}
|
||||
}
|
||||
// handle setItems
|
||||
setITEMS = function () {
|
||||
var formname = 'EditView';
|
||||
if (check_form_(formname) == true) {
|
||||
SetTab('ITEMS');
|
||||
//checkProducts();
|
||||
//disable stock change
|
||||
$("#stock").prop("disabled", true);
|
||||
}
|
||||
};
|
||||
// wyszukiwanie start
|
||||
$('#searchProductsInput').keyup(function () {
|
||||
// stronicowanie od 1 strony przy zmianie szukanego produktu
|
||||
$('#searchStart').val(0);
|
||||
searchProducts();
|
||||
});
|
||||
AddSearchRecord();
|
||||
});
|
||||
|
||||
function loadECommerceProducts(ecp) {
|
||||
var products = JSON.parse(ecp);
|
||||
items = products;
|
||||
FillTable(products);
|
||||
}
|
||||
// handle save
|
||||
async function saveDocument() {
|
||||
if (!check_form_('EditView')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (items.filter(x => x.product_id !=='').length === 0) {
|
||||
alert("Brak produktów");
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
items[i].part_no = $("#part_no_" + i).val();
|
||||
items[i].un_code = $("#un_code_" + i).val();
|
||||
}
|
||||
|
||||
$(".loading_panel").css("display", "block");
|
||||
await sleep(50);
|
||||
if (!await checkProducts()) {
|
||||
alert("Brak produktów na stanie");
|
||||
return;
|
||||
}
|
||||
//save
|
||||
$(".loading_panel").css("display", "block");
|
||||
await sleep(50);
|
||||
$("#register_date").prop("disabled", false);
|
||||
$("#assigned_user_name").prop("disabled", false);
|
||||
$('#EditView input[name="action"]').val('Save');
|
||||
clearEmpty();
|
||||
$("#position_list").val(JSON.stringifyNoSecurity(items));
|
||||
window.onbeforeunload = null;
|
||||
$.ajax({
|
||||
url: 'index.php?to_pdf=1',
|
||||
method: 'POST',
|
||||
data: $('#EditView').serialize(),
|
||||
success: function(data) {
|
||||
window.location.replace("index.php?module=EcmStockDocOuts&action=DetailView&record="+data);
|
||||
},
|
||||
error: function(error) {
|
||||
alert("Błąd zapisu!");
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
var check_form_ = check_form;
|
||||
|
||||
function confirmExit() {
|
||||
return "";
|
||||
}
|
||||
|
||||
function lockEnter() {
|
||||
// prevent default
|
||||
$(window).keydown(function (event) {
|
||||
if (event.keyCode == 13 && $(":focus").prop('tagName') != 'TEXTAREA') {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
7
modules/EcmStockDocOuts/javascript/EcmStockDocOutsDetail.js
Executable file
7
modules/EcmStockDocOuts/javascript/EcmStockDocOutsDetail.js
Executable file
@@ -0,0 +1,7 @@
|
||||
//START:
|
||||
$(document).ready(
|
||||
function() {
|
||||
DrawHeaders();
|
||||
getItems(false);
|
||||
});
|
||||
|
||||
1013
modules/EcmStockDocOuts/javascript/bimit_table2.js
Normal file
1013
modules/EcmStockDocOuts/javascript/bimit_table2.js
Normal file
File diff suppressed because it is too large
Load Diff
120
modules/EcmStockDocOuts/javascript/columndefs-detail.js
Executable file
120
modules/EcmStockDocOuts/javascript/columndefs-detail.js
Executable file
@@ -0,0 +1,120 @@
|
||||
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_netto',
|
||||
'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_netto',
|
||||
'label' : 'Wartość',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[6]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true};
|
||||
//end: total
|
||||
columns[7] = {
|
||||
'name' : 'product_',
|
||||
'label' : 'Sztuk<br>w kartonie',
|
||||
'width' : 3,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[7]['content'][0] = {
|
||||
'name' : 'pieces_per_carton',
|
||||
'type': 'text',
|
||||
'isNumber' : true,
|
||||
'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'
|
||||
};
|
||||
columns[8] = {
|
||||
'name' : 'product_',
|
||||
'label' : 'Ilość<br>kartonów',
|
||||
'width' : 3,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[8]['content'][0] = {
|
||||
'name' : 'cartons',
|
||||
'type': 'text',
|
||||
'isNumber' : true,
|
||||
'readonly' : true
|
||||
};
|
||||
columns[9] = {
|
||||
'name' : 'part_no',
|
||||
'label' : 'Numer partii',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[9]['content'][0] = {
|
||||
'name' : '',
|
||||
'type': 'text'
|
||||
};
|
||||
columns[10] = {
|
||||
'name' : 'un_code',
|
||||
'label' : 'Kod UN',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[10]['content'][0] = {
|
||||
'name' : '',
|
||||
'type': 'text'
|
||||
};
|
||||
244
modules/EcmStockDocOuts/javascript/columndefs.js
Executable file
244
modules/EcmStockDocOuts/javascript/columndefs.js
Executable file
@@ -0,0 +1,244 @@
|
||||
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'
|
||||
};
|
||||
columns[1]['content'][4] = {
|
||||
'name' : 'precision',
|
||||
'type' : 'hidden'
|
||||
};
|
||||
columns[1]['content'][5] = {
|
||||
'name' : 'is_consignment',
|
||||
'type' : 'hidden'
|
||||
};
|
||||
columns[1]['content'][6] = {
|
||||
'name' : 'consignment_part',
|
||||
'type' : 'text',
|
||||
};
|
||||
columns[1]['content'][7] = {
|
||||
'name' : 'consignment_id',
|
||||
'type' : 'hidden',
|
||||
};
|
||||
columns[1]['content'][8] = {
|
||||
'name' : 'is_oo',
|
||||
'type' : 'hidden'
|
||||
};
|
||||
columns[1]['content'][9] = {
|
||||
'name' : 'consignment_qty',
|
||||
'type' : 'hidden',
|
||||
};
|
||||
// end: code
|
||||
// begin: name
|
||||
columns[2] = {
|
||||
'name' : 'name',
|
||||
'label' : 'Nazwa',
|
||||
'width' : 14,
|
||||
'content' : new Array(),
|
||||
};
|
||||
columns[2]['content'][0] = {
|
||||
'name' : '',
|
||||
'type' : 'text'
|
||||
};
|
||||
// end: name
|
||||
// begin: quantity
|
||||
columns[3] = {
|
||||
'name' : 'quantity',
|
||||
'label' : 'Ilość',
|
||||
'width' : 3,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[3]['content'][0] = {
|
||||
'name' : '',
|
||||
'type' : 'text',
|
||||
'isNumber' : true,
|
||||
'onChange' : "setRowDate($(this).parent('td').parent('tr').index());calculateRow($(this).parent(\'td\').parent(\'tr\').index());"
|
||||
};
|
||||
// end: quantity
|
||||
// begin: unit
|
||||
columns[4] = {
|
||||
'name' : 'unit_',
|
||||
'label' : 'J.M.',
|
||||
'width' : 2,
|
||||
'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<br>sprzedaży',
|
||||
'width' : 3,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[5]['content'][0] = {
|
||||
'name' : 'netto',
|
||||
'type' : 'text',
|
||||
'isNumber' : true,
|
||||
'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'
|
||||
};
|
||||
columns[5]['content'][1] = {
|
||||
'name' : 'brutto',
|
||||
'type' : 'hidden',
|
||||
'isNumber' : true
|
||||
};
|
||||
// end: price
|
||||
// begin: vat
|
||||
columns[6] = {
|
||||
'name' : 'ecmvat_',
|
||||
'label' : 'VAT',
|
||||
'width' : 3,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[6]['content'][0] = {
|
||||
'name' : 'id',
|
||||
'type' : 'hidden'
|
||||
};
|
||||
columns[6]['content'][1] = {
|
||||
'name' : 'name',
|
||||
'type' : 'text'
|
||||
};
|
||||
columns[6]['content'][2] = {
|
||||
'name' : 'value',
|
||||
'type' : 'hidden'
|
||||
};
|
||||
// end: vat
|
||||
// begin: total
|
||||
columns[7] = {
|
||||
'name' : 'total_',
|
||||
'label' : 'Wartość',
|
||||
'width' : 3,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[7]['content'][0] = {
|
||||
'name' : 'netto',
|
||||
'type' : 'text',
|
||||
'isNumber' : true
|
||||
};
|
||||
columns[7]['content'][1] = {
|
||||
'name' : 'brutto',
|
||||
'type' : 'hidden',
|
||||
'isNumber' : true
|
||||
};
|
||||
columns[7]['content'][2] = {
|
||||
'name' : 'vat',
|
||||
'type' : 'hidden',
|
||||
'isNumber' : true
|
||||
};
|
||||
// end: total
|
||||
// begin: stock_state
|
||||
columns[8] = {
|
||||
'name' : 'stock_state',
|
||||
'label' : 'Stan',
|
||||
'width' : 3,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[8]['content'][0] = {
|
||||
'name' : '',
|
||||
'type' : 'text',
|
||||
'isNumber' : true
|
||||
};
|
||||
// end: stock_state
|
||||
columns[9] = {
|
||||
'name' : 'product_',
|
||||
'label' : 'Sztuk<br>w kartonie',
|
||||
'width' : 3,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[9]['content'][0] = {
|
||||
'name' : 'pieces_per_carton',
|
||||
'type': 'text',
|
||||
'isNumber' : true,
|
||||
'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'
|
||||
};
|
||||
columns[10] = {
|
||||
'name' : 'product_',
|
||||
'label' : 'Ilość<br>kartonów',
|
||||
'width' : 3,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[10]['content'][0] = {
|
||||
'name' : 'cartons',
|
||||
'type': 'text',
|
||||
'isNumber' : true,
|
||||
'readonly' : true
|
||||
};
|
||||
columns[11] = {
|
||||
'name' : 'part_no',
|
||||
'label' : 'Numer partii',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[11]['content'][0] = {
|
||||
'name' : '',
|
||||
'type': 'text'
|
||||
};
|
||||
columns[12] = {
|
||||
'name' : 'un_code',
|
||||
'label' : 'Kod UN',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[12]['content'][0] = {
|
||||
'name' : '',
|
||||
'type': 'text'
|
||||
};
|
||||
// begin: options
|
||||
columns[13] = {
|
||||
'name' : 'options',
|
||||
'label' : 'Opcje',
|
||||
'width' : 3,
|
||||
'content' : new Array(),
|
||||
};
|
||||
4
modules/EcmStockDocOuts/javascript/searchcolumndefs.js
Executable file
4
modules/EcmStockDocOuts/javascript/searchcolumndefs.js
Executable file
@@ -0,0 +1,4 @@
|
||||
var extraproductinfo_show=true; // info o produkcie
|
||||
var unit_show=true; // jednostka produktu
|
||||
var number_show=false; // numeruje wiersze
|
||||
var module_function="EcmStockDocOuts";
|
||||
Reference in New Issue
Block a user