From dd04aff20186eef2be5deb8766d3c086d93fd1a8 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 10 Nov 2010 18:05:36 +0100 Subject: [PATCH] Gesamtbetrag auf Gegenkonto buchen --- SL/DB/Invoice.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 96c140cd5..482bb70d3 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -120,6 +120,8 @@ sub new_from { sub post { my ($self, %params) = @_; + croak("Missing parameter 'ar_id'") unless $params{ar_id}; + $self->db->do_transaction(sub { 1; # dummy instruction for Emacs ;) @@ -133,6 +135,8 @@ sub post { $self->_post_add_acctrans($data{amounts}); $self->_post_add_acctrans($data{taxes}); + $self->_post_add_acctrans({ $params{ar_id} => $self->amount * -1 }); + $self->_post_update_allocated($data{allocated}); die; -- 2.20.1