X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FInvoice.pm;h=0138efc024a3f423e907967747a27554ec2c9223;hb=357d134d265637fb37ed2cd47da2ce3ef44d015a;hp=c6658413568220b28d3a3b58a34dcab42903ada5;hpb=c7f777ac5f9a7c13bf402d008cf609a7ba33a9c5;p=kivitendo-erp.git diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index c66584135..0138efc02 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -188,11 +188,14 @@ sub post { sub _post_add_acctrans { my ($self, $entries) = @_; + my $default_tax_id = SL::DB::Manager::Tax->find_by(taxkey => 0)->id; + while (my ($chart_id, $spec) = each %{ $entries }) { - $spec = { taxkey => 0, amount => $spec } unless ref $spec; + $spec = { taxkey => 0, tax_id => $default_tax_id, amount => $spec } unless ref $spec; SL::DB::AccTransaction->new(trans_id => $self->id, chart_id => $chart_id, amount => $spec->{amount}, + tax_id => $spec->{tax_id}, taxkey => $spec->{taxkey}, project_id => $self->globalproject_id, transdate => $self->transdate)->save;