Hedera.Ticket = new Class ({ Extends: Hedera.Form ,onTicketChange: function (ticket) { if (!ticket.value) return; var params = {ticket: ticket.value}; this.conn.execQuery ('CALL myTicketLogAccess (#ticket)', params); } ,onPrintClick: function () { var params = {ticket: this.hash.get ('ticket')}; this.gui.openReport ('delivery-note', params); } ,subtotalRenderer: function (column, form) { column.value = this.subtotal (form); } ,repeaterFunc: function (scope, form) { scope.$.subtotal.value = this.subtotal (form); } ,subtotal: function (form) { var row = form.$; return row.quantity * row.price * ((100 - row.discount) / 100); } ,onPackagesChanged: function (model) { this.$.packages.node.style.display = model.numRows > 0 ? 'block' : 'none'; } });