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

SF.net SVN: ledger-smb:[3526] trunk/bin



Revision: 3526
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3526&view=rev
Author:   einhverfr
Date:     2011-07-15 22:25:37 +0000 (Fri, 15 Jul 2011)

Log Message:
-----------
correcting bug 3363524

Modified Paths:
--------------
    trunk/bin/aa.pl
    trunk/bin/ir.pl
    trunk/bin/is.pl

Modified: trunk/bin/aa.pl
===================================================================
--- trunk/bin/aa.pl	2011-07-15 18:33:19 UTC (rev 3525)
+++ trunk/bin/aa.pl	2011-07-15 22:25:37 UTC (rev 3526)
@@ -89,6 +89,24 @@
 # $locale->text('Nov')
 # $locale->text('Dec')
 
+sub copy_to_new{
+    delete $form->{id};
+    delete $form->{invnumber};
+    update();
+}
+
+sub new_screen {
+    use LedgerSMB::Form;
+    my @reqprops = qw(ARAP vc dbh stylesheet);
+    $oldform = $form;
+    $form = {};
+    bless $form, Form;
+    for (@reqprops){
+        $form->{$_} = $oldform->{$_};
+    }
+    &add();
+}
+
 sub add {
 
     $form->{title} = "Add";
@@ -955,6 +973,10 @@
         %button = (
             'update' =>
               { ndx => 1, key => 'U', value => $locale->text('Update') },
+            'copy_to_new' => # Shares an index with copy because one or the other
+                             # must be deleted.  One can only either copy or 
+                             # update, not both. --CT
+              { ndx => 1, key => 'C', value => $locale->text('Copy to New') },
             'print' =>
               { ndx => 2, key => 'P', value => $locale->text('Print') },
             'post' => { ndx => 3, key => 'O', value => $locale->text('Post') },
@@ -963,13 +985,6 @@
                 key   => 'R',
                 value => $locale->text('Print and Post')
             },
-            'post_as_new' =>
-              { ndx => 5, key => 'N', value => $locale->text('Post as new') },
-            'print_and_post_as_new' => {
-                ndx   => 6,
-                key   => 'W',
-                value => $locale->text('Print and Post as new')
-            },
             'schedule' =>
               { ndx => 7, key => 'H', value => $locale->text('Schedule') },
             'delete' =>
@@ -977,6 +992,8 @@
 
             'save_info' => 
               { ndx => 9, key => 'I', value => $locale->text('Save Info') },
+            'new_screen' => # Create a blank ar/ap invoice.
+             { ndx => 10, key=> 'N', value => $locale->text('New') }
         );
         if (!$form->{approved} && !$form->{batch_id}){
            $button{approve} = { 
@@ -1020,7 +1037,7 @@
         elsif (!$form->{id}) {
 
             for ( "post_as_new", "print_and_post_as_new", "delete","save_info",
-                  "print") {
+                  "print", 'copy', 'new_screen') {
                 delete $button{$_};
             }
             delete $button{"print_and_post"} if !${LedgerSMB::Sysconfig::latex};
@@ -1031,6 +1048,11 @@
                 }
             }
         }
+        if ($form->{id}){
+            for ( "update", "post_as_new", "print_and_post_as_new"){
+               delete $button{$_};
+            }
+        }
 
         for ( sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button )
         {

Modified: trunk/bin/ir.pl
===================================================================
--- trunk/bin/ir.pl	2011-07-15 18:33:19 UTC (rev 3525)
+++ trunk/bin/ir.pl	2011-07-15 22:25:37 UTC (rev 3526)
@@ -48,7 +48,25 @@
 1;
 
 # end of main
+sub copy_to_new{
+    delete $form->{id};
+    delete $form->{invnumber};
+    update();
+}
 
+sub new_screen {
+    use LedgerSMB::Form;
+    my @reqprops = qw(ARAP vc dbh stylesheet type);
+    $oldform = $form;
+    $form = {};
+    bless $form, Form;
+    for (@reqprops){
+        $form->{$_} = $oldform->{$_};
+    }
+    &add();
+}
+
+
 sub add {
     if ($form->{type} eq 'debit_invoice'){
         $form->{title} = $locale->text('Add Debit Invoice');
@@ -794,6 +812,10 @@
         %button = (
             'update' =>
               { ndx => 1, key => 'U', value => $locale->text('Update') },
+            'copy_to_new' => # Shares an index with copy because one or the other
+                             # must be deleted.  One can only either copy or 
+                             # update, not both. --CT
+              { ndx => 1, key => 'C', value => $locale->text('Copy to New') },
             'post' => { ndx => 3, key => 'O', value => $locale->text('Post') },
             'post_as_new' =>
               { ndx => 5, key => 'N', value => $locale->text('Post as new') },
@@ -810,6 +832,8 @@
               { ndx => 9, key=> 'O', value => $locale->text('On Hold') },
 	    'save_info'  => 
                 { ndx => 10, key => 'I', value => $locale->text('Save Info') },
+            'new_screen' => # Create a blank ar/ap invoice.
+             { ndx => 11, key=> 'N', value => $locale->text('New') }
         );
 
         if ( $form->{id} ) {
@@ -817,6 +841,9 @@
             if ( $form->{locked} ) {
                 for ( "post", "delete", 'on_hold' ) { delete $button{$_} }
             }
+            for ( 'post_as_new', 'print_and_post_as_new', "update") {
+                delete $button{$_};
+            }
 
         }
         else {

Modified: trunk/bin/is.pl
===================================================================
--- trunk/bin/is.pl	2011-07-15 18:33:19 UTC (rev 3525)
+++ trunk/bin/is.pl	2011-07-15 22:25:37 UTC (rev 3526)
@@ -55,6 +55,26 @@
 # end of main
 sub on_update{}
 
+sub copy_to_new{
+    delete $form->{id};
+    delete $form->{invnumber};
+    update();
+}
+
+sub new_screen {
+    use LedgerSMB::Form;
+    my @reqprops = qw(ARAP vc dbh stylesheet type);
+    $oldform = $form;
+    $form = {};
+    bless $form, Form;
+    for (@reqprops){
+        $form->{$_} = $oldform->{$_};
+    }
+    &add();
+}
+
+
+
 sub add {
     if ($form->{type} eq 'credit_invoice'){
         $form->{title} = $locale->text('Add Credit Invoice');
@@ -887,6 +907,10 @@
         %button = (
             'update' =>
               { ndx => 1, key => 'U', value => $locale->text('Update') },
+            'copy_to_new' => # Shares an index with copy because one or the other
+                             # must be deleted.  One can only either copy or 
+                             # update, not both. --CT
+              { ndx => 1, key => 'C', value => $locale->text('Copy to New') },
             'print' =>
               { ndx => 2, key => 'P', value => $locale->text('Print') },
             'post' => { ndx => 3, key => 'O', value => $locale->text('Post') },
@@ -918,6 +942,8 @@
                 { ndx => 12, key => 'V', value => $locale->text('Void') },
              'save_info'  => 
                 { ndx => 13, key => 'I', value => $locale->text('Save Info') },
+            'new_screen' => # Create a blank ar/ap invoice.
+             { ndx => 14, key=> 'N', value => $locale->text('New') }
 
         );
 
@@ -937,6 +963,9 @@
                     delete $button{$_};
                 }
             }
+            for ("update", "post", "post_as_new", "print_and_post_as_new"){
+                delete $button{$_};
+            } 
 
         }
         else {


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