Add JS files
This commit is contained in:
220
modules/EcmSales/javascript/EcmSales3.js
Executable file
220
modules/EcmSales/javascript/EcmSales3.js
Executable file
@@ -0,0 +1,220 @@
|
||||
//START:
|
||||
$(document).ready(
|
||||
function() {
|
||||
//set sizes
|
||||
$("#parent_name").attr("size", "70");
|
||||
$("#parent_name_copy").attr("size", "70");
|
||||
$("#parent_shipping_address_name").attr("size", "70");
|
||||
$("#payment_date_days").css("width", "40");
|
||||
//$("#payment_method").css("width", "100");
|
||||
//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);
|
||||
// confirm exit
|
||||
window.onbeforeunload = confirmExit;
|
||||
// prevent submit by enter press
|
||||
lockEnter();
|
||||
// parent info
|
||||
$("#delivery_date").on('inputchange',function() {
|
||||
calculateDate($("#delivery_date").val());
|
||||
});
|
||||
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);
|
||||
// categories
|
||||
|
||||
$('#pdf_type').change(function () {
|
||||
manageOO();
|
||||
var count = $('#' + itemsTable + '_T tr').length - 1; // -1 -
|
||||
// thead row
|
||||
for (var index = 0; index != count; index++){
|
||||
calculateRow(index);
|
||||
|
||||
}
|
||||
calculateTotal();
|
||||
});
|
||||
|
||||
getCategoriesList();
|
||||
// its vat free change
|
||||
$("#no_tax").change(function() {
|
||||
// calculate totals
|
||||
var count = $('#' + itemsTable + '_T tr').length - 1; // -1 -
|
||||
// thead row
|
||||
for (var index = 0; index != count; index++)
|
||||
calculateRow(index);
|
||||
});
|
||||
// language channge
|
||||
$("#ecmlanguage").change(function() {
|
||||
changeLanguage();
|
||||
});
|
||||
removeFromValidate('EditView', 'shipping_iln');
|
||||
DrawHeaders();
|
||||
// stock selector
|
||||
$("#stock").change(function() {
|
||||
$("#stock_id").val(($("#stock :selected").val()));
|
||||
|
||||
});
|
||||
if($("#type :selected").val()=='sales_order'){
|
||||
removeFromValidate('EditView', 'invoice_date');
|
||||
}
|
||||
$("#type").change(function() {
|
||||
if($("#type :selected").val()=='sales_order'){
|
||||
removeFromValidate('EditView', 'invoice_date');
|
||||
} else {
|
||||
addToValidate('EditView', 'invoice_date', 'id', 'true', '');
|
||||
}
|
||||
|
||||
});
|
||||
if (($("#new_number").val() == true)
|
||||
&& ($("#duplicate").val() != true) && ($("#ecmquote_id").val() =='')) {
|
||||
EcmDocumentNumberGenerator_getNumberTemplate('document_no', 'EcmSales');
|
||||
//sale from subpanel??
|
||||
var ecp = $("#ecommerce_products").val();
|
||||
if (ecp && ecp.length > 0) {
|
||||
loadECommerceProducts(ecp);
|
||||
} else if ($("#parent_id").val()!='') {
|
||||
$(".loading_panel").css("display", "block");
|
||||
setTimeout(function() {
|
||||
getParentInfo($("#parent_id").val(), $(
|
||||
"#parent_type :selected").val());
|
||||
}, 1000);
|
||||
}
|
||||
$(".loading_panel").css("display", "none");
|
||||
} else if (($("#new_number").val() == true)
|
||||
&& ($("#duplicate").val() == true)) {
|
||||
EcmDocumentNumberGenerator_getNumberTemplate('document_no', 'EcmSales');
|
||||
getParentInfo($("#parent_id").val(),
|
||||
$("#parent_type :selected").val());
|
||||
getItems();
|
||||
$(".loading_panel").css("display", "none");
|
||||
} else if (($("#new_number").val() == true)
|
||||
&& ($("#ecmquote_id").val() != '')) {
|
||||
|
||||
EcmDocumentNumberGenerator_getNumberTemplate('document_no', 'EcmSales');
|
||||
getParentInfo($("#parent_id").val(),
|
||||
'Accounts');
|
||||
getItemsFromSale();
|
||||
$(".loading_panel").css("display", "none");
|
||||
} else {
|
||||
getParentInfo($("#parent_id").val(),
|
||||
$("#parent_type :selected").val());
|
||||
getItems();
|
||||
$(".loading_panel").css("display", "none");
|
||||
}
|
||||
// handle setItems
|
||||
setITEMS = function() {
|
||||
var formname = 'EditView';
|
||||
if (check_form_(formname) == true) {
|
||||
SetTab('ITEMS');
|
||||
}
|
||||
};
|
||||
//payment date functions
|
||||
$('#payment_date_days').css('height', '18');
|
||||
$('#payment_date_days').val('0');
|
||||
$('#payment_date_days').change(function() {
|
||||
calculatePaymentDate();
|
||||
});
|
||||
// parent info
|
||||
var previousVal4;
|
||||
var pollInterval4 = setInterval(function() {
|
||||
var val = $('#payment_date').val();
|
||||
if (val !== previousVal4) {
|
||||
setTimeout(function() {
|
||||
calculateDateDiff();
|
||||
}, 1000);
|
||||
}
|
||||
previousVal4 = val;
|
||||
}, 1000);
|
||||
// wyszukiwanie start
|
||||
$('#searchProductsInput').keyup(function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
// 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) {
|
||||
// zapobiega zapisywaniu dokumentu firefox bug, w przypadku nacisniecia enter w polu z autocomplete
|
||||
if(event.clientY==0 && event.clientX==0){
|
||||
return false;
|
||||
}
|
||||
window.onbeforeunload = null;
|
||||
if (items.length == 0 || items[0].product_id=='') {
|
||||
alert("Brak produktów");
|
||||
return false;
|
||||
}
|
||||
// usuwa rekord pomocniczy
|
||||
clearEmpty();
|
||||
$(".loading_panel").css("display", "block");
|
||||
// calculate totals
|
||||
var count = $('#' + itemsTable + '_T tr').length - 1; // -1 - thead row
|
||||
for (var index = 0; index != count; index++) {
|
||||
calculateRow(index);
|
||||
if (validation.recipient_code == true)
|
||||
console.log('Sprawdzić kody trzeba');
|
||||
}
|
||||
$("#total_netto").val($("#t_netto").val());
|
||||
$("#total_brutto").val($("#t_brutto").val());
|
||||
$("#discount").val($("#disc").val());
|
||||
$("#position_list").val(JSON.stringifyNoSecurity(items));
|
||||
|
||||
|
||||
|
||||
if (check_form_(formname) === true) {
|
||||
return true;
|
||||
} else {
|
||||
window.onbeforeunload = confirmExit;
|
||||
$(".loading_panel").css("display", "none");
|
||||
return false;
|
||||
}
|
||||
};
|
||||
function confirmExit() {
|
||||
return "";
|
||||
}
|
||||
|
||||
function lockEnter() {
|
||||
// prevent default
|
||||
|
||||
$(window).keydown(function(event) {
|
||||
|
||||
if (event.keyCode == 13 && $(":focus").prop('tagName')!='input') {
|
||||
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loadECommerceProducts(ecp) {
|
||||
var products = JSON.parse(ecp);
|
||||
items = products;
|
||||
FillTable(products);
|
||||
}
|
||||
8
modules/EcmSales/javascript/EcmSalesDetail.js
Executable file
8
modules/EcmSales/javascript/EcmSalesDetail.js
Executable file
@@ -0,0 +1,8 @@
|
||||
//START:
|
||||
$(document).ready(
|
||||
function() {
|
||||
DrawHeaders();
|
||||
getItems(false);
|
||||
$(".loading_panel").css("display", "none");
|
||||
});
|
||||
|
||||
197
modules/EcmSales/javascript/ListNewSales.js
Executable file
197
modules/EcmSales/javascript/ListNewSales.js
Executable file
@@ -0,0 +1,197 @@
|
||||
function createMultiPdf() {
|
||||
var sel = $('input[type=checkbox]:checked').map(function(make_pdf, el) {
|
||||
return $(el).val()
|
||||
}).get();
|
||||
|
||||
$.blockUI({ css: {
|
||||
border: 'none',
|
||||
padding: '15px',
|
||||
backgroundColor: '#000',
|
||||
'-webkit-border-radius': '10px',
|
||||
'-moz-border-radius': '10px',
|
||||
opacity: .5,
|
||||
'font-weight': 'bold',
|
||||
'font-size': '16px',
|
||||
color: '#fff',
|
||||
},
|
||||
message: "Trwa generowanie pliku..."
|
||||
});
|
||||
|
||||
var docs = new Array();
|
||||
jQuery.each(sel, function(key, val) {
|
||||
tmp = {};
|
||||
tmp['module'] = 'EcmSales';
|
||||
tmp['record'] = val;
|
||||
docs.push(tmp);
|
||||
});
|
||||
EcmMultiPdf_create(docs);
|
||||
}
|
||||
|
||||
function getSelected() {
|
||||
var sel = $('input[type=checkbox]:checked').map(function(make_pdf, el) {
|
||||
return $(el).val()
|
||||
}).get();
|
||||
|
||||
document.getElementById("idss").value=sel;
|
||||
|
||||
return sel;
|
||||
}
|
||||
|
||||
|
||||
function getList() {
|
||||
if($('#idss').val()!=""){
|
||||
window.open('index.php?module=EcmSales&action=ProductSummary&ids='+$('#idss').val());
|
||||
} else {
|
||||
alert("Proszę zaznaczyć chociaż jedną pozycje!");
|
||||
}
|
||||
|
||||
}
|
||||
function getList2() {
|
||||
if($('#idss').val()!=""){
|
||||
window.open('index.php?module=EcmSales&action=productsSummaryList&to_pdf=1&ids='+$('#idss').val());
|
||||
} else {
|
||||
alert("Proszę zaznaczyć chociaż jedną pozycje!");
|
||||
}
|
||||
|
||||
}
|
||||
function getList3() {
|
||||
if($('#idss').val()!=""){
|
||||
window.open('index.php?module=EcmSales&action=ComponentsList&ids='+$('#idss').val());
|
||||
} else {
|
||||
alert("Proszę zaznaczyć chociaż jedną pozycje!");
|
||||
}
|
||||
|
||||
}
|
||||
$(document).ready(function()
|
||||
{
|
||||
// by document no
|
||||
$.tablesorter.addParser({
|
||||
// set a unique id
|
||||
id: 'rangesort',
|
||||
is: function (s) {
|
||||
// return false so this parser is not auto detected
|
||||
return false;
|
||||
},
|
||||
format: function (s, table, cell, cellIndex) {
|
||||
// get data attributes from $(cell).attr('data-something');
|
||||
// check specific column using cellIndex
|
||||
|
||||
return $(cell).attr('data-price');
|
||||
},
|
||||
// set type, either numeric or text
|
||||
type: 'numeric'
|
||||
});
|
||||
// by total netto
|
||||
$.tablesorter.addParser({
|
||||
// set a unique id
|
||||
id: 'rangesorttota',
|
||||
is: function (s) {
|
||||
// return false so this parser is not auto detected
|
||||
return false;
|
||||
},
|
||||
format: function (s, table, cell, cellIndex) {
|
||||
// get data attributes from $(cell).attr('data-something');
|
||||
// check specific column using cellIndex
|
||||
|
||||
return $(cell).attr('data-total');
|
||||
},
|
||||
// set type, either numeric or text
|
||||
type: 'numeric'
|
||||
});
|
||||
// by vat
|
||||
|
||||
$.tablesorter.addParser({
|
||||
// set a unique id
|
||||
id: 'rangesorttotav',
|
||||
is: function (s) {
|
||||
// return false so this parser is not auto detected
|
||||
return false;
|
||||
},
|
||||
format: function (s, table, cell, cellIndex) {
|
||||
// get data attributes from $(cell).attr('data-something');
|
||||
// check specific column using cellIndex
|
||||
|
||||
return $(cell).attr('data-total');
|
||||
},
|
||||
// set type, either numeric or text
|
||||
type: 'numeric'
|
||||
});
|
||||
// by total brutto
|
||||
$.tablesorter.addParser({
|
||||
// set a unique id
|
||||
id: 'rangesorttotan',
|
||||
is: function (s) {
|
||||
// return false so this parser is not auto detected
|
||||
return false;
|
||||
},
|
||||
format: function (s, table, cell, cellIndex) {
|
||||
// get data attributes from $(cell).attr('data-something');
|
||||
// check specific column using cellIndex
|
||||
|
||||
return $(cell).attr('data-total');
|
||||
},
|
||||
// set type, either numeric or text
|
||||
type: 'numeric'
|
||||
});
|
||||
// by total invoice
|
||||
$.tablesorter.addParser({
|
||||
// set a unique id
|
||||
id: 'rangesorttotai',
|
||||
is: function (s) {
|
||||
// return false so this parser is not auto detected
|
||||
return false;
|
||||
},
|
||||
format: function (s, table, cell, cellIndex) {
|
||||
// get data attributes from $(cell).attr('data-something');
|
||||
// check specific column using cellIndex
|
||||
|
||||
return $(cell).attr('data-total');
|
||||
},
|
||||
// set type, either numeric or text
|
||||
type: 'numeric'
|
||||
});
|
||||
$('#selectall').click(function(event) { //on click
|
||||
if(this.checked) { // check select status
|
||||
$('.make_pdf').each(function() { //loop through each checkbox
|
||||
this.checked = true; //select all checkboxes with class "checkbox1"
|
||||
});
|
||||
}else{
|
||||
$('.make_pdf').each(function() { //loop through each checkbox
|
||||
this.checked = false; //deselect all checkboxes with class "checkbox1"
|
||||
});
|
||||
}
|
||||
});
|
||||
// hightlight table row
|
||||
$('#myTable tr').mouseover(function(e) {
|
||||
$('#myTable tr').removeClass('highlighted');
|
||||
$(this).addClass('highlighted');
|
||||
});
|
||||
$('.tablesorter').tablesorter({
|
||||
headers: {
|
||||
0: {
|
||||
// disable it by setting the property sorter to false
|
||||
sorter: false
|
||||
},
|
||||
2: {
|
||||
sorter: 'rangesort'
|
||||
},
|
||||
3: {
|
||||
// disable it by setting the property sorter to false
|
||||
sorter: false
|
||||
},
|
||||
7: {
|
||||
sorter: 'rangesorttota'
|
||||
},
|
||||
8: {
|
||||
sorter: 'rangesorttotav'
|
||||
},
|
||||
9: {
|
||||
sorter: 'rangesorttotan'
|
||||
},
|
||||
10: {
|
||||
sorter: 'rangesorttotai'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
171
modules/EcmSales/javascript/ProductSummary.js
Executable file
171
modules/EcmSales/javascript/ProductSummary.js
Executable file
@@ -0,0 +1,171 @@
|
||||
|
||||
function getSelected() {
|
||||
var sel = $('input[type=checkbox]:checked').map(function(make_pdf, el) {
|
||||
return $(el).val()
|
||||
}).get();
|
||||
|
||||
document.getElementById("idss").value=sel;
|
||||
|
||||
return sel;
|
||||
}
|
||||
|
||||
function getList() {
|
||||
window.open('index.php?module=EcmSales&action=productsSummaryList&to_pdf=1&ids='+$('#idss').val());
|
||||
}
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
||||
// by document no
|
||||
$.tablesorter.addParser({
|
||||
// set a unique id
|
||||
id: 'rangesort',
|
||||
is: function (s) {
|
||||
// return false so this parser is not auto detected
|
||||
return false;
|
||||
},
|
||||
format: function (s, table, cell, cellIndex) {
|
||||
// get data attributes from $(cell).attr('data-something');
|
||||
// check specific column using cellIndex
|
||||
|
||||
return $(cell).attr('data-price');
|
||||
},
|
||||
// set type, either numeric or text
|
||||
type: 'numeric'
|
||||
});
|
||||
// by total netto
|
||||
$.tablesorter.addParser({
|
||||
// set a unique id
|
||||
id: 'rangesorttota',
|
||||
is: function (s) {
|
||||
// return false so this parser is not auto detected
|
||||
return false;
|
||||
},
|
||||
format: function (s, table, cell, cellIndex) {
|
||||
// get data attributes from $(cell).attr('data-something');
|
||||
// check specific column using cellIndex
|
||||
|
||||
return $(cell).attr('data-total');
|
||||
},
|
||||
// set type, either numeric or text
|
||||
type: 'numeric'
|
||||
});
|
||||
// by vat
|
||||
|
||||
$.tablesorter.addParser({
|
||||
// set a unique id
|
||||
id: 'rangesorttotav',
|
||||
is: function (s) {
|
||||
// return false so this parser is not auto detected
|
||||
return false;
|
||||
},
|
||||
format: function (s, table, cell, cellIndex) {
|
||||
// get data attributes from $(cell).attr('data-something');
|
||||
// check specific column using cellIndex
|
||||
|
||||
return $(cell).attr('data-total');
|
||||
},
|
||||
// set type, either numeric or text
|
||||
type: 'numeric'
|
||||
});
|
||||
// by total brutto
|
||||
$.tablesorter.addParser({
|
||||
// set a unique id
|
||||
id: 'rangesorttotan',
|
||||
is: function (s) {
|
||||
// return false so this parser is not auto detected
|
||||
return false;
|
||||
},
|
||||
format: function (s, table, cell, cellIndex) {
|
||||
// get data attributes from $(cell).attr('data-something');
|
||||
// check specific column using cellIndex
|
||||
|
||||
return $(cell).attr('data-total');
|
||||
},
|
||||
// set type, either numeric or text
|
||||
type: 'numeric'
|
||||
});
|
||||
// by total invoice
|
||||
$.tablesorter.addParser({
|
||||
// set a unique id
|
||||
id: 'rangesorttotai',
|
||||
is: function (s) {
|
||||
// return false so this parser is not auto detected
|
||||
return false;
|
||||
},
|
||||
format: function (s, table, cell, cellIndex) {
|
||||
// get data attributes from $(cell).attr('data-something');
|
||||
// check specific column using cellIndex
|
||||
|
||||
return $(cell).attr('data-total');
|
||||
},
|
||||
// set type, either numeric or text
|
||||
type: 'numeric'
|
||||
});
|
||||
$('#selectall').click(function(event) { //on click
|
||||
if(this.checked) { // check select status
|
||||
$('.make_pdf').each(function() { //loop through each checkbox
|
||||
this.checked = true; //select all checkboxes with class "checkbox1"
|
||||
});
|
||||
}else{
|
||||
$('.make_pdf').each(function() { //loop through each checkbox
|
||||
this.checked = false; //deselect all checkboxes with class "checkbox1"
|
||||
});
|
||||
}
|
||||
});
|
||||
$('#selectall2').click(function(event) { //on click
|
||||
if(this.checked) { // check select status
|
||||
$('.make_pdf2').each(function() { //loop through each checkbox
|
||||
this.checked = true; //select all checkboxes with class "checkbox1"
|
||||
});
|
||||
}else{
|
||||
$('.make_pdf2').each(function() { //loop through each checkbox
|
||||
this.checked = false; //deselect all checkboxes with class "checkbox1"
|
||||
});
|
||||
}
|
||||
});
|
||||
$('#selectall3').click(function(event) { //on click
|
||||
if(this.checked) { // check select status
|
||||
$('.make_pdf3').each(function() { //loop through each checkbox
|
||||
this.checked = true; //select all checkboxes with class "checkbox1"
|
||||
});
|
||||
}else{
|
||||
$('.make_pdf3').each(function() { //loop through each checkbox
|
||||
this.checked = false; //deselect all checkboxes with class "checkbox1"
|
||||
});
|
||||
}
|
||||
});
|
||||
// hightlight table row
|
||||
$('#myTable tr').mouseover(function(e) {
|
||||
$('#myTable tr').removeClass('highlighted');
|
||||
$(this).addClass('highlighted');
|
||||
});
|
||||
$("#myTable").tablesorter({
|
||||
headers: {
|
||||
0: {
|
||||
// disable it by setting the property sorter to false
|
||||
sorter: false
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$("#myTable2").tablesorter({
|
||||
headers: {
|
||||
0: {
|
||||
// disable it by setting the property sorter to false
|
||||
sorter: false
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
$("#myTable3").tablesorter({
|
||||
headers: {
|
||||
0: {
|
||||
// disable it by setting the property sorter to false
|
||||
sorter: false
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
1124
modules/EcmSales/javascript/bimit_table4.js
Executable file
1124
modules/EcmSales/javascript/bimit_table4.js
Executable file
File diff suppressed because it is too large
Load Diff
105
modules/EcmSales/javascript/columndefs-detail.js
Executable file
105
modules/EcmSales/javascript/columndefs-detail.js
Executable file
@@ -0,0 +1,105 @@
|
||||
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' : 'Indeks',
|
||||
'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' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'};
|
||||
//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_start
|
||||
columns[5] = {
|
||||
'name' : 'price_start',
|
||||
'label' : 'Cena<br>początkowa',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[5]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'};
|
||||
columns[5]['content'][1] = {'name' : '_div', 'type': 'text'};
|
||||
//end: price_start
|
||||
//begin: discount
|
||||
columns[6] = {
|
||||
'name' : 'discount',
|
||||
'label' : 'Upust<br.(%)',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[6]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'};
|
||||
//end: discount
|
||||
//begin: price_netto
|
||||
columns[7] = {
|
||||
'name' : 'price_netto',
|
||||
'label' : 'Cena<br>po upuście',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[7]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'readonly' : true};
|
||||
//end: price_start
|
||||
//begin: ecmvat
|
||||
columns[8] = {
|
||||
'name' : 'ecmvat_',
|
||||
'label' : 'VAT<br>(%)',
|
||||
'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' : 'netto', 'type': 'text', 'isNumber' : true, 'readonly' : true};
|
||||
//end: total
|
||||
117
modules/EcmSales/javascript/columndefs2.js
Executable file
117
modules/EcmSales/javascript/columndefs2.js
Executable file
@@ -0,0 +1,117 @@
|
||||
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' : 'Indeks',
|
||||
'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' : 'precision', 'type': 'hidden'};
|
||||
columns[1]['content'][4] = {'name' : 'is_oo', 'type': 'hidden'};
|
||||
columns[1]['content'][4] = {'name' : 'recipient_code', 'type': 'hidden'};
|
||||
//end: code
|
||||
//begin: name
|
||||
columns[2] = {
|
||||
'name' : 'name',
|
||||
'label' : 'Nazwa',
|
||||
'width' : 20,
|
||||
'onChange' : 'changeName($(this).parent(\'td\').parent(\'tr\').index());',
|
||||
'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' : '_res', 'type': 'text', 'isNumber' : true, 'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'};
|
||||
//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_start
|
||||
columns[5] = {
|
||||
'name' : 'price_start',
|
||||
'label' : 'Cena<br>pocz.',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[5]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'};
|
||||
columns[5]['content'][1] = {'name' : '_div', 'type': 'text'};
|
||||
//end: price_start
|
||||
//begin: discount
|
||||
columns[6] = {
|
||||
'name' : 'discount',
|
||||
'label' : 'Upust (%)',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[6]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'};
|
||||
//end: discount
|
||||
//begin: price_netto
|
||||
columns[7] = {
|
||||
'name' : 'price_netto',
|
||||
'label' : 'Cena<br>po upuście',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[7]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'readonly' : true};
|
||||
//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' : 'netto', 'type': 'text', 'isNumber' : true, 'readonly' : true};
|
||||
//end: total
|
||||
//begin: options
|
||||
columns[10] = {
|
||||
'name' : 'options',
|
||||
'label' : 'Opcje',
|
||||
'width' : 3,
|
||||
'content' : new Array(),
|
||||
};
|
||||
4
modules/EcmSales/javascript/searchcolumndefs.js
Executable file
4
modules/EcmSales/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="EcmSales";
|
||||
69
modules/EcmSales/javascript/tablenavigator.js
Executable file
69
modules/EcmSales/javascript/tablenavigator.js
Executable file
@@ -0,0 +1,69 @@
|
||||
(function ($) {
|
||||
$.fn.enableCellNavigation = function () {
|
||||
|
||||
var arrow = { left: 37, up: 38, right: 39, down: 40 };
|
||||
|
||||
// select all on focus
|
||||
this.find('input').keydown(function (e) {
|
||||
|
||||
// shortcut for key other than arrow keys
|
||||
if ($.inArray(e.which, [arrow.left, arrow.up, arrow.right, arrow.down]) < 0) { return; }
|
||||
|
||||
var input = e.target;
|
||||
var td = $(e.target).closest('td');
|
||||
var moveTo = null;
|
||||
|
||||
switch (e.which) {
|
||||
|
||||
case arrow.left: {
|
||||
if (input.selectionStart == 0) {
|
||||
moveTo = td.prev('td:has(input,textarea)');
|
||||
}
|
||||
break;
|
||||
}
|
||||
case arrow.right: {
|
||||
if (input.selectionEnd == input.value.length) {
|
||||
moveTo = td.next('td:has(input,textarea)');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case arrow.up:
|
||||
case arrow.down: {
|
||||
|
||||
var tr = td.closest('tr');
|
||||
var pos = td[0].cellIndex;
|
||||
|
||||
var moveToRow = null;
|
||||
if (e.which == arrow.down) {
|
||||
moveToRow = tr.next('tr');
|
||||
}
|
||||
else if (e.which == arrow.up) {
|
||||
moveToRow = tr.prev('tr');
|
||||
}
|
||||
|
||||
if (moveToRow.length) {
|
||||
moveTo = $(moveToRow[0].cells[pos]);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (moveTo && moveTo.length) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
moveTo.find('input,textarea').each(function (i, input) {
|
||||
input.focus();
|
||||
input.select();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
10
modules/EcmSales/javascript/wzCreator.js
Normal file
10
modules/EcmSales/javascript/wzCreator.js
Normal file
@@ -0,0 +1,10 @@
|
||||
$(document).ready(function () {
|
||||
$('#selectAll').click(function (e) {
|
||||
var elements = $('.make_pdf');
|
||||
|
||||
// Do something with the elements
|
||||
elements.each(function() {
|
||||
$(this).prop('checked', true);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user