diff --git a/.claude/settings.local.json b/.claude/settings.local.json old mode 100644 new mode 100755 index 789940c..99a074c --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -11,7 +11,30 @@ "Bash(mysql:*)", "Bash(ls:*)", "Bash(php:*)", - "Bash(mariadb:*)" + "Bash(for module in /srv/http/dolibarr/custom/*/core/modules/mod*.php)", + "Bash(do echo \"=== $module ===\" grep -A5 \"''js''\" \"$module\")", + "Bash(done)", + "Bash(find:*)", + "Bash(chown:*)", + "Bash(sudo chown:*)", + "Bash(composer show:*)", + "Bash(journalctl:*)", + "Bash(sudo tail:*)", + "Bash(strings:*)", + "Bash(qpdf --show-object=all:*)", + "Bash(pdftk:*)", + "Bash(pdfinfo:*)", + "Bash(exiftool:*)", + "Bash(pacman:*)", + "Bash(git init:*)", + "Bash(git remote add:*)", + "Bash(git branch:*)", + "Bash(git add:*)", + "Bash(git commit:*)", + "Bash(git tag:*)", + "Bash(git push:*)", + "Bash(git pull:*)", + "Bash(git stash:*)" ] } } diff --git a/batch.php b/batch.php old mode 100644 new mode 100755 diff --git a/bin/module_importzugferd-2.2.zip b/bin/module_importzugferd-2.2.zip new file mode 100755 index 0000000..075fbae Binary files /dev/null and b/bin/module_importzugferd-2.2.zip differ diff --git a/bin/module_importzugferd-2.3.zip b/bin/module_importzugferd-2.3.zip new file mode 100755 index 0000000..4e42d53 Binary files /dev/null and b/bin/module_importzugferd-2.3.zip differ diff --git a/bin/module_importzugferd-2.4.zip b/bin/module_importzugferd-2.4.zip new file mode 100755 index 0000000..7ff8167 Binary files /dev/null and b/bin/module_importzugferd-2.4.zip differ diff --git a/bin/module_importzugferd-2.5.zip b/bin/module_importzugferd-2.5.zip new file mode 100755 index 0000000..dbb1a6d Binary files /dev/null and b/bin/module_importzugferd-2.5.zip differ diff --git a/card.php b/card.php old mode 100644 new mode 100755 diff --git a/class/actions_importzugferd.class.php b/class/actions_importzugferd.class.php old mode 100644 new mode 100755 index 84ab06c..8243f7d --- a/class/actions_importzugferd.class.php +++ b/class/actions_importzugferd.class.php @@ -383,6 +383,9 @@ class ActionsImportZugferd $invoice->note_private = $langs->trans('ImportedFromZugferd') . ' - ' . $this->import->ref; $invoice->multicurrency_code = $invoice_data['totals']['currency'] ?: 'EUR'; + // Set invoice label to the most expensive item's name + $invoice->libelle = $this->getMostExpensiveItemName($this->result['lines']); + $this->db->begin(); $invoice_id = $invoice->create($user); @@ -865,6 +868,34 @@ class ActionsImportZugferd return copy($pdf_path, $destfile); } + /** + * Get the name of the most expensive item from invoice lines + * + * @param array $lines Processed invoice lines + * @return string Name of the most expensive item + */ + public function getMostExpensiveItemName($lines) + { + $maxTotal = 0; + $itemName = ''; + + foreach ($lines as $line) { + // Skip metal surcharge lines + if (!empty($line['is_metal_surcharge'])) { + continue; + } + + $lineTotal = (float) $line['line_total']; + if ($lineTotal > $maxTotal) { + $maxTotal = $lineTotal; + // Use product label if available, otherwise use name from invoice + $itemName = !empty($line['product_label']) ? $line['product_label'] : $line['name']; + } + } + + return $itemName; + } + /** * Get import result * diff --git a/class/cron_importzugferd.class.php b/class/cron_importzugferd.class.php old mode 100644 new mode 100755 diff --git a/class/datanorm.class.php b/class/datanorm.class.php old mode 100644 new mode 100755 diff --git a/class/datanormparser.class.php b/class/datanormparser.class.php old mode 100644 new mode 100755 diff --git a/class/importline.class.php b/class/importline.class.php old mode 100644 new mode 100755 diff --git a/class/importnotification.class.php b/class/importnotification.class.php old mode 100644 new mode 100755 diff --git a/class/productmapping.class.php b/class/productmapping.class.php old mode 100644 new mode 100755 diff --git a/class/zugferdimport.class.php b/class/zugferdimport.class.php old mode 100644 new mode 100755 diff --git a/class/zugferdparser.class.php b/class/zugferdparser.class.php old mode 100644 new mode 100755 diff --git a/core/boxes/box_new_products.php b/core/boxes/box_new_products.php old mode 100644 new mode 100755 diff --git a/core/modules/modImportZugferd.class.php b/core/modules/modImportZugferd.class.php index 7c0ca62..1a7eb6b 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.2'; + $this->version = '3.3'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; diff --git a/css/importzugferd.css.php b/css/importzugferd.css.php old mode 100644 new mode 100755 diff --git a/datanorm.php b/datanorm.php old mode 100644 new mode 100755 diff --git a/datanorm_changelog.php b/datanorm_changelog.php old mode 100644 new mode 100755 diff --git a/datanorm_list.php b/datanorm_list.php old mode 100644 new mode 100755 diff --git a/datanorm_update.php b/datanorm_update.php old mode 100644 new mode 100755 diff --git a/docs/DATANORM_FORMAT.md b/docs/DATANORM_FORMAT.md old mode 100644 new mode 100755 diff --git a/img/object_importzugferd.svg b/img/object_importzugferd.svg old mode 100644 new mode 100755 diff --git a/import.php b/import.php old mode 100644 new mode 100755 diff --git a/langs/de_DE/importzugferd.lang b/langs/de_DE/importzugferd.lang old mode 100644 new mode 100755 diff --git a/list.php b/list.php old mode 100644 new mode 100755 diff --git a/mapping.php b/mapping.php old mode 100644 new mode 100755 diff --git a/new_products.php b/new_products.php old mode 100644 new mode 100755 diff --git a/sql/llx_importzugferd_datanorm.key.sql b/sql/llx_importzugferd_datanorm.key.sql old mode 100644 new mode 100755 diff --git a/sql/llx_importzugferd_datanorm.sql b/sql/llx_importzugferd_datanorm.sql old mode 100644 new mode 100755 diff --git a/sql/llx_importzugferd_datanorm_log.key.sql b/sql/llx_importzugferd_datanorm_log.key.sql old mode 100644 new mode 100755 diff --git a/sql/llx_importzugferd_datanorm_log.sql b/sql/llx_importzugferd_datanorm_log.sql old mode 100644 new mode 100755 diff --git a/sql/llx_importzugferd_import.key.sql b/sql/llx_importzugferd_import.key.sql old mode 100644 new mode 100755 diff --git a/sql/llx_importzugferd_import.sql b/sql/llx_importzugferd_import.sql old mode 100644 new mode 100755 diff --git a/sql/llx_importzugferd_import_line.key.sql b/sql/llx_importzugferd_import_line.key.sql old mode 100644 new mode 100755 diff --git a/sql/llx_importzugferd_import_line.sql b/sql/llx_importzugferd_import_line.sql old mode 100644 new mode 100755 diff --git a/sql/llx_importzugferd_productmapping.key.sql b/sql/llx_importzugferd_productmapping.key.sql old mode 100644 new mode 100755 diff --git a/sql/llx_importzugferd_productmapping.sql b/sql/llx_importzugferd_productmapping.sql old mode 100644 new mode 100755