From: Moritz Bunkus Date: Wed, 10 Nov 2010 17:05:36 +0000 (+0100) Subject: Gesamtbetrag auf Gegenkonto buchen X-Git-Tag: release-2.6.3~61^2~7^2~1^2~2^2~65 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=dd04aff20186eef2be5deb8766d3c086d93fd1a8;p=kivitendo-erp.git Gesamtbetrag auf Gegenkonto buchen --- 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;