Revision e5ea1c83
Von Sven Schöling vor etwa 15 Jahren hinzugefügt
SL/AP.pm | ||
---|---|---|
401 | 401 |
qq| v.vendornumber, v.country, v.ustid, | . |
402 | 402 |
qq| tz.description AS taxzone, | . |
403 | 403 |
qq| pt.description AS payment_terms, | . |
404 |
qq{ ch.accno || ' -- ' || ch.description AS charts } . |
|
404 |
qq{ ( SELECT ch.accno || ' -- ' || ch.description |
|
405 |
FROM acc_trans at |
|
406 |
LEFT JOIN chart ch ON ch.id = at.chart_id |
|
407 |
WHERE ch.link ~ 'AP[[:>:]]' |
|
408 |
AND at.trans_id = a.id |
|
409 |
LIMIT 1 |
|
410 |
) AS charts } . |
|
405 | 411 |
qq|FROM ap a | . |
406 | 412 |
qq|JOIN vendor v ON (a.vendor_id = v.id) | . |
407 | 413 |
qq|LEFT JOIN employee e ON (a.employee_id = e.id) | . |
408 | 414 |
qq|LEFT JOIN project pr ON (a.globalproject_id = pr.id) | . |
409 | 415 |
qq|LEFT JOIN tax_zones tz ON (tz.id = v.taxzone_id)| . |
410 |
qq|LEFT JOIN payment_terms pt ON (pt.id = v.payment_id)| . |
|
411 |
qq|LEFT JOIN acc_trans at ON (at.trans_id = a.id)| . |
|
412 |
qq|INNER JOIN chart ch ON (ch.id = at.chart_id AND ch.link ~ 'AP[[:>:]]')|; |
|
416 |
qq|LEFT JOIN payment_terms pt ON (pt.id = v.payment_id)|; |
|
413 | 417 |
|
414 | 418 |
my $where = ''; |
415 | 419 |
my @values; |
Auch abrufbar als: Unified diff
Inner Join vermeiden um leere Rechnungen nicht zu verlieren
Fix für Bug 1155