Add JS files
This commit is contained in:
76
modules/EcmReports/javascript/ReportBuyesByVat.js
Executable file
76
modules/EcmReports/javascript/ReportBuyesByVat.js
Executable file
@@ -0,0 +1,76 @@
|
||||
var isHide = true;
|
||||
var vatIsHide = true;
|
||||
var showAndHideButton;
|
||||
$(document).ready(function () {
|
||||
// $.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..."
|
||||
// });
|
||||
|
||||
|
||||
$("#pdfEksport").click(pdfExport);
|
||||
|
||||
//var fileUrl = url.slice(0, url.indexOf("index")) + "modules/EcmReports/ExcelFiles/ReportBuyesByVat.xls";
|
||||
|
||||
|
||||
$("table").tablesorter({
|
||||
theme: 'blue',
|
||||
widgets: ['zebra', 'staticRow', 'filter'],
|
||||
widgetOptions: {
|
||||
zebra: ["normal-row", "alt-row"]
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function excelExport() {
|
||||
var url = $(location).attr('href').replace("ReportBuyesByVat", "ReportBuyesByVatToExcell");
|
||||
url = url + "&to_pdf=1";
|
||||
console.log(url);
|
||||
var fileUrl = url.slice(0, url.indexOf("index")) + "modules/EcmReports/ExcelFiles/RaportZakupu.xls";
|
||||
$.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..."
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: {
|
||||
date_from: $('#date_from').val(),
|
||||
date_to: $('#date_to').val(),
|
||||
},
|
||||
success: function (data) {
|
||||
$.unblockUI();
|
||||
window.location.href = fileUrl
|
||||
},
|
||||
error: function () {
|
||||
$.unblockUI();
|
||||
alert('Eksport zakończony niepowodzeniem!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function pdfExport() {
|
||||
var url = $(location).attr('href');
|
||||
url = url + "&to_pdf=1";
|
||||
window.open(url, '_blank');
|
||||
console.log('cos');
|
||||
}
|
||||
Reference in New Issue
Block a user