Merged changes up to 2.3.16 into unstable
[fa-stable.git] / sales / includes / db / custalloc_db.inc
index f2896620d4b0e7f4abd5dff97ff61743c963c70c..e9c73f0caed2eb7c8cb0632bff4d9313f230adfa 100644 (file)
@@ -345,7 +345,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.