X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/d2f731cac86e4590b46e990caf7bb5f7f717ccb6..737b3bdd3f0f38849d51162dc6f307a0d4a8da71:/SL/DB/Invoice.pm diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 0ef5b6602..99c2e11ad 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -249,12 +249,6 @@ sub post { my $worker = sub { my %data = $self->calculate_prices_and_taxes; - my $grossamount = $self->amount; - $self->amount($::form->round_amount($grossamount, 2, 1)); - my $rounding = $::form->round_amount( - $self->amount - $grossamount, - 2 - ); $self->_post_create_assemblyitem_entries($data{assembly_items}); $self->save; @@ -262,11 +256,12 @@ sub post { $self->_post_add_acctrans($data{amounts_cogs}); $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}); - $self->_post_book_rounding($rounding); + $self->_post_book_rounding($data{rounding}); }; if ($self->db->in_transaction) {