Revision 2a4516c1
Von Niclas Zimmermann vor fast 12 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
863 | 863 |
$query = |
864 | 864 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id) |
865 | 865 |
VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, |
866 |
(SELECT tax_id FROM taxkeys WHERE chart_id= (SELECT id FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1), |
|
866 |
(SELECT tax_id |
|
867 |
FROM taxkeys |
|
868 |
WHERE chart_id= (SELECT id |
|
869 |
FROM chart |
|
870 |
WHERE accno = ?) |
|
871 |
AND startdate <= ? |
|
872 |
ORDER BY startdate DESC LIMIT 1), |
|
867 | 873 |
(SELECT taxkey_id FROM chart WHERE accno = ?), ?)|; |
868 | 874 |
@values = (conv_i($trans_id), $accno, $form->{amount}{$trans_id}{$accno}, conv_date($form->{invdate}), $accno, conv_date($taxdate), $accno, conv_i($project_id)); |
869 | 875 |
do_query($form, $dbh, $query, @values); |
... | ... | |
878 | 884 |
$query = |
879 | 885 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id) |
880 | 886 |
VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, |
881 |
(SELECT tax_id FROM taxkeys WHERE chart_id= (SELECT id FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1), |
|
887 |
(SELECT tax_id |
|
888 |
FROM taxkeys |
|
889 |
WHERE chart_id= (SELECT id |
|
890 |
FROM chart |
|
891 |
WHERE accno = ?) |
|
892 |
AND startdate <= ? |
|
893 |
ORDER BY startdate DESC LIMIT 1), |
|
882 | 894 |
(SELECT taxkey_id FROM chart WHERE accno = ?), ?)|; |
883 | 895 |
@values = (conv_i($trans_id), $accno, $form->{amount}{$trans_id}{$accno}, conv_date($form->{invdate}), $accno, conv_date($taxdate), $accno, conv_i($project_id)); |
884 | 896 |
do_query($form, $dbh, $query, @values); |
... | ... | |
928 | 940 |
$query = |
929 | 941 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id) |
930 | 942 |
VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, |
931 |
(SELECT tax_id FROM taxkeys WHERE chart_id= (SELECT id FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1), |
|
943 |
(SELECT tax_id |
|
944 |
FROM taxkeys |
|
945 |
WHERE chart_id= (SELECT id |
|
946 |
FROM chart |
|
947 |
WHERE accno = ?) |
|
948 |
AND startdate <= ? |
|
949 |
ORDER BY startdate DESC LIMIT 1), |
|
932 | 950 |
(SELECT taxkey_id FROM chart WHERE accno = ?), ?)|; |
933 | 951 |
@values = (conv_i($form->{"id"}), $form->{AR}, $amount, $form->{"datepaid_$i"}, $form->{AR}, conv_date($taxdate), $form->{AR}, $project_id); |
934 | 952 |
do_query($form, $dbh, $query, @values); |
... | ... | |
941 | 959 |
$query = |
942 | 960 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, source, memo, tax_id, taxkey, project_id) |
943 | 961 |
VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, |
944 |
(SELECT tax_id FROM taxkeys WHERE chart_id= (SELECT id FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1), |
|
962 |
(SELECT tax_id |
|
963 |
FROM taxkeys |
|
964 |
WHERE chart_id= (SELECT id |
|
965 |
FROM chart |
|
966 |
WHERE accno = ?) |
|
967 |
AND startdate <= ? |
|
968 |
ORDER BY startdate DESC LIMIT 1), |
|
945 | 969 |
(SELECT taxkey_id FROM chart WHERE accno = ?), ?)|; |
946 | 970 |
@values = (conv_i($form->{"id"}), $accno, $form->{"paid_$i"}, $form->{"datepaid_$i"}, |
947 | 971 |
$gldate, $form->{"source_$i"}, $form->{"memo_$i"}, $accno, conv_date($taxdate), $accno, $project_id); |
... | ... | |
986 | 1010 |
$query = |
987 | 1011 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, cleared, fx_transaction, tax_id, taxkey, project_id) |
988 | 1012 |
VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, '0', '1', |
989 |
(SELECT tax_id FROM taxkeys WHERE chart_id= (SELECT id FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1), |
|
1013 |
(SELECT tax_id |
|
1014 |
FROM taxkeys |
|
1015 |
WHERE chart_id= (SELECT id |
|
1016 |
FROM chart |
|
1017 |
WHERE accno = ?) |
|
1018 |
AND startdate <= ? |
|
1019 |
ORDER BY startdate DESC LIMIT 1), |
|
990 | 1020 |
(SELECT taxkey_id FROM chart WHERE accno = ?), ?)|; |
991 | 1021 |
@values = (conv_i($form->{"id"}), $accno, $form->{fx}{$accno}{$transdate}, conv_date($transdate), $accno, conv_date($taxdate), $accno, conv_i($project_id)); |
992 | 1022 |
do_query($form, $dbh, $query, @values); |
Auch abrufbar als: Unified diff
Bessere Formatierung
Verbessert die Formatierung von Commit 5c5e92bc37819dd9df952068b9e58b47dd0b0de2
(Großschreibung von SQL-Befehlen, Zeilenumbrüche bei langen Sub-Queries)