From: Janusz Dobrowolski Date: Thu, 15 Jan 2009 14:59:15 +0000 (+0000) Subject: Javascript for bank reconciliation page. X-Git-Tag: v2.4.2~19^2~1610 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=51e9cd9d5cb89c21816556c650de1ef6bade2910;p=fa-stable.git Javascript for bank reconciliation page. --- diff --git a/js/reconcile.js b/js/reconcile.js new file mode 100644 index 00000000..badeaa07 --- /dev/null +++ b/js/reconcile.js @@ -0,0 +1,28 @@ +function focus_amount(i) { + save_focus(i); + i.setAttribute('_last', get_amount(i.name)); +} + +function blur_amount(i) { + var change = get_amount(i.name); + + price_format(i.name, change, user.pdec); + change = change-i.getAttribute('_last'); + if (i.name=='beg_balance') + change = -change; + + price_format('difference', get_amount('difference',1,1)+change, user.pdec); +} + +var balances = { + '.amount': function(e) { + e.onblur = function() { + blur_amount(this); + }; + e.onfocus = function() { + focus_amount(this); + }; + } +} + +Behaviour.register(balances);