From dafa2c0c32b771543d1c674db414df3c5bce3b57 Mon Sep 17 00:00:00 2001
From: einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>
Date: Thu, 14 Sep 2006 05:19:11 +0000
Subject: Batch printing works for checks.  One odd bug remains however in that
 when you print and post it sends a blank/invalid postscript or pdf to the
 screen.  The item is properly queued however.  There may be a difference as
 to how print and post works on the newer versions.  Will have to continue to
 look into this.

git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@87 4979c152-3d1c-0410-bac9-87ea11338e46
---
 LedgerSMB/BP.pm        |  4 ++--
 bin/mozilla/arapprn.pl | 16 ++++++++++++++++
 menu.ini               |  7 +++++++
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/LedgerSMB/BP.pm b/LedgerSMB/BP.pm
index 1d863389..011a70d6 100755
--- a/LedgerSMB/BP.pm
+++ b/LedgerSMB/BP.pm
@@ -50,7 +50,7 @@ sub get_vc {
 				 sales_quotation => ['oe'],
 				 request_quotation => ['oe'],
 				 timecard => ['jcitems'],
-				 check => ['ar'],
+				 check => ['ap'],
 		);
 
 	my $query = "";
@@ -126,7 +126,7 @@ sub get_spoolfiles {
 				 sales_quotation => ['oe'],
 				 request_quotation => ['oe'],
 				 timecard => ['jc'],
-				 check => ['ar'],
+				 check => ['ap'],
 		);
 
 	($form->{transdatefrom}, $form->{transdateto}) = $form->from_to($form->{year}, $form->{month}, $form->{interval}) if $form->{year} && $form->{month};
diff --git a/bin/mozilla/arapprn.pl b/bin/mozilla/arapprn.pl
index 6bb808cf..26831b1d 100755
--- a/bin/mozilla/arapprn.pl
+++ b/bin/mozilla/arapprn.pl
@@ -114,6 +114,17 @@ sub print {
     $filename .= $$;
   }
 
+  $filename .= ($form->{format} eq 'postscript') ? '.ps' : '.pdf';
+  $form->{OUT} = ">$spool/$filename";
+
+  $form->{queued} .= " $form->{formname} $filename";
+  $form->{queued} =~ s/^ //;
+  $printform = new Form;
+  for (keys %$form){
+    $printform->{$_} = $form->{$_};
+  }
+
+
   if ($form->{printandpost}){
     &post;
   } else {
@@ -204,6 +215,11 @@ sub print_check {
                    id          => $form->{id} );
 
     $old_form->{audittrail} .= $form->audittrail("", \%myconfig, \%audittrail);
+    $filename .= ($old_form->{format} eq 'postscript') ? '.ps' : '.pdf';
+    $old_form->{OUT} = ">$spool/$filename";
+
+    $old_form->{queued} .= " $form->{formname} $filename";
+    $old_form->{queued} =~ s/^ //;
   }
 
   if ($form->{media} !~ /(screen|queue)/) {
diff --git a/menu.ini b/menu.ini
index e637f72b..02485adc 100644
--- a/menu.ini
+++ b/menu.ini
@@ -528,6 +528,13 @@ action=acc_menu
 target=acc_menu
 submenu=1
 
+[Batch Printing--Print--Checks]
+module=bp.pl
+action=search
+type=check
+vc=vendor
+
+
 [Batch Printing--Print--Sales Invoices]
 module=bp.pl
 action=search
-- 
cgit v1.2.3