Revision ee757592
Von Bernd Bleßmann vor etwa 1 Jahr hinzugefügt
SL/CT.pm | ||
---|---|---|
330 | 330 |
$query .= |
331 | 331 |
qq| UNION | . |
332 | 332 |
qq|SELECT ct.*, ct.itime::DATE AS insertdate, b.description AS business, e.name as salesman, | . |
333 |
qq| pt.description as payment | . |
|
333 |
qq| pt.description as payment, tz.description as taxzone | .
|
|
334 | 334 |
$pg_select . |
335 | 335 |
$main_cp_select . |
336 | 336 |
qq|, a.invnumber, a.ordnumber, a.quonumber, a.id AS invid, | . |
... | ... | |
341 | 341 |
qq|LEFT JOIN business b ON (ct.business_id = b.id) | . |
342 | 342 |
qq|LEFT JOIN employee e ON (ct.salesman_id = e.id) | . |
343 | 343 |
qq|LEFT JOIN payment_terms pt ON (ct.payment_id = pt.id) | . |
344 |
qq|LEFT JOIN tax_zones tz ON (ct.taxzone_id = tz.id) | . |
|
344 | 345 |
$pg_join . |
345 | 346 |
qq|WHERE $where AND (a.invoice = '1')|; |
346 | 347 |
} |
... | ... | |
350 | 351 |
$query .= |
351 | 352 |
qq| UNION | . |
352 | 353 |
qq|SELECT ct.*, ct.itime::DATE AS insertdate, b.description AS business, e.name as salesman, | . |
353 |
qq| pt.description as payment | . |
|
354 |
qq| pt.description as payment, tz.description as taxzone | .
|
|
354 | 355 |
$pg_select . |
355 | 356 |
$main_cp_select . |
356 | 357 |
qq|, ' ' AS invnumber, o.ordnumber, o.quonumber, o.id AS invid, | . |
... | ... | |
360 | 361 |
qq|LEFT JOIN business b ON (ct.business_id = b.id) | . |
361 | 362 |
qq|LEFT JOIN employee e ON (ct.salesman_id = e.id) | . |
362 | 363 |
qq|LEFT JOIN payment_terms pt ON (ct.payment_id = pt.id) | . |
364 |
qq|LEFT JOIN tax_zones tz ON (ct.taxzone_id = tz.id) | . |
|
363 | 365 |
$pg_join . |
364 | 366 |
qq|WHERE $where AND ((o.record_type = 'sales_order') OR (o.record_type = 'purchase_order'))|; |
365 | 367 |
} |
... | ... | |
369 | 371 |
$query .= |
370 | 372 |
qq| UNION | . |
371 | 373 |
qq|SELECT ct.*, ct.itime::DATE AS insertdate, b.description AS business, e.name as salesman, | . |
372 |
qq| pt.description as payment | . |
|
374 |
qq| pt.description as payment, tz.description as taxzone | .
|
|
373 | 375 |
$pg_select . |
374 | 376 |
$main_cp_select . |
375 | 377 |
qq|, ' ' AS invnumber, o.ordnumber, o.quonumber, o.id AS invid, | . |
... | ... | |
379 | 381 |
qq|LEFT JOIN business b ON (ct.business_id = b.id) | . |
380 | 382 |
qq|LEFT JOIN employee e ON (ct.salesman_id = e.id) | . |
381 | 383 |
qq|LEFT JOIN payment_terms pt ON (ct.payment_id = pt.id) | . |
384 |
qq|LEFT JOIN tax_zones tz ON (ct.taxzone_id = tz.id) | . |
|
382 | 385 |
$pg_join . |
383 | 386 |
qq|WHERE $where AND ((o.record_type = 'sales_quotation') OR (o.record_type = 'request_quotation'))|; |
384 | 387 |
} |
Auch abrufbar als: Unified diff
Kunden/Lieferanten-Bericht: SQL-Fehler: Steuerrate auch in Unions