diff --git a/debian/changelog b/debian/changelog
index e3463cb9..eec1ecb6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-hedera-web (1.406.17) stable; urgency=low
+hedera-web (1.406.18) stable; urgency=low
* Initial Release.
diff --git a/forms/ecomerce/ticket/style.css b/forms/ecomerce/ticket/style.css
index 850f6bfd..9fecbb6f 100644
--- a/forms/ecomerce/ticket/style.css
+++ b/forms/ecomerce/ticket/style.css
@@ -81,6 +81,10 @@
{
color: #777;
}
+.ticket .line > .info .discount
+{
+ color: green;
+}
.ticket .line > .info > .amount
{
float: left;
diff --git a/forms/ecomerce/ticket/ticket.js b/forms/ecomerce/ticket/ticket.js
index 395f64c1..11360995 100644
--- a/forms/ecomerce/ticket/ticket.js
+++ b/forms/ecomerce/ticket/ticket.js
@@ -1,52 +1,46 @@
-Hedera.Ticket = new Class
-({
- Extends: Hedera.Form
+Hedera.Ticket = new Class({
+ Extends: Hedera.Form,
- ,onTicketChange: function (ticket)
- {
+ onTicketChange: function(ticket) {
if (!ticket.value)
return;
- var batch = new Sql.Batch ();
- batch.addValue ('ticket', ticket.value);
- this.conn.execQuery ('CALL myTicketLogAccess (#ticket)', null, batch);
- }
+ var batch = new Sql.Batch();
+ batch.addValue('ticket', ticket.value);
+ this.conn.execQuery('CALL myTicketLogAccess(#ticket)', null, batch);
+ },
- ,onTicketReady: function (form)
- {
- if (form.get ('method') != 'PICKUP')
- Vn.Node.setText (this.$('method'), _('Agency'));
+ onTicketReady: function(form) {
+ if (form.get('method') != 'PICKUP')
+ Vn.Node.setText(this.$('method'), _('Agency'));
else
- Vn.Node.setText (this.$('method'), _('Warehouse'));
- }
+ Vn.Node.setText(this.$('method'), _('Warehouse'));
+ },
- ,onPrintClick: function ()
- {
- var batch = new Sql.Batch ();
- batch.addValue ('ticket', this.$('ticket-id').value);
- this.gui.openReport ('delivery-note', batch);
- }
+ onPrintClick: function() {
+ var batch = new Sql.Batch();
+ batch.addValue('ticket', this.$('ticket-id').value);
+ this.gui.openReport('delivery-note', batch);
+ },
- ,subtotalRenderer: function (column, form)
- {
- column.value = this.subtotal (form);
- }
-
- ,repeaterFunc: function (res, form)
- {
- res.$('subtotal').value = this.subtotal (form);
- }
+ repeaterFunc: function(res, form) {
+ var discount = res.$('discount');
+ discount.style.display = form.get('discount') ? 'inline' : 'none';
+ res.$('discount-subtotal').value = this.discountSubtotal(form);
+ res.$('subtotal').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);
- }
+ discountSubtotal: function(form) {
+ return form.get('quantity') * form.get('price');
+ },
- ,onPackagesChanged: function (model)
- {
+ subtotal: function(form) {
+ var discount = form.get('discount');
+ return this.discountSubtotal(form) * ((100 - discount) / 100);
+ },
+
+ onPackagesChanged: function(model) {
this.$('packages').node.style.display =
model.numRows > 0 ? 'block' : 'none';
}
diff --git a/forms/ecomerce/ticket/ui.xml b/forms/ecomerce/ticket/ui.xml
index 4132a4b8..97f03ce2 100644
--- a/forms/ecomerce/ticket/ui.xml
+++ b/forms/ecomerce/ticket/ui.xml
@@ -96,6 +96,10 @@
+
+