forked from verdnatura/hedera-web
24 lines
460 B
JavaScript
24 lines
460 B
JavaScript
|
|
Hedera.DeliveryNote = new Class
|
|
({
|
|
Extends: Hedera.Report
|
|
|
|
,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);
|
|
}
|
|
|
|
,onPackagesChanged: function (model)
|
|
{
|
|
this.$('packages').node.style.display =
|
|
model.numRows > 0 ? 'block' : 'none';
|
|
}
|
|
});
|