Version 3.3
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
63dd72f5be
commit
47fbc561f6
40 changed files with 56 additions and 2 deletions
25
.claude/settings.local.json
Normal file → Executable file
25
.claude/settings.local.json
Normal file → Executable file
|
|
@ -11,7 +11,30 @@
|
||||||
"Bash(mysql:*)",
|
"Bash(mysql:*)",
|
||||||
"Bash(ls:*)",
|
"Bash(ls:*)",
|
||||||
"Bash(php:*)",
|
"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:*)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
0
batch.php
Normal file → Executable file
0
batch.php
Normal file → Executable file
BIN
bin/module_importzugferd-2.2.zip
Executable file
BIN
bin/module_importzugferd-2.2.zip
Executable file
Binary file not shown.
BIN
bin/module_importzugferd-2.3.zip
Executable file
BIN
bin/module_importzugferd-2.3.zip
Executable file
Binary file not shown.
BIN
bin/module_importzugferd-2.4.zip
Executable file
BIN
bin/module_importzugferd-2.4.zip
Executable file
Binary file not shown.
BIN
bin/module_importzugferd-2.5.zip
Executable file
BIN
bin/module_importzugferd-2.5.zip
Executable file
Binary file not shown.
0
card.php
Normal file → Executable file
0
card.php
Normal file → Executable file
31
class/actions_importzugferd.class.php
Normal file → Executable file
31
class/actions_importzugferd.class.php
Normal file → Executable file
|
|
@ -383,6 +383,9 @@ class ActionsImportZugferd
|
||||||
$invoice->note_private = $langs->trans('ImportedFromZugferd') . ' - ' . $this->import->ref;
|
$invoice->note_private = $langs->trans('ImportedFromZugferd') . ' - ' . $this->import->ref;
|
||||||
$invoice->multicurrency_code = $invoice_data['totals']['currency'] ?: 'EUR';
|
$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();
|
$this->db->begin();
|
||||||
|
|
||||||
$invoice_id = $invoice->create($user);
|
$invoice_id = $invoice->create($user);
|
||||||
|
|
@ -865,6 +868,34 @@ class ActionsImportZugferd
|
||||||
return copy($pdf_path, $destfile);
|
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
|
* Get import result
|
||||||
*
|
*
|
||||||
|
|
|
||||||
0
class/cron_importzugferd.class.php
Normal file → Executable file
0
class/cron_importzugferd.class.php
Normal file → Executable file
0
class/datanorm.class.php
Normal file → Executable file
0
class/datanorm.class.php
Normal file → Executable file
0
class/datanormparser.class.php
Normal file → Executable file
0
class/datanormparser.class.php
Normal file → Executable file
0
class/importline.class.php
Normal file → Executable file
0
class/importline.class.php
Normal file → Executable file
0
class/importnotification.class.php
Normal file → Executable file
0
class/importnotification.class.php
Normal file → Executable file
0
class/productmapping.class.php
Normal file → Executable file
0
class/productmapping.class.php
Normal file → Executable file
0
class/zugferdimport.class.php
Normal file → Executable file
0
class/zugferdimport.class.php
Normal file → Executable file
0
class/zugferdparser.class.php
Normal file → Executable file
0
class/zugferdparser.class.php
Normal file → Executable file
0
core/boxes/box_new_products.php
Normal file → Executable file
0
core/boxes/box_new_products.php
Normal file → Executable file
|
|
@ -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'
|
$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'
|
// 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
|
// Url to the file with your last numberversion of this module
|
||||||
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';
|
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';
|
||||||
|
|
||||||
|
|
|
||||||
0
css/importzugferd.css.php
Normal file → Executable file
0
css/importzugferd.css.php
Normal file → Executable file
0
datanorm.php
Normal file → Executable file
0
datanorm.php
Normal file → Executable file
0
datanorm_changelog.php
Normal file → Executable file
0
datanorm_changelog.php
Normal file → Executable file
0
datanorm_list.php
Normal file → Executable file
0
datanorm_list.php
Normal file → Executable file
0
datanorm_update.php
Normal file → Executable file
0
datanorm_update.php
Normal file → Executable file
0
docs/DATANORM_FORMAT.md
Normal file → Executable file
0
docs/DATANORM_FORMAT.md
Normal file → Executable file
0
img/object_importzugferd.svg
Normal file → Executable file
0
img/object_importzugferd.svg
Normal file → Executable file
|
Before Width: | Height: | Size: 792 B After Width: | Height: | Size: 792 B |
0
import.php
Normal file → Executable file
0
import.php
Normal file → Executable file
0
langs/de_DE/importzugferd.lang
Normal file → Executable file
0
langs/de_DE/importzugferd.lang
Normal file → Executable file
0
list.php
Normal file → Executable file
0
list.php
Normal file → Executable file
0
mapping.php
Normal file → Executable file
0
mapping.php
Normal file → Executable file
0
new_products.php
Normal file → Executable file
0
new_products.php
Normal file → Executable file
0
sql/llx_importzugferd_datanorm.key.sql
Normal file → Executable file
0
sql/llx_importzugferd_datanorm.key.sql
Normal file → Executable file
0
sql/llx_importzugferd_datanorm.sql
Normal file → Executable file
0
sql/llx_importzugferd_datanorm.sql
Normal file → Executable file
0
sql/llx_importzugferd_datanorm_log.key.sql
Normal file → Executable file
0
sql/llx_importzugferd_datanorm_log.key.sql
Normal file → Executable file
0
sql/llx_importzugferd_datanorm_log.sql
Normal file → Executable file
0
sql/llx_importzugferd_datanorm_log.sql
Normal file → Executable file
0
sql/llx_importzugferd_import.key.sql
Normal file → Executable file
0
sql/llx_importzugferd_import.key.sql
Normal file → Executable file
0
sql/llx_importzugferd_import.sql
Normal file → Executable file
0
sql/llx_importzugferd_import.sql
Normal file → Executable file
0
sql/llx_importzugferd_import_line.key.sql
Normal file → Executable file
0
sql/llx_importzugferd_import_line.key.sql
Normal file → Executable file
0
sql/llx_importzugferd_import_line.sql
Normal file → Executable file
0
sql/llx_importzugferd_import_line.sql
Normal file → Executable file
0
sql/llx_importzugferd_productmapping.key.sql
Normal file → Executable file
0
sql/llx_importzugferd_productmapping.key.sql
Normal file → Executable file
0
sql/llx_importzugferd_productmapping.sql
Normal file → Executable file
0
sql/llx_importzugferd_productmapping.sql
Normal file → Executable file
Loading…
Reference in a new issue