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

@@ -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);