X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fincludes%2Fdb%2Fcustalloc_db.inc;h=7260f0e10ed0702b19ab0c4e0dd8648cd8eb9693;hb=1e4cd218cd0b7e1093b4b63d6636f5360b3c7958;hp=c80378c6737ad710dce7ac8ff85ba03d794b7b2c;hpb=4528afda32783ab1b4e5e88fe19e2136a3f060e1;p=fa-stable.git diff --git a/sales/includes/db/custalloc_db.inc b/sales/includes/db/custalloc_db.inc index c80378c6..7260f0e1 100644 --- a/sales/includes/db/custalloc_db.inc +++ b/sales/includes/db/custalloc_db.inc @@ -202,7 +202,8 @@ function get_sql_for_customer_allocation_inquiry() + 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 @@ -285,7 +286,7 @@ function credit_sales_invoice_allocate($invoice_no, $credit_no, $amount, $date) $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.