Fix
This commit is contained in:
parent
02fc65e82b
commit
ee7766d062
|
@ -55,7 +55,7 @@ $_SESSION['superselect']['ddt'] = $dir;
|
|||
if ($dir == 'uscita') {
|
||||
echo '
|
||||
<div class="col-md-3">
|
||||
{[ "type": "text", "label": "'.tr('Numero fattura').'", "required": 1, "name": "numero","class": "text-center alphanumeric-mask", "value": "$numero$" ]}
|
||||
{[ "type": "text", "label": "'.tr('Numero fattura/protocollo').'", "required": 1, "name": "numero","class": "text-center alphanumeric-mask", "value": "$numero$" ]}
|
||||
</div>';
|
||||
$label = tr('Numero secondario');
|
||||
} else {
|
||||
|
|
|
@ -45,7 +45,7 @@ function get_new_numerofattura($data)
|
|||
|
||||
}else{
|
||||
|
||||
$query = "SELECT IFNULL(MAX(numero),'0') AS max_numerofattura FROM co_documenti WHERE DATE_FORMAT( data, '%Y' ) = ".prepare(date('Y', strtotime($data)))." AND idtipodocumento IN(SELECT id FROM co_tipidocumento WHERE dir = '".prepare($dir)."') ORDER BY CAST(numero AS UNSIGNED) DESC LIMIT 0, 1";
|
||||
$query = "SELECT IFNULL(MAX(numero),'0') AS max_numerofattura FROM co_documenti WHERE DATE_FORMAT( data, '%Y' ) = ".prepare(date('Y', strtotime($data)))." AND idtipodocumento IN(SELECT id FROM co_tipidocumento WHERE dir = ".prepare($dir).") ORDER BY CAST(numero AS UNSIGNED) DESC LIMIT 0, 1";
|
||||
$rs = $dbo->fetchArray($query);
|
||||
|
||||
$numero = $rs[0]['max_numerofattura'] + 1;
|
||||
|
|
Loading…
Reference in New Issue