summaryrefslogtreecommitdiff
path: root/LedgerSMB/AA.pm
diff options
context:
space:
mode:
authoraurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46>2007-07-05 18:44:24 +0000
committeraurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46>2007-07-05 18:44:24 +0000
commit94903b12ecba837d8717bcf91b7bcc25556a996a (patch)
tree8e8185200c5a72e3cef0d7edf3391f38409a50ea /LedgerSMB/AA.pm
parent9aec614fb5c2470d3bb60e88bb6a71429d50b790 (diff)
Modifications to support toggling of the On-Hold field in the ar and ap tables;
An On-Hold toggle button was added to the Invoice Edit page, as well as a selector for All Invoices (default), Active Invoices, and Held Invoices to the AR and AP search pages. Modifications as needed to bring the code in line with linuxpoet's entity patches. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1350 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/AA.pm')
-rw-r--r--LedgerSMB/AA.pm21
1 files changed, 20 insertions, 1 deletions
diff --git a/LedgerSMB/AA.pm b/LedgerSMB/AA.pm
index 8c4c4ad9..5a523cd0 100644
--- a/LedgerSMB/AA.pm
+++ b/LedgerSMB/AA.pm
@@ -886,6 +886,25 @@ sub transactions {
WHERE lower(description)
LIKE '$var'))|;
}
+
+ if ($form->{invoice_type}) {
+
+ if ( $form->{invoice_type} == 2 ) {
+
+ $where .= qq|
+ AND a.on_hold = 'f'
+ |;
+ }
+
+ if ($form->{invoice_type} == 3) {
+
+ $where .= qq|
+ AND a.on_hold = 't'
+ |;
+ }
+ }
+
+ # the third state, all invoices, sets no explicit toggles. It just selects them all, as normal.
$query .= "WHERE $where
ORDER BY $sortorder";
@@ -972,7 +991,7 @@ sub get_name {
FROM $form->{vc} c
JOIN entity ON (entity.id = c.entity_id)
LEFT JOIN business b ON (b.id = c.business_id)
- WHERE c.id = ?|;
+ WHERE c.entity_id = ?|;
# TODO: Add location join
@queryargs = ( $form->{"$form->{vc}_id"} );