hedera-web/reports/delivery-note/delivery-note.js

40 lines
935 B
JavaScript
Raw Normal View History

2015-11-19 13:57:23 +00:00
2018-08-30 13:26:05 +00:00
Hedera.DeliveryNote = new Class({
Extends: Hedera.Report,
2018-02-06 08:57:05 +00:00
2018-08-30 13:26:05 +00:00
onTicketReady: function(form) {
2022-05-28 15:49:46 +00:00
if (form.$.method != 'PICKUP')
2022-05-28 01:18:06 +00:00
Vn.Node.setText(this.$.method, _('Agency'));
2018-02-06 08:57:05 +00:00
else
2022-05-28 01:18:06 +00:00
Vn.Node.setText(this.$.method, _('Warehouse'));
2018-08-30 13:26:05 +00:00
},
2018-02-06 08:57:05 +00:00
2018-08-30 13:26:05 +00:00
discountRenderer: function(column, form) {
2022-05-28 15:49:46 +00:00
column.value = form.$.discount ? form.$.discount : null;
2018-08-30 13:26:05 +00:00
},
2015-11-19 13:57:23 +00:00
2018-08-30 13:26:05 +00:00
subtotalRenderer: function(column, form) {
column.value = this.subtotal(form);
},
subtotal: function(form) {
2022-05-28 15:49:46 +00:00
var price = form.$.price;
var discount = form.$.discount;
return form.$.quantity * price *((100 - discount) / 100);
2018-08-30 13:26:05 +00:00
},
serviceSubtotal: function(column, form) {
2022-05-28 15:49:46 +00:00
column.value = form.$.quantity * form.$.price;
},
onServicesChanged: function(model) {
2022-05-28 01:18:06 +00:00
this.$.services.node.style.display =
model.numRows > 0 ? 'block' : 'none';
},
2018-01-05 12:57:35 +00:00
2018-08-30 13:26:05 +00:00
onPackagesChanged: function(model) {
2022-05-28 01:18:06 +00:00
this.$.packages.node.style.display =
2018-01-05 12:57:35 +00:00
model.numRows > 0 ? 'block' : 'none';
}
2015-11-19 13:57:23 +00:00
});