From 52801bff8dfc1d1abd28e4a439623a60a1179e63 Mon Sep 17 00:00:00 2001 From: Dasc3er Date: Mon, 19 Apr 2021 17:35:42 +0200 Subject: [PATCH 1/5] Correzione per pagamenti RiBa Introduzione class IBAN di base per la gestione delle informazioni generali sui conti bancari. --- modules/banche/src/IBAN.php | 527 ++++++++++++++++++++++++++++ modules/fatture/buttons.php | 3 +- modules/fatture/init.php | 1 - modules/fatture/src/Fattura.php | 4 +- modules/pagamenti/actions.php | 1 - modules/pagamenti/edit.php | 8 +- modules/pagamenti/src/Pagamento.php | 8 + update/2_4_23.sql | 4 + 8 files changed, 545 insertions(+), 11 deletions(-) create mode 100644 modules/banche/src/IBAN.php diff --git a/modules/banche/src/IBAN.php b/modules/banche/src/IBAN.php new file mode 100644 index 000000000..9035c8fd4 --- /dev/null +++ b/modules/banche/src/IBAN.php @@ -0,0 +1,527 @@ + [ + 'length' => 28, + 'pattern' => '8n 16c', + 'structure' => 'ALkk bbbs sssx cccc cccc cccc cccc', + ], + 'AD' => [ + 'length' => 24, + 'pattern' => '8n 12c', + 'structure' => 'ADkk bbbb ssss cccc cccc cccc', + ], + 'AT' => [ + 'length' => 20, + 'pattern' => '16n', + 'structure' => 'ATkk bbbb bccc cccc cccc', + ], + 'AZ' => [ + 'length' => 28, + 'pattern' => '4c 20n', + 'structure' => 'AZkk bbbb cccc cccc cccc cccc cccc', + ], + 'BH' => [ + 'length' => 22, + 'pattern' => '4a 14c', + 'structure' => 'BHkk bbbb cccc cccc cccc cc', + ], + 'BE' => [ + 'length' => 16, + 'pattern' => '12n', + 'structure' => 'BEkk bbbc cccc ccxx', + ], + 'BA' => [ + 'length' => 20, + 'pattern' => '16n', + 'structure' => 'BA39 bbbs sscc cccc ccxx', + ], + 'BR' => [ + 'length' => 29, + 'pattern' => '23n 1a 1c', + 'structure' => 'BR39 bbbb bbbb ssss sccc cccc cccc c', + ], + 'BG' => [ + 'length' => 22, + 'pattern' => '4a 6n 8c', + 'structure' => 'BGkk bbbb ssss ddcc cccc cc', + ], + 'CR' => [ + 'length' => 21, + 'pattern' => '17n', + 'structure' => 'CRkk bbbc cccc cccc cccc c', + ], + 'HR' => [ + 'length' => 21, + 'pattern' => '17n', + 'structure' => 'HRkk bbbb bbbc cccc cccc c', + ], + 'CY' => [ + 'length' => 28, + 'pattern' => '8n 16c', + 'structure' => 'CYkk bbbs ssss cccc cccc cccc cccc', + ], + 'CZ' => [ + 'length' => 24, + 'pattern' => '20n', + 'structure' => 'CZkk bbbb ssss sscc cccc cccc', + ], + 'DK' => [ + 'length' => 18, + 'pattern' => '14n', + 'structure' => 'DKkk bbbb cccc cccc cc', + ], + 'DO' => [ + 'length' => 28, + 'pattern' => '4a 20n', + 'structure' => 'DOkk bbbb cccc cccc cccc cccc cccc', + ], + 'EE' => [ + 'length' => 20, + 'pattern' => '16n', + 'structure' => 'EEkk bbss cccc cccc cccx', + ], + 'FO' => [ + 'length' => 18, + 'pattern' => '14n', + 'structure' => 'FOkk bbbb cccc cccc cx', + ], + 'FI' => [ + 'length' => 18, + 'pattern' => '14n', + 'structure' => 'FIkk bbbb bbcc cccc cx', + ], + 'FR' => [ + 'length' => 27, + 'pattern' => '10n 11c 2n', + 'structure' => 'FRkk bbbb bggg ggcc cccc cccc cxx', + ], + 'GE' => [ + 'length' => 22, + 'pattern' => '2c 16n', + 'structure' => 'GEkk bbcc cccc cccc cccc cc', + ], + 'DE' => [ + 'length' => 22, + 'pattern' => '18n', + 'structure' => 'DEkk bbbb bbbb cccc cccc cc', + ], + 'GI' => [ + 'length' => 23, + 'pattern' => '4a 15c', + 'structure' => 'GIkk bbbb cccc cccc cccc ccc', + ], + 'GR' => [ + 'length' => 27, + 'pattern' => '7n 16c', + 'structure' => 'GRkk bbbs sssc cccc cccc cccc ccc', + ], + 'GL' => [ + 'length' => 18, + 'pattern' => '14n', + 'structure' => 'GLkk bbbb cccc cccc cc', + ], + 'GT' => [ + 'length' => 28, + 'pattern' => '4c 20c', + 'structure' => 'GTkk bbbb cccc cccc cccc cccc cccc', + ], + 'HU' => [ + 'length' => 28, + 'pattern' => '24n', + 'structure' => 'HUkk bbbs sssk cccc cccc cccc cccx', + ], + 'IS' => [ + 'length' => 26, + 'pattern' => '22n', + 'structure' => 'ISkk bbbb sscc cccc iiii iiii ii', + ], + 'IE' => [ + 'length' => 22, + 'pattern' => '4c 14n', + 'structure' => 'IEkk aaaa bbbb bbcc cccc cc', + ], + 'IL' => [ + 'length' => 23, + 'pattern' => '19n', + 'structure' => 'ILkk bbbn nncc cccc cccc ccc', + ], + 'IT' => [ + 'length' => 27, + 'pattern' => '1a 10n 12c', + 'structure' => 'ITkk xbbb bbss sssc cccc cccc ccc', + ], + 'KZ' => [ + 'length' => 20, + 'pattern' => '3n 13c', + 'structure' => 'KZkk bbbc cccc cccc cccc', + ], + 'KW' => [ + 'length' => 30, + 'pattern' => '4a 22c', + 'structure' => 'KWkk bbbb cccc cccc cccc cccc cccc cc', + ], + 'LV' => [ + 'length' => 21, + 'pattern' => '4a 13c', + 'structure' => 'LVkk bbbb cccc cccc cccc c', + ], + 'LB' => [ + 'length' => 28, + 'pattern' => '4n 20c', + 'structure' => 'LBkk bbbb cccc cccc cccc cccc cccc', + ], + 'LI' => [ + 'length' => 21, + 'pattern' => '5n 12c', + 'structure' => 'LIkk bbbb bccc cccc cccc c', + ], + 'LT' => [ + 'length' => 20, + 'pattern' => '16n', + 'structure' => 'LTkk bbbb bccc cccc cccc', + ], + 'LU' => [ + 'length' => 20, + 'pattern' => '3n 13c', + 'structure' => 'LUkk bbbc cccc cccc cccc', + ], + 'MK' => [ + 'length' => 19, + 'pattern' => '3n 10c 2n', + 'structure' => 'MK07 bbbc cccc cccc cxx', + ], + 'MT' => [ + 'length' => 31, + 'pattern' => '4a 5n 18c', + 'structure' => 'MTkk bbbb ssss sccc cccc cccc cccc ccc', + ], + 'MR' => [ + 'length' => 27, + 'pattern' => '23n', + 'structure' => 'MRkk bbbb bsss sscc cccc cccc cxx', + ], + 'MU' => [ + 'length' => 30, + 'pattern' => '4a 19n 3a', + 'structure' => 'MUkk bbbb bbss cccc cccc cccc cccc cc', + ], + 'MC' => [ + 'length' => 27, + 'pattern' => '10n 11c 2n', + 'structure' => 'MCkk bbbb bsss sscc cccc cccc cxx', + ], + 'MD' => [ + 'length' => 24, + 'pattern' => '2c 18n', + 'structure' => 'MDkk bbcc cccc cccc cccc cccc', + ], + 'ME' => [ + 'length' => 22, + 'pattern' => '18n', + 'structure' => 'ME25 bbbc cccc cccc cccc xx', + ], + 'NL' => [ + 'length' => 18, + 'pattern' => '4a 10n', + 'structure' => 'NLkk bbbb cccc cccc cc', + ], + 'NO' => [ + 'length' => 15, + 'pattern' => '11n', + 'structure' => 'NOkk bbbb cccc ccx', + ], + 'PK' => [ + 'length' => 24, + 'pattern' => '4c 16n', + 'structure' => 'PKkk bbbb cccc cccc cccc cccc', + ], + 'PS' => [ + 'length' => 29, + 'pattern' => '4c 21n', + 'structure' => 'PSkk bbbb zzzz zzzz zccc cccc cccc c', + ], + 'PL' => [ + 'length' => 28, + 'pattern' => '24n', + 'structure' => 'PLkk bbbs sssx cccc cccc cccc cccc', + ], + 'PT' => [ + 'length' => 25, + 'pattern' => '21n', + 'structure' => 'PT50 bbbb ssss cccc cccc cccx x', + ], + 'RO' => [ + 'length' => 24, + 'pattern' => '4a 16c', + 'structure' => 'ROkk bbbb cccc cccc cccc cccc', + ], + 'SM' => [ + 'length' => 27, + 'pattern' => '1a 10n 12c', + 'structure' => 'SMkk xbbb bbss sssc cccc cccc ccc', + ], + 'SA' => [ + 'length' => 24, + 'pattern' => '2n 18c', + 'structure' => 'SAkk bbcc cccc cccc cccc cccc', + ], + 'RS' => [ + 'length' => 22, + 'pattern' => '18n', + 'structure' => 'RSkk bbbc cccc cccc cccc aa', + ], + 'SK' => [ + 'length' => 24, + 'pattern' => '20n', + 'structure' => 'SKkk bbbb ssss sscc cccc cccc', + ], + 'SI' => [ + 'length' => 19, + 'pattern' => '15n', + 'structure' => 'SI56 bbss sccc cccc cxx', + ], + 'ES' => [ + 'length' => 24, + 'pattern' => '20n', + 'structure' => 'ESkk bbbb ssss xxcc cccc cccc', + ], + 'SE' => [ + 'length' => 24, + 'pattern' => '20n', + 'structure' => 'SEkk bbbc cccc cccc cccc cccc', + ], + 'CH' => [ + 'length' => 21, + 'pattern' => '5n 12c', + 'structure' => 'CHkk bbbb bccc cccc cccc c', + ], + 'TN' => [ + 'length' => 24, + 'pattern' => '20n', + 'structure' => 'TNkk bbss sccc cccc cccc cccc', + ], + 'TR' => [ + 'length' => 26, + 'pattern' => '5n 17c', + 'structure' => 'TRkk bbbb b0cc cccc cccc cccc cc', + ], + 'AE' => [ + 'length' => 23, + 'pattern' => '3n 16n', + 'structure' => 'AEkk bbbc cccc cccc cccc ccc', + ], + 'GB' => [ + 'length' => 22, + 'pattern' => '4a 14n', + 'structure' => 'GBkk bbbb ssss sscc cccc cc', + ], + 'VG' => [ + 'length' => 24, + 'pattern' => '4c 16n', + 'structure' => 'VGkk bbbb cccc cccc cccc cccc', + ], + ]; + + protected static $parsers = [ + 'b' => 'bank_code', + 's' => 'branch_code', + 'c' => 'account_number', + 'd' => 'account_type', + 'i' => 'id', + 'k' => 'check_digits', + 'x' => 'national_check_digits', + ]; + + /** + * @var string + */ + protected $iban; + /** + * @var string + */ + protected $nation; + /** + * @var string + */ + protected $bank_code; + /** + * @var string + */ + protected $branch_code; + /** + * @var string + */ + protected $account_number; + /** + * @var string + */ + protected $account_type; + /** + * @var string + */ + protected $id; + /** + * @var string + */ + protected $check_digits; + /** + * @var string + */ + protected $national_check_digits; + + public function __construct($iban) + { + $iban = str_replace(' ', '', $iban); + $this->iban = $iban; + + $this->nation = $nation = substr($iban, 0, 2); + $info = self::$countries[$nation]; + + $structure = $info['structure']; + $structure = str_replace(' ', '', $structure); + + $regex = $nation; + $keys = array_keys(self::$parsers); + + $length = strlen($this->iban); + $current = strlen($nation); + while ($current <= $length) { + $char = $structure[$current]; + if (in_array($char, $keys)) { + $count = substr_count($structure, $char); + $regex .= '(?<'.self::$parsers[$char].'>[A-Z0-9]{'.$count.'})'; + $current += $count; + } else { + $regex .= $char; + ++$current; + } + } + + preg_match_all('/^'.$regex.'/', $iban, $matches); + $matches = array_filter($matches, 'is_string', ARRAY_FILTER_USE_KEY); + foreach ($matches as $key => $value) { + if (empty($value[0])) { + throw new UnexpectedValueException('Invalid '.$key.' for format '.$regex); + } + + $this->{$key} = $value[0]; + } + } + + public static function generate($contents = []) + { + $nation = $contents['nation']; + $info = self::$countries[$nation]; + + $structure = $info['structure']; + $structure = str_replace(' ', '', $structure); + + $keys = array_keys(self::$parsers); + + $length = strlen($structure); + $current = strlen($nation); + $result = $nation; + while ($current <= $length) { + $char = $structure[$current]; + if (in_array($char, $keys)) { + $count = substr_count($structure, $char); + $result .= str_pad($contents[self::$parsers[$char]], $count, STR_PAD_LEFT); + $current += $count; + } else { + $result .= $char; + ++$current; + } + } + + return new self($result); + } + + /** + * @return string + */ + public function getIban() + { + return $this->iban; + } + + /** + * @return string + */ + public function getNation() + { + return $this->nation; + } + + /** + * @return string + */ + public function getBankCode() + { + return $this->bank_code; + } + + /** + * @return string + */ + public function getBranchCode() + { + return $this->branch_code; + } + + /** + * @return string + */ + public function getAccountNumber() + { + return $this->account_number; + } + + /** + * @return string + */ + public function getAccountType() + { + return $this->account_type; + } + + /** + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ + public function getCheckDigits() + { + return $this->check_digits; + } + + /** + * @return string + */ + public function getNationalCheckDigits() + { + return $this->national_check_digits; + } +} diff --git a/modules/fatture/buttons.php b/modules/fatture/buttons.php index 300cc3504..a0c63fcb4 100755 --- a/modules/fatture/buttons.php +++ b/modules/fatture/buttons.php @@ -68,7 +68,8 @@ $totale_scadenze = $dbo->fetchOne('SELECT SUM(da_pagare - pagato) AS differenza, if (!empty($record['is_fiscale'])) { // Aggiunta insoluto $registrazione_insoluto = 0; - if (!empty($record['riba']) && $dir == 'entrata' && in_array($record['stato'], ['Emessa', 'Parzialmente pagato', 'Pagato'])) { + $pagamento = $fattura->pagamento; + if ($pagamento->isRiBa() && $dir == 'entrata' && in_array($record['stato'], ['Emessa', 'Parzialmente pagato', 'Pagato'])) { $registrazione_insoluto = 1; } diff --git a/modules/fatture/init.php b/modules/fatture/init.php index d10f5bd23..67b497cb4 100755 --- a/modules/fatture/init.php +++ b/modules/fatture/init.php @@ -46,7 +46,6 @@ if (isset($id_record)) { co_documenti.split_payment AS split_payment, co_statidocumento.descrizione AS `stato`, co_tipidocumento.descrizione AS `descrizione_tipo`, - co_pagamenti.riba AS `riba`, (SELECT is_fiscale FROM zz_segments WHERE id = id_segment) AS is_fiscale, (SELECT descrizione FROM co_ritenutaacconto WHERE id=idritenutaacconto) AS ritenutaacconto_desc, (SELECT descrizione FROM co_rivalse WHERE id=idrivalsainps) AS rivalsainps_desc, diff --git a/modules/fatture/src/Fattura.php b/modules/fatture/src/Fattura.php index 2f5406924..dc22562eb 100755 --- a/modules/fatture/src/Fattura.php +++ b/modules/fatture/src/Fattura.php @@ -704,9 +704,9 @@ class Fattura extends Document */ public function getBanca() { - $riba = database()->fetchOne('SELECT riba FROM co_pagamenti WHERE id ='.prepare($this->idpagamento)); + $pagamento = $this->pagamento; - if ($riba['riba'] == 1) { + if ($pagamento->isRiBa()) { $banca = Banca::where('id_anagrafica', $this->idanagrafica) ->where('predefined', 1) ->first(); diff --git a/modules/pagamenti/actions.php b/modules/pagamenti/actions.php index 3cf52c443..597875fd5 100755 --- a/modules/pagamenti/actions.php +++ b/modules/pagamenti/actions.php @@ -48,7 +48,6 @@ switch (filter('op')) { 'giorno' => $giorno, 'prc' => post('percentuale')[$key], 'descrizione' => $descrizione, - 'riba' => post('riba'), 'idconto_vendite' => post('idconto_vendite'), 'idconto_acquisti' => post('idconto_acquisti'), 'codice_modalita_pagamento_fe' => post('codice_modalita_pagamento_fe'), diff --git a/modules/pagamenti/edit.php b/modules/pagamenti/edit.php index d37d748ba..7582c6709 100755 --- a/modules/pagamenti/edit.php +++ b/modules/pagamenti/edit.php @@ -31,16 +31,12 @@ include_once __DIR__.'/../../core.php';
-
+
{[ "type": "text", "label": "", "name": "descrizione", "value": "$descrizione$", "required": 1 ]}
- {[ "type": "select", "label": "", "name": "codice_modalita_pagamento_fe", "value": "$codice_modalita_pagamento_fe$", "values": "query=SELECT codice as id, CONCAT(codice, ' - ', descrizione) AS descrizione FROM fe_modalita_pagamento", "required": 1 ]} -
- -
- {[ "type": "checkbox", "label": "", "name": "riba", "value": "$riba$", "help": "" ]} + {[ "type": "select", "label": "", "name": "codice_modalita_pagamento_fe", "value": "$codice_modalita_pagamento_fe$", "values": "query=SELECT codice as id, CONCAT(codice, ' - ', descrizione) AS descrizione FROM fe_modalita_pagamento", "required": 1, "help": "" ]}
diff --git a/modules/pagamenti/src/Pagamento.php b/modules/pagamenti/src/Pagamento.php index ca7542c71..b118199d7 100755 --- a/modules/pagamenti/src/Pagamento.php +++ b/modules/pagamenti/src/Pagamento.php @@ -111,4 +111,12 @@ class Pagamento extends Model return $results; } + + /** + * @return bool + */ + public function isRiBa() + { + return $this->codice_modalita_pagamento_fe == 'MP12'; + } } diff --git a/update/2_4_23.sql b/update/2_4_23.sql index 9c6d4e562..377b2df01 100644 --- a/update/2_4_23.sql +++ b/update/2_4_23.sql @@ -152,3 +152,7 @@ ALTER TABLE `or_righe_ordini` ADD `ora_evasione` TIME NULL AFTER `data_evasione` -- Aggiunta indice sull'id preventivo per velocizzare il caricamento del rif. numero fattura in vista preventivi ALTER TABLE `co_righe_documenti` ADD INDEX(`idpreventivo`); + +-- Correzione per segmenti con pagamenti RiBa per Scadenzario +UPDATE `zz_segments` SET `clause` = REPLACE(`clause`, 'co_pagamenti.riba=1', 'co_pagamenti.codice_modalita_pagamento_fe= ''MP12'''); +ALTER TABLE `co_pagamenti` DROP `riba`; From 6c5c5812af61f3bc691143bf22fea934a92e84d2 Mon Sep 17 00:00:00 2001 From: MatteoPistorello Date: Tue, 20 Apr 2021 10:27:41 +0200 Subject: [PATCH 2/5] Fix row list preventivi --- modules/preventivi/row-list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/preventivi/row-list.php b/modules/preventivi/row-list.php index 6a48db3f1..bf4f6f09d 100755 --- a/modules/preventivi/row-list.php +++ b/modules/preventivi/row-list.php @@ -333,7 +333,7 @@ $(document).ready(function() { dropOnEmpty: true, scroll: true, update: function(event, ui) { - let order = $(".table tr[data-id]").toArray().map(a => $(a).data("id")) + let order = $(".table .sortable tr[data-id]").toArray().map(a => $(a).data("id")) $.post(globals.rootdir + "/actions.php", { id: ui.item.data("id"), From dc0414ec008f27238849c341707264a07d47661f Mon Sep 17 00:00:00 2001 From: MatteoPistorello Date: Tue, 20 Apr 2021 16:25:20 +0200 Subject: [PATCH 3/5] Aggiunto duplicazione template --- modules/emails/actions.php | 13 +++++++++++++ modules/emails/buttons.php | 31 +++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 modules/emails/buttons.php diff --git a/modules/emails/actions.php b/modules/emails/actions.php index b8d8305a6..cf4d434b2 100755 --- a/modules/emails/actions.php +++ b/modules/emails/actions.php @@ -58,5 +58,18 @@ switch (post('op')) { flash()->info(tr('Template delle email eliminato!')); + break; + + case 'copy': + $dbo->query('CREATE TEMPORARY TABLE tmp SELECT * FROM em_templates WHERE id= '.prepare($id_record)); + $dbo->query('ALTER TABLE tmp DROP id'); + $dbo->query('INSERT INTO em_templates SELECT NULL,tmp. * FROM tmp'); + $id_record = $dbo->lastInsertedID(); + $dbo->query('DROP TEMPORARY TABLE tmp'); + + $dbo->query('UPDATE em_templates SET name = CONCAT (name, " (copia)") WHERE id = '.prepare($id_record)); + + flash()->info(tr('Template duplicato correttamente!')); + break; } diff --git a/modules/emails/buttons.php b/modules/emails/buttons.php new file mode 100644 index 000000000..578483a8b --- /dev/null +++ b/modules/emails/buttons.php @@ -0,0 +1,31 @@ +. + */ + +include_once __DIR__.'/../../core.php'; + +echo' +'; + +// Duplica template +echo ' +
+ + +
'; + From 132f1734588bade3703c2a4f2ed7083a305aabf4 Mon Sep 17 00:00:00 2001 From: MatteoPistorello Date: Tue, 20 Apr 2021 16:25:55 +0200 Subject: [PATCH 4/5] Aggiunto filtro clienti in contratti --- CHANGELOG.md | 2 ++ update/2_4_23.sql | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb38e54c9..e5ae853f9 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,8 @@ Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://k ### Aggiunto (Added) - Nuovo *Sconto finale* per gli **Ordini**, **Preventivi**, **DDT** e **Contratti**, influenza il valore *Netto a pagare* del documento. - Nuovo filtro in attività per mostrare al tecnico solo le attività assegnate. + - Nuovo filtro in contratti per mostrare al cliente solo i contratti collegati. + - Nuovo pulsante **Duplica Template** per copiare un template già esistente. ## 2.4.22 diff --git a/update/2_4_23.sql b/update/2_4_23.sql index 477d5f386..7013e3e62 100644 --- a/update/2_4_23.sql +++ b/update/2_4_23.sql @@ -162,3 +162,6 @@ INSERT INTO `zz_prints` (`id_module`, `is_record`, `name`, `title`, `filename`, -- Correzione per segmenti con pagamenti RiBa per Scadenzario UPDATE `zz_segments` SET `clause` = REPLACE(`clause`, 'co_pagamenti.riba=1', 'co_pagamenti.codice_modalita_pagamento_fe= ''MP12'''); ALTER TABLE `co_pagamenti` DROP `riba`; + +-- Aggiunto filtro in contratti per i clienti +INSERT INTO `zz_group_module` (`idgruppo`, `idmodule`, `name`, `clause`, `position`, `enabled`, `default`) VALUES(4, 31, 'Mostra i contratti ai clienti coivolti', 'co_contratti.idanagrafica=|id_anagrafica|', 'WHR', 1, 1); \ No newline at end of file From b657da9e722bbc71ea2cf0ff632fac12d436677f Mon Sep 17 00:00:00 2001 From: MatteoPistorello Date: Tue, 20 Apr 2021 17:12:04 +0200 Subject: [PATCH 5/5] Importazione campo referente in tutti i documenti --- modules/contratti/actions.php | 1 + modules/ddt/actions.php | 1 + modules/fatture/actions.php | 1 + modules/interventi/actions.php | 1 + modules/ordini/actions.php | 1 + 5 files changed, 5 insertions(+) diff --git a/modules/contratti/actions.php b/modules/contratti/actions.php index 957824e4e..2c1aca8b9 100644 --- a/modules/contratti/actions.php +++ b/modules/contratti/actions.php @@ -475,6 +475,7 @@ $riga = $contratto->getRiga($type, $id_riga); $contratto->descrizione = $documento->descrizione; $contratto->esclusioni = $documento->esclusioni; + $contratto->idreferente = $documento->idreferente; $contratto->save(); diff --git a/modules/ddt/actions.php b/modules/ddt/actions.php index 553fe73c8..db26f8252 100755 --- a/modules/ddt/actions.php +++ b/modules/ddt/actions.php @@ -326,6 +326,7 @@ switch (post('op')) { $ddt->idsede_destinazione = $id_sede; $ddt->idcausalet = post('id_causale_trasporto'); + $ddt->idreferente = $documento->idreferente; $ddt->save(); diff --git a/modules/fatture/actions.php b/modules/fatture/actions.php index 4ee747767..d44d92871 100755 --- a/modules/fatture/actions.php +++ b/modules/fatture/actions.php @@ -697,6 +697,7 @@ switch (post('op')) { $fattura->idsede_destinazione = $documento->idsede; $fattura->id_ritenuta_contributi = post('id_ritenuta_contributi') ?: null; + $fattura->idreferente = $documento->idreferente; $fattura->save(); diff --git a/modules/interventi/actions.php b/modules/interventi/actions.php index 8f5286f2f..ddc98f1ee 100644 --- a/modules/interventi/actions.php +++ b/modules/interventi/actions.php @@ -421,6 +421,7 @@ switch (post('op')) { $intervento->codice_cup = $documento->codice_cup; $intervento->codice_cig = $documento->codice_cig; $intervento->num_item = $documento->num_item; + $intervento->idreferente = $documento->idreferente; $intervento->save(); diff --git a/modules/ordini/actions.php b/modules/ordini/actions.php index d79e6afb9..e912c4e9c 100755 --- a/modules/ordini/actions.php +++ b/modules/ordini/actions.php @@ -397,6 +397,7 @@ switch (post('op')) { $ordine->codice_cup = $documento->codice_cup; $ordine->codice_cig = $documento->codice_cig; $ordine->num_item = $documento->num_item; + $ordine->idreferente = $documento->idreferente; $ordine->save();