Skip to content

Commit 6c1e156

Browse files
committed
fix: conteggio documenti collegati ad aliquota iva
1 parent ff7241d commit 6c1e156

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

modules/iva/edit.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
$id = prepare($id_record);
3838

39-
$res = $dbo->fetchNum('
39+
$res = $dbo->fetchOne('
4040
SELECT (
4141
SELECT COUNT(*) FROM `co_righe_documenti` WHERE `co_righe_documenti`.`idiva` = '.$id.'
4242
) + (
@@ -51,9 +51,9 @@
5151
SELECT COUNT(*) FROM `mg_articoli` WHERE `mg_articoli`.`idiva_vendita` = '.$id.'
5252
) + (
5353
SELECT COUNT(*) FROM `an_anagrafiche` WHERE `an_anagrafiche`.`idiva_vendite` = '.$id.' OR `an_anagrafiche`.`idiva_acquisti` = '.$id.'
54-
) AS total');
54+
) AS total')['total'];
5555
$is_readonly = 0;
56-
if ($res) {
56+
if ($res > 0) {
5757
$is_readonly = '1';
5858
}
5959

0 commit comments

Comments
 (0)