+ trans.ov_freight_tax + trans.ov_discount) AS TotalAmount,
trans.alloc AS Allocated,
((trans.type = ".ST_SALESINVOICE.")
- AND trans.due_date < '" . date2sql(Today()) . "') AS OverDue
+ AND trans.due_date < '" . date2sql(Today()) . "') AS OverDue,
+ trans.debtor_no
FROM "
.TB_PREF."debtor_trans as trans, "
.TB_PREF."debtors_master as debtor
$free += $unalloc;
}
}
- if ($free < $amount) {
+ if (floatcmp($free, $amount)<0) {
// this should never happen unless sparse credit notices were allocated to
// the invoice, or summarized freight costs on credit notes is more than those on invoice.
display_error(_("Unsuspected overallocation happened due to sparse credit notes exists for this invoice.