';
}
if (empty($record['is_fiscale'])) {
$msg = '{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "values": "query=SELECT id, name AS descrizione FROM zz_segments WHERE id_module=\''.$id_module.'\' AND is_fiscale = 1 ORDER BY name" ]}';
echo '
';
}
?>
fetchNum('SELECT id FROM co_movimenti WHERE iddocumento='.prepare($id_record).' AND primanota=1');
$rs3 = $dbo->fetchArray('SELECT SUM(da_pagare-pagato) AS differenza, SUM(da_pagare) FROM co_scadenziario GROUP BY iddocumento HAVING iddocumento='.prepare($id_record));
$differenza = isset($rs3[0]) ? $rs3[0]['differenza'] : null;
$da_pagare = isset($rs3[0]) ? $rs3[0]['da_pagare'] : null;
if (($n2 <= 0 && $record['stato'] == 'Emessa') || $differenza != 0) {
?>