X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/10d9b17f7a9c45d07f278ed6031851af5b9c97e5..0b26e5752e295:/bin/mozilla/gl.pl diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 7ce3a300d..cca3eca54 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -917,6 +917,12 @@ sub display_rows { my $copy2credit = $i == 1 ? 'onkeyup="copy_debit_to_credit()"' : ''; my $balance = $form->format_amount(\%::myconfig, $balances{$accno_id} // 0, 2, 'DRCR'); + # if we have a bt_chart_id we disallow changing the amount of the bank account + if ($form->{bt_chart_id}) { + $debitreadonly = $creditreadonly = "readonly" if ($form->{"accno_id_$i"} eq $form->{bt_chart_id}); + $copy2credit = '' if $i == 1; # and disallow copy2credit + } + print qq| $accno ${balance} @@ -1346,11 +1352,12 @@ sub post_transaction { die "no chart id:" unless $chart_id; $payment = SL::DB::Manager::AccTransaction->get_all(where => [ trans_id => $::form->{id}, - chart_link => { like => '%AR_paid%' }, + chart_link => { like => '%_paid%' }, chart_id => $chart_id ]); die "guru meditation error: Can only assign amount to one bank account booking" if scalar @{ $payment } > 1; # credit/debit * -1 matches the sign for bt.amount and bt.invoice_amount + die "Can only assign the full bank amount to a single general ledger booking" unless $bt->amount == $payment->[0]->amount * -1; $bt->update_attributes(invoice_amount => $bt->invoice_amount + ($payment->[0]->amount * -1)); # create record_link