Revision 8bd9c500
Von Martin Helmling mh@waldpark.octosoft.eu vor mehr als 8 Jahren hinzugefügt
SL/AP.pm | ||
---|---|---|
482 | 482 |
} |
483 | 483 |
if ($form->{project_id}) { |
484 | 484 |
$where .= |
485 |
qq|AND ((a.globalproject_id = ?) OR EXISTS | . |
|
485 |
qq| AND ((a.globalproject_id = ?) OR EXISTS | .
|
|
486 | 486 |
qq| (SELECT * FROM invoice i | . |
487 | 487 |
qq| WHERE i.project_id = ? AND i.trans_id = a.id) | . |
488 | 488 |
qq| OR EXISTS | . |
... | ... | |
509 | 509 |
|
510 | 510 |
if ($form->{parts_partnumber}) { |
511 | 511 |
$where .= <<SQL; |
512 |
AND EXISTS (
|
|
512 |
AND EXISTS ( |
|
513 | 513 |
SELECT invoice.trans_id |
514 | 514 |
FROM invoice |
515 | 515 |
LEFT JOIN parts ON (invoice.parts_id = parts.id) |
... | ... | |
523 | 523 |
|
524 | 524 |
if ($form->{parts_description}) { |
525 | 525 |
$where .= <<SQL; |
526 |
AND EXISTS (
|
|
526 |
AND EXISTS ( |
|
527 | 527 |
SELECT invoice.trans_id |
528 | 528 |
FROM invoice |
529 | 529 |
WHERE (invoice.trans_id = a.id) |
Auch abrufbar als: Unified diff
Einkaufsrechnungen: Suche nach Artikelnummer/-beschreibung in Positionen(2)
BUGfix für substr($where, 0, 4, " WHERE "):
$where muss am Anfang innerhalb 4 Zeichen das AND stehen haben,
sonst kommt es zu einem SQL Syntaxerror