Revision e5ea1c83
Von Sven Schöling vor etwa 15 Jahren hinzugefügt
SL/AR.pm | ||
---|---|---|
424 | 424 |
qq| e2.name AS salesman, | . |
425 | 425 |
qq| tz.description AS taxzone, | . |
426 | 426 |
qq| pt.description AS payment_terms, | . |
427 |
qq{ ch.accno || ' -- ' || ch.description AS charts } . |
|
427 |
qq{ ( SELECT ch.accno || ' -- ' || ch.description |
|
428 |
FROM acc_trans at |
|
429 |
LEFT JOIN chart ch ON ch.id = at.chart_id |
|
430 |
WHERE ch.link ~ 'AR[[:>:]]' |
|
431 |
AND at.trans_id = a.id |
|
432 |
LIMIT 1 |
|
433 |
) AS charts } . |
|
428 | 434 |
qq|FROM ar a | . |
429 | 435 |
qq|JOIN customer c ON (a.customer_id = c.id) | . |
430 | 436 |
qq|LEFT JOIN employee e ON (a.employee_id = e.id) | . |
431 | 437 |
qq|LEFT JOIN employee e2 ON (a.salesman_id = e2.id) | . |
432 | 438 |
qq|LEFT JOIN project pr ON (a.globalproject_id = pr.id)| . |
433 | 439 |
qq|LEFT JOIN tax_zones tz ON (tz.id = c.taxzone_id)| . |
434 |
qq|LEFT JOIN payment_terms pt ON (pt.id = c.payment_id)| . |
|
435 |
qq|LEFT JOIN acc_trans at ON (at.trans_id = a.id)| . |
|
436 |
qq|INNER JOIN chart ch ON (ch.id = at.chart_id AND ch.link ~ 'AR[[:>:]]')|; |
|
440 |
qq|LEFT JOIN payment_terms pt ON (pt.id = c.payment_id)|; |
|
437 | 441 |
|
438 | 442 |
my $where = "1 = 1"; |
439 | 443 |
if ($form->{customer_id}) { |
Auch abrufbar als: Unified diff
Inner Join vermeiden um leere Rechnungen nicht zu verlieren
Fix für Bug 1155