mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
Migliorie minori compilazione attributi avanzati
This commit is contained in:
@@ -207,7 +207,7 @@ elseif ($record['stato'] == 'Bozza') {
|
|||||||
|
|
||||||
if ($dir == 'entrata') {
|
if ($dir == 'entrata') {
|
||||||
?>
|
?>
|
||||||
{[ "type": "select", "label": "<?php echo tr('Cliente'); ?>", "name": "idanagrafica", "required": 1, "ajax-source": "clienti", "help": "<?php echo tr("In caso di autofattura indicare l'azienda: ").stripslashes($database->fetchOne('SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica = '.prepare(setting('Azienda predefinita')))['ragione_sociale']); ?>", "value": "$idanagrafica$" ]}
|
{[ "type": "select", "label": "<?php echo tr('Cliente'); ?>", "name": "idanagrafica", "required": 1, "ajax-source": "clienti","select-options": <?php echo json_encode(['id_anagrafica' => $record['idanagrafica']]); ?>, "help": "<?php echo tr("In caso di autofattura indicare l'azienda: ").stripslashes($database->fetchOne('SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica = '.prepare(setting('Azienda predefinita')))['ragione_sociale']); ?>", "value": "$idanagrafica$" ]}
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
|
@@ -61,7 +61,7 @@ foreach ($dato['riferimento_linea'] as $linea) {
|
|||||||
echo '
|
echo '
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{[ "type": "number", "name": "'.$nome.'['.$key.'][riferimento_linea][]", "value": "'.$linea.'", "maxlength": 4, "decimals": 0 ]}
|
{[ "type": "number", "name": "'.$nome.'['.$key.'][riferimento_linea][]", "value": "'.$linea.'", "maxlength": 4, "decimals": 0, "extra": " title=\"\" " ]}
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ echo '
|
|||||||
<tr class="fifth-level">
|
<tr class="fifth-level">
|
||||||
<td style="vertical-align: middle;">'.str_repeat($space, 4).$info['code'].'.3 Data</td>
|
<td style="vertical-align: middle;">'.str_repeat($space, 4).$info['code'].'.3 Data</td>
|
||||||
<td>
|
<td>
|
||||||
{[ "type": "date", "name": "'.$nome.'['.$key.'][data]", "value": "'.$dato['data'].'" ]}
|
{[ "type": "date", "name": "'.$nome.'['.$key.'][data]", "value": "'.$dato['data'].'", "readonly": '.(empty($dato['id_documento']) ? 1:0 ).' ]}
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ echo '
|
|||||||
<tr class="fifth-level">
|
<tr class="fifth-level">
|
||||||
<td style="vertical-align: middle;">'.str_repeat($space, 4).$info['code'].'.4 NumItem</td>
|
<td style="vertical-align: middle;">'.str_repeat($space, 4).$info['code'].'.4 NumItem</td>
|
||||||
<td>
|
<td>
|
||||||
{[ "type": "text", "name": "'.$nome.'['.$key.'][num_item]", "value": "'.$dato['num_item'].'", "maxlength": 20 ]}
|
{[ "type": "text", "name": "'.$nome.'['.$key.'][num_item]", "value": "'.$dato['num_item'].'", "maxlength": 20, "readonly": '.(empty($dato['id_documento']) ? 1:0 ).' ]}
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ echo '
|
|||||||
<tr class="fifth-level">
|
<tr class="fifth-level">
|
||||||
<td style="vertical-align: middle;">'.str_repeat($space, 4).$info['code'].'.5 CodiceCommessaConvenzione</td>
|
<td style="vertical-align: middle;">'.str_repeat($space, 4).$info['code'].'.5 CodiceCommessaConvenzione</td>
|
||||||
<td>
|
<td>
|
||||||
{[ "type": "text", "name": "'.$nome.'['.$key.'][codice_commessa]", "value": "'.$dato['codice_commessa'].'", "maxlength": 100 ]}
|
{[ "type": "text", "name": "'.$nome.'['.$key.'][codice_commessa]", "value": "'.$dato['codice_commessa'].'", "maxlength": 100, "readonly": '.(empty($dato['id_documento']) ? 1:0 ).' ]}
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ echo '
|
|||||||
<tr class="fifth-level">
|
<tr class="fifth-level">
|
||||||
<td style="vertical-align: middle;">'.str_repeat($space, 4).$info['code'].'.6 CodiceCUP</td>
|
<td style="vertical-align: middle;">'.str_repeat($space, 4).$info['code'].'.6 CodiceCUP</td>
|
||||||
<td>
|
<td>
|
||||||
{[ "type": "text", "name": "'.$nome.'['.$key.'][codice_cup]", "value": "'.$dato['codice_cup'].'", "maxlength": 15 ]}
|
{[ "type": "text", "name": "'.$nome.'['.$key.'][codice_cup]", "value": "'.$dato['codice_cup'].'", "maxlength": 15, "readonly": '.(empty($dato['id_documento']) ? 1:0 ).' ]}
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
|
||||||
@@ -118,7 +118,28 @@ echo '
|
|||||||
<tr class="fifth-level" id="last-'.$nome.'-'.$key.'">
|
<tr class="fifth-level" id="last-'.$nome.'-'.$key.'">
|
||||||
<td style="vertical-align: middle;">'.str_repeat($space, 4).$info['code'].'.7 CodiceCIG</td>
|
<td style="vertical-align: middle;">'.str_repeat($space, 4).$info['code'].'.7 CodiceCIG</td>
|
||||||
<td>
|
<td>
|
||||||
{[ "type": "text", "name": "'.$nome.'['.$key.'][codice_cig]", "value": "'.$dato['codice_cig'].'", "maxlength": 15 ]}
|
{[ "type": "text", "name": "'.$nome.'['.$key.'][codice_cig]", "value": "'.$dato['codice_cig'].'", "maxlength": 15, "readonly": '.(empty($dato['id_documento']) ? 1:0 ).' ]}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>';
|
</tbody>';
|
||||||
|
|
||||||
|
echo '
|
||||||
|
<script type="text/javascript">
|
||||||
|
$( document ).ready(function() {
|
||||||
|
$(\'input[name="'.$nome.'['.$key.'][id_documento]"]\').keyup(function() {
|
||||||
|
if ( $(\'input[name="'.$nome.'['.$key.'][id_documento]"]\').val() != ""){
|
||||||
|
$(\'input[name="'.$nome.'['.$key.'][data]"]\').prop("readonly", false);
|
||||||
|
$(\'input[name="'.$nome.'['.$key.'][num_item]"]\').prop("readonly", false);
|
||||||
|
$(\'input[name="'.$nome.'['.$key.'][codice_commessa]"]\').prop("readonly", false);
|
||||||
|
$(\'input[name="'.$nome.'['.$key.'][codice_cup]"]\').prop("readonly", false);
|
||||||
|
$(\'input[name="'.$nome.'['.$key.'][codice_cig]"]\').prop("readonly", false);
|
||||||
|
}else{
|
||||||
|
$(\'input[name="'.$nome.'['.$key.'][data]"]\').prop("readonly", true);
|
||||||
|
$(\'input[name="'.$nome.'['.$key.'][num_item]"]\').prop("readonly", true);
|
||||||
|
$(\'input[name="'.$nome.'['.$key.'][codice_commessa]"]\').prop("readonly", true);
|
||||||
|
$(\'input[name="'.$nome.'['.$key.'][codice_cup]"]\').prop("readonly", true);
|
||||||
|
$(\'input[name="'.$nome.'['.$key.'][codice_cig]"]\').prop("readonly", true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>';
|
@@ -37,10 +37,10 @@ trait ReferenceTrait
|
|||||||
$number = $this->getReferenceNumber();
|
$number = $this->getReferenceNumber();
|
||||||
$date = $this->getReferenceDate();
|
$date = $this->getReferenceDate();
|
||||||
|
|
||||||
$idanagrafica = $this->getReferenceRagioneSociale();
|
$ragione_sociale = $this->getReferenceRagioneSociale();
|
||||||
|
|
||||||
// Testi predefiniti
|
// Testi predefiniti
|
||||||
if (!empty($date) && !empty($number) && !empty($idanagrafica) && !empty($show_ragione_sociale) ) {
|
if (!empty($date) && !empty($number) && !empty($ragione_sociale) && !empty($show_ragione_sociale) ) {
|
||||||
$description = tr('_DOC_ num. _NUM_ del _DATE_ (_RAGIONE_SOCIALE_)');
|
$description = tr('_DOC_ num. _NUM_ del _DATE_ (_RAGIONE_SOCIALE_)');
|
||||||
}
|
}
|
||||||
elseif (!empty($date) && !empty($number)) {
|
elseif (!empty($date) && !empty($number)) {
|
||||||
@@ -57,7 +57,7 @@ trait ReferenceTrait
|
|||||||
$description = replace($description, [
|
$description = replace($description, [
|
||||||
'_DOC_' => $name,
|
'_DOC_' => $name,
|
||||||
'_NUM_' => $number,
|
'_NUM_' => $number,
|
||||||
'_RAGIONE_SOCIALE_' => $idanagrafica,
|
'_RAGIONE_SOCIALE_' => $ragione_sociale,
|
||||||
'_DATE_' => dateFormat($date),
|
'_DATE_' => dateFormat($date),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user