Skip to content

Commit 0ef3a71

Browse files
committed
fix: allegati fatture elettroniche
1 parent 110d8b0 commit 0ef3a71

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugins/exportFE/src/FatturaElettronica.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,11 +1724,12 @@ protected static function getAllegati($fattura)
17241724

17251725
// Inclusione
17261726
foreach ($allegati as $allegato) {
1727-
if ($allegato['category'] == 'Allegati Fattura Elettronica') {
1727+
$categoria = database()->fetchOne('SELECT `name` FROM `zz_files_categories` WHERE `id` = '.prepare($allegato['id_category']))['name'];
1728+
if ($categoria == 'Allegati Fattura Elettronica') {
17281729
$file = base_dir().'/'.$directory.'/'.$allegato['filename'];
17291730

17301731
$attachments[] = [
1731-
'NomeAttachment' => $allegato['name'],
1732+
'NomeAttachment' => $allegato['name'].'.'.\Uploads::fileInfo($file)['extension'],
17321733
'FormatoAttachment' => \Uploads::fileInfo($file)['extension'],
17331734
'Attachment' => base64_encode(file_get_contents($file)),
17341735
];

0 commit comments

Comments
 (0)