Revision 600b2748
Von Moritz Bunkus vor mehr als 15 Jahren hinzugefügt
sql/Pg-upgrade2/update_date_paid.sql | ||
---|---|---|
1 | 1 |
-- @tag: update_date_paid |
2 | 2 |
-- @description: Aktualisieren des Zahldatums in der Datenbank bei Kreditoren- und Debitorenbuchungen, wo die Funktion "Zahlung buchen" verwendet wurde |
3 | 3 |
-- @depends: release_2_6_0 |
4 |
UPDATE ap a SET datepaid = (SELECT max(ac.transdate) FROM acc_trans ac LEFT JOIN chart c ON (ac.chart_id = c.id) WHERE ac.trans_id=a.id AND c.link LIKE '%paid%') WHERE paid > 0 AND datepaid IS null AND NOT invoice; |
|
5 |
UPDATE ar a SET datepaid = (SELECT max(ac.transdate) FROM acc_trans ac LEFT JOIN chart c ON (ac.chart_id = c.id) WHERE ac.trans_id=a.id AND c.link LIKE '%paid%') WHERE paid > 0 AND datepaid IS null AND NOT invoice; |
|
4 |
UPDATE ap SET datepaid = (SELECT max(ac.transdate) FROM acc_trans ac LEFT JOIN chart c ON (ac.chart_id = c.id) WHERE ac.trans_id = ap.id AND c.link LIKE '%paid%') WHERE paid > 0 AND datepaid IS null AND NOT invoice; |
|
5 |
UPDATE ar SET datepaid = (SELECT max(ac.transdate) FROM acc_trans ac LEFT JOIN chart c ON (ac.chart_id = c.id) WHERE ac.trans_id = ar.id AND c.link LIKE '%paid%') WHERE paid > 0 AND datepaid IS null AND NOT invoice; |
Auch abrufbar als: Unified diff
Neuere PostgreSQL-Versionen unterstützen das Aliasen von zu aktualisierenden Tabellen nicht.