2017-08-04 16:28:16 +02:00
|
|
|
<?php
|
2020-09-07 15:04:06 +02:00
|
|
|
/*
|
|
|
|
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
2021-01-20 15:08:51 +01:00
|
|
|
* Copyright (C) DevCode s.r.l.
|
2020-09-07 15:04:06 +02:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2017-09-08 18:19:39 +02:00
|
|
|
include_once __DIR__.'/info.php';
|
2017-09-10 14:35:41 +02:00
|
|
|
|
2017-09-12 11:49:39 +02:00
|
|
|
// Retrocompatibilità con le stampe gestite da HTML2PDF
|
2018-02-04 17:26:25 +01:00
|
|
|
$replaces['default_header'] = str_replace(['{PAGENO}', '{nb}'], ['[[page_cu]]', '[[page_nb]]'], $replaces['default_header']);
|
|
|
|
|
|
|
|
$replaces['footer'] = str_replace(['{PAGENO}', '{nb}'], ['[[page_cu]]', '[[page_nb]]'], $replaces['footer']);
|
|
|
|
$replaces['default_footer'] = str_replace(['{PAGENO}', '{nb}'], ['[[page_cu]]', '[[page_nb]]'], $replaces['default_footer']);
|
2017-09-10 14:35:41 +02:00
|
|
|
|
|
|
|
$prefixes = [
|
|
|
|
'c_',
|
|
|
|
'f_',
|
|
|
|
];
|
|
|
|
|
|
|
|
foreach ($prefixes as $prefix) {
|
|
|
|
if ($replaces[$prefix.'piva'] != $replaces[$prefix.'codicefiscale']) {
|
|
|
|
$replaces[$prefix.'piva'] = !empty($replaces[$prefix.'piva']) ? 'P.Iva: '.$replaces[$prefix.'piva'] : '';
|
|
|
|
$replaces[$prefix.'codicefiscale'] = !empty($replaces[$prefix.'codicefiscale']) ? 'C.F.: '.$replaces[$prefix.'codicefiscale'] : '';
|
|
|
|
} else {
|
|
|
|
$replaces[$prefix.'piva'] = !empty($replaces[$prefix.'piva']) ? 'P.Iva/C.F.: '.$replaces[$prefix.'piva'] : '';
|
|
|
|
$replaces[$prefix.'codicefiscale'] = '';
|
|
|
|
}
|
2019-05-10 06:32:06 +02:00
|
|
|
|
|
|
|
$replaces[$prefix.'codice_destinatario'] = !empty($replaces[$prefix.'codice_destinatario']) ? 'Cod.Fatturazione: '.$replaces[$prefix.'codice_destinatario'] : '';
|
2017-09-10 14:35:41 +02:00
|
|
|
$replaces[$prefix.'capsoc'] = !empty($replaces[$prefix.'capsoc']) ? 'Cap.Soc.: '.$replaces[$prefix.'capsoc'] : '';
|
|
|
|
$replaces[$prefix.'sitoweb'] = !empty($replaces[$prefix.'sitoweb']) ? 'Web: '.$replaces[$prefix.'sitoweb'] : '';
|
|
|
|
$replaces[$prefix.'telefono'] = !empty($replaces[$prefix.'telefono']) ? 'Tel: '.$replaces[$prefix.'telefono'] : '';
|
|
|
|
$replaces[$prefix.'fax'] = !empty($replaces[$prefix.'fax']) ? 'Fax: '.$replaces[$prefix.'fax'] : '';
|
|
|
|
$replaces[$prefix.'cellulare'] = !empty($replaces[$prefix.'cellulare']) ? 'Cell: '.$replaces[$prefix.'cellulare'] : '';
|
|
|
|
$replaces[$prefix.'email'] = !empty($replaces[$prefix.'email']) ? 'Email: '.$replaces[$prefix.'email'] : '';
|
|
|
|
$replaces[$prefix.'codiceiban'] = !empty($replaces[$prefix.'codiceiban']) ? 'IBAN: '.$replaces[$prefix.'codiceiban'] : '';
|
2019-01-10 18:41:25 +01:00
|
|
|
$replaces[$prefix.'pec'] = !empty($replaces[$prefix.'pec']) ? 'PEC: '.$replaces[$prefix.'pec'] : '';
|
|
|
|
|
2017-09-10 14:35:41 +02:00
|
|
|
foreach ($replaces as $key => $value) {
|
2020-10-29 16:48:37 +01:00
|
|
|
if (string_starts_with($key, $prefix)) {
|
2017-09-10 14:35:41 +02:00
|
|
|
$replaces[$key] = empty($value) ? $value : $value.'<br/>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|