ReportSales fix

This commit is contained in:
2025-02-10 16:20:05 +00:00
parent dac814b926
commit a879b73ea6
3 changed files with 7 additions and 5 deletions

View File

@@ -127,15 +127,13 @@
pozycja.price_purchase*pozycja.quantity_corrected
END
) as koszt,
round(sum(s.quantity),0) AS 'state'
(SELECT SUM(s.quantity) FROM ecmstockstates s WHERE s.product_id = pozycja.ecmproduct_id) as state
FROM
ecminvoiceoutitems pozycja
JOIN
ecminvoiceouts faktura ON pozycja.ecminvoiceout_id = faktura.id
LEFT JOIN
ecmproducts produkt ON pozycja.ecmproduct_id = produkt.id
LEFT JOIN
ecmstockstates s ON s.product_id = pozycja.ecmproduct_id
WHERE
faktura.register_date BETWEEN
'".$date_from_to_query->format('Y-m-d')."' AND