$js .= get_js_date_picker();
page(_($help_context = "Customer Allocation Inquiry"), false, false, "", $js);
$js .= get_js_date_picker();
page(_($help_context = "Customer Allocation Inquiry"), false, false, "", $js);
customer_list_cells(_("Select a customer: "), 'customer_id', $_POST['customer_id'], true);
customer_list_cells(_("Select a customer: "), 'customer_id', $_POST['customer_id'], true);
-date_cells(_("from:"), 'TransAfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+date_cells(_("from:"), 'TransAfterDate', '', null, -user_transaction_days());
date_cells(_("to:"), 'TransToDate', '', null, 1);
cust_allocations_list_cells(_("Type:"), 'filterType', null);
date_cells(_("to:"), 'TransToDate', '', null, 1);
cust_allocations_list_cells(_("Type:"), 'filterType', null);
$link =
pager_link(_("Allocation"),
"/sales/allocations/customer_allocate.php?trans_no=" . $row["trans_no"]
$link =
pager_link(_("Allocation"),
"/sales/allocations/customer_allocate.php?trans_no=" . $row["trans_no"]
if ($row["type"] == ST_CUSTCREDIT && $row['TotalAmount'] > 0)
{
/*its a credit note which could have an allocation */
return $link;
if ($row["type"] == ST_CUSTCREDIT && $row['TotalAmount'] > 0)
{
/*its a credit note which could have an allocation */
return $link;
- }
- elseif (($row["type"] == ST_CUSTPAYMENT || $row["type"] == ST_BANKDEPOSIT) &&
- (floatcmp($row['TotalAmount'], $row['Allocated']) > 0))
+ } elseif ($row["type"] == ST_JOURNAL && $row['TotalAmount'] < 0)
+ {
+ return $link;
+ } elseif (($row["type"] == ST_CUSTPAYMENT || $row["type"] == ST_BANKDEPOSIT) &&
+ (floatcmp($row['TotalAmount'], $row['Allocated']) >= 0))
return pager_link(_("Payment"),
"/sales/customer_payments.php?customer_id=".$row["debtor_no"]."&SInvoice=" . $row["trans_no"], ICON_MONEY);
return pager_link(_("Payment"),
"/sales/customer_payments.php?customer_id=".$row["debtor_no"]."&SInvoice=" . $row["trans_no"], ICON_MONEY);
-$sql = get_sql_for_customer_allocation_inquiry();
+$sql = get_sql_for_customer_allocation_inquiry(get_post('TransAfterDate'), get_post('TransToDate'),
+ get_post('customer_id'), get_post('filterType'), check_value('showSettled'));