Add JS files
This commit is contained in:
310
modules/EcmStockDocCorrects/javascript/Consignments.js
Normal file
310
modules/EcmStockDocCorrects/javascript/Consignments.js
Normal file
@@ -0,0 +1,310 @@
|
||||
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 (UnformatNumber($('#quantity_'+index).val())<=0)
|
||||
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);
|
||||
console.log(items[index].product_is_consignment);
|
||||
if (items[index].product_is_consignment != '1') {
|
||||
console.log('nie partia');
|
||||
if (UnformatNumber($('#quantity_' + index).val()) > 0)
|
||||
$('#consignments_div_'+index).remove();
|
||||
else
|
||||
if (!items[index].product_consignment_id || items[index].product_consignment_id=='')
|
||||
getConsignmentsDiv(index);
|
||||
} else {
|
||||
console.log('partia');
|
||||
if (UnformatNumber($('#quantity_' + index).val()) > 0)
|
||||
getInsertConsignmentsDiv(index);
|
||||
else
|
||||
if (!items[index].product_consignment_id || items[index].product_consignment_id=='')
|
||||
getConsignmentsDiv(index);
|
||||
}
|
||||
}
|
||||
|
||||
var getInsertConsignmentsDiv = function(index) {
|
||||
if($('#product_id_' + index).val()=='' || $('#product_is_consignment_' + index).val() != '1') return '';
|
||||
$('#consignments_div_' + index).remove(); // panel exists
|
||||
var part = '';
|
||||
|
||||
if (items[index].product_consignment_part!='')
|
||||
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.append(div);
|
||||
div.show('slow');
|
||||
//input.focus();
|
||||
if($('#product_consignment_part_' + index).val()=='')getPartNumber(index);
|
||||
}
|
||||
|
||||
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
|
||||
console.log('goł!');
|
||||
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);
|
||||
$('#quantity_' + index).val(FormatNumber(c.availability*-1,c.precision));
|
||||
//$('#quantity_' + index).attr('readonly', 'readonly');
|
||||
$('#price_'+index).val(FormatNumber(c.price));
|
||||
$('#price_old_'+index).val(FormatNumber(c.price));
|
||||
console.log($('#type').val());
|
||||
if ($('#type').val() == '6ed5b076-ddd1-9809-b236-54e5b2bcbd97') {
|
||||
$('#price_old_'+index).attr('type','text');
|
||||
$('<br>').insertAfter('#price_'+index);
|
||||
$('#quantity_' + index).val(FormatNumber(c.availability,c.precision));
|
||||
} else {
|
||||
$('#quantity_' + index).val(FormatNumber(c.availability*-1,c.precision));
|
||||
}
|
||||
//insert max qty
|
||||
$('#max_quantity_'+index).remove();
|
||||
$('#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;
|
||||
}
|
||||
|
||||
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);
|
||||
if ($('#type').val() == '6ed5b076-ddd1-9809-b236-54e5b2bcbd97') {
|
||||
|
||||
|
||||
$('#price_old_'+index).remove();
|
||||
$('#onlyRemove_'+index).remove();
|
||||
|
||||
$('#price_'+index).parent().append('<div id="onlyRemove_'+index+'"><p style="text-align:right">(było: '+FormatNumber(c.price)+')</p><input type="hidden" readonly="readonly" value="'+FormatNumber(c.price)+'" onclick="$(this).select();" style="text-align: right;background-color:#ffffff;" id="price_old_'+index+'" name="price_old_'+index+'" class="inputs"></div>');
|
||||
$('#quantity_' + index).val(FormatNumber(c.availability,c.precision));
|
||||
$('#quantity_' + index).attr('readonly',true);
|
||||
} else {
|
||||
$('#quantity_' + index).val(FormatNumber(c.availability*-1,c.precision));
|
||||
}
|
||||
$('#price_'+index).val(FormatNumber(c.price));
|
||||
//insert max qty
|
||||
if ($('#type').val() == '6ed5b076-ddd1-9809-b236-54e5b2bcbd97') {
|
||||
$('#quantity_'+index).parent().append('<p style="text-align: right;" id="max_quantity_'+index+'">(Max: '+FormatNumber(c.availability,c.precision)+')</p>');
|
||||
} else {
|
||||
$('#quantity_'+index).parent().append('<p style="text-align: right;" id="max_quantity_'+index+'">(Max: '+FormatNumber(c.availability*-1,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 ($('#type').val()=='6ed5b076-ddd1-9809-b236-54e5b2bcbd97') {
|
||||
var tmp = items[index].product_consignment_part;
|
||||
if (!tmp) tmp = '';
|
||||
if (tmp.length==0) NO_ERROR = false;
|
||||
}
|
||||
}
|
||||
return NO_ERROR;
|
||||
}
|
||||
123
modules/EcmStockDocCorrects/javascript/EcmStockDocCorrects.js
Executable file
123
modules/EcmStockDocCorrects/javascript/EcmStockDocCorrects.js
Executable file
@@ -0,0 +1,123 @@
|
||||
//START:
|
||||
$(document).ready(
|
||||
function() {
|
||||
var checkgen;
|
||||
// confirm exit
|
||||
window.onbeforeunload = confirmExit;
|
||||
// prevent submit by enter press
|
||||
lockEnter();
|
||||
// categories
|
||||
getCategoriesList();
|
||||
|
||||
$("#stock").change(function() {
|
||||
$("#stock_id").val(($("#stock :selected").val()));
|
||||
});
|
||||
DrawHeaders();
|
||||
|
||||
//$("#register_date").prop("disabled", true);
|
||||
$("#assigned_user_name").prop("disabled", true);
|
||||
//$("#register_date_trigger").hide();
|
||||
$("#btn_assigned_user_name").hide();
|
||||
$("#btn_clr_assigned_user_name").hide();
|
||||
|
||||
if (($("#new_number").val() == true)
|
||||
&& ($("#duplicate").val() != true)) {
|
||||
EcmDocumentNumberGenerator_getNumberTemplate('document_no', 'EcmStockDocCorrects');
|
||||
} else if (($("#new_number").val() == true)
|
||||
&& ($("#duplicate").val() == true)) {
|
||||
EcmDocumentNumberGenerator_getNumberTemplate('document_no', 'EcmStockDocCorrects');
|
||||
getItems();
|
||||
}
|
||||
$("#stock").change(function() {
|
||||
$("#stock_id").val(($("#stock :selected").val()));
|
||||
EcmDocumentNumberGenerator_getNumber('tmp_number', 'EcmStockDocCorrects', $("#stock :selected").val());
|
||||
});
|
||||
// handle setItems
|
||||
setITEMS = function() {
|
||||
var formname = 'EditView';
|
||||
if (check_form_(formname) == true) {
|
||||
SetTab('ITEMS');
|
||||
checkProducts();
|
||||
//disable stock change
|
||||
$("#stock").prop("disabled", true);
|
||||
$("#type").prop("disabled", true);
|
||||
}
|
||||
};
|
||||
// wyszukiwanie start
|
||||
$('#searchProductsInput').keyup(function() {
|
||||
// stronicowanie od 1 strony przy zmianie szukanego produktu
|
||||
$('#searchStart').val(0);
|
||||
searchProducts();
|
||||
});
|
||||
AddSearchRecord();
|
||||
|
||||
$(".loading_panel").css("display", "none");
|
||||
});
|
||||
// handle save
|
||||
var check_form_ = check_form;
|
||||
check_form = function(formname,event) {
|
||||
window.onbeforeunload = null;
|
||||
// zapobiega zapisywaniu dokumentu firefox bug, w przypadku nacisniecia enter w polu z autocomplete
|
||||
if(event.clientY==0 && event.clientX==0){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (items.length == 0 || items[0].product_id=='') {
|
||||
alert("Brak produktów");
|
||||
return false;
|
||||
}
|
||||
|
||||
var part_error=true;
|
||||
$.each(items, function(i, v) {
|
||||
if (!v.product_id || v.product_id=="") return;
|
||||
if (v.product_is_consignment!='1') return;
|
||||
if($('#type').val()=='8a6b804b-fac7-5cc2-de19-54c209116b19'){
|
||||
if (!v.product_consignment_part || v.product_consignment_part=="") {
|
||||
alert("Nie wprowadzono partii");
|
||||
part_error=false;
|
||||
}
|
||||
} else {
|
||||
if (!v.product_consignment_id || v.product_consignment_id=="") {
|
||||
alert("Nie wybrano partii");
|
||||
part_error=false;
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
$(".loading_panel").css("display", "block");
|
||||
$("#register_date").prop("disabled", false);
|
||||
$("#assigned_user_name").prop("disabled", false);
|
||||
$("#type").prop("disabled", false);
|
||||
|
||||
|
||||
var check = checkProducts();
|
||||
|
||||
$(".loading_panel").css("display", "none");
|
||||
if (check_form_(formname) == false || check == false || part_error==false) {
|
||||
$("#register_date").prop("disabled", true);
|
||||
$("#assigned_user_name").prop("disabled", true);
|
||||
window.onbeforeunload = confirmExit;
|
||||
$(".loading_panel").css("display", "none");
|
||||
return false;
|
||||
} else {
|
||||
clearEmpty();
|
||||
$("#position_list").val(JSON.stringifyNoSecurity(items));
|
||||
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;
|
||||
}
|
||||
});
|
||||
}
|
||||
7
modules/EcmStockDocCorrects/javascript/EcmStockDocCorrectsDetail.js
Executable file
7
modules/EcmStockDocCorrects/javascript/EcmStockDocCorrectsDetail.js
Executable file
@@ -0,0 +1,7 @@
|
||||
//START:
|
||||
$(document).ready(
|
||||
function() {
|
||||
DrawHeaders();
|
||||
getItems(false);
|
||||
});
|
||||
|
||||
586
modules/EcmStockDocCorrects/javascript/bimit_table.js
Normal file
586
modules/EcmStockDocCorrects/javascript/bimit_table.js
Normal file
@@ -0,0 +1,586 @@
|
||||
var itemsTable = 'itemsTable';
|
||||
var items = new Array();
|
||||
var displayArray = new Array();
|
||||
var searchedProducts = new Array();
|
||||
var ajax_url = "index.php?module=EcmStockDocCorrects&action=javahelper&to_pdf=1";
|
||||
|
||||
//custom Fill Table
|
||||
|
||||
function calculateAll() {
|
||||
var count = $('#' + itemsTable + '_T tr').length - 1; // -1 - thead row
|
||||
for (var index = 0; index != count; index++) {
|
||||
calculateRow(index);
|
||||
}
|
||||
}
|
||||
|
||||
function calculateRow(index) {
|
||||
if (index == -1)
|
||||
return;
|
||||
items[index].quantity_consignment_id = $('#quantity_consignment_id_'+index).val();
|
||||
items[index].quantity_consignment_doc = $('#quantity_consignment_doc_'+index).val();
|
||||
if($('#type').val()!='8a6b804b-fac7-5cc2-de19-54c209116b19'){
|
||||
getConsignmentsDiv(index);
|
||||
} else {
|
||||
getInsertConsignmentsDiv(index);
|
||||
}
|
||||
|
||||
|
||||
// liczone według najlepszych zasad księgowości
|
||||
var price = UnformatNumber($('#price_' + index).val());
|
||||
var price_old = UnformatNumber($('#price_old_' + index).val());
|
||||
var quantity = UnformatNumber($('#quantity_' + index).val());
|
||||
|
||||
|
||||
//alert(palet);
|
||||
var total = price * quantity;
|
||||
var total2 = price_old * quantity;
|
||||
// put data
|
||||
$('#product_total_' + index).val(FormatNumber(total));
|
||||
|
||||
// put data to items array
|
||||
items[index].price = toFixed(price, 2);
|
||||
items[index].price_old = toFixed(price_old, 2);
|
||||
|
||||
items[index].product_total = total;
|
||||
items[index].quantity = toFixed(quantity, 2);
|
||||
|
||||
items[index].name = $('#name_' + index).val();
|
||||
items[index].unit_name = $('#unit_name_' + index).val();
|
||||
if($('#type').val()=='6ed5b076-ddd1-9809-b236-54e5b2bcbd97'){
|
||||
$('#onlyRemoveDif_'+index).remove();
|
||||
$('#unit_name_'+index).parent().append('<div id="onlyRemoveDif_'+index+'"><p style="text-align:right">(Różnica: '+FormatNumber(total-total2)+')<input type="hidden" id="diff_this_'+index+'" value="'+FormatNumber(total-total2)+'"></p></div>');
|
||||
|
||||
}
|
||||
// calculate total
|
||||
calculateTotal();
|
||||
}
|
||||
function calculateTotal() {
|
||||
if($('#type').val()=='6ed5b076-ddd1-9809-b236-54e5b2bcbd97'){
|
||||
var count = $('#' + itemsTable + '_T tr').length - 1; // -1 - thead row
|
||||
count = items.length;
|
||||
var vats = new Array();
|
||||
var all_subtotal = 0;
|
||||
var all_total = 0;
|
||||
var sum_vats = 0;
|
||||
var sum_discounts = 0;
|
||||
var weight_total=0;
|
||||
|
||||
|
||||
for (var index = 0; index != count; index++) {
|
||||
subtotal = UnformatNumber($('#diff_this_' + index).val());
|
||||
if(!isNaN(subtotal)){
|
||||
all_subtotal += subtotal;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
all_total = all_subtotal;
|
||||
|
||||
DrawSummary();
|
||||
|
||||
$("#t_netto").val(FormatNumber(all_total));
|
||||
} else {
|
||||
var count = $('#' + itemsTable + '_T tr').length - 1; // -1 - thead row
|
||||
count = items.length;
|
||||
var vats = new Array();
|
||||
var all_subtotal = 0;
|
||||
var all_total = 0;
|
||||
var sum_vats = 0;
|
||||
var sum_discounts = 0;
|
||||
var weight_total=0;
|
||||
|
||||
|
||||
for (var index = 0; index != count; index++) {
|
||||
subtotal = UnformatNumber($('#product_total_' + index).val());
|
||||
if(!isNaN(subtotal)){
|
||||
all_subtotal += subtotal;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
all_total = all_subtotal;
|
||||
|
||||
DrawSummary();
|
||||
|
||||
$("#t_netto").val(FormatNumber(all_total));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
function DrawSummary() {
|
||||
$("#result_table").html('');
|
||||
html = '';
|
||||
html += '<tr id="subtotal_tr"> ';
|
||||
html += '<td class="positionsLabel" style="border-top:0px;">Suma</td>';
|
||||
html += '<td class="positionsField" style="border-top:0px;"><input type="text" style="border:0px;font-weight:900;width:100%;text-align:right;" readonly="readonly" name="t_netto" id="t_netto" value=\'\'></td>';
|
||||
html += '</tr>';
|
||||
$("#result_table").html(html);
|
||||
}
|
||||
|
||||
// draw table
|
||||
function DrawHeaders() {
|
||||
var html = '<link rel="stylesheet" type="text/css" href="modules/EcmQuotes/MyTable.css" />';
|
||||
html += '<div style="width:100%;border: 1px solid rgb(48,192,255);background-color:white;overflow:auto;" id="'
|
||||
+ itemsTable + 'DIV">';
|
||||
html += '<table class="positions" style="width:100%;" id="' + itemsTable
|
||||
+ '_T">';
|
||||
html += '<thead id="head">';
|
||||
html += '<tr id="tr">';
|
||||
// draw columns headers
|
||||
$.each(columns, function(index, column) {
|
||||
if(column.hide=='yes'){
|
||||
hide='display:none;'
|
||||
} else {
|
||||
hide='';
|
||||
}
|
||||
html += '<td width="' + column.width + '%" style="'+hide+'">' + column.label + '</td>';
|
||||
});
|
||||
html += '</tr></thead><tbody></tbody></table>';
|
||||
html += '</div><br>';
|
||||
// totals table
|
||||
html += '<table width="100%"" cellpadding="0" cellspacing="0" border="0">';
|
||||
html += '<tr>';
|
||||
html += '<td width="55%" class="dataLabel" valign="top">';
|
||||
html += ' ';
|
||||
html += '</td> <!--color:#b3b9cf;-->';
|
||||
html += '<td width="40%" class="dataField" style="text-align: left;">';
|
||||
html += '<br>';
|
||||
html += '<table id="result_table" cellpadding="0" cellspacing="0" style="width:100%; height:100%; border: 1px solid rgb(48,192,255);">';
|
||||
html += '</table>';
|
||||
html += '</td>';
|
||||
html += '<td width="5%" class="dataField" style="text-align: left;"> </td>';
|
||||
html += '</tr>';
|
||||
html += '</table>';
|
||||
// sort? why not!
|
||||
/*
|
||||
* html += 'Sortowanie: '; html += '<select id="sort_field"
|
||||
* onChange="sortTable();"'; html += '<option value=""></option>'; html += '<option
|
||||
* value="name">Nazwa</option>'; html += '<option value="code">Kod</option>';
|
||||
* html += '<option value="category">Kategoria</option>'; html += '<option
|
||||
* value="category">Kategoria</option>'; html += '<option
|
||||
* value="price">Cena po<br>upuście</option>'; html += '<option
|
||||
* value="total">Wartość</option>'; html += '</select>';
|
||||
*/
|
||||
$('#' + itemsTable).html(html);
|
||||
}
|
||||
/*
|
||||
function searchProducts() {
|
||||
var searchKey = $('#searchProductsInput').val();
|
||||
if (searchKey.length < 2 && searchKey != '%') {
|
||||
return;
|
||||
}
|
||||
$("#searchResultDiv").html(
|
||||
'<img src="modules/EcmQuotes/images/loading.gif"/>');
|
||||
setTimeout(function() {
|
||||
if (searchKey == $('#searchProductsInput').val()) {
|
||||
var params = {
|
||||
job : 'searchProducts',
|
||||
searchKey : searchKey,
|
||||
searchCategory : $("#productSearchCategory :selected").val(),
|
||||
searchStock : $("#productSearchStock :selected").val(),
|
||||
searchSort : $("#productSearchSort :selected").val(),
|
||||
searchStockId : $("#stock :selected").val(),
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
if (data != '-1')
|
||||
if (data.length == 0)
|
||||
$('#searchResultDiv').html(
|
||||
'MOD.LBL_SEARCH_NO_RESULT');
|
||||
else
|
||||
createSearchResult(data);
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function createSearchResult(data) {
|
||||
var html = '<table style="text-align: center;" cellpadding="0" cellspacing="0" width="100%" border="0" class="list view">';
|
||||
html += '<theader><tr>';
|
||||
html += '<th style=" width: 15pt; margin: auto auto;"><input type="checkbox" name="selectall" id="selectall"></th>';
|
||||
html += '<th style=" width: 100pt; text-align: center;">Kod</th>';
|
||||
html += '<th style=" width: 300pt; text-align: center;">Nazwa</th>';
|
||||
if ($("#productSearchStock :selected").val() != '1')
|
||||
html += '<th style=" width: 30pt; text-align: center;">Stan</th>';
|
||||
|
||||
html += '</tr></thead>';
|
||||
var counter;
|
||||
$
|
||||
.each(
|
||||
data,
|
||||
function(index, value) {
|
||||
if(counter%2==0){
|
||||
html += '<tr style="height: 15pt;" class="oddListRowS1">';
|
||||
} else {
|
||||
html += '<tr style="height: 15pt;" class="evenListRowS1">';
|
||||
}
|
||||
html += '<td style=""><input id="prod_'
|
||||
+ value.id + '" name="prod_s" type="checkbox"/></td>';
|
||||
html += '<td style="" onClick="$(\'#prod_'
|
||||
+ value.id
|
||||
+ '\').prop(\'checked\', true);">'
|
||||
+ value.code + '</td>';
|
||||
html += '<td style="" onClick="unsetAllCheckboxes(); $(\'#prod_'
|
||||
+ value.id
|
||||
+ '\').prop(\'checked\', true); return addProducts();">'
|
||||
+ value.name + '</td>';
|
||||
if ($("#productSearchStock :selected").val() != '1')
|
||||
html += '<td style="">'
|
||||
+ value.stock_state + '</td>';
|
||||
html += '</tr>';
|
||||
searchedProducts.push(value.id);
|
||||
counter++;
|
||||
});
|
||||
// add button
|
||||
html += '</table><br>';
|
||||
html += 'Ilość: <input type="text" id="searchInputQty" value=""/>';
|
||||
html += '<br><br><input type="button" value="Dodaj wiele" onClick="return addProducts();"/>';
|
||||
$('#searchResultDiv').html(html);
|
||||
|
||||
}
|
||||
|
||||
function unsetAllCheckboxes() {
|
||||
$("#searchResultDiv input[type=checkbox]").each(function() {
|
||||
$(this).prop("checked", false);
|
||||
});
|
||||
}
|
||||
*/
|
||||
function addProducts() {
|
||||
$(".loading_panel").css("display", "block");
|
||||
clearEmpty();
|
||||
var products = new Array();
|
||||
$.each(searchedProducts, function(index, value) {
|
||||
if ($('#prod_' + value).is(':checked'))
|
||||
products[value] = true;
|
||||
});
|
||||
var stockId=$("#stock_id").val();
|
||||
for ( var key in products) {
|
||||
var params = {
|
||||
job : 'getProduct',
|
||||
id : key,
|
||||
stockId : stockId,
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
if (data != '-1') {
|
||||
var p = new Object();
|
||||
p.product_id = data.id;
|
||||
p.name = data.name;
|
||||
p.product_code = data.code;
|
||||
p.price = data.price;
|
||||
p.unit_name = data.unit_name;
|
||||
p.unit_id = data.unit_id;
|
||||
p.ecmvat_id = data.ecmvat_id;
|
||||
p.ecmvat_value = data.ecmvat_value;
|
||||
p.ecmvat_name = data.ecmvat_name;
|
||||
p.stock_state = data.stock_state;
|
||||
p.product_category_id = data.product_category_id;
|
||||
p.product_precision = data.unit_precision;
|
||||
p.unit_precision = data.unit_precision;
|
||||
p.product_is_consignment = data.is_consignment;
|
||||
if ($("#searchInputQty").val() != ''
|
||||
&& !isNaN(parseFloat(UnformatNumber($(
|
||||
"#searchInputQty").val()))))
|
||||
p.quantity = $("#searchInputQty").val();
|
||||
items.push(p);
|
||||
console.log(p);
|
||||
}
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
AddSearchRecord();
|
||||
FillTable(items);
|
||||
calculateAll();
|
||||
// clear results
|
||||
$('#searchResultDiv').html('');
|
||||
searchedProducts = new Array();
|
||||
$('#searchProductsInput').val('');
|
||||
|
||||
$(".loading_panel").css("display", "none");
|
||||
}
|
||||
|
||||
function AddProduct(index,record){
|
||||
$(".loading_panel").css("display", "block");
|
||||
var record;
|
||||
var pricebook = $("#pricebook_id :selected").val();
|
||||
|
||||
var params = {
|
||||
job : 'getProduct',
|
||||
id : record,
|
||||
stockId : $("#stock_id").val(),
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
if (data != '-1') {
|
||||
|
||||
items[index].product_id = data.id;
|
||||
items[index].name = data.name;
|
||||
items[index].product_code = data.code;
|
||||
items[index].product_id = data.id;
|
||||
items[index].ecmvat_id = data.ecmvat_id;
|
||||
items[index].ecmvat_value = data.ecmvat_value;
|
||||
items[index].ecmvat_name = data.ecmvat_name;
|
||||
items[index].product_ean = data.ean;
|
||||
items[index].discount = data.discount;
|
||||
items[index].product_ean2 = data.ean2;
|
||||
items[index].unit_name = data.unit_name;
|
||||
items[index].unit_id = data.unit_id;
|
||||
items[index].price_start = data.price_start;
|
||||
items[index].recipient_code = data.recipient_code;
|
||||
items[index].stock_state = data.stock_state;
|
||||
items[index].product_precision = data.unit_precision;
|
||||
items[index].unit_precision = data.unit_precision;
|
||||
items[index].product_is_consignment = data.is_consignment;
|
||||
if ($("#searchInputPrice").val() != ''
|
||||
&& !isNaN(parseFloat(UnformatNumber($(
|
||||
"#searchInputPrice").val()))))
|
||||
items[index].price_start = $("#searchInputPrice").val();
|
||||
if ($("#searchInputQty").val() != ''
|
||||
&& !isNaN(parseFloat(UnformatNumber($(
|
||||
"#searchInputQty").val()))))
|
||||
items[index].quantity = $("#searchInputQty").val();
|
||||
|
||||
}
|
||||
},
|
||||
data : params
|
||||
});
|
||||
AddSearchRecord();
|
||||
FillTable(items);
|
||||
calculateAll();
|
||||
$('#searchResultDiv').html('');
|
||||
$(".loading_panel").css("display", "none");
|
||||
$("#quantity_"+index).focus().select();
|
||||
}
|
||||
|
||||
function getItems(editview) {
|
||||
var record = '';
|
||||
if ($("#duplicate").val() == true)
|
||||
record = $("input[name='return_id']").val();
|
||||
else
|
||||
record = $("input[name='record']").val();
|
||||
if (isNaN(editview))
|
||||
editview = true;
|
||||
var params = {
|
||||
job : 'getItems',
|
||||
record : record,
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
items = data;
|
||||
if (editview)
|
||||
FillTable(items, false);
|
||||
else {
|
||||
FillTable(items, true);
|
||||
var count = $('#' + itemsTable + '_T tr').length - 1; // -1 - thead row
|
||||
for (var index = 0; index != count; index++) {
|
||||
if (items[index].product_consignment_doc) {
|
||||
$('#product_code_'+index).parent().append($( "<p>"+items[index].product_consignment_doc+"</p>" ));
|
||||
}
|
||||
}
|
||||
}
|
||||
$(".loading_panel").css("display", "none");
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
|
||||
function DrawDetailSummary() {
|
||||
$("#result_table").html('');
|
||||
html = '';
|
||||
html += '<tr id="subtotal_tr"> ';
|
||||
html += '<td class="positionsLabel" style="border-top:0px;">Suma dokumentu</td>';
|
||||
html += '<td class="positionsField" style="border-top:0px;"><input type="text" style="border:0px;font-weight:900;width:100%;text-align:right;" readonly="readonly" name="t_netto" id="t_netto" value=\''
|
||||
+ $("#doc_total").val() + '\'></td>';
|
||||
html += '</tr>';
|
||||
$("#result_table").html(html);
|
||||
}
|
||||
|
||||
function generateNumber() {
|
||||
var params = {
|
||||
job : 'generateNumber',
|
||||
stock: $("#stock_id").val(),
|
||||
date : $("#register_date").val(),
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
if (data == '-1') {
|
||||
// try loading again
|
||||
generateNumber();
|
||||
} else {
|
||||
$("#document_no").val(data.document_no);
|
||||
$("#number").val(data.number);
|
||||
$(".loading_panel").css("display", "none");
|
||||
}
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
function getCategoriesList() {
|
||||
var params = {
|
||||
job : 'getCategoriesList'
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
var html = '<option value=""></option>';
|
||||
$.each(data, function(index, value) {
|
||||
html += '<option value="' + value.id + '">' + value.name
|
||||
+ '</option>';
|
||||
$("#productSearchCategory").html(html);
|
||||
});
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
|
||||
function refreshStock(index) {
|
||||
var params = {
|
||||
job : 'getStockState',
|
||||
id : $("#product_id_" + index).val(),
|
||||
stockId : $("#stock_id").val(),
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
$("#stock_state_" + index).val(FormatNumber(data));
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
|
||||
function checkProducts() {
|
||||
//var count = $('#' + itemsTable + '_T tr').length - 1; // -1 - thead row
|
||||
var count = items.length;
|
||||
var error = false; // hope :)
|
||||
for (var index = 0; index != count; index++) {
|
||||
if($("#product_id_" + index).val()!=''){
|
||||
refreshStock(index);
|
||||
var qty = UnformatNumber($("#quantity_" + index).val());
|
||||
var cat_id = $("#product_category_id_" + index).val();
|
||||
var con_qty = $("#product_consignment_qty_" + index).val();
|
||||
var stock = UnformatNumber($("#stock_state_" + index).val());
|
||||
var price_new = UnformatNumber($("#price_" + index).val());
|
||||
var price_old = UnformatNumber($("#price_old_" + index).val());
|
||||
// refresh items array
|
||||
items[index].quantity = qty;
|
||||
if ($('#product_is_consignment_' + index).val() != '1' && $('#product_consignment_id_' + index).val()=='' ) {
|
||||
con_qty=stock;
|
||||
}
|
||||
items[index].price = UnformatNumber($("#price_" + index).val());
|
||||
// przecena
|
||||
if ($('#type').val() == '6ed5b076-ddd1-9809-b236-54e5b2bcbd97') {
|
||||
if($('#product_consignment_id_' + index).val()==''){
|
||||
error=true;
|
||||
alert("Można przecenić tylko konkretną pozycje!");
|
||||
}
|
||||
if(qty<=0 || qty<con_qty || price_new==price_old || price_new<=0){
|
||||
error = true;
|
||||
$("#quantity_" + index).css("color", "red");
|
||||
|
||||
} else {
|
||||
$("#quantity_" + index).css("color", "black");
|
||||
}
|
||||
}
|
||||
// korekta minus
|
||||
console.log(qty+' '+con_qty+' '+Math.abs(qty));
|
||||
if ($('#type').val() == '7bb903d0-c296-7d1b-6e50-54c209e30850') {
|
||||
if(qty>=0 || Math.abs(qty)>con_qty){
|
||||
|
||||
error = true;
|
||||
$("#quantity_" + index).css("color", "red");
|
||||
|
||||
} else {
|
||||
$("#quantity_" + index).css("color", "black");
|
||||
}
|
||||
}
|
||||
// korekta plus
|
||||
if ($('#type').val() == '8a6b804b-fac7-5cc2-de19-54c209116b19') {
|
||||
if(qty<=0 || price_new<=0){
|
||||
error = true;
|
||||
$("#quantity_" + index).css("color", "red");
|
||||
|
||||
} else {
|
||||
$("#quantity_" + index).css("color", "black");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (error)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
function getComponents(index) {
|
||||
$(".loading_panel").css("display", "block");
|
||||
var product_id = items[index].product_id;
|
||||
var qty = items[index].quantity;
|
||||
//var price = items[index].price;
|
||||
|
||||
var params = {
|
||||
job : 'getComponents',
|
||||
product_id : product_id,
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
if (data.length > 0) {
|
||||
items.splice(index, 1);
|
||||
$.each(data, function(index, value) {
|
||||
var p = new Object();
|
||||
p.product_id = value.id;
|
||||
p.name = value.name;
|
||||
p.product_code = value.code;
|
||||
p.price = value.price;
|
||||
p.unit_name = value.unit_name;
|
||||
p.unit_id = value.unit_id;
|
||||
p.quantity = qty * parseInt(value.quantity);
|
||||
p.product_category_id = value.product_category_id;
|
||||
|
||||
if (p.product_category_id=='d7f876b0-1a3d-43a1-7c9b-511ba40df3d1')
|
||||
return;
|
||||
items.push(p);
|
||||
});
|
||||
};
|
||||
},
|
||||
data : params
|
||||
});
|
||||
FillTable(items);
|
||||
//getConsignmentsDiv(index);
|
||||
$(".loading_panel").css("display", "none");
|
||||
}
|
||||
|
||||
// sortable rows in main table
|
||||
$("#" + itemsTable + " tbody").sortable();
|
||||
114
modules/EcmStockDocCorrects/javascript/columndefs-detail.js
Executable file
114
modules/EcmStockDocCorrects/javascript/columndefs-detail.js
Executable 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();'
|
||||
};
|
||||
columns[3]['content'][1] = {
|
||||
'name' : '_consignment_doc',
|
||||
'type' : 'text',
|
||||
};
|
||||
// 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
|
||||
184
modules/EcmStockDocCorrects/javascript/columndefs.js
Normal file
184
modules/EcmStockDocCorrects/javascript/columndefs.js
Normal file
@@ -0,0 +1,184 @@
|
||||
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' : 'total',
|
||||
'type' : 'hidden'
|
||||
};
|
||||
columns[1]['content'][5] = {
|
||||
'name' : 'precision',
|
||||
'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' : 'consignment_qty',
|
||||
'type' : 'hidden',
|
||||
};
|
||||
columns[1]['content'][9] = {
|
||||
'name' : 'is_consignment',
|
||||
'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());'
|
||||
};
|
||||
columns[3]['content'][1] = {
|
||||
'name' : '_consignment_doc',
|
||||
'type' : 'text',
|
||||
|
||||
};
|
||||
columns[3]['content'][2] = {
|
||||
'name' : '_consignment_id',
|
||||
'type' : 'hidden',
|
||||
};
|
||||
|
||||
// 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());'
|
||||
};
|
||||
columns[4]['content'][1] = {
|
||||
'name' : '_old',
|
||||
'type' : 'text',
|
||||
'isNumber' : true,
|
||||
'readonly': true,
|
||||
};
|
||||
// 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' : 'ecmvat_',
|
||||
'label' : 'VAT (%)',
|
||||
'width' : 0,
|
||||
'hide' : 'yes',
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[7]['content'][0] = {
|
||||
'name' : 'name',
|
||||
'type' : 'hidden'
|
||||
};
|
||||
columns[7]['content'][1] = {
|
||||
'name' : 'value',
|
||||
'type' : 'hidden'
|
||||
};
|
||||
columns[7]['content'][2] = {
|
||||
'name' : 'id',
|
||||
'type' : 'hidden'
|
||||
};
|
||||
columns[8] = {
|
||||
'name' : 'options',
|
||||
'label' : 'Opcje',
|
||||
'width' : 3,
|
||||
'content' : new Array(),
|
||||
};
|
||||
4
modules/EcmStockDocCorrects/javascript/searchcolumndefs.js
Executable file
4
modules/EcmStockDocCorrects/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="EcmStockDocCorrects";
|
||||
Reference in New Issue
Block a user