]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/Invoice.pm
Gesamtbetrag auf Gegenkonto buchen
[mfinanz.git] / SL / DB / Invoice.pm
index 96c140cd546719276e0265e2e6b31afe92a758d5..482bb70d3eab1b58d30bc49f5944f0236b16f391 100644 (file)
@@ -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;