From 680751df05bcf5102084f465b8e781cac7337928 Mon Sep 17 00:00:00 2001 From: tetragon Date: Sun, 28 Oct 2007 18:32:29 +0000 Subject: Finish templating bin/bp.pl Adjust LSMB::BP's get_spoolfiles to not blow up during tests git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1822 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/BP.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'LedgerSMB/BP.pm') diff --git a/LedgerSMB/BP.pm b/LedgerSMB/BP.pm index 4eaade6b..ae75d7ff 100644 --- a/LedgerSMB/BP.pm +++ b/LedgerSMB/BP.pm @@ -200,13 +200,14 @@ sub get_spoolfiles { $query .= qq| $union - SELECT a.id, vc.name, a.$invnumber AS invnumber, a.transdate, + SELECT a.id, c.legal_name AS name, a.$invnumber AS invnumber, a.transdate, a.ordnumber, a.quonumber, $invoice AS invoice, '$item' AS module, s.spoolfile - FROM $item a, $form->{vc} vc, status s + FROM $item a, $form->{vc} vc, status s, company c WHERE s.trans_id = a.id AND s.spoolfile IS NOT NULL AND s.formname = ? + AND c.entity_id = vc.entity_id AND a.entity_id = vc.entity_id|; push( @queryargs, $form->{type} ); @@ -217,7 +218,7 @@ sub get_spoolfiles { if ( $form->{ $form->{vc} } ne "" ) { $item = $form->like( lc $form->{ $form->{vc} } ); - $query .= " AND lower(vc.name) LIKE ?"; + $query .= " AND lower(c.legal_name) LIKE ?"; push @queryargs, $item; } } @@ -331,6 +332,7 @@ sub delete_spool { sub print_spool { my ( $self, $myconfig, $form ) = @_; + ##SC: XXX May need to be changed after hooking up printing to templates # connect to database my $dbh = $form->{dbh}; -- cgit v1.2.3