From 3c73d05998cf50fed7fa5c0a568a1a911e7023e2 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 12 Feb 2015 21:50:24 +0100 Subject: [PATCH] Currency filter not working in documents. --- reporting/rep107.php | 5 ++++- reporting/rep108.php | 3 +++ reporting/rep109.php | 3 +++ reporting/rep111.php | 3 +++ reporting/rep112.php | 3 +++ reporting/rep113.php | 3 +++ reporting/rep209.php | 3 +++ reporting/rep210.php | 3 +++ 8 files changed, 25 insertions(+), 1 deletion(-) diff --git a/reporting/rep107.php b/reporting/rep107.php index b0f6be77..6e0307ea 100644 --- a/reporting/rep107.php +++ b/reporting/rep107.php @@ -75,7 +75,10 @@ function print_invoices() $sign = 1; $myrow = get_customer_trans($i, ST_SALESINVOICE); - if($customer && $myrow['debtor_no'] != $customer) { + if($customer != ALL_TEXT && $myrow['debtor_no'] != $customer) { + continue; + } + if ($currency != ALL_TEXT && $myrow['curr_code'] != $currency) { continue; } $baccount = get_default_bank_account($myrow['curr_code']); diff --git a/reporting/rep108.php b/reporting/rep108.php index b438e641..a3f76f38 100644 --- a/reporting/rep108.php +++ b/reporting/rep108.php @@ -95,6 +95,9 @@ function print_statements() while ($myrow=db_fetch($result)) { + if ($currency != ALL_TEXT && $myrow['curr_code'] != $currency) { + continue; + } $date = date('Y-m-d'); $myrow['order_'] = ""; diff --git a/reporting/rep109.php b/reporting/rep109.php index 3251efcf..8b22697a 100644 --- a/reporting/rep109.php +++ b/reporting/rep109.php @@ -72,6 +72,9 @@ function print_sales_orders() for ($i = $from; $i <= $to; $i++) { $myrow = get_sales_order_header($i, ST_SALESORDER); + if ($currency != ALL_TEXT && $myrow['curr_code'] != $currency) { + continue; + } $baccount = get_default_bank_account($myrow['curr_code']); $params['bankaccount'] = $baccount['id']; $branch = get_branch($myrow["branch_code"]); diff --git a/reporting/rep111.php b/reporting/rep111.php index 0bbf0425..6eeda915 100644 --- a/reporting/rep111.php +++ b/reporting/rep111.php @@ -68,6 +68,9 @@ function print_sales_quotations() for ($i = $from; $i <= $to; $i++) { $myrow = get_sales_order_header($i, ST_SALESQUOTE); + if ($currency != ALL_TEXT && $myrow['curr_code'] != $currency) { + continue; + } $baccount = get_default_bank_account($myrow['curr_code']); $params['bankaccount'] = $baccount['id']; $branch = get_branch($myrow["branch_code"]); diff --git a/reporting/rep112.php b/reporting/rep112.php index 45851689..4662a785 100644 --- a/reporting/rep112.php +++ b/reporting/rep112.php @@ -111,6 +111,9 @@ function print_receipts() $myrow = get_receipt($j, $i); if (!$myrow) continue; + if ($currency != ALL_TEXT && $myrow['curr_code'] != $currency) { + continue; + } $res = get_bank_trans($j, $i); $baccount = db_fetch($res); $params['bankaccount'] = $baccount['bank_act']; diff --git a/reporting/rep113.php b/reporting/rep113.php index f38fd4c1..c73388ab 100644 --- a/reporting/rep113.php +++ b/reporting/rep113.php @@ -74,6 +74,9 @@ function print_credits() continue; $sign = -1; $myrow = get_customer_trans($i, ST_CUSTCREDIT); + if ($currency != ALL_TEXT && $myrow['curr_code'] != $currency) { + continue; + } $baccount = get_default_bank_account($myrow['curr_code']); $params['bankaccount'] = $baccount['id']; diff --git a/reporting/rep209.php b/reporting/rep209.php index c1632dfd..31c82b0a 100644 --- a/reporting/rep209.php +++ b/reporting/rep209.php @@ -91,6 +91,9 @@ function print_po() for ($i = $from; $i <= $to; $i++) { $myrow = get_po($i); + if ($currency != ALL_TEXT && $myrow['curr_code'] != $currency) { + continue; + } $baccount = get_default_bank_account($myrow['curr_code']); $params['bankaccount'] = $baccount['id']; diff --git a/reporting/rep210.php b/reporting/rep210.php index 25000670..5b7634d2 100644 --- a/reporting/rep210.php +++ b/reporting/rep210.php @@ -108,6 +108,9 @@ function print_remittances() $myrow = get_remittance($j, $i); if (!$myrow) continue; + if ($currency != ALL_TEXT && $myrow['curr_code'] != $currency) { + continue; + } $res = get_bank_trans($j, $i); $baccount = db_fetch($res); $params['bankaccount'] = $baccount['bank_act']; -- 2.30.2