Files
crm.e5.pl/modules/EcmSales/javascript/ListNewSales.js

198 lines
5.7 KiB
JavaScript
Raw Normal View History

2024-04-27 09:23:34 +02:00
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=ProductSummary&to_pdf=1&ids='+$('#idss').val());
} else {
2024-04-27 09:23:34 +02:00
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'
}
}
});
*/
});