0
1
Fork 0
hedera-web-mindshore/reports/delivery-note/delivery-note.js

40 lines
987 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) {
if (form.get('method') != 'PICKUP')
Vn.Node.setText(this.$('method'), _('Agency'));
2018-02-06 08:57:05 +00:00
else
2018-08-30 13:26:05 +00:00
Vn.Node.setText(this.$('method'), _('Warehouse'));
},
2018-02-06 08:57:05 +00:00
2018-08-30 13:26:05 +00:00
discountRenderer: function(column, form) {
column.value = form.get('discount') ? form.get('discount') : null;
},
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) {
var price = form.get('price');
var discount = form.get('discount');
return form.get('quantity') * price *((100 - discount) / 100);
},
serviceSubtotal: function(column, form) {
column.value = form.get('quantity') * form.get('price');
},
onServicesChanged: function(model) {
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) {
2018-01-05 12:57:35 +00:00
this.$('packages').node.style.display =
model.numRows > 0 ? 'block' : 'none';
}
2015-11-19 13:57:23 +00:00
});