evita facturacion proveedores #2491

Merged
pako merged 2 commits from 7420-supplierPackaging_ReportSource into dev 2024-05-21 12:19:07 +00:00
1 changed files with 4 additions and 1 deletions

View File

@ -27,7 +27,10 @@ BEGIN
SELECT DISTINCT clientFk
FROM (
SELECT clientFk, SUM(quantity) totalQuantity
FROM tmp.packagingToInvoice
FROM tmp.packagingToInvoice tpi
JOIN client c ON c.id = tpi.clientFk
LEFT JOIN supplier s ON s.nif = c.fi
WHERE s.id IS NULL
GROUP BY itemFk, clientFk
HAVING totalQuantity > 0)sub;