Aggiunta idsede negli ordini

This commit is contained in:
Fabio Lovato 2019-01-29 13:13:24 +01:00
parent 1784ce63c0
commit aa56de0a18
3 changed files with 13 additions and 0 deletions

View File

@ -203,6 +203,7 @@ switch (post('op')) {
$totale_ordine = 0.00; $totale_ordine = 0.00;
$data = post('data'); $data = post('data');
$idanagrafica = post('idanagrafica'); $idanagrafica = post('idanagrafica');
$idsede = post('idsede');
$idpagamento = post('idpagamento'); $idpagamento = post('idpagamento');
$idconto = post('idconto'); $idconto = post('idconto');
$idordine = post('idordine'); $idordine = post('idordine');

View File

@ -36,6 +36,7 @@ $button = !empty(get('op')) ? tr('Aggiungi') : $button;
$rs = $dbo->fetchArray('SELECT * FROM '.$table.' WHERE id='.prepare($id_record)); $rs = $dbo->fetchArray('SELECT * FROM '.$table.' WHERE id='.prepare($id_record));
$numero = !empty($rs[0]['numero_esterno']) ? $rs[0]['numero_esterno'] : $rs[0]['numero']; $numero = !empty($rs[0]['numero_esterno']) ? $rs[0]['numero_esterno'] : $rs[0]['numero'];
$idanagrafica = $rs[0]['idanagrafica']; $idanagrafica = $rs[0]['idanagrafica'];
$idsede = $rs[0]['idsede'];
$idpagamento = $rs[0]['idpagamento']; $idpagamento = $rs[0]['idpagamento'];
$idconto = $rs[0]['idconto']; $idconto = $rs[0]['idconto'];
@ -55,6 +56,7 @@ if (!empty($rs)) {
<form action="'.$rootdir.'/editor.php?id_module='.Modules::get($module_name)['id'].(!empty(get('iddocumento')) ? '&id_record='.get('iddocumento') : '').'" method="post"> <form action="'.$rootdir.'/editor.php?id_module='.Modules::get($module_name)['id'].(!empty(get('iddocumento')) ? '&id_record='.get('iddocumento') : '').'" method="post">
<input type="hidden" name="'.$id.'" value="'.$id_record.'"> <input type="hidden" name="'.$id.'" value="'.$id_record.'">
<input type="hidden" name="idanagrafica" value="'.$idanagrafica.'"> <input type="hidden" name="idanagrafica" value="'.$idanagrafica.'">
<input type="hidden" name="idsede" value="'.$idsede.'">
<input type="hidden" name="idconto" value="'.$idconto.'"> <input type="hidden" name="idconto" value="'.$idconto.'">
<input type="hidden" name="idpagamento" value="'.$idpagamento.'"> <input type="hidden" name="idpagamento" value="'.$idpagamento.'">
<input type="hidden" name="iddocumento" value="'.$id_record.'"> <input type="hidden" name="iddocumento" value="'.$id_record.'">

View File

@ -73,6 +73,10 @@ if ($module['name'] == 'Ordini cliente') {
} }
?> ?>
</div> </div>
<div class="col-md-3">
{[ "type": "select", "label": "<?php echo tr('Sede'); ?>", "name": "idsede", "required": 1, "ajax-source": "sedi", "value": "<?php echo $record['idsede']; ?>", "readonly": "<?php echo $record['flag_completato']; ?>" ]}
</div>
<div class="col-md-3"> <div class="col-md-3">
{[ "type": "select", "label": "<?php echo tr('Pagamento'); ?>", "name": "idpagamento", "required": 1, "values": "query=SELECT id, descrizione FROM co_pagamenti GROUP BY descrizione ORDER BY descrizione ASC", "value": "$idpagamento$", "readonly": "<?php echo $record['flag_completato']; ?>" ]} {[ "type": "select", "label": "<?php echo tr('Pagamento'); ?>", "name": "idpagamento", "required": 1, "values": "query=SELECT id, descrizione FROM co_pagamenti GROUP BY descrizione ORDER BY descrizione ASC", "value": "$idpagamento$", "readonly": "<?php echo $record['flag_completato']; ?>" ]}
@ -228,4 +232,10 @@ if ($record['flag_completato']) {
<?php <?php
} }
?> ?>
$('#idanagrafica').change( function(){
session_set('superselect,idanagrafica', $(this).val(), 0);
$("#idsede").selectReset();
});
</script> </script>