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

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



Revision: 6694
          http://sourceforge.net/p/ledger-smb/code/6694
Author:   einhverfr
Date:     2014-01-28 14:47:59 +0000 (Tue, 28 Jan 2014)
Log Message:
-----------
Added db support for multiple payment accounts for payment reports, fixed unapproved transactions showing up.
I have not allowed multiple accounts via the UI currently because this can't currently work with batch workflows.  This may take some more time to look at doing here.

Modified Paths:
--------------
    trunk/UI/Reports/filters/payments.html
    trunk/sql/modules/Payment.sql

Modified: trunk/UI/Reports/filters/payments.html
===================================================================
--- trunk/UI/Reports/filters/payments.html	2014-01-28 14:26:53 UTC (rev 6693)
+++ trunk/UI/Reports/filters/payments.html	2014-01-28 14:47:59 UTC (rev 6694)
@@ -53,7 +53,8 @@
 		label = text('Name')
 	} ?> --></div>
 <div class="input" id="account_input_div">
-	<?lsmb INCLUDE select element_data = {
+	<?lsmb 
+             INCLUDE select element_data = {
 		name           = "cash_accno"
 		options        = cash_accounts
 		default_values = [cash_accno]

Modified: trunk/sql/modules/Payment.sql
===================================================================
--- trunk/sql/modules/Payment.sql	2014-01-28 14:26:53 UTC (rev 6693)
+++ trunk/sql/modules/Payment.sql	2014-01-28 14:47:59 UTC (rev 6694)
@@ -1051,10 +1051,10 @@
 				ch.description]]), a.source, 
 			b.control_code, b.description, a.voucher_id, a.transdate
 		FROM entity_credit_account c
-		JOIN ( select entity_credit_account, id, curr
+		JOIN ( select entity_credit_account, id, curr, approved
 			FROM ar WHERE in_entity_class = 2
 			UNION
-			SELECT entity_credit_account, id, curr
+			SELECT entity_credit_account, id, curr, approved
 			FROM ap WHERE in_entity_class = 1
 			) arap ON (arap.entity_credit_account = c.id)
 		JOIN acc_trans a ON (arap.id = a.trans_id)
@@ -1062,13 +1062,20 @@
 		JOIN company co ON (c.entity_id = co.entity_id)
 		LEFT JOIN voucher v ON (v.id = a.voucher_id)
 		LEFT JOIN batch b ON (b.id = v.batch_id)
-		WHERE (ch.accno = in_cash_accno)
+		WHERE (ch.accno = in_cash_accno OR ch.id IN (select account_id 
+                                                               FROM account_link
+                                                              WHERE description
+                                                                    IN(
+                                                                     'AR_paid',
+                                                                     'AP_paid'
+                                                                    )))
                         AND (in_currency IS NULL OR in_currency = arap.curr)
 			AND (c.id = in_credit_id OR in_credit_id IS NULL)
 			AND (a.transdate >= in_date_from 
 				OR in_date_from IS NULL)
 			AND (a.transdate <= in_date_to OR in_date_to IS NULL)
 			AND (source = in_source OR in_source IS NULL)
+                        AND arap.approved AND a.approved
 		GROUP BY c.meta_number, c.id, co.legal_name, a.transdate, 
 			a.source, a.memo, b.id, b.control_code, b.description, 
                         voucher_id

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


------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits