]> wagnertech.de Git - mfinanz.git/blobdiff - SL/AP.pm
Bessere Formatierung
[mfinanz.git] / SL / AP.pm
index 091e1c27ffafd28225a196860cd67824adf46785..53607fff43761cfc06a749d5c3b39a4da9b94e7e 100644 (file)
--- a/SL/AP.pm
+++ b/SL/AP.pm
@@ -237,7 +237,13 @@ sub post_transaction {
       qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, taxkey, tax_id) | .
       qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, | .
       qq|        (SELECT taxkey_id FROM chart WHERE accno = ?),| . 
-      qq|        (SELECT tax_id FROM taxkeys WHERE chart_id= (SELECT id  FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1))|;
+      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))|;
     @values = ($form->{id}, $form->{AP_amounts}{payables}, $form->{payables},
                conv_date($form->{transdate}), $form->{AP_amounts}{payables}, $form->{AP_amounts}{payables}, conv_date($form->{transdate}));
     do_query($form, $dbh, $query, @values);
@@ -286,7 +292,13 @@ sub post_transaction {
           qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey, tax_id) | .
           qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, | .
           qq|        (SELECT taxkey_id FROM chart WHERE accno = ?),| .
-          qq|        (SELECT tax_id FROM taxkeys WHERE chart_id= (SELECT id  FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1))|;
+          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))|;
         @values = ($form->{id}, $form->{AP_payables}, $amount,
                    conv_date($form->{"datepaid_$i"}), $project_id,
                    $form->{AP_payables}, $form->{AP_payables}, conv_date($form->{"datepaid_$i"}));
@@ -300,7 +312,13 @@ sub post_transaction {
         qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, source, memo, project_id, taxkey, tax_id) | .
         qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, ?, | .
         qq|        (SELECT taxkey_id FROM chart WHERE accno = ?), | . 
-        qq|        (SELECT tax_id FROM taxkeys WHERE chart_id= (SELECT id  FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1))|;
+        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))|;
       @values = ($form->{id}, $form->{"AP_paid_account_$i"}, $form->{"paid_$i"},
                  conv_date($form->{"datepaid_$i"}), $gldate, $form->{"source_$i"},
                  $form->{"memo_$i"}, $project_id, $form->{"AP_paid_account_$i"},
@@ -316,7 +334,13 @@ sub post_transaction {
           qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, fx_transaction, cleared, project_id, taxkey, tax_id) | .
           qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, 't', 'f', ?, | .
           qq|        (SELECT taxkey_id FROM chart WHERE accno = ?), | .
-          qq|        (SELECT tax_id FROM taxkeys WHERE chart_id= (SELECT id  FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1))|;
+          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))|;
         @values = ($form->{id}, $form->{"AP_paid_account_$i"}, $amount,
                    conv_date($form->{"datepaid_$i"}), $project_id,
                    $form->{"AP_paid_account_$i"},
@@ -335,7 +359,13 @@ sub post_transaction {
           qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, fx_transaction, cleared, project_id, taxkey, tax_id) | .
           qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, 't', 'f', ?, | .
           qq|        (SELECT taxkey_id FROM chart WHERE accno = ?)| .
-          qq|        (SELECT tax_id FROM taxkeys WHERE chart_id= (SELECT id  FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1))|;
+          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))|;
         @values = ($form->{id}, ($amount > 0) ?
                    $form->{fxgain_accno} : $form->{fxloss_accno},
                    $amount, conv_date($form->{"datepaid_$i"}), $project_id,