diff --git a/class/datanorm.class.php b/class/datanorm.class.php index 50c1148..c224eb0 100755 --- a/class/datanorm.class.php +++ b/class/datanorm.class.php @@ -975,13 +975,13 @@ class Datanorm extends CommonObject // P;A format - multiple articles per line // Format: P;A;ArtNr;PreisKz;Preis;PE;Zuschlag;x;x;x;ArtNr2;... - // PE is the price unit code from DATPREIS (may differ from A-record!) + // Rabattkennzeichen aus DATPREIS (wird gespeichert aber nicht fuer price_unit verwendet) if ($recordType === 'P' && isset($parts[1]) && $parts[1] === 'A') { $i = 2; while ($i < count($parts) - 2) { $articleNumber = trim($parts[$i] ?? ''); $priceRaw = trim($parts[$i + 2] ?? '0'); - $datpreisPeCode = (int)trim($parts[$i + 3] ?? '0'); // PE code from DATPREIS + $datpreisPeCode = (int)trim($parts[$i + 3] ?? '0'); // Rabattkennzeichen (nicht PE!) $metalSurchargeRaw = trim($parts[$i + 4] ?? '0'); $price = (float)$priceRaw / 100; // Convert cents to euros $metalSurcharge = (float)$metalSurchargeRaw / 100; // Convert cents to euros @@ -1000,7 +1000,7 @@ class Datanorm extends CommonObject // Simple format: P;ArtNr;PreisKz;Preis;PE;... $articleNumber = trim($parts[1] ?? ''); $priceRaw = trim($parts[3] ?? '0'); - $datpreisPeCode = (int)trim($parts[4] ?? '0'); // PE code if available + $datpreisPeCode = (int)trim($parts[4] ?? '0'); // Rabattkennzeichen (nicht PE!) if (strpos($priceRaw, ',') === false && strpos($priceRaw, '.') === false) { $price = (float)$priceRaw / 100; diff --git a/core/modules/modImportZugferd.class.php b/core/modules/modImportZugferd.class.php index bc1da66..e315554 100755 --- a/core/modules/modImportZugferd.class.php +++ b/core/modules/modImportZugferd.class.php @@ -76,7 +76,7 @@ class modImportZugferd extends DolibarrModules $this->editor_squarred_logo = ''; // Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@importzugferd' // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated', 'experimental_deprecated' or a version string like 'x.y.z' - $this->version = '3.8'; + $this->version = '4.0'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; diff --git a/import.php b/import.php index 39ced3f..abee0da 100755 --- a/import.php +++ b/import.php @@ -2356,10 +2356,12 @@ if ($action == 'edit' && $import->id > 0) { // Line items print '
'; - print '
'; + // Form fuer fehlende Lieferantenpreise (ausserhalb der Tabelle, um verschachtelte Forms zu vermeiden) + print ''; print ''; print ''; print ''; + print '
'; print '
'; print ''; print ''; @@ -2480,11 +2482,11 @@ if ($action == 'edit' && $import->id > 0) { print ' '; // Alle Einkaufspreise des Produktes anzeigen - $sqlPrices = "SELECT pfp.fk_soc, pfp.price, pfp.ref_fourn, pfp.quantity, s.nom as supplier_name"; + $sqlPrices = "SELECT pfp.fk_soc, pfp.price, pfp.unitprice, pfp.ref_fourn, pfp.quantity, s.nom as supplier_name"; $sqlPrices .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price pfp"; $sqlPrices .= " LEFT JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid = pfp.fk_soc"; $sqlPrices .= " WHERE pfp.fk_product = ".(int)$line->fk_product; - $sqlPrices .= " ORDER BY pfp.price ASC"; + $sqlPrices .= " ORDER BY pfp.unitprice ASC"; $resPrices = $db->query($sqlPrices); if ($resPrices && $db->num_rows($resPrices) > 0) { print '
'; @@ -2493,7 +2495,10 @@ if ($action == 'edit' && $import->id > 0) { $style = $isInvoiceSupplier ? 'font-weight: bold;' : 'color: #666;'; print '
'; print dol_escape_htmltag($objP->supplier_name); - print ': '.price($objP->price).''; + print ': '.price($objP->unitprice).''; + if ($objP->quantity > 1) { + print ' ('.price($objP->price).'/'.(int)$objP->quantity.'Stk.)'; + } if (!empty($objP->ref_fourn)) { print ' ('.dol_escape_htmltag($objP->ref_fourn).')'; } @@ -2519,7 +2524,7 @@ if ($action == 'edit' && $import->id > 0) { // Fehlende Lieferantenpreise aus anderen Katalogen sammeln (Anzeige weiter unten) if ($import->fk_soc > 0 && getDolGlobalString('IMPORTZUGFERD_DATANORM_SEARCH_ALL')) { // Alle vorhandenen Lieferantenpreise fuer dieses Produkt laden - $sqlExistingPrices = "SELECT fk_soc, price, barcode FROM ".MAIN_DB_PREFIX."product_fournisseur_price"; + $sqlExistingPrices = "SELECT fk_soc, price, unitprice, barcode FROM ".MAIN_DB_PREFIX."product_fournisseur_price"; $sqlExistingPrices .= " WHERE fk_product = ".(int)$line->fk_product; $resExistingPrices = $db->query($sqlExistingPrices); $existingSupplierIds = array(); @@ -2528,9 +2533,9 @@ if ($action == 'edit' && $import->id > 0) { if ($resExistingPrices) { while ($objPrice = $db->fetch_object($resExistingPrices)) { $existingSupplierIds[$objPrice->fk_soc] = true; - // Preis und EAN vom Rechnungslieferanten merken + // Stueckpreis und EAN vom Rechnungslieferanten merken if ($objPrice->fk_soc == $import->fk_soc) { - $currentSupplierPrice = $objPrice->price; + $currentSupplierPrice = $objPrice->unitprice; if (!empty($objPrice->barcode)) { $supplierEan = $objPrice->barcode; } @@ -2607,7 +2612,7 @@ if ($action == 'edit' && $import->id > 0) { $cbValue = $line->fk_product.','.$missing['fk_soc'].','.$missing['datanorm_id']; print '
'; print '
'; } - print ''; // End missing_prices_form + // missing_prices_form ist bereits oben geschlossen (ausgelagert wegen verschachtelter Forms) // Datanorm Preview Section (shown when preview action was triggered) if (!empty($datanormPreviewMatches)) {