amazon august

This commit is contained in:
2025-09-24 06:38:38 +00:00
parent be27602ca3
commit 7943842f90
11 changed files with 1479 additions and 10 deletions

View File

@@ -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/07-2025.csv';
$filename = getcwd() . '/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/files/08-2025.csv';
$handle = fopen($filename, 'r');
if ($handle === false) {
die('Cannot open file: ' . $filename);

View File

@@ -1,7 +1,7 @@
<?php
// https://crm.twinpol.com/?module=EcmInvoiceOuts&action=ecommerce&amazon-wz=true
$filename = getcwd() . '/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/files/amazon-wz-07-2025.csv';
$filename = getcwd() . '/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/files/amazon-wz-08-2025.csv';
$handle = fopen($filename, 'r');
if ($handle === false) {
die('Cannot open file: ' . $filename);
@@ -18,6 +18,17 @@ while (($data = fgetcsv($handle, 0, ";")) !== false) {
if (substr($p['product_code'], -1) == '.' || substr($p['product_code'], -1) == '-') {
$p['product_code'] = substr($p['product_code'], 0, -1);
}
// ehhhhh
if ($p['product_code'] == 'FR00218_1000_amz_de') {
$p['product_code'] = 'FR00218_1000_amz_de_n';
}
if ($p['product_code'] == 'FR00225_1000_amz_de') {
$p['product_code'] = 'FR00225_1000_amz_de_n';
}
if ($p['product_code'] == 'FR00229_90_amz_de') {
$p['product_code'] = 'FR00229_90_amz_de_n';
}
// end of: ehhhhh
$p['quantity'] = floatval(str_replace(' ', '', $data[3]));
$p['total'] = floatval(str_replace(' ', '', str_replace(',', '.', $data[5])));
$p['price_netto'] = round($p['total'] / $p['quantity'], 2);

View File

@@ -9,7 +9,7 @@ DELETE FROM ecommerce_invoices_products WHERE invoice_id IN (
DELETE FROM ecommerce_invoices WHERE origin='amazon vat local' AND register_date LIKE '2025-02-%';
*/
$filename = getcwd() . '/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/files/07-2025.csv';
$filename = getcwd() . '/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/files/08-2025.csv';
$handle = fopen($filename, 'r');
if ($handle === false) {
die('Cannot open file: ' . $filename);

View File

@@ -4,7 +4,7 @@ error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
ini_set('display_errors', 1);
// read csv file tab separated
$filename = getcwd() . '/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/files/07-2025.csv';
$filename = getcwd() . '/modules/EcmInvoiceOuts/BimIT-eCommerceInvoices/amazonWDT/files/08-2025.csv';
$handle = fopen($filename, 'r');
if ($handle === false) {
die('Cannot open file: ' . $filename);
@@ -31,12 +31,12 @@ fclose($handle);
//if (count($de) == 0) {
// die('No data for DE');
//}
//createInvoice('DE', $de);
//createInvoice('DE', $de,);
//if (count($cz) == 0) {
// die('No data for CZ');
//}
//createInvoice('CZ', $cz);
if (count($cz) == 0) {
die('No data for CZ');
}
createInvoice('CZ', $cz, true);
function createInvoice($type, $products, $DO_REAL_SAVE = false)
{
@@ -57,7 +57,7 @@ function createInvoice($type, $products, $DO_REAL_SAVE = false)
$invoice->parent_address_city = 'Obrowo';
$invoice->type = 'normal';
$date = '31.07.2025';
$date = '31.08.2025';
$invoice->register_date = $date;
$invoice->sell_date = $date;
$invoice->validtill_date = $date;
@@ -87,6 +87,10 @@ function createInvoice($type, $products, $DO_REAL_SAVE = false)
if ($p[10] == 'FR00148_') {
$p[10] = 'FR00148_1000_amz_de_3pcs';
}
// (08.2025)
if ($p[10] == 'F3-W9PW-O239') {
$p[10] = 'FR00148_1000_amz_de';
}
$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) {