Add customer filter in Invoice report
authorMaxime Bourget <bmx007@gmail.com>
Thu, 2 May 2013 21:44:43 +0000 (22:44 +0100)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 8 May 2013 05:33:36 +0000 (07:33 +0200)
reporting/rep107.php
reporting/reports_main.php

index 94681d9010e20f2203b04cd37efae6a419708ad3..b0f6be77e307e57d020eb8dc298c2dcca50f8d18 100644 (file)
@@ -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
+?>
index f0e9e0101d461cce800f6e9824d7c9339faff351..e1995d141e7eb7b861d6b89e16990cc00cc13c9f 100644 (file)
@@ -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',