X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fgl.pl;h=886d756f8badff49761b640832028e1c5b09e985;hb=3e79972f6ef5617708e4eef5d66c82a66cf6a588;hp=79e50859ebcfa430b7dff39792fe1fbf4b53cdfc;hpb=f2991e38ef44e1d32b60a7a0182bf458a10bce47;p=kivitendo-erp.git diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 79e50859e..886d756f8 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -1365,8 +1365,9 @@ sub post_transaction { 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 (partial) bank amount to a single general ledger booking" - unless $bt->not_assigned_amount == $payment->[0]->amount * -1; + + die "Can only assign the full (partial) bank amount to a single general ledger booking" . $bt->not_assigned_amount . " " . ($payment->[0]->amount * -1) + unless (abs($bt->not_assigned_amount - ($payment->[0]->amount * -1)) < 0.001); $bt->update_attributes(invoice_amount => $bt->invoice_amount + ($payment->[0]->amount * -1)); @@ -1394,6 +1395,10 @@ sub post_transaction { if ($form->{callback} =~ /BankTransaction/ && $form->{bt_id}) { print $form->redirect_header($form->{callback}); $form->redirect($locale->text('GL transaction posted.') . ' ' . $locale->text('ID') . ': ' . $form->{id}); + } elsif ($::instance_conf->get_gl_add_doc && $::instance_conf->get_doc_storage) { + my $add_doc_url = build_std_url("script=gl.pl", 'action=edit', 'id=' . E($form->{id})); + print $form->redirect_header($add_doc_url); + $form->redirect($locale->text('GL transaction posted.') . ' ' . $locale->text('ID') . ': ' . $form->{id}); } # remove or clarify