From 7dbc765886bff602f03ff53414d48eeb557c6944 Mon Sep 17 00:00:00 2001 From: Maxime Bourget Date: Thu, 2 May 2013 22:44:43 +0100 Subject: [PATCH] Add customer filter in Invoice report --- reporting/rep107.php | 9 +++++++-- reporting/reports_main.php | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/reporting/rep107.php b/reporting/rep107.php index 94681d90..b0f6be77 100644 --- a/reporting/rep107.php +++ b/reporting/rep107.php @@ -42,7 +42,8 @@ function print_invoices() $email = $_POST['PARAM_3']; $pay_service = $_POST['PARAM_4']; $comments = $_POST['PARAM_5']; - $orientation = $_POST['PARAM_6']; + $customer = $_POST['PARAM_6']; + $orientation = $_POST['PARAM_7']; if (!$from || !$to) return; @@ -73,6 +74,10 @@ function print_invoices() continue; $sign = 1; $myrow = get_customer_trans($i, ST_SALESINVOICE); + + if($customer && $myrow['debtor_no'] != $customer) { + continue; + } $baccount = get_default_bank_account($myrow['curr_code']); $params['bankaccount'] = $baccount['id']; @@ -208,4 +213,4 @@ function print_invoices() $rep->End(); } -?> \ No newline at end of file +?> diff --git a/reporting/reports_main.php b/reporting/reports_main.php index f0e9e010..e1995d14 100644 --- a/reporting/reports_main.php +++ b/reporting/reports_main.php @@ -99,7 +99,9 @@ $reports->addReport(RC_CUSTOMER, 107, _('Print &Invoices'), _('email Customers') => 'YES_NO', _('Payment Link') => 'PAYMENT_LINK', _('Comments') => 'TEXTBOX', - _('Orientation') => 'ORIENTATION')); + _('Customer') => 'CUSTOMERS_NO_FILTER', + _('Orientation') => 'ORIENTATION' +)); $reports->addReport(RC_CUSTOMER, 113, _('Print &Credit Notes'), array( _('From') => 'CREDIT', _('To') => 'CREDIT', -- 2.30.2