OpenXE/classes/Modules/AmaInvoice/www/js/amainvoice.js

53 lines
1.5 KiB
JavaScript
Raw Normal View History

2021-05-21 08:49:41 +02:00
var AmaInvoice = function ($) {
'use strict';
var me = {
storage: {
tableList: []
},
expertChange: function () {
if ($('#expert').prop('checked')) {
$('.trexpert').show();
} else {
$('.trexpert').hide();
}
},
init: function () {
$('#import').on('click', function () {
me.storage.tableList = [];
$('#amainvoice_list').find(':checked').each(function () {
me.storage.tableList.push($(this).data('id'));
});
if (me.storage.tableList.length > 0) {
$.ajax({
type: 'POST',
url: 'index.php?module=amainvoice&action=list&cmd=importlist',
data: {
list: me.storage.tableList
},
success: function () {
me.storage.tableList = [];
}
});
}
});
if ($('#createorder').prop('checked')) {
$('#expert').prop('checked', true);
}
$('#expert').on('change', function () {
me.expertChange();
});
me.expertChange();
}
};
return {
init: me.init
};
}(jQuery);
$(document).ready(function () {
AmaInvoice.init();
});