Skip to content

Commit 1061f32

Browse files
committed
fix: esportazione xml bonifico
1 parent 1e07ee2 commit 1061f32

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

plugins/presentazioni_bancarie/src/Cbi/Ricevuta.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
* @property string $comune_debitore
1616
* @property int $abi_banca
1717
* @property int $cab_banca
18+
* @property string $iban
1819
* @property string $descrizione_banca
1920
* @property int $codice_cliente
21+
* @property string $ctgypurp
2022
* @property string $descrizione
2123
* @property string $provincia_debitore
2224
* @property string $descrizione_origine
@@ -68,6 +70,10 @@ class Ricevuta extends Elemento
6870
/**
6971
* @var string Valore alfanumerico di 50 cifre
7072
*/
73+
protected $iban;
74+
/**
75+
* @var string Valore alfanumerico di 27 cifre
76+
*/
7177
protected $descrizione_banca;
7278
/**
7379
* Codice cliente attribuito dal creditore.
@@ -78,7 +84,11 @@ class Ricevuta extends Elemento
7884
/**
7985
* @var string Valore alfanumerico di 40 cifre, con i campi (CIG CUP)
8086
*/
81-
protected $descrizione;
87+
protected $ctgypurp;
88+
/**
89+
* @var string Valore alfanumerico che indica il tipo di bonifico
90+
*/
91+
protected $descrizione;
8292
/**
8393
* @var string Valore alfanumerico di 2 cifre
8494
*/
@@ -103,8 +113,10 @@ public function toRibaAbiCbiFormat()
103113
$this->comune_debitore,
104114
$this->abi_banca,
105115
$this->cab_banca,
116+
$this->iban,
106117
$this->descrizione_banca,
107118
$this->codice_cliente,
119+
$this->ctgypurp,
108120
$this->descrizione,
109121
$this->provincia_debitore,
110122
$this->descrizione_origine,

plugins/presentazioni_bancarie/src/Gestore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function aggiungi(Scadenza $scadenza, int $identifier, string $descrizion
168168
$is_credito_diretto = (($direzione == 'uscita') || (empty($documento) && $importo < 0 && $ctgypurp != 'SALA')) && in_array($pagamento->codice_modalita_pagamento_fe, ['MP09', 'MP10', 'MP11', 'MP19', 'MP20', 'MP21']);
169169
$is_debito_diretto = $direzione == 'entrata' && in_array($pagamento->codice_modalita_pagamento_fe, ['MP09', 'MP10', 'MP11', 'MP19', 'MP20', 'MP21']) && !empty($this->banca_azienda->creditor_id); // Mandato SEPA disponibile
170170
$is_riba = $direzione == 'entrata' && in_array($pagamento->codice_modalita_pagamento_fe, ['MP12']) && !empty($this->banca_azienda->codice_sia);
171-
$is_bonifico = $direzione == 'uscita' && in_array($pagamento->codice_modalita_pagamento_fe, ['MP05']) && !empty($this->banca_azienda->codice_sia) || (empty($documento) && $importo < 0);
171+
$is_bonifico = (in_array($pagamento->codice_modalita_pagamento_fe, ['MP05']) && $importo < 0 && !empty($this->banca_azienda->codice_sia)) || (empty($documento));
172172

173173
if (in_array($pagamento->codice_modalita_pagamento_fe, ['MP19', 'MP21'])) {
174174
$method = 'B2B';

0 commit comments

Comments
 (0)