From: Bernd Bleßmann Date: Mon, 3 Feb 2020 11:48:24 +0000 (+0100) Subject: S:D:Invoice: _post_add_acctrans: Keine Tranaktionen mit Summe == 0 speichern. X-Git-Tag: release-3.5.6.1~269 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=6f2c9845c64de05b36274212300e453a2507ef8e;p=kivitendo-erp.git S:D:Invoice: _post_add_acctrans: Keine Tranaktionen mit Summe == 0 speichern. Das liefert einen Fehler beim DATEV-Export. Zudem filtert die Buchungsroutine der Rechnungsmaske diese Buchungen aus raus. Bezieht sich auch auf #414 Refs #414 --- diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 38ec9c0f7..6f8438f1c 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -303,14 +303,16 @@ sub _post_add_acctrans { $chart_link = SL::DB::Manager::Chart->find_by(id => $chart_id)->{'link'}; $chart_link ||= ''; - 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, - chart_link => $chart_link)->save; + if ($spec->{amount} != 0) { + 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, + chart_link => $chart_link)->save; + } } }