diff --git a/modules/fatture/edit.php b/modules/fatture/edit.php
index a053fd19d..d9484d72e 100644
--- a/modules/fatture/edit.php
+++ b/modules/fatture/edit.php
@@ -55,7 +55,7 @@ $_SESSION['superselect']['ddt'] = $dir;
if ($dir == 'uscita') {
echo '
- {[ "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$" ]}
';
$label = tr('Numero secondario');
} else {
diff --git a/modules/fatture/modutil.php b/modules/fatture/modutil.php
index cc2c3caed..5663d43a7 100644
--- a/modules/fatture/modutil.php
+++ b/modules/fatture/modutil.php
@@ -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;