[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[5541] trunk



Revision: 5541
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5541&view=rev
Author:   einhverfr
Date:     2013-01-12 07:36:35 +0000 (Sat, 12 Jan 2013)
Log Message:
-----------
Fixing open/closed handling of invoice search

Modified Paths:
--------------
    trunk/LedgerSMB/Report/Invoices/Transactions.pm
    trunk/UI/Reports/filters/invoice_search.html
    trunk/sql/modules/Report.sql

Modified: trunk/LedgerSMB/Report/Invoices/Transactions.pm
===================================================================
--- trunk/LedgerSMB/Report/Invoices/Transactions.pm	2013-01-11 10:16:53 UTC (rev 5540)
+++ trunk/LedgerSMB/Report/Invoices/Transactions.pm	2013-01-12 07:36:35 UTC (rev 5541)
@@ -169,7 +169,21 @@
 
 has tax_account_id => (is => 'ro', isa => 'Int', required => 0);
 
+=item open bool
 
+If true, show open invoices
+
+=item closed bool
+
+If true, show closed invoices.  Naturally if neither open or closed is set, no
+invoices will be shown.
+
+=cut
+
+has open => (is => 'ro', isa => 'Bool', required => 0);
+has closed => (is => 'ro', isa => 'Bool', required => 0);
+
+
 =back
 
 =head1 INTERNLS

Modified: trunk/UI/Reports/filters/invoice_search.html
===================================================================
--- trunk/UI/Reports/filters/invoice_search.html	2013-01-11 10:16:53 UTC (rev 5540)
+++ trunk/UI/Reports/filters/invoice_search.html	2013-01-12 07:36:35 UTC (rev 5541)
@@ -324,7 +324,7 @@
                    label = text('Due Date') #'
         } ?></td>
         <td><?lsmb PROCESS input element_data = {
-                    name = 'col_amount_due'
+                    name = 'col_due'
                     type = 'checkbox'
                    value = '1' 
                    label = text('Amount Due') #'

Modified: trunk/sql/modules/Report.sql
===================================================================
--- trunk/sql/modules/Report.sql	2013-01-11 10:16:53 UTC (rev 5540)
+++ trunk/sql/modules/Report.sql	2013-01-12 07:36:35 UTC (rev 5541)
@@ -464,7 +464,7 @@
  in_employee_id int, in_manager_id int, in_invnumber text, in_ordnumber text,
  in_ponumber text, in_source text, in_description text, in_notes text, 
  in_shipvia text, in_from_date date, in_to_date date, in_on_hold bool,
- in_taxable bool, in_tax_account_id int)
+ in_taxable bool, in_tax_account_id int, in_open bool, in_closed bool)
 RETURNS SETOF aa_transactions_line LANGUAGE PLPGSQL AS $$
 
 DECLARE retval aa_transactions_line;
@@ -542,6 +542,10 @@
                                    WHERE ac.trans_id = a.id 
                                          AND al.description ilike '%tax'))
             )
+            AND ( -- open/closed handling
+              (in_open IS TRUE AND p.due <> 0) 
+              OR (in_closed IS TRUE AND p.due = 0)
+            )
 
 LOOP
 

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.