From 96dbc0768869a53c1d146efbc0bd364c2ea9de63 Mon Sep 17 00:00:00 2001 From: Niclas Zimmermann Date: Mon, 6 May 2013 15:01:30 +0200 Subject: [PATCH] Entfernung von trailing whitespaces --- SL/AP.pm | 64 ++++++++++++++++++++++++++++---------------------------- SL/AR.pm | 60 ++++++++++++++++++++++++++-------------------------- SL/IR.pm | 4 ++-- 3 files changed, 64 insertions(+), 64 deletions(-) diff --git a/SL/AP.pm b/SL/AP.pm index ac12c2902..04e1ade07 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -240,13 +240,13 @@ sub post_transaction { $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, taxkey, tax_id, chart_link) | . qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, | . - qq| (SELECT taxkey_id FROM chart WHERE accno = ?),| . - qq| (SELECT tax_id| . - qq| FROM taxkeys| . - qq| WHERE chart_id= (SELECT id | . - qq| FROM chart| . - qq| WHERE accno = ?)| . - qq| AND startdate <= ?| . + qq| (SELECT taxkey_id FROM chart WHERE accno = ?),| . + qq| (SELECT tax_id| . + qq| FROM taxkeys| . + qq| WHERE chart_id= (SELECT id | . + qq| FROM chart| . + qq| WHERE accno = ?)| . + qq| AND startdate <= ?| . qq| ORDER BY startdate DESC LIMIT 1),| . qq| (SELECT c.link FROM chart c WHERE c.accno = ?))|; @values = ($form->{id}, $form->{AP_amounts}{payables}, $form->{payables}, @@ -298,12 +298,12 @@ sub post_transaction { qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey, tax_id, chart_link) | . qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, | . qq| (SELECT taxkey_id FROM chart WHERE accno = ?),| . - qq| (SELECT tax_id| . - qq| FROM taxkeys| . - qq| WHERE chart_id= (SELECT id | . - qq| FROM chart| . - qq| WHERE accno = ?)| . - qq| AND startdate <= ?| . + qq| (SELECT tax_id| . + qq| FROM taxkeys| . + qq| WHERE chart_id= (SELECT id | . + qq| FROM chart| . + qq| WHERE accno = ?)| . + qq| AND startdate <= ?| . qq| ORDER BY startdate DESC LIMIT 1),| . qq| (SELECT c.link FROM chart c WHERE c.accno = ?))|; @values = ($form->{id}, $form->{AP_payables}, $amount, @@ -319,13 +319,13 @@ sub post_transaction { $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, source, memo, project_id, taxkey, tax_id, chart_link) | . qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, ?, | . - qq| (SELECT taxkey_id FROM chart WHERE accno = ?), | . + qq| (SELECT taxkey_id FROM chart WHERE accno = ?), | . qq| (SELECT tax_id| . - qq| FROM taxkeys| . - qq| WHERE chart_id= (SELECT id | . - qq| FROM chart| . - qq| WHERE accno = ?)| . - qq| AND startdate <= ?| . + qq| FROM taxkeys| . + qq| WHERE chart_id= (SELECT id | . + qq| FROM chart| . + qq| WHERE accno = ?)| . + qq| AND startdate <= ?| . qq| ORDER BY startdate DESC LIMIT 1),| . qq| (SELECT c.link FROM chart c WHERE c.accno = ?))|; @values = ($form->{id}, $form->{"AP_paid_account_$i"}, $form->{"paid_$i"}, @@ -344,12 +344,12 @@ sub post_transaction { qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, fx_transaction, cleared, project_id, taxkey, tax_id, chart_link) | . qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, 't', 'f', ?, | . qq| (SELECT taxkey_id FROM chart WHERE accno = ?), | . - qq| (SELECT tax_id| . - qq| FROM taxkeys| . - qq| WHERE chart_id= (SELECT id | . - qq| FROM chart| . - qq| WHERE accno = ?)| . - qq| AND startdate <= ?| . + qq| (SELECT tax_id| . + qq| FROM taxkeys| . + qq| WHERE chart_id= (SELECT id | . + qq| FROM chart| . + qq| WHERE accno = ?)| . + qq| AND startdate <= ?| . qq| ORDER BY startdate DESC LIMIT 1),| . qq| (SELECT c.link FROM chart c WHERE c.accno = ?))|; @values = ($form->{id}, $form->{"AP_paid_account_$i"}, $amount, @@ -371,15 +371,15 @@ sub post_transaction { qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, fx_transaction, cleared, project_id, taxkey, tax_id, chart_link) | . qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, 't', 'f', ?, | . qq| (SELECT taxkey_id FROM chart WHERE accno = ?)| . - qq| (SELECT tax_id| . - qq| FROM taxkeys| . - qq| WHERE chart_id= (SELECT id | . - qq| FROM chart| . - qq| WHERE accno = ?)| . - qq| AND startdate <= ?| . + qq| (SELECT tax_id| . + qq| FROM taxkeys| . + qq| WHERE chart_id= (SELECT id | . + qq| FROM chart| . + qq| WHERE accno = ?)| . + qq| AND startdate <= ?| . qq| ORDER BY startdate DESC LIMIT 1),| . qq| (SELECT c.link FROM chart c WHERE c.accno = ?))|; - @values = ($form->{id}, + @values = ($form->{id}, ($amount > 0) ? $form->{fxgain_accno} : $form->{fxloss_accno}, $amount, conv_date($form->{"datepaid_$i"}), $project_id, ($amount > 0) ? $form->{fxgain_accno} : $form->{fxloss_accno}, diff --git a/SL/AR.pm b/SL/AR.pm index 1626c5863..212b2b894 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -191,12 +191,12 @@ sub post_transaction { # add recievables $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, taxkey, tax_id, chart_link) VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, (SELECT taxkey_id FROM chart WHERE accno = ?), - (SELECT tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), (SELECT c.link FROM chart c WHERE c.accno = ?))|; @values = (conv_i($form->{id}), $form->{AR_amounts}{receivables}, conv_i($form->{receivables}), conv_date($form->{transdate}), @@ -239,12 +239,12 @@ sub post_transaction { # add receivable $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey, tax_id, chart_link) VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, (SELECT taxkey_id FROM chart WHERE accno = ?), - (SELECT tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), (SELECT c.link FROM chart c WHERE c.accno = ?))|; @values = (conv_i($form->{id}), $form->{AR}{receivables}, $amount, conv_date($form->{"datepaid_$i"}), $project_id, $form->{AR}{receivables}, $form->{AR}{receivables}, conv_date($form->{"datepaid_$i"}), @@ -260,12 +260,12 @@ sub post_transaction { $amount = $form->{"paid_$i"} * -1; $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, source, memo, project_id, taxkey, tax_id, chart_link) VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, ?, (SELECT taxkey_id FROM chart WHERE accno = ?), - (SELECT tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), (SELECT c.link FROM chart c WHERE c.accno = ?))|; @values = (conv_i($form->{id}), $form->{AR}{"paid_$i"}, $amount, conv_date($form->{"datepaid_$i"}), $gldate, $form->{"source_$i"}, $form->{"memo_$i"}, $project_id, $form->{AR}{"paid_$i"}, @@ -278,12 +278,12 @@ sub post_transaction { if ($amount != 0) { $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, fx_transaction, cleared, project_id, taxkey, tax_id, chart_link) VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, 't', 'f', ?, (SELECT taxkey_id FROM chart WHERE accno = ?), - (SELECT tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), (SELECT c.link FROM chart c WHERE c.accno = ?))|; @values = (conv_i($form->{id}), $form->{AR}{"paid_$i"}, $amount, conv_date($form->{"datepaid_$i"}), $project_id, $form->{AR}{"paid_$i"}, @@ -298,12 +298,12 @@ sub post_transaction { my $accno = ($amount > 0) ? $form->{fxgain_accno} : $form->{fxloss_accno}; $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, fx_transaction, cleared, project_id, taxkey, tax_id, chart_link) VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, 't', 'f', ?, (SELECT taxkey_id FROM chart WHERE accno = ?), - (SELECT tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), (SELECT c.link FROM chart c WHERE c.accno = ?))|; @values = (conv_i($form->{id}), $accno, $amount, conv_date($form->{"datepaid_$i"}), $project_id, $accno, $accno, conv_date($form->{"datepaid_$i"}), $accno); diff --git a/SL/IR.pm b/SL/IR.pm index e46e902cc..85f6b18f6 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -1212,8 +1212,8 @@ sub retrieve_item { my $transdate = ""; if ($form->{type} eq "invoice") { - $transdate = $form->{deliverydate} ? $dbh->quote($form->{deliverydate}) - : $form->{invdate} ? $dbh->quote($form->{invdate}) + $transdate = $form->{deliverydate} ? $dbh->quote($form->{deliverydate}) + : $form->{invdate} ? $dbh->quote($form->{invdate}) : "current_date"; } else { $transdate = $form->{transdate} ? $dbh->quote($form->{transdate}) : "current_date"; -- 2.20.1