1 /**********************************************************************
2 Copyright (C) FrontAccounting, LLC.
3 Released under the terms of the GNU General Public License, GPL,
4 as published by the Free Software Foundation, either version 3
5 of the License, or (at your option) any later version.
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9 See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
10 ***********************************************************************/
11 function focus_amount(i) {
13 i.setAttribute('_last', get_amount(i.name));
16 function blur_amount(i) {
17 var change = get_amount(i.name);
19 price_format(i.name, change, user.pdec);
20 change = change-i.getAttribute('_last');
21 if (i.name=='beg_balance')
24 price_format('difference', get_amount('difference',1,1)+change, user.pdec, 1);
28 '.amount': function(e) {
29 e.onblur = function() {
32 e.onfocus = function() {
38 Behaviour.register(balances);