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

@@ -1,5 +1,5 @@
<?php
// created: 2025-01-31 16:54:46
// created: 2025-02-10 11:34:48
$customDoms = array (
'ecmproducts_attribute_dom' =>
array (
@@ -35,6 +35,7 @@ $customDoms = array (
'62ea70ee-d2cc-e68b-d51b-661670a10c98' => 'Bottle D21_250ml ',
'c10933f2-62ce-cfb2-52b1-659f1f2b9e4a' => 'B D22_250ml (szyjka)',
'855e5265-8d2d-4682-8e4c-659f1d1ead09' => 'Bottle D23_250ml',
'e3a77ebf-9ba1-3776-3d80-67a9e325c268' => 'Bottle D24 250 ml (Ula)',
'359d7556-f107-92de-4121-659f1eafeb90' => 'B D11_500ml (RPET)',
'90053c7e-98fb-873e-b414-659f1bc748cc' => 'Bottle D12_500ml',
'9b883933-6bb0-cc85-29b0-659f03d60a98' => 'Bottle D21_500ml',
@@ -154,6 +155,7 @@ $customDoms = array (
'8d09cc5f-2348-6d22-80dc-6736057e390d' => 'Seltino',
'7ceeacc7-e79b-4eb0-2aa3-676529593a3c' => 'PureNest',
'ca4ee928-3385-d7f8-090e-678e697c3b8e' => 'gc clean!',
'9d630708-a3f3-de9b-bbe0-67a9dfd114a2' => 'MPM',
),
'ecmproducts_category_dom' =>
array (

View File

@@ -1,5 +1,5 @@
<?php
// created: 2025-01-31 16:54:46
// created: 2025-02-10 11:34:48
$customDoms = array (
'ecmproducts_attribute_dom' =>
array (
@@ -35,6 +35,7 @@ $customDoms = array (
'62ea70ee-d2cc-e68b-d51b-661670a10c98' => 'Butelka D21_250ml_new (Odkamieniacz)',
'c10933f2-62ce-cfb2-52b1-659f1f2b9e4a' => 'Butelka D22_250ml (szyjka)',
'855e5265-8d2d-4682-8e4c-659f1d1ead09' => 'Butelka D23_250ml (Zmywarka)',
'e3a77ebf-9ba1-3776-3d80-67a9e325c268' => 'Butelka D24 250 ml (Ula)',
'359d7556-f107-92de-4121-659f1eafeb90' => 'Butelka D11_500ml (RPET)',
'90053c7e-98fb-873e-b414-659f1bc748cc' => 'Butelka D12_500ml (Dywan)',
'9b883933-6bb0-cc85-29b0-659f03d60a98' => 'Butelka D21_500ml (Odkamieniacz)',
@@ -154,6 +155,7 @@ $customDoms = array (
'8d09cc5f-2348-6d22-80dc-6736057e390d' => 'Seltino',
'7ceeacc7-e79b-4eb0-2aa3-676529593a3c' => 'PureNest',
'ca4ee928-3385-d7f8-090e-678e697c3b8e' => 'gc clean!',
'9d630708-a3f3-de9b-bbe0-67a9dfd114a2' => 'MPM',
),
'ecmproducts_category_dom' =>
array (

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