From: Bernd Bleßmann Date: Fri, 17 Apr 2015 09:13:02 +0000 (+0200) Subject: Beim Erzeugen einer Rechnung für Mahngebühren taxzone_id des Kunden eintragen. X-Git-Tag: release-3.3.0beta~146 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=afe7df8b3ebf17140e0d008ebb9852a6e392c3f4;p=kivitendo-erp.git Beim Erzeugen einer Rechnung für Mahngebühren taxzone_id des Kunden eintragen. Ist notwendig geworden, da das Feld taxzone_id inzwischen not null ist. Behebt #54 (redmine). --- diff --git a/SL/DN.pm b/SL/DN.pm index c9289e46f..55200835e 100644 --- a/SL/DN.pm +++ b/SL/DN.pm @@ -211,7 +211,7 @@ sub create_invoice_for_fees { $query = qq|INSERT INTO ar (id, invnumber, transdate, gldate, customer_id, taxincluded, amount, netamount, paid, duedate, - invoice, currency_id, notes, + invoice, currency_id, taxzone_id, notes, employee_id) VALUES ( ?, -- id @@ -232,6 +232,14 @@ sub create_invoice_for_fees { (SELECT duedate FROM dunning WHERE dunning_id = ? LIMIT 1), 'f', -- invoice (SELECT id FROM currencies WHERE name = ?), -- curr + --taxzone_id: + (SELECT taxzone_id FROM customer WHERE id = + (SELECT ar.customer_id + FROM dunning dn + LEFT JOIN ar ON (dn.trans_id = ar.id) + WHERE dn.dunning_id = ? + LIMIT 1) + ), ?, -- notes -- employee_id: (SELECT id FROM employee WHERE login = ?) @@ -243,6 +251,7 @@ sub create_invoice_for_fees { $amount, $dunning_id, # duedate $curr, # default currency + $dunning_id, # taxzone_id sprintf($main::locale->text('Automatically created invoice for fee and interest for dunning %s'), $dunning_id), # notes $::myconfig{login}); # employee_id do_query($form, $dbh, $query, @values);