hedera-web/web/forms/ecomerce/orders/orders.js

56 lines
934 B
JavaScript
Raw Normal View History

Vn.Orders = new Class
({
Extends: Vn.Module
,activate: function ()
{
Vn.Tpv.check (this.conn);
}
2015-07-10 12:30:08 +00:00
,onBasketClick: function ()
{
2015-07-10 12:30:08 +00:00
this.hash.set ({'form': 'ecomerce/basket'});
}
,onShowClick: function (column, ticketId)
{
this.hash.set ({
2015-01-31 01:05:12 +00:00
'form': 'ecomerce/ticket',
'ticket': ticketId
});
}
// TPV
,balanceConditionalFunc: function (field, value)
{
var className = 'balance-amount ';
2015-03-07 00:56:24 +00:00
if (value > 0)
className += 'positive-balance';
else
className += 'negative-balance';
2015-03-07 00:56:24 +00:00
field.node.className = className;
}
,onPayButtonClick: function ()
{
2015-11-05 07:30:19 +00:00
var company = 442;
var amount = this.$('debt').value;
2015-02-08 15:38:38 +00:00
amount = amount <= 0 ? null : amount;
var defaultAmountStr = '';
2015-07-10 12:30:08 +00:00
if (amount !== null)
defaultAmountStr = Vn.Value.format (amount, '%.2d');
var amount = parseFloat (prompt (_('AmountToPay:'), defaultAmountStr));
Vn.Tpv.pay (this.conn, amount, company);
}
});