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

SF.net SVN: ledger-smb:[4859] branches/1.3



Revision: 4859
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4859&view=rev
Author:   einhverfr
Date:     2012-06-07 09:57:54 +0000 (Thu, 07 Jun 2012)
Log Message:
-----------
Preventing voided invoices from being voided again

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/bin/is.pl

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2012-06-07 08:58:57 UTC (rev 4858)
+++ branches/1.3/Changelog	2012-06-07 09:57:54 UTC (rev 4859)
@@ -5,6 +5,7 @@
 Changelog for 1.3.19
 * New link for customer/vendor when not a dropdown (Chris T)
 * Removed file debugging code from file.pl (Chris T)
+* fixed can void voids. (Chris T, h/t Erik Huelsmann, item 3515561)
 
 Changelog for 1.3.18
 * Fixed missing template for CSV pricelists (Chris T)

Modified: branches/1.3/bin/is.pl
===================================================================
--- branches/1.3/bin/is.pl	2012-06-07 08:58:57 UTC (rev 4858)
+++ branches/1.3/bin/is.pl	2012-06-07 09:57:54 UTC (rev 4859)
@@ -590,6 +590,11 @@
 }
 
 sub void {
+    if ($form->{invnumber} =~ /-VOID$/){
+       $form->error($locale->text(
+           "Can't void a voided invoice!"
+       ));
+    }
     for my $i (1 .. $form->{rowcount}){
         $form->{"qty_$_"} *= -1;
     }
@@ -952,17 +957,17 @@
             'on_hold' =>
               { ndx => 12, key => 'O', value => $locale->text('On Hold') },
              'void'  => 
-                { ndx => 12, key => 'V', value => $locale->text('Void') },
+                { ndx => 13, key => 'V', value => $locale->text('Void') },
              'save_info'  => 
-                { ndx => 13, key => 'I', value => $locale->text('Save Info') },
+                { ndx => 14, key => 'I', value => $locale->text('Save Info') },
             'new_screen' => # Create a blank ar/ap invoice.
-             { ndx => 14, key=> 'N', value => $locale->text('New') }
+             { ndx => 15, key=> 'N', value => $locale->text('New') }
 
         );
 
 
+       delete $button{void} if $form->{invnumber} =~ /-VOID/;
 
-
         if ( $form->{id} ) {
 
             if ( $form->{locked} || $transdate <= $closedto ) {
@@ -998,7 +1003,6 @@
                 %button = ();
             }
         }
-
         for ( sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button )
         {
             $form->print_button( \%button, $_ );
@@ -1510,4 +1514,3 @@
 }
 
 
-

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