From 1fba275de673c27cc787f6555f2f06ec18b3a5db Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 8 Jan 2014 14:51:52 +0100 Subject: [PATCH] =?utf8?q?Mahnungsrechnungen:=20tax=5Fid=20und=20chart=5Fl?= =?utf8?q?ink=20in=20acc=5Ftrans=20bef=C3=BCllen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DN.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/SL/DN.pm b/SL/DN.pm index b4ad666d0..38174f912 100644 --- a/SL/DN.pm +++ b/SL/DN.pm @@ -248,19 +248,21 @@ sub create_invoice_for_fees { do_query($form, $dbh, $query, @values); $query = - qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, taxkey) - VALUES (?, ?, ?, current_date, current_date, 0)|; + qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, taxkey, tax_id, chart_link) + VALUES (?, ?, ?, current_date, current_date, 0, + (SELECT id FROM tax WHERE (taxkey = 0) AND (rate = 0)), + (SELECT link FROM chart WHERE id = ?))|; $sth = prepare_query($form, $dbh, $query); - @values = ($ar_id, conv_i($form->{AR_amount_fee}), $fee_remaining); + @values = ($ar_id, conv_i($form->{AR_amount_fee}), $fee_remaining, conv_i($form->{AR_amount_fee})); do_statement($form, $sth, $query, @values); if ($interest_remaining) { - @values = ($ar_id, conv_i($form->{AR_amount_interest}), $interest_remaining); + @values = ($ar_id, conv_i($form->{AR_amount_interest}), $interest_remaining, conv_i($form->{AR_amount_interest})); do_statement($form, $sth, $query, @values); } - @values = ($ar_id, conv_i($form->{AR}), -1 * $amount); + @values = ($ar_id, conv_i($form->{AR}), -1 * $amount, conv_i($form->{AR})); do_statement($form, $sth, $query, @values); $sth->finish(); -- 2.20.1