X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Finquiry%2Fcustomer_allocation_inquiry.php;h=fedec4c48ab85c668d30d26ab5892c4f2342aad7;hb=7e830126b96477e969fe3b48d9fc0e78f6c1fe00;hp=f32bd6cbb2c4212b1ef41d81aa7db91bd05fb84f;hpb=46c5f7a65a7659a44ae8254c63152074363d3987;p=fa-stable.git diff --git a/sales/inquiry/customer_allocation_inquiry.php b/sales/inquiry/customer_allocation_inquiry.php index f32bd6cb..fedec4c4 100644 --- a/sales/inquiry/customer_allocation_inquiry.php +++ b/sales/inquiry/customer_allocation_inquiry.php @@ -41,7 +41,7 @@ start_row(); customer_list_cells(_("Select a customer: "), 'customer_id', $_POST['customer_id'], true); -date_cells(_("from:"), 'TransAfterDate', '', null, -30); +date_cells(_("from:"), 'TransAfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days()); date_cells(_("to:"), 'TransToDate', '', null, 1); cust_allocations_list_cells(_("Type:"), 'filterType', null); @@ -103,7 +103,7 @@ function alloc_link($row) return $link; } elseif (($row["type"] == ST_CUSTPAYMENT || $row["type"] == ST_BANKDEPOSIT) && - ($row['TotalAmount'] - $row['Allocated']) > 0) + (floatcmp($row['TotalAmount'], $row['Allocated']) > 0)) { /*its a receipt which could have an allocation*/ return $link; @@ -112,7 +112,10 @@ function alloc_link($row) { /*its a negative receipt */ return ''; - } + } elseif ($row["type"] == ST_SALESINVOICE && ($row['TotalAmount'] - $row['Allocated']) > 0) + return pager_link(_("Payment"), + "/sales/customer_payments.php?customer_id=".$row["debtor_no"]."&SInvoice=" . $row["trans_no"], ICON_MONEY); + } function fmt_debit($row)