Revision 5d76e93e
Von G. Richardson vor mehr als 5 Jahren hinzugefügt
SL/CA.pm | ||
---|---|---|
101 | 101 |
c.pos_eur, |
102 | 102 |
c.valid_from, |
103 | 103 |
c.datevautomatik, |
104 |
comma(tk.startdate::text) AS startdate,
|
|
105 |
comma(tk.taxkey_id::text) AS taxkey,
|
|
106 |
comma(tx.taxdescription || to_char (tx.rate, '99V99' ) || '%') AS taxdescription,
|
|
107 |
comma(taxchart.accno::text) AS taxaccount,
|
|
108 |
comma(tk.pos_ustva::text) AS tk_ustva,
|
|
104 |
array_agg(tk.startdate) AS startdates,
|
|
105 |
array_agg(tk.taxkey_id) AS taxkeys,
|
|
106 |
array_agg(tx.taxdescription || to_char (tx.rate, '99V99' ) || '%') AS taxdescriptions,
|
|
107 |
array_agg(taxchart.accno) AS taxaccounts,
|
|
108 |
array_agg(tk.pos_ustva) AS pos_ustvas,
|
|
109 | 109 |
( SELECT accno |
110 | 110 |
FROM chart c2 |
111 | 111 |
WHERE c2.id = c.id |
sql/Pg-upgrade2/remove_comma_aggregate_functions.sql | ||
---|---|---|
1 |
-- @tag: remove_comma_aggregate_functions |
|
2 |
-- @description: Entfernt Aggregate Funktion comma |
|
3 |
-- @depends: release_3_5_3 |
|
4 |
|
|
5 |
DROP AGGREGATE IF EXISTS comma(text); |
|
6 |
DROP FUNCTION IF EXISTS comma_aggregate ( text, text) ; |
templates/webpages/am/list_account_details.html | ||
---|---|---|
35 | 35 |
</tr> |
36 | 36 |
|
37 | 37 |
<tr class="coa_listrow[% loop.count % 2 %]"> |
38 |
<td class="coa_detail_emph">[% IF row.taxkey %][% HTML.escape(row.taxkey).replace(',', '<br>') %][% ELSE %]-[% END %]</td>
|
|
39 |
<td class="coa_detail_emph">[% IF row.taxaccount %][% HTML.escape(row.taxaccount).replace(',', '<br>') %][% ELSE %]-[% END %]</td>
|
|
40 |
<td class="coa_detail_emph">[% IF row.taxdescription %][% HTML.escape(row.taxdescription).replace(',', '<br>') %][% ELSE %]-[% END %]</td>
|
|
41 |
<td class="coa_detail_emph">[% IF row.tk_ustva %][% HTML.escape(row.tk_ustva).replace(',', '<br>') %][% ELSE %]-[% END %]</td>
|
|
42 |
<td class="coa_detail_emph">[% IF row.startdate %][% HTML.escape(row.startdate).replace(',', '<br>') %][% ELSE %]-[% END %]</td>
|
|
38 |
<td class = "coa_detail_emph">[% IF row.taxkeys.size %][% FOR taxkey = row.taxkeys %][% HTML.escape(taxkey) %]<br>[% END %][% ELSE %]-[% END %]</td>
|
|
39 |
<td class = "coa_detail_emph">[% IF row.taxaccounts.size %][% FOR taxaccount = row.taxaccounts %][% HTML.escape(taxaccount) %]<br>[% END %][% ELSE %]-[% END %]</td>
|
|
40 |
<td class = "coa_detail_emph">[% IF row.taxdescriptions.size %][% FOR taxdescription = row.taxdescriptions %][% HTML.escape(taxdescription) %]<br>[% END %][% ELSE %]-[% END %]</td>
|
|
41 |
<td class = "coa_detail_emph">[% IF row.pos_ustvas.size %][% FOR pos_ustva = row.pos_ustvas %][% HTML.escape(pos_ustva) %]<br>[% END %][% ELSE %]-[% END %]</td>
|
|
42 |
<td class = "coa_detail_emph">[% IF row.startdates.size %][% FOR startdate = row.startdates %][% HTML.escape(startdate) %]<br>[% END %][% ELSE %]-[% END %]</td>
|
|
43 | 43 |
</tr> |
44 | 44 |
|
45 | 45 |
<tr class="coa_listrow[% loop.count % 2 %]"> |
Auch abrufbar als: Unified diff
Aggregatfunktion comma entfernt und Templates angepasst
"comma" war eine alte benutzerdefinierte Aggregatfunktion, die benutzt
wurde, um mehrere aggregierte Werte aus einem GROUP BY in einen
kommaseparierten String umzuwandeln.
Mittlerweile würde man das einfach mit array_agg und array_to_string machen:
array_to_string(array_agg(startdate), ', ') as startdate
Im Template wurden die ',' dann durch '<br>' ersetzt. Stattdessen werden
die Werte im Query nun als array_agg ausgegeben, und im Template wird
eine Schleife über das Arrayref gebildet.