fix: struttura dati cliente/fornitore ddt uscita/entrata

This commit is contained in:
Luca 2024-10-24 16:16:11 +02:00
parent 8e14aff240
commit eacba9b3bc
1 changed files with 18 additions and 19 deletions

View File

@ -134,32 +134,31 @@ echo '
</div>
</div>
<div class="card-body">
<div class="card-body">
<!-- RIGA 1 -->
<div class="row">
<div class="col-md-3">
'.Modules::link('Anagrafiche', $record['idanagrafica'], null, null, 'class="pull-right"').'
{[ "type": "select", "label": "'.($dir == 'uscita' ? tr('Mittente') : tr('Destinatario')).'", "name": "idanagrafica", "required": 1, "value": "$idanagrafica$", "ajax-source": "clienti_fornitori" ]}
</div>';
<!-- RIGA 1 -->
<div class="row">
<div class="col-md-3">
'.Modules::link('Anagrafiche', $record['idanagrafica'], null, null, 'class="pull-right"').'
{[ "type": "select", "label": "'.($dir == 'uscita' ? tr('Mittente') : tr('Destinatario')).'", "name": "idanagrafica", "required": 1, "value": "$idanagrafica$", "ajax-source": "clienti_fornitori" ]}
</div>';
if ($dir == 'entrata') {
echo '
<div class="col-md-3">';
if ($record['idagente'] != 0) {
echo Modules::link('Anagrafiche', $record['idagente'], null, null, 'class="pull-right"');
}
echo '
{[ "type": "select", "label": "'.tr('Agente').'", "name": "idagente", "ajax-source": "agenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].'}, "value": "$idagente$" ]}
</div>';
echo '
<div class="col-md-3">';
if ($record['idagente'] != 0) {
echo Modules::link('Anagrafiche', $record['idagente'], null, null, 'class="pull-right"');
}
echo '
<div class="col-md-3">';
{[ "type": "select", "label": "'.tr('Agente').'", "name": "idagente", "ajax-source": "agenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].'}, "value": "$idagente$" ]}
</div>';
}
echo '
<div class="col-md-3">';
if (!empty($record['idreferente'])) {
echo Plugins::link('Referenti', $record['idanagrafica'], null, null, 'class="pull-right"');
echo Plugins::link('Referenti', $record['idanagrafica'], null, null, 'class="pull-right"');
}
echo '
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].', "idsede_destinazione": '.$record['idsede_destinazione'].'} ]}
</div>
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].', "idsede_destinazione": '.$record['idsede_destinazione'].'} ]}
</div>
</div>
</div>