Fixes in sales credit note voiding procedures (invalid changes in delivery notes).
[fa-stable.git] / sales / includes / db / custalloc_db.inc
index 896649090fedf2658b5dd85ac8b4b4d1a4d4d289..7260f0e10ed0702b19ab0c4e0dd8648cd8eb9693 100644 (file)
@@ -286,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.