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_budget(i) {
13 i.setAttribute('_last', get_amount(i.name));
16 function blur_budget(i) {
17 var amount = get_amount(i.name);
18 var total = get_amount('Total', 1);
20 price_format(i.name, amount, 0);
21 price_format('Total', total+amount-i.getAttribute('_last'), 0, 1, 1);
26 '.amount': function(e) {
27 e.onblur = function() {
30 e.onfocus = function() {
36 Behaviour.register(budget_calc);