From 01cf1379d097ea95ce59adb41401ab68082feed6 Mon Sep 17 00:00:00 2001 From: Pek5892 Date: Fri, 3 May 2024 15:41:14 +0200 Subject: [PATCH] Fix riferimento banca in FE --- plugins/exportFE/src/FatturaElettronica.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/exportFE/src/FatturaElettronica.php b/plugins/exportFE/src/FatturaElettronica.php index 5781a8f45..da91e096f 100755 --- a/plugins/exportFE/src/FatturaElettronica.php +++ b/plugins/exportFE/src/FatturaElettronica.php @@ -1662,8 +1662,8 @@ class FatturaElettronica $co_scadenziario = $database->fetchArray('SELECT * FROM `co_scadenziario` WHERE `iddocumento` = '.prepare($documento['id'])); foreach ($co_scadenziario as $scadenza) { $co_pagamenti = Pagamento::find($scadenza['id_pagamento']); - $banca = Banca::find($scadenza['id_banca_azienda']); - + $banca = ($co_pagamenti->isRiBa()) ? Banca::find($scadenza['id_banca_controparte']) ?: Banca::where('id_anagrafica', $scadenza['idanagrafica'])->where('predefined', 1)->first() : Banca::find($scadenza['id_banca_azienda']); + $pagamento = [ 'ModalitaPagamento' => $co_pagamenti['codice_modalita_pagamento_fe'], 'DataScadenzaPagamento' => $scadenza['scadenza'],