X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/d735aab3fc2987d555c63ce0dc8e24626ca30654..a54bd67ad73ba2ba6fbb8a2bdce288af39676a67:/SL/IR.pm diff --git a/SL/IR.pm b/SL/IR.pm index ad28c968b..fbff03e1b 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -873,17 +873,20 @@ sub reverse_invoice { #adjust allocated $form->update_balance($dbh, "invoice", "allocated", qq|id = $pthref->{id}|, $qty); - $form->update_balance($dbh, "acc_trans", "amount", - qq| (trans_id = $pthref->{trans_id}) - AND (chart_id = $ref->{expense_accno_id}) - AND (transdate = '$pthref->{transdate}')|, - $amount); - - $form->update_balance($dbh, "acc_trans", "amount", - qq| (trans_id = $pthref->{trans_id}) - AND (chart_id = $ref->{inventory_accno_id}) - AND (transdate = '$pthref->{transdate}')|, - $amount * -1); + if ( $::instance_conf->get_inventory_system eq 'perpetual' ) { + + $form->update_balance($dbh, "acc_trans", "amount", + qq| (trans_id = $pthref->{trans_id}) + AND (chart_id = $ref->{expense_accno_id}) + AND (transdate = '$pthref->{transdate}')|, + $amount); + + $form->update_balance($dbh, "acc_trans", "amount", + qq| (trans_id = $pthref->{trans_id}) + AND (chart_id = $ref->{inventory_accno_id}) + AND (transdate = '$pthref->{transdate}')|, + $amount * -1); + } last if (($ref->{allocated} -= $qty) <= 0); }