From 4fd4edafe6d156fac9665bce2b0092b7c090a07c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Tue, 12 Aug 2025 19:26:48 +0000 Subject: [PATCH 1/2] E-Commerce, 07.2025 --- .../BimIT-eCommerceInvoices/amazonWDT/B2BReader.php | 2 +- .../BimIT-eCommerceInvoices/amazonWDT/amazonWZ.php | 2 +- .../BimIT-eCommerceInvoices/amazonWDT/localVatReader.php | 2 +- .../BimIT-eCommerceInvoices/amazonWDT/wdtReader.php | 9 +++++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/B2BReader.php b/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/B2BReader.php index bcc41e42..07330a63 100644 --- a/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/B2BReader.php +++ b/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/B2BReader.php @@ -9,7 +9,7 @@ DELETE FROM ecommerce_invoices_products WHERE invoice_id IN ( DELETE FROM ecommerce_invoices WHERE origin='amazon b2b' AND register_date LIKE '2025-04-%'; */ -$filename = getcwd() . '/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/files/06-2025.csv'; +$filename = getcwd() . '/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/files/07-2025.csv'; $handle = fopen($filename, 'r'); if ($handle === false) { die('Cannot open file: ' . $filename); diff --git a/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/amazonWZ.php b/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/amazonWZ.php index 232c1502..25ac60b4 100644 --- a/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/amazonWZ.php +++ b/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/amazonWZ.php @@ -1,7 +1,7 @@ parent_address_city = 'Obrowo'; $invoice->type = 'normal'; - $date = '30.06.2025'; + $date = '31.07.2025'; $invoice->register_date = $date; $invoice->sell_date = $date; $invoice->validtill_date = $date; @@ -83,6 +83,11 @@ function createInvoice($type, $products, $DO_REAL_SAVE = false) $p[10] = substr($p[10], 0, -1); } + // fixes.. (07.2025) + if ($p[10] == 'FR00148_') { + $p[10] = 'FR00148_1000_amz_de_3pcs'; + } + $fromDb = $db->fetchByAssoc($db->query("SELECT id, name, code, product_category_id, unit_id FROM ecmproducts WHERE code = '$p[10]' OR amazon_code = '$p[10]'")); if ($fromDb == false) { var_dump($p); From b977d3786e2540a5a13925cbf0ed1a25519a3bba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Thu, 21 Aug 2025 18:12:57 +0000 Subject: [PATCH 2/2] export rewizor fix --- .../BimIT-eCommerceInvoices/ecommerceInvoicesListView.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/ecommerceInvoicesListView.php b/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/ecommerceInvoicesListView.php index 38d1e133..4b167c1d 100644 --- a/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/ecommerceInvoicesListView.php +++ b/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/ecommerceInvoicesListView.php @@ -132,7 +132,7 @@ function exportToRewizor($source, $date, $type) $i['corrected_register_date'] = date("Ymd000000",strtotime(date('d.m.Y', strtotime($fv['register_date'])))); } if ($source == 'amazon b2b') { - $i['category'] = 'Dostawa Wewnątrzwspólnotowa'; + $i['category'] = 'WDT'; $i['parent_country_code'] = substr($i['parent_nip'], 0, 2); $i['parent_name'] = $i['parent_name'] . ' ' . $i['parent_nip']; $i['parent_hash'] = $i['parent_nip']; //substr(md5($i['parent_name']), 0, 20);