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

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



Revision: 81
          http://svn.sourceforge.net/ledger-smb/?rev=81&view=rev
Author:   einhverfr
Date:     2006-09-12 23:45:11 -0700 (Tue, 12 Sep 2006)

Log Message:
-----------
Added most of the code for batch printing for checks.  Doesn't quite work yet 
but nothing else should be broken.  If we have to, I suppose we could disable 
the UI option in the next release if necessary.

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/BP.pm
    trunk/bin/mozilla/aa.pl
    trunk/bin/mozilla/ap.pl
    trunk/bin/mozilla/arapprn.pl
    trunk/bin/mozilla/bp.pl

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2006-09-13 06:12:06 UTC (rev 80)
+++ trunk/Changelog	2006-09-13 06:45:11 UTC (rev 81)
@@ -1,5 +1,15 @@
-Changelog for LedgerSMB v 2.6.17
+Changelog for LedgerSMV 1.1.0
 
+* 
+* Warnings are printed when check stub is truncated
+* Protection against duplicate transaction id's.
+* FLOAT datatypes removed from database
+* Sales Data Report added
+* SL2LS.pl now dies if it cannot open the files.
+* Corrected directory transversal bug
+
+Changelog for LedgerSMB v 1.0.0
+
 (Changes relative to the pre-fork SQL-Ledger 2.6.17)
 
 * Corrected sessionid security hole allowing bypass of login to main application

Modified: trunk/LedgerSMB/BP.pm
===================================================================
--- trunk/LedgerSMB/BP.pm	2006-09-13 06:12:06 UTC (rev 80)
+++ trunk/LedgerSMB/BP.pm	2006-09-13 06:45:11 UTC (rev 81)
@@ -49,7 +49,9 @@
 				 bin_list => ['oe'],
 				 sales_quotation => ['oe'],
 				 request_quotation => ['oe'],
-				 timecard => ['jcitems'],);
+				 timecard => ['jcitems'],
+				 check => ['ar'],
+		);
 
 	my $query = "";
 	my $sth;
@@ -123,7 +125,9 @@
 				 bin_list => ['oe'],
 				 sales_quotation => ['oe'],
 				 request_quotation => ['oe'],
-				 timecard => ['jc'],);
+				 timecard => ['jc'],
+				 check => ['ar'],
+		);
 
 	($form->{transdatefrom}, $form->{transdateto}) = $form->from_to($form->{year}, $form->{month}, $form->{interval}) if $form->{year} && $form->{month};
 

Modified: trunk/bin/mozilla/aa.pl
===================================================================
--- trunk/bin/mozilla/aa.pl	2006-09-13 06:12:06 UTC (rev 80)
+++ trunk/bin/mozilla/aa.pl	2006-09-13 06:45:11 UTC (rev 81)
@@ -963,6 +963,10 @@
   }
 
   if (AA->post_transaction(\%myconfig, \%$form)) {
+    $form->update_status(\%myconfig);
+    if ($form->{printandpost}){
+      &{ "print_$form->{formname}" }($old_form, 1);
+    }
     $form->redirect($locale->text('Transaction posted!'));
   } else {
     $form->error($locale->text('Cannot post transaction!'));

Modified: trunk/bin/mozilla/ap.pl
===================================================================
--- trunk/bin/mozilla/ap.pl	2006-09-13 06:12:06 UTC (rev 80)
+++ trunk/bin/mozilla/ap.pl	2006-09-13 06:45:11 UTC (rev 81)
@@ -46,7 +46,7 @@
 #======================================================================
 
 use LedgerSMB::PE;
-use Ledger::IR;
+use LedgerSMB::IR;
 
 require "$form->{path}/arap.pl";
 require "$form->{path}/arapprn.pl";

Modified: trunk/bin/mozilla/arapprn.pl
===================================================================
--- trunk/bin/mozilla/arapprn.pl	2006-09-13 06:12:06 UTC (rev 80)
+++ trunk/bin/mozilla/arapprn.pl	2006-09-13 06:45:11 UTC (rev 81)
@@ -105,9 +105,22 @@
     }
     
   }
+  if ($filename = $queued{$form->{formname}}) {
+    $form->{queued} =~ s/$form->{formname} $filename//;
+    unlink "$spool/$filename";
+    $filename =~ s/\..*$//g;
+  } else {
+    $filename = time;
+    $filename .= $$;
+  }
 
-  &{ "print_$form->{formname}" }($old_form, 1);
+  if ($form->{printandpost}){
+    &post;
+  } else {
+    &{ "print_$form->{formname}" }($old_form, 1);
+  }
 
+
 }
 
 
@@ -177,8 +190,27 @@
   if ($form->{format} =~ /(postscript|pdf)/) {
     $form->{IN} =~ s/html$/tex/;
   }
+  if ($form->{media} eq 'queue') {
 
-  if ($form->{media} !~ /(screen)/) {
+    # save status
+    $form->update_status(\%myconfig);
+
+    $old_form->{queued} = $form->{queued};
+
+    %audittrail = ( tablename   => ($order) ? 'oe' : lc $ARAP,
+                    reference   => $form->{"${inv}number"},
+                   formname    => $form->{formname},
+                   action      => 'queued',
+                   id          => $form->{id} );
+
+    $old_form->{audittrail} .= $form->audittrail("", \%myconfig, \%audittrail);
+  }
+
+  if ($form->{media} !~ /(screen|queue)/) {
+
+    %queued = split / /, $form->{queued};
+
+
     $form->{OUT} = "| $printer{$form->{media}}";
     
     if ($form->{printed} !~ /$form->{formname}/) {
@@ -363,8 +395,39 @@
   if ($form->{format} =~ /(postscript|pdf)/) {
     $form->{IN} =~ s/html$/tex/;
   }
+  if ($form->{media} eq 'queue') {
+    %queued = split / /, $form->{queued};
 
-  if ($form->{media} !~ /(screen)/) {
+    if ($filename = $queued{$form->{formname}}) {
+      $form->{queued} =~ s/$form->{formname} $filename//;
+      unlink "$spool/$filename";
+      $filename =~ s/\..*$//g;
+    } else {
+      $filename = time;
+      $filename .= $$;
+    }
+
+    $filename .= ($form->{format} eq 'postscript') ? '.ps' : '.pdf';
+    $form->{OUT} = ">$spool/$filename";
+
+    $form->{queued} .= " $form->{formname} $filename";
+    $form->{queued} =~ s/^ //;
+
+    # save status
+    $form->update_status(\%myconfig);
+
+    $old_form->{queued} = $form->{queued};
+
+    %audittrail = ( tablename   => ($order) ? 'oe' : lc $ARAP,
+                    reference   => $form->{"${inv}number"},
+                   formname    => $form->{formname},
+                   action      => 'queued',
+                   id          => $form->{id} );
+
+    $old_form->{audittrail} .= $form->audittrail("", \%myconfig, \%audittrail);
+  }
+
+  if ($form->{media} !~ /(queue|screen)/) {
     $form->{OUT} = "| $printer{$form->{media}}";
     
     if ($form->{printed} !~ /$form->{formname}/) {
@@ -556,6 +619,7 @@
     $form->{selectformat} .= qq|
             <option value="postscript">|.$locale->text('Postscript').qq|
 	    <option value="pdf">|.$locale->text('PDF');
+    $media .= qq|<option value="queue">|.$locale->text('Queue');
   }
 
   $format = qq|<select name=format>$form->{selectformat}</select>|;

Modified: trunk/bin/mozilla/bp.pl
===================================================================
--- trunk/bin/mozilla/bp.pl	2006-09-13 06:12:06 UTC (rev 80)
+++ trunk/bin/mozilla/bp.pl	2006-09-13 06:45:11 UTC (rev 81)
@@ -83,6 +83,7 @@
              sales_quotation => { title => 'Quotations', name => 'Customer' },
              request_quotation => { title => 'RFQs', name => 'Vendor' },
              timecard => { title => 'Time Cards', name => 'Employee' },
+	     check => {title => 'Check', name => 'Vendor'},
 	   );
 
   $label{invoice}{invnumber} = qq|


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