."cust.tax_id, "
."com.memo_";
- if ($trans_type == ST_CUSTPAYMENT) {
+ if ($trans_type == ST_CUSTPAYMENT || $trans_type == ST_BANKDEPOSIT) {
// it's a payment so also get the bank account
// Chaitanya : Added bank_act to support Customer Payment Edit
$sql .= ",bank_act,".TB_PREF."bank_accounts.bank_name, ".TB_PREF."bank_accounts.bank_account_name,
LEFT JOIN ".TB_PREF."shippers ON ".TB_PREF."shippers.shipper_id=trans.ship_via,
".TB_PREF."debtors_master cust";
- if ($trans_type == ST_CUSTPAYMENT) {
+ if ($trans_type == ST_CUSTPAYMENT || $trans_type == ST_BANKDEPOSIT) {
// it's a payment so also get the bank account
$sql .= ", ".TB_PREF."bank_trans, ".TB_PREF."bank_accounts";
}
AND trans.type=".db_escape($trans_type)."
AND trans.debtor_no=cust.debtor_no";
- if ($trans_type == ST_CUSTPAYMENT) {
+ if ($trans_type == ST_CUSTPAYMENT || $trans_type == ST_BANKDEPOSIT) {
// it's a payment so also get the bank account
$sql .= " AND ".TB_PREF."bank_trans.trans_no =".db_escape($trans_id)."
AND ".TB_PREF."bank_trans.type=$trans_type
return $sql;
}
-function get_sql_for_sales_deliveries_view($selected_customer, $selected_stock_item=null)
+function get_sql_for_sales_deliveries_view($selected_customer, $selected_stock_item=null, $customer_id=ALL_TEXT)
{
$sql = "SELECT trans.trans_no,
debtor.name,
if (isset($_POST['StockLocation']) && $_POST['StockLocation'] != ALL_TEXT)
$sql .= " AND sorder.from_stk_loc = ".db_escape($_POST['StockLocation'])." ";
+
+ if ($customer_id != ALL_TEXT)
+ $sql .= " AND sorder.debtor_no = ".db_escape($customer_id) . " AND trans.debtor_no = ".db_escape($customer_id);
$sql .= " GROUP BY trans.trans_no ";