From a879b73ea6559fadb35347b25efdfe07d5aea73a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Mon, 10 Feb 2025 16:20:05 +0000 Subject: [PATCH] ReportSales fix --- include/language/en_us.EcmDropdownEditor.php | 4 +++- include/language/pl_pl.EcmDropdownEditor.php | 4 +++- modules/EcmReports/ReportSales.inc.php | 4 +--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/language/en_us.EcmDropdownEditor.php b/include/language/en_us.EcmDropdownEditor.php index ca92b5fe..b7fe168a 100644 --- a/include/language/en_us.EcmDropdownEditor.php +++ b/include/language/en_us.EcmDropdownEditor.php @@ -1,5 +1,5 @@ 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 ( diff --git a/include/language/pl_pl.EcmDropdownEditor.php b/include/language/pl_pl.EcmDropdownEditor.php index 1e6d31d8..c7539cda 100644 --- a/include/language/pl_pl.EcmDropdownEditor.php +++ b/include/language/pl_pl.EcmDropdownEditor.php @@ -1,5 +1,5 @@ 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 ( diff --git a/modules/EcmReports/ReportSales.inc.php b/modules/EcmReports/ReportSales.inc.php index e2b0ac2c..c06da8be 100644 --- a/modules/EcmReports/ReportSales.inc.php +++ b/modules/EcmReports/ReportSales.inc.php @@ -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