Revision 66eb2bd0
Von Udo Spallek vor fast 18 Jahren hinzugefügt
SL/CA.pm | ||
---|---|---|
72 | 72 |
$sth->finish; |
73 | 73 |
|
74 | 74 |
$query = qq{ |
75 |
|
|
76 |
SELECT c.id, |
|
75 |
SELECT |
|
77 | 76 |
c.accno, |
77 |
c.id, |
|
78 | 78 |
c.description, |
79 | 79 |
c.charttype, |
80 |
c.gifi_accno, |
|
81 | 80 |
c.category, |
82 | 81 |
c.link, |
83 | 82 |
c.pos_bwa, |
... | ... | |
85 | 84 |
c.pos_eur, |
86 | 85 |
c.valid_from, |
87 | 86 |
c.datevautomatik, |
88 |
( SELECT comma(taxkey) |
|
89 |
FROM tax tx |
|
90 |
WHERE tx.id in ( |
|
91 |
SELECT tk.tax_id from taxkeys tk |
|
92 |
WHERE tk.chart_id = c.id |
|
93 |
) |
|
94 |
ORDER BY c.accno |
|
95 |
) AS taxkey, |
|
96 |
|
|
97 |
( SELECT comma(taxdescription || to_char (rate, '99V99' ) || '%') |
|
98 |
FROM tax tx |
|
99 |
WHERE tx.id in ( |
|
100 |
SELECT tk.tax_id from taxkeys tk |
|
101 |
WHERE tk.chart_id = c.id |
|
102 |
) |
|
103 |
ORDER BY c.accno |
|
104 |
) AS taxdescription, |
|
105 |
|
|
106 |
( SELECT comma(taxnumber) |
|
107 |
FROM tax tx |
|
108 |
WHERE tx.id in ( |
|
109 |
SELECT tk.tax_id from taxkeys tk |
|
110 |
WHERE tk.chart_id = c.id |
|
111 |
) |
|
112 |
ORDER BY c.accno |
|
113 |
) AS taxaccount, |
|
114 |
|
|
115 |
( SELECT comma(tk.pos_ustva) |
|
116 |
FROM taxkeys tk |
|
117 |
WHERE tk.chart_id = c.id |
|
118 |
ORDER BY c.id |
|
119 |
) AS tk_ustva, |
|
120 |
|
|
121 |
( SELECT comma(startdate) |
|
122 |
FROM taxkeys tk |
|
123 |
WHERE tk.chart_id = c.id |
|
124 |
ORDER BY c.id |
|
125 |
) AS startdate, |
|
126 |
|
|
87 |
comma(tk.startdate) AS startdate, |
|
88 |
comma(tk.taxkey_id) AS taxkey, |
|
89 |
comma(tx.taxdescription || to_char (tx.rate, '99V99' ) || '%') AS taxdescription, |
|
90 |
comma(tx.taxnumber) AS taxaccount, |
|
91 |
comma(tk.pos_ustva) AS tk_ustva, |
|
127 | 92 |
( SELECT accno |
128 |
FROM chart c2
|
|
129 |
WHERE c2.id = c.id
|
|
93 |
FROM chart c2 |
|
94 |
WHERE c2.id = c.id |
|
130 | 95 |
) AS new_account |
131 | 96 |
FROM chart c |
132 |
ORDER BY accno |
|
97 |
LEFT JOIN taxkeys tk ON (c.id = tk.chart_id) |
|
98 |
LEFT JOIN tax tx ON (tk.tax_id = tx.id) |
|
99 |
GROUP BY c.accno, c.id, c.description, c.charttype, c.gifi_accno, |
|
100 |
c.category, c.link, c.pos_bwa, c.pos_bilanz, c.pos_eur, c.valid_from, |
|
101 |
c.datevautomatik |
|
102 |
ORDER BY c.accno |
|
133 | 103 |
}; |
134 | 104 |
|
135 | 105 |
$sth = $dbh->prepare($query); |
Auch abrufbar als: Unified diff
System->Kontenuebersicht->Konten: Abfrage war falsch.