X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/11c511f708201bafc1851c364215838c79f5b322..2a4516c122395c29a8fd57d5a7a53a1c6b6c2ca4:/SL/AP.pm diff --git a/SL/AP.pm b/SL/AP.pm index 091e1c27f..53607fff4 100644 --- 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,