Fix SQL error when advance_days is set to 0.

This commit is contained in:
anubis 2009-01-02 22:26:41 -05:00
parent 3c9570ffe9
commit eedd737a97

View File

@ -33,7 +33,7 @@ class advance_notice
/* get the max invoice days from the setup_invoice table */
if(!$this->advance_days) {
$setup = $db->Execute(sqlSelect($db,"setup_invoice","advance_notice","advance_notice>0 and advance_notice != '' and advance_notice is not null"));
if(!$setup && !$setup->RecordCount()) return false;
if(!$setup->RecordCount()) return false;
$this->advance_days = $setup->fields['advance_notice'];
}
@ -106,4 +106,4 @@ class advance_notice
$db->Execute("UPDATE ".AGILE_DB_PREFIX."service SET invoice_advance_notified=1 WHERE site_id=".DEFAULT_SITE." AND id in ($ids)");
}
}
?>
?>