mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
Miglioramento dati FE per righe di fattura
This commit is contained in:
56
include/common/fe_components/altri_dati.php
Normal file
56
include/common/fe_components/altri_dati.php
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// Altri dati gestionali
|
||||||
|
echo '
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
'.str_repeat($space, 3).'2.2.1.16 AltriDatiGestionali - '.tr('Riga _NUM_', [
|
||||||
|
'_NUM_' => $key,
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($key == 1) {
|
||||||
|
echo '
|
||||||
|
<button type="button" class="btn btn-xs btn-info pull-right" onclick="add_altri_dati(this)" id="add-altri_dati">
|
||||||
|
<i class="fa fa-plus"></i> '.tr('Aggiungi').'
|
||||||
|
</button>';
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
|
// Tipo Dato
|
||||||
|
echo '
|
||||||
|
<tr>
|
||||||
|
<td style="vertical-align: middle;">'.str_repeat($space, 4).'2.2.1.16.1 TipoDato</td>
|
||||||
|
<td>
|
||||||
|
{[ "type": "text", "name": "altri_dati['.$key.'][tipo_dato]", "value": "'.$dato['tipo_dato'].'", "maxlength": 20 ]}
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
|
// Riferimento Testo
|
||||||
|
echo '
|
||||||
|
<tr>
|
||||||
|
<td style="vertical-align: middle;">'.str_repeat($space, 4).'2.2.1.16.2 RiferimentoTesto</td>
|
||||||
|
<td>
|
||||||
|
{[ "type": "text", "name": "altri_dati['.$key.'][riferimento_testo]", "value": "'.$dato['riferimento_testo'].'", "maxlength": 20 ]}
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
|
// Riferimento Numero
|
||||||
|
echo '
|
||||||
|
<tr>
|
||||||
|
<td style="vertical-align: middle;">'.str_repeat($space, 4).'2.2.1.16.3 RiferimentoNumero</td>
|
||||||
|
<td>
|
||||||
|
{[ "type": "number", "name": "altri_dati['.$key.'][riferimento_numero]", "value": "'.$dato['tipo_dato'].'", "maxlength": 20 ]}
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
|
// Riferimento Data
|
||||||
|
echo '
|
||||||
|
<tr id="last-altri_dati-'.$key.'">
|
||||||
|
<td style="vertical-align: middle;">'.str_repeat($space, 4).'2.2.1.16.4 RiferimentoData</td>
|
||||||
|
<td>
|
||||||
|
{[ "type": "date", "name": "altri_dati['.$key.'][riferimento_data]", "value": "'.$dato['tipo_dato'].'", "maxlength": 20 ]}
|
||||||
|
</td>
|
||||||
|
</tr>';
|
@@ -92,70 +92,3 @@ echo '
|
|||||||
{[ "type": "number", "label": "'.tr('Sconto unitario').'", "name": "sconto", "value": "'.$result['sconto_unitario'].'", "icon-after": "choice|untprc|'.$result['tipo_sconto'].'", "help": "'.tr('Il valore positivo indica uno sconto. Per applicare un rincaro inserire un valore negativo.').'" ]}
|
{[ "type": "number", "label": "'.tr('Sconto unitario').'", "name": "sconto", "value": "'.$result['sconto_unitario'].'", "icon-after": "choice|untprc|'.$result['tipo_sconto'].'", "help": "'.tr('Il valore positivo indica uno sconto. Per applicare un rincaro inserire un valore negativo.').'" ]}
|
||||||
</div>
|
</div>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
if ($module['name'] == 'Fatture di vendita') {
|
|
||||||
$collapsed = empty($result['data_inizio_periodo']) && empty($result['data_fine_periodo']) && empty($result['riferimento_amministrazione']);
|
|
||||||
|
|
||||||
echo '
|
|
||||||
<div class="box box-info '.($collapsed ? 'collapsed-box' : '').'">
|
|
||||||
<div class="box-header with-border">
|
|
||||||
<h3 class="box-title">'.tr('Dati Fatturazione Elettronica').'</h3>
|
|
||||||
<div class="box-tools pull-right">
|
|
||||||
<button type="button" class="btn btn-box-tool" data-widget="collapse">
|
|
||||||
<i class="fa fa-plus"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="box-body">';
|
|
||||||
|
|
||||||
$tipi_cessione_prestazione = [
|
|
||||||
[
|
|
||||||
'id' => 'SC',
|
|
||||||
'text' => 'SC - '.tr('Sconto'),
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'id' => 'PR',
|
|
||||||
'text' => 'PR - '.tr('Premio'),
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'id' => 'AB',
|
|
||||||
'text' => 'AB - '.tr('Abbuono'),
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'id' => 'AC',
|
|
||||||
'text' => 'AC - '.tr('Spesa accessoria'),
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
// Data inizio periodo
|
|
||||||
echo '
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6">
|
|
||||||
{[ "type": "select", "label": "'.tr('Tipo Cessione Prestazione').'", "name": "tipo_cessione_prestazione", "value": "'.$result['tipo_cessione_prestazione'].'", "values": '.json_encode($tipi_cessione_prestazione).' ]}
|
|
||||||
</div>';
|
|
||||||
|
|
||||||
// Riferimento amministrazione
|
|
||||||
echo '
|
|
||||||
<div class="col-md-6">
|
|
||||||
{[ "type": "text", "label": "'.tr('Riferimento Amministrazione').'", "name": "riferimento_amministrazione", "value": "'.$result['riferimento_amministrazione'].'", "maxlength": 20 ]}
|
|
||||||
</div>
|
|
||||||
</div>';
|
|
||||||
|
|
||||||
// Data inizio periodo
|
|
||||||
echo '
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6">
|
|
||||||
{[ "type": "date", "label": "'.tr('Data Inizio Periodo').'", "name": "data_inizio_periodo", "value": "'.$result['data_inizio_periodo'].'" ]}
|
|
||||||
</div>';
|
|
||||||
|
|
||||||
// Data fine periodo
|
|
||||||
echo '
|
|
||||||
<div class="col-md-6">
|
|
||||||
{[ "type": "date", "label": "'.tr('Data Fine Periodo').'", "name": "data_fine_periodo", "value": "'.$result['data_fine_periodo'].'" ]}
|
|
||||||
</div>
|
|
||||||
</div>';
|
|
||||||
|
|
||||||
echo '
|
|
||||||
</div>
|
|
||||||
</div>';
|
|
||||||
}
|
|
||||||
|
118
include/common/riga_fe.php
Normal file
118
include/common/riga_fe.php
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$tipi_cessione_prestazione = [
|
||||||
|
[
|
||||||
|
'id' => 'SC',
|
||||||
|
'text' => 'SC - '.tr('Sconto'),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'id' => 'PR',
|
||||||
|
'text' => 'PR - '.tr('Premio'),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'id' => 'AB',
|
||||||
|
'text' => 'AB - '.tr('Abbuono'),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'id' => 'AC',
|
||||||
|
'text' => 'AC - '.tr('Spesa accessoria'),
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
$space = str_repeat(' ', 6);
|
||||||
|
|
||||||
|
echo '
|
||||||
|
<table class="table">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th colspan="2">2 FatturaElettronicaBody</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th colspan="2">'.str_repeat($space, 1).'2.2 DatiBeniServizi</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th colspan="2">'.str_repeat($space, 2).'2.2.1 DettaglioLinee</th>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
|
// Tipo Cessione Prestazione
|
||||||
|
echo '
|
||||||
|
<tr>
|
||||||
|
<td style="vertical-align: middle;">'.str_repeat($space, 3).'2.2.1.2 TipoCessionePrestazione</td>
|
||||||
|
<td>
|
||||||
|
{[ "type": "select", "name": "tipo_cessione_prestazione", "value": "'.$result['tipo_cessione_prestazione'].'", "values": '.json_encode($tipi_cessione_prestazione).' ]}
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
|
// Data inizio periodo
|
||||||
|
echo '
|
||||||
|
<tr>
|
||||||
|
<td style="vertical-align: middle;">'.str_repeat($space, 3).'2.2.1.7 DataInizioPeriodo</td>
|
||||||
|
<td>
|
||||||
|
{[ "type": "date", "name": "data_inizio_periodo", "value": "'.$result['data_inizio_periodo'].'" ]}
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
|
// Data fine periodo
|
||||||
|
echo '
|
||||||
|
<tr>
|
||||||
|
<td style="vertical-align: middle;">'.str_repeat($space, 3).'2.2.1.8 DataFinePeriodo</td>
|
||||||
|
<td>
|
||||||
|
{[ "type": "date", "name": "data_fine_periodo", "value": "'.$result['data_fine_periodo'].'" ]}
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
|
// Riferimento amministrazione
|
||||||
|
echo '
|
||||||
|
<tr>
|
||||||
|
<td style="vertical-align: middle;">'.str_repeat($space, 3).'2.2.1.15 RiferimentoAmministrazione</td>
|
||||||
|
<td>
|
||||||
|
{[ "type": "text", "name": "riferimento_amministrazione", "value": "'.$result['riferimento_amministrazione'].'", "maxlength": 20 ]}
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
|
if (empty($result['altri_dati'])) {
|
||||||
|
$result['altri_dati'][] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$key = 1;
|
||||||
|
foreach ($result['altri_dati'] as $dato) {
|
||||||
|
include __DIR__.'/fe_components/altri_dati.php';
|
||||||
|
|
||||||
|
++$key;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '
|
||||||
|
</tbody>
|
||||||
|
</table>';
|
||||||
|
|
||||||
|
echo '
|
||||||
|
<script>
|
||||||
|
function replaceAll(str, find, replace) {
|
||||||
|
return str.replace(new RegExp(find, "g"), replace);
|
||||||
|
}
|
||||||
|
|
||||||
|
var n = '.($key - 1).';
|
||||||
|
function add_altri_dati(btn){
|
||||||
|
$("#template .superselect, #template .superselectajax").select2().select2("destroy");
|
||||||
|
var last = $(btn).closest("table").find("tr[id^=last-altri_dati]").last();
|
||||||
|
|
||||||
|
n++;
|
||||||
|
var text = replaceAll($("#altri_dati-templace").html(), "-id-", "" + n);
|
||||||
|
|
||||||
|
last.after(text);
|
||||||
|
console.log(text);
|
||||||
|
|
||||||
|
start_superselect();
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<table class="hide">
|
||||||
|
<tbody id="altri_dati-templace">';
|
||||||
|
$dato = [];
|
||||||
|
$key = '-id-';
|
||||||
|
|
||||||
|
include __DIR__.'/fe_components/altri_dati.php';
|
||||||
|
|
||||||
|
echo '
|
||||||
|
</tbody>
|
||||||
|
</table>';
|
36
lib/util.php
36
lib/util.php
@@ -45,6 +45,42 @@ if (!function_exists('array_clean')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!function_exists('array_deep_clean')) {
|
||||||
|
/**
|
||||||
|
* Pulisce i contenuti vuoti di un array.
|
||||||
|
*
|
||||||
|
* @param $array
|
||||||
|
*
|
||||||
|
* @since 2.4.11
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function array_deep_clean($input)
|
||||||
|
{
|
||||||
|
// If it is an element, then just return it
|
||||||
|
if (!is_array($input)) {
|
||||||
|
return $input;
|
||||||
|
}
|
||||||
|
|
||||||
|
$non_empty_items = [];
|
||||||
|
|
||||||
|
foreach ($input as $key => $value) {
|
||||||
|
// Ignore empty cells
|
||||||
|
if ($value) {
|
||||||
|
$cleaned = array_deep_clean($value);
|
||||||
|
|
||||||
|
// Use recursion to evaluate cells
|
||||||
|
if (!empty($cleaned)) {
|
||||||
|
$non_empty_items[$key] = $cleaned;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Finally return the array without empty items
|
||||||
|
return $non_empty_items;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!function_exists('starts_with')) {
|
if (!function_exists('starts_with')) {
|
||||||
/**
|
/**
|
||||||
* Check if a string starts with the given string.
|
* Check if a string starts with the given string.
|
||||||
|
@@ -323,6 +323,36 @@ switch (post('op')) {
|
|||||||
// Ricalcolo inps, ritenuta e bollo
|
// Ricalcolo inps, ritenuta e bollo
|
||||||
ricalcola_costiagg_fattura($id_record);
|
ricalcola_costiagg_fattura($id_record);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 'manage_dati_fe':
|
||||||
|
$id_riga = post('idriga');
|
||||||
|
if ($id_riga != null) {
|
||||||
|
$riga = Articolo::find($id_riga) ?: Riga::find($id_riga);
|
||||||
|
$riga = $riga ?: Descrizione::find($id_riga);
|
||||||
|
$riga = $riga ?: Sconto::find($id_riga);
|
||||||
|
|
||||||
|
$data = Filter::getPOST();
|
||||||
|
|
||||||
|
$ignore = [
|
||||||
|
'id_plugin',
|
||||||
|
'id_module',
|
||||||
|
'id_record',
|
||||||
|
'backto',
|
||||||
|
'hash',
|
||||||
|
'op',
|
||||||
|
'idriga',
|
||||||
|
'dir',
|
||||||
|
];
|
||||||
|
foreach ($ignore as $name) {
|
||||||
|
unset($data[$name]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$riga->dati_aggiuntivi_fe = $data;
|
||||||
|
$riga->save();
|
||||||
|
|
||||||
|
flash()->info(tr('Dati FE aggiornati correttamente!'));
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'manage_sconto':
|
case 'manage_sconto':
|
||||||
|
23
modules/fatture/row-fe.php
Normal file
23
modules/fatture/row-fe.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Modules\Fatture\Fattura;
|
||||||
|
|
||||||
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
|
$documento = Fattura::find($id_record);
|
||||||
|
|
||||||
|
// Impostazioni per la gestione
|
||||||
|
$options = [
|
||||||
|
'op' => 'manage_dati_fe',
|
||||||
|
'action' => 'edit',
|
||||||
|
'dir' => $documento->direzione,
|
||||||
|
];
|
||||||
|
|
||||||
|
// Dati della riga
|
||||||
|
$id_riga = get('idriga');
|
||||||
|
$riga = $documento->getRighe()->find($id_riga);
|
||||||
|
|
||||||
|
$result = $riga->toArray();
|
||||||
|
$result = array_merge($result, $riga->dati_aggiuntivi_fe);
|
||||||
|
|
||||||
|
echo App::load('riga_fe.php', $result, $options);
|
@@ -262,9 +262,17 @@ foreach ($righe as $row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
<a class='btn btn-xs btn-warning' title='Modifica questa riga...' onclick=\"launch_modal( 'Modifica riga', '".$structure->fileurl('row-edit.php').'?id_module='.$id_module.'&id_record='.$id_record.'&idriga='.$riga['id']."', 1 );\"><i class='fa fa-edit'></i></a>
|
<a class='btn btn-xs btn-info' data-toggle='modal' data-title='".tr('Dati Fattura Elettronica')."' data-href='".$structure->fileurl('row-fe.php').'?id_module='.$id_module.'&id_record='.$id_record.'&idriga='.$riga['id']."'>
|
||||||
|
<i class='fa fa-file-code-o '></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
<a class='btn btn-xs btn-danger' title='Rimuovi questa riga...' onclick=\"if( confirm('Rimuovere questa riga dalla fattura?') ){ $('#delete-form-".$riga['id']."').submit(); }\"><i class='fa fa-trash'></i></a>
|
<a class='btn btn-xs btn-warning' title='Modifica questa riga...' onclick=\"launch_modal( 'Modifica riga', '".$structure->fileurl('row-edit.php').'?id_module='.$id_module.'&id_record='.$id_record.'&idriga='.$riga['id']."', 1 );\">
|
||||||
|
<i class='fa fa-edit'></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a class='btn btn-xs btn-danger' title='Rimuovi questa riga...' onclick=\"if( confirm('Rimuovere questa riga dalla fattura?') ){ $('#delete-form-".$riga['id']."').submit(); }\">
|
||||||
|
<i class='fa fa-trash'></i>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</form>";
|
</form>";
|
||||||
}
|
}
|
||||||
|
@@ -34,6 +34,29 @@ trait RelationTrait
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Restituisce i dati aggiuntivi per la fattura elettronica dell'elemento.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getDatiAggiuntiviFEAttribute()
|
||||||
|
{
|
||||||
|
$result = json_decode($this->attributes['dati_aggiuntivi_fe'], true);
|
||||||
|
|
||||||
|
return (array) $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Imposta i dati aggiuntivi per la fattura elettronica dell'elemento.
|
||||||
|
*/
|
||||||
|
public function setDatiAggiuntiviFEAttribute($values)
|
||||||
|
{
|
||||||
|
$values = (array) $values;
|
||||||
|
$dati = array_deep_clean($values);
|
||||||
|
|
||||||
|
$this->attributes['dati_aggiuntivi_fe'] = json_encode($dati);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restituisce il totale (imponibile + iva + rivalsa_inps + iva_rivalsainps) dell'elemento.
|
* Restituisce il totale (imponibile + iva + rivalsa_inps + iva_rivalsainps) dell'elemento.
|
||||||
*
|
*
|
||||||
|
@@ -918,13 +918,15 @@ class FatturaElettronica
|
|||||||
return $item->aliquota != null;
|
return $item->aliquota != null;
|
||||||
})->aliquota;
|
})->aliquota;
|
||||||
foreach ($righe as $numero => $riga) {
|
foreach ($righe as $numero => $riga) {
|
||||||
|
$dati_aggiuntivi = $riga->dati_aggiuntivi_fe;
|
||||||
|
|
||||||
$dettaglio = [
|
$dettaglio = [
|
||||||
'NumeroLinea' => $numero + 1,
|
'NumeroLinea' => $numero + 1,
|
||||||
];
|
];
|
||||||
|
|
||||||
// 2.2.1.2
|
// 2.2.1.2
|
||||||
if (!empty($riga['tipo_cessione_prestazione'])) {
|
if (!empty($dati_aggiuntivi['tipo_cessione_prestazione'])) {
|
||||||
$dettaglio['TipoCessionePrestazione'] = $riga['tipo_cessione_prestazione'];
|
$dettaglio['TipoCessionePrestazione'] = $dati_aggiuntivi['tipo_cessione_prestazione'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2.2.1.3
|
// 2.2.1.3
|
||||||
@@ -962,11 +964,11 @@ class FatturaElettronica
|
|||||||
$dettaglio['UnitaMisura'] = $riga['um'];
|
$dettaglio['UnitaMisura'] = $riga['um'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($riga['data_inizio_periodo'])) {
|
if (!empty($dati_aggiuntivi['data_inizio_periodo'])) {
|
||||||
$dettaglio['DataInizioPeriodo'] = $riga['data_inizio_periodo'];
|
$dettaglio['DataInizioPeriodo'] = $dati_aggiuntivi['data_inizio_periodo'];
|
||||||
}
|
}
|
||||||
if (!empty($riga['data_fine_periodo'])) {
|
if (!empty($dati_aggiuntivi['data_fine_periodo'])) {
|
||||||
$dettaglio['DataFinePeriodo'] = $riga['data_fine_periodo'];
|
$dettaglio['DataFinePeriodo'] = $dati_aggiuntivi['data_fine_periodo'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$dettaglio['PrezzoUnitario'] = $riga->prezzo_unitario_vendita ?: 0;
|
$dettaglio['PrezzoUnitario'] = $riga->prezzo_unitario_vendita ?: 0;
|
||||||
@@ -1010,20 +1012,44 @@ class FatturaElettronica
|
|||||||
$dettaglio['Natura'] = $aliquota['codice_natura_fe'];
|
$dettaglio['Natura'] = $aliquota['codice_natura_fe'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($riga['riferimento_amministrazione'])) {
|
if (!empty($dati_aggiuntivi['riferimento_amministrazione'])) {
|
||||||
$dettaglio['RiferimentoAmministrazione'] = $riga['riferimento_amministrazione'];
|
$dettaglio['RiferimentoAmministrazione'] = $dati_aggiuntivi['riferimento_amministrazione'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// AltriDatiGestionali (2.2.1.16) - Ritenuta ENASARCO
|
// AltriDatiGestionali (2.2.1.16) - Ritenuta ENASARCO
|
||||||
// https://forum.italia.it/uploads/default/original/2X/d/d35d721c3a3a601d2300378724a270154e23af52.jpeg
|
// https://forum.italia.it/uploads/default/original/2X/d/d35d721c3a3a601d2300378724a270154e23af52.jpeg
|
||||||
if (!empty($riga['ritenuta_contributi'])) {
|
if (!empty($riga['ritenuta_contributi'])) {
|
||||||
$dettaglio['AltriDatiGestionali'] = [
|
$dettaglio[]['AltriDatiGestionali'] = [
|
||||||
'TipoDato' => 'CASSA-PREV',
|
'TipoDato' => 'CASSA-PREV',
|
||||||
'RiferimentoTesto' => setting('Tipo Cassa Previdenziale').' - '.$ritenuta_contributi->descrizione.' ('.Translator::numberToLocale($ritenuta_contributi->percentuale).'%)',
|
'RiferimentoTesto' => setting('Tipo Cassa Previdenziale').' - '.$ritenuta_contributi->descrizione.' ('.Translator::numberToLocale($ritenuta_contributi->percentuale).'%)',
|
||||||
'RiferimentoNumero' => $riga->ritenuta_contributi,
|
'RiferimentoNumero' => $riga->ritenuta_contributi,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($dati_aggiuntivi['altri_dati'])) {
|
||||||
|
foreach ($dati_aggiuntivi['altri_dati'] as $dato) {
|
||||||
|
$altri_dati = [];
|
||||||
|
|
||||||
|
if (!empty($dato['tipo_dato'])) {
|
||||||
|
$altri_dati['TipoDato'] = $dato['tipo_dato'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($dato['riferimento_testo'])) {
|
||||||
|
$altri_dati['RiferimentoTesto'] = $dato['riferimento_testo'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($dato['riferimento_numero'])) {
|
||||||
|
$altri_dati['RiferimentoNumero'] = $dato['riferimento_numero'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($dato['riferimento_data'])) {
|
||||||
|
$altri_dati['RiferimentoData'] = $dato['riferimento_data'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$dettaglio[]['AltriDatiGestionali'] = $altri_dati;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$result[] = [
|
$result[] = [
|
||||||
'DettaglioLinee' => $dettaglio,
|
'DettaglioLinee' => $dettaglio,
|
||||||
];
|
];
|
||||||
|
@@ -61,7 +61,7 @@ class DateHandler implements HandlerInterface
|
|||||||
|
|
||||||
if (empty($values['icon-before']) || empty($values['icon-after'])) {
|
if (empty($values['icon-before']) || empty($values['icon-after'])) {
|
||||||
$result .= '
|
$result .= '
|
||||||
<div class="input-group">';
|
<div class="input-group" style="width: 100%;">';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,3 +1,8 @@
|
|||||||
UPDATE `zz_prints` SET `filename` = 'Preventivo num. {numero} del {data}' WHERE `name` = 'Preventivo (senza totali)';
|
UPDATE `zz_prints` SET `filename` = 'Preventivo num. {numero} del {data}' WHERE `name` = 'Preventivo (senza totali)';
|
||||||
|
|
||||||
DELETE FROM `zz_plugins` WHERE `name` = 'Pianificazione ordini di servizio';
|
DELETE FROM `zz_plugins` WHERE `name` = 'Pianificazione ordini di servizio';
|
||||||
|
|
||||||
|
-- Aggiunta campo JSON per le informazioni aggiuntive FE
|
||||||
|
ALTER TABLE `co_righe_documenti` ADD `dati_aggiuntivi_fe` TEXT;
|
||||||
|
UPDATE `co_righe_documenti` SET `dati_aggiuntivi_fe` = CONCAT('{"tipo_cessione_prestazione":"', IFNULL(tipo_cessione_prestazione, ""), '","riferimento_amministrazione":"', IFNULL(riferimento_amministrazione, ""), '","data_inizio_periodo":"', IFNULL(data_inizio_periodo, ""), '","data_fine_periodo":"', IFNULL(data_fine_periodo, ""), '"}');
|
||||||
|
ALTER TABLE `co_righe_documenti` DROP `tipo_cessione_prestazione`, DROP `riferimento_amministrazione`, DROP `data_inizio_periodo`, DROP `data_fine_periodo`;
|
||||||
|
Reference in New Issue
Block a user