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

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



Revision: 6867
          http://sourceforge.net/p/ledger-smb/code/6867
Author:   einhverfr
Date:     2014-02-17 10:08:27 +0000 (Mon, 17 Feb 2014)
Log Message:
-----------
adding buttons to both top and bottom of invoice and order screens.  This hopefully makes the buttons more accessible on many reports, but it also will hopefully address the situation where js fails and enter activates an [X] button, dropping the part off the screen

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

Modified: trunk/bin/ir.pl
===================================================================
--- trunk/bin/ir.pl	2014-02-17 09:51:29 UTC (rev 6866)
+++ trunk/bin/ir.pl	2014-02-17 10:08:27 UTC (rev 6867)
@@ -581,6 +581,80 @@
   </tr>
 |;
 
+    if ( !$form->{readonly} ) {
+        print qq|<tr><td>|;
+        %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') },
+            'purchase_order' => {
+                ndx   => 6,
+                key   => 'L',
+                value => $locale->text('Purchase Order')
+            },
+            'schedule' =>
+              { ndx => 7, key => 'H', value => $locale->text('Schedule') },
+            'on_hold' =>
+              { 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->{separate_duties} or $form->{batch_id}){
+           $button{'post'}->{value} = $locale->text('Save');
+        }
+
+        if ( $form->{id} ) {
+         
+            for ( "post", "delete") { delete $button{$_} }
+            for ( 'post_as_new', 'print_and_post_as_new', "update") {
+                delete $button{$_};
+            }
+            my $is_draft = 0;
+            if (!$form->{approved}){
+               $is_draft = 1;
+               $button{approve} = { 
+                       ndx   => 3, 
+                       key   => 'O', 
+                       value => $locale->text('Post as Saved') };
+               if (grep /^lsmb_$form->{company}__draft_modify$/, @{$form->{_roles}}){
+                   $button{edit_and_save} = { 
+                       ndx   => 4, 
+                       key   => 'E', 
+                       value => $locale->text('Save as Shown') };
+              }
+               # Delete these for batches too
+               delete $button{$_}
+                 for qw(post_as_new post e_mail sales_order void print on_hold); 
+            }
+
+        }
+        else {
+
+            if ( $transdate > $closedto ) {
+                for ( 'update', 'post', 'schedule' ) { $allowed{$_} = 1 }
+                for ( keys %button ) { delete $button{$_} if !$allowed{$_} }
+            }
+            elsif ($closedto) {
+                %buttons = ();
+            }
+        }
+
+        for ( sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button )
+        {
+            $form->print_button( \%button, $_ );
+        }
+
+    }
+
     $form->hide_form(qw(selectcurrency defaultcurrency taxaccounts));
 
     for ( split / /, $form->{taxaccounts} ) {
@@ -917,71 +991,6 @@
     # type=submit $locale->text('Delete')
 
     if ( !$form->{readonly} ) {
-        %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') },
-            'purchase_order' => {
-                ndx   => 6,
-                key   => 'L',
-                value => $locale->text('Purchase Order')
-            },
-            'schedule' =>
-              { ndx => 7, key => 'H', value => $locale->text('Schedule') },
-            'on_hold' =>
-              { 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->{separate_duties} or $form->{batch_id}){
-           $button{'post'}->{value} = $locale->text('Save');
-        }
-
-        if ( $form->{id} ) {
-         
-            for ( "post", "delete") { delete $button{$_} }
-            for ( 'post_as_new', 'print_and_post_as_new', "update") {
-                delete $button{$_};
-            }
-            my $is_draft = 0;
-            if (!$form->{approved}){
-               $is_draft = 1;
-               $button{approve} = { 
-                       ndx   => 3, 
-                       key   => 'O', 
-                       value => $locale->text('Post as Saved') };
-               if (grep /^lsmb_$form->{company}__draft_modify$/, @{$form->{_roles}}){
-                   $button{edit_and_save} = { 
-                       ndx   => 4, 
-                       key   => 'E', 
-                       value => $locale->text('Save as Shown') };
-              }
-               # Delete these for batches too
-               delete $button{$_}
-                 for qw(post_as_new post e_mail sales_order void print on_hold); 
-            }
-
-        }
-        else {
-
-            if ( $transdate > $closedto ) {
-                for ( 'update', 'post', 'schedule' ) { $allowed{$_} = 1 }
-                for ( keys %button ) { delete $button{$_} if !$allowed{$_} }
-            }
-            elsif ($closedto) {
-                %buttons = ();
-            }
-        }
-
         for ( sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button )
         {
             $form->print_button( \%button, $_ );

Modified: trunk/bin/is.pl
===================================================================
--- trunk/bin/is.pl	2014-02-17 09:51:29 UTC (rev 6866)
+++ trunk/bin/is.pl	2014-02-17 10:08:27 UTC (rev 6867)
@@ -633,7 +633,105 @@
         $form->hide_form( "${item}_rate", "${item}_description",
             "${item}_taxnumber" );
     }
+    if ( !$form->{readonly} ) {
+        print "<tr><td>";
+        
+        # changes by Aurynn to add an On Hold button
 
+        %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') },
+            'ship_to' =>
+              { ndx => 4, key => 'T', value => $locale->text('Ship to') },
+            'e_mail' =>
+              { ndx => 5, key => 'E', value => $locale->text('E-mail') },
+            'sales_order' =>
+              { ndx => 9, key => 'L', value => $locale->text('Sales Order') },
+            'schedule' =>
+              { ndx => 10, key => 'H', value => $locale->text('Schedule') },
+            'on_hold' =>
+              { ndx => 12, key => 'O',  value => $hold_button_text },
+             'void'  => 
+                { ndx => 13, key => 'V', value => $locale->text('Void') },
+             'save_info'  => 
+                { ndx => 14, key => 'I', value => $locale->text('Save Info') },
+            'new_screen' => # Create a blank ar/ap invoice.
+             { ndx => 15, key=> 'N', value => $locale->text('New') }
+
+        );
+
+
+        if ($form->{separate_duties} or $form->{batch_id}){
+           $button{'post'}->{value} = $locale->text('Save');
+        }
+       delete $button{void} if $form->{invnumber} =~ /-VOID/;
+
+        if ( $form->{id} ) {
+
+            for ( "post", "print_and_post", "delete" ) {
+                delete $button{$_};
+            }
+            my $is_draft = 0;
+            if (!$form->{approved} && !$form->{batch_id}){
+               if (!$form->{batch_id}){
+                   $is_draft = 1;
+                   $button{approve} = { 
+                       ndx   => 3, 
+                       key   => 'O', 
+                       value => $locale->text('Post as Saved') };
+                   if (grep /^lsmb_$form->{company}__draft_modify$/, @{$form->{_roles}}){
+                       $button{edit_and_save} = { 
+                           ndx   => 4, 
+                           key   => 'E', 
+                           value => $locale->text('Save as Shown') };
+                   }
+              }
+               delete $button{$_}
+                 for qw(post_as_new post e_mail sales_order void print on_hold); 
+           }
+
+            if ( !${LedgerSMB::Sysconfig::latex} ) {
+                for ( "print_and_post", "print_and_post_as_new" ) {
+                    delete $button{$_};
+                }
+            }
+            for ("update", "post", "post_as_new", "print_and_post_as_new"){
+                delete $button{$_};
+            } 
+
+        }
+        else {
+
+            if ( $transdate > $closedto ) {
+                # Added on_hold, by Aurynn.
+                for ( "update", "ship_to", "post",
+                    "schedule")
+                {
+                    $allowed{$_} = 1;
+                }
+                $a{'print_and_post'} = 1 if ${LedgerSMB::Sysconfig::latex};
+
+                for ( keys %button ) { delete $button{$_} if !$allowed{$_} }
+            }
+            elsif ($closedto) {
+                %button = ();
+            }
+        }
+        for ( sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button )
+        {
+            $form->print_button( \%button, $_ );
+        }
+
+        print "</td></tr>";
+    }
+
 }
 
 sub void {
@@ -992,100 +1090,10 @@
     # type=submit $locale->text('Sales Order')
 
     if ( !$form->{readonly} ) {
-        
-        # changes by Aurynn to add an On Hold button
-
-        %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') },
-            'ship_to' =>
-              { ndx => 4, key => 'T', value => $locale->text('Ship to') },
-            'e_mail' =>
-              { ndx => 5, key => 'E', value => $locale->text('E-mail') },
-            'sales_order' =>
-              { ndx => 9, key => 'L', value => $locale->text('Sales Order') },
-            'schedule' =>
-              { ndx => 10, key => 'H', value => $locale->text('Schedule') },
-            'on_hold' =>
-              { ndx => 12, key => 'O',  value => $hold_button_text },
-             'void'  => 
-                { ndx => 13, key => 'V', value => $locale->text('Void') },
-             'save_info'  => 
-                { ndx => 14, key => 'I', value => $locale->text('Save Info') },
-            'new_screen' => # Create a blank ar/ap invoice.
-             { ndx => 15, key=> 'N', value => $locale->text('New') }
-
-        );
-
-
-        if ($form->{separate_duties} or $form->{batch_id}){
-           $button{'post'}->{value} = $locale->text('Save');
-        }
-       delete $button{void} if $form->{invnumber} =~ /-VOID/;
-
-        if ( $form->{id} ) {
-
-            for ( "post", "print_and_post", "delete" ) {
-                delete $button{$_};
-            }
-            my $is_draft = 0;
-            if (!$form->{approved} && !$form->{batch_id}){
-               if (!$form->{batch_id}){
-                   $is_draft = 1;
-                   $button{approve} = { 
-                       ndx   => 3, 
-                       key   => 'O', 
-                       value => $locale->text('Post as Saved') };
-                   if (grep /^lsmb_$form->{company}__draft_modify$/, @{$form->{_roles}}){
-                       $button{edit_and_save} = { 
-                           ndx   => 4, 
-                           key   => 'E', 
-                           value => $locale->text('Save as Shown') };
-                   }
-              }
-               delete $button{$_}
-                 for qw(post_as_new post e_mail sales_order void print on_hold); 
-           }
-
-            if ( !${LedgerSMB::Sysconfig::latex} ) {
-                for ( "print_and_post", "print_and_post_as_new" ) {
-                    delete $button{$_};
-                }
-            }
-            for ("update", "post", "post_as_new", "print_and_post_as_new"){
-                delete $button{$_};
-            } 
-
-        }
-        else {
-
-            if ( $transdate > $closedto ) {
-                # Added on_hold, by Aurynn.
-                for ( "update", "ship_to", "post",
-                    "schedule")
-                {
-                    $allowed{$_} = 1;
-                }
-                $a{'print_and_post'} = 1 if ${LedgerSMB::Sysconfig::latex};
-
-                for ( keys %button ) { delete $button{$_} if !$allowed{$_} }
-            }
-            elsif ($closedto) {
-                %button = ();
-            }
-        }
         for ( sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button )
         {
             $form->print_button( \%button, $_ );
         }
-
     }
 
     if ($form->{id}){

Modified: trunk/bin/oe.pl
===================================================================
--- trunk/bin/oe.pl	2014-02-17 09:51:29 UTC (rev 6866)
+++ trunk/bin/oe.pl	2014-02-17 10:08:27 UTC (rev 6867)
@@ -693,6 +693,7 @@
       </table>
     </td>
   </tr>
+  <tr><td>
 
 |;
 
@@ -706,7 +707,112 @@
 <input type=hidden name="${_}_description" value="$form->{"${_}_description"}">
 |;
     }
+    if ( !$form->{readonly} ) {
+        %button = (
+            'update' =>
+              { ndx => 1, key => 'U', value => $locale->text('Update') },
+            'print' =>
+              { ndx => 2, key => 'P', value => $locale->text('Print') },
+            'save' => { ndx => 3, key => 'S', value => $locale->text('Save') },
+            'ship_to' =>
+              { ndx => 4, key => 'T', value => $locale->text('Ship to') },
+            'e_mail' =>
+              { ndx => 5, key => 'E', value => $locale->text('E-mail') },
+            'print_and_save' => {
+                ndx   => 6,
+                key   => 'R',
+                value => $locale->text('Print and Save')
+            },
+            'save_as_new' =>
+              { ndx => 7, key => 'N', value => $locale->text('Save as new') },
+            'print_and_save_as_new' => {
+                ndx   => 8,
+                key   => 'W',
+                value => $locale->text('Print and Save as new')
+            },
+            'sales_invoice' =>
+              { ndx => 9, key => 'I', value => $locale->text('Sales Invoice') },
+            'sales_order' =>
+              { ndx => 10, key => 'O', value => $locale->text('Sales Order') },
+            'quotation' =>
+              { ndx => 11, key => 'Q', value => $locale->text('Quotation') },
+            'vendor_invoice' => {
+                ndx   => 12,
+                key   => 'I',
+                value => $locale->text('Vendor Invoice')
+            },
+            'purchase_order' => {
+                ndx   => 13,
+                key   => 'O',
+                value => $locale->text('Purchase Order')
+            },
+            'rfq' => { ndx => 14, key => 'Q', value => $locale->text('RFQ') },
+            'schedule' =>
+              { ndx => 15, key => 'H', value => $locale->text('Schedule') },
+            'delete' =>
+              { ndx => 16, key => 'D', value => $locale->text('Delete') },
+        );
 
+        %a = ();
+        for ( "update", "ship_to", "save" ) { $a{$_} = 1 }
+        $a{'print_and_save'} = 1 if ${LedgerSMB::Sysconfig::latex};
+
+        if ( $form->{id} ) {
+
+            $a{'e_mail'}                = 1;
+            $a{'delete'}                = 1;
+            $a{'print'}                 = 1;
+            $a{'save_as_new'}           = 1;
+            $a{'print_and_save_as_new'} = 1 if ${LedgerSMB::Sysconfig::latex};
+
+            if ( $form->{type} =~ /sales_/ ) {
+                if ( $myconfig{acs} !~ /AR--Sales Invoice/ ) {
+                    $a{'sales_invoice'} = 1;
+                }
+            }
+            else {
+                if ( $myconfig{acs} !~ /AP--Vendor Invoice/ ) {
+                    $a{'vendor_invoice'} = 1;
+                }
+            }
+
+            if ( $form->{type} eq 'sales_order' ) {
+                if ( $myconfig{acs} !~ /Quotations--RFQ/ ) {
+                    $a{'quotation'} = 1;
+                }
+            }
+
+            if ( $form->{type} eq 'purchase_order' ) {
+                if ( $myconfig{acs} !~ /Quotations--RFQ/ ) {
+                    $a{'rfq'} = 1;
+                }
+            }
+
+            if ( $form->{type} eq 'sales_quotation' ) {
+                if ( $myconfig{acs} !~ /Order Entry--Sales Order/ ) {
+                    $a{'sales_order'} = 1;
+                }
+            }
+
+            if ( $myconfig{acs} !~ /Order Entry--Purchase Order/ ) {
+                if ( $form->{type} eq 'request_quotation' ) {
+                    $a{'purchase_order'} = 1;
+                }
+            }
+        }
+
+        if ( $form->{type} =~ /_order/ ) {
+            $a{'schedule'} = 1;
+        }
+
+    }
+    for ( keys %button ) { delete $button{$_} if !$a{$_} }
+
+    for ( sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button ) {
+        $form->print_button( \%button, $_ );
+    }
+    print "</td></tr>";
+
 }
 
 sub form_footer {
@@ -842,107 +948,6 @@
     # type=submit $locale->text('Sales Order')
     # type=submit $locale->text('Purchase Order')
 
-    if ( !$form->{readonly} ) {
-        %button = (
-            'update' =>
-              { ndx => 1, key => 'U', value => $locale->text('Update') },
-            'print' =>
-              { ndx => 2, key => 'P', value => $locale->text('Print') },
-            'save' => { ndx => 3, key => 'S', value => $locale->text('Save') },
-            'ship_to' =>
-              { ndx => 4, key => 'T', value => $locale->text('Ship to') },
-            'e_mail' =>
-              { ndx => 5, key => 'E', value => $locale->text('E-mail') },
-            'print_and_save' => {
-                ndx   => 6,
-                key   => 'R',
-                value => $locale->text('Print and Save')
-            },
-            'save_as_new' =>
-              { ndx => 7, key => 'N', value => $locale->text('Save as new') },
-            'print_and_save_as_new' => {
-                ndx   => 8,
-                key   => 'W',
-                value => $locale->text('Print and Save as new')
-            },
-            'sales_invoice' =>
-              { ndx => 9, key => 'I', value => $locale->text('Sales Invoice') },
-            'sales_order' =>
-              { ndx => 10, key => 'O', value => $locale->text('Sales Order') },
-            'quotation' =>
-              { ndx => 11, key => 'Q', value => $locale->text('Quotation') },
-            'vendor_invoice' => {
-                ndx   => 12,
-                key   => 'I',
-                value => $locale->text('Vendor Invoice')
-            },
-            'purchase_order' => {
-                ndx   => 13,
-                key   => 'O',
-                value => $locale->text('Purchase Order')
-            },
-            'rfq' => { ndx => 14, key => 'Q', value => $locale->text('RFQ') },
-            'schedule' =>
-              { ndx => 15, key => 'H', value => $locale->text('Schedule') },
-            'delete' =>
-              { ndx => 16, key => 'D', value => $locale->text('Delete') },
-        );
-
-        %a = ();
-        for ( "update", "ship_to", "save" ) { $a{$_} = 1 }
-        $a{'print_and_save'} = 1 if ${LedgerSMB::Sysconfig::latex};
-
-        if ( $form->{id} ) {
-
-            $a{'e_mail'}                = 1;
-            $a{'delete'}                = 1;
-            $a{'print'}                 = 1;
-            $a{'save_as_new'}           = 1;
-            $a{'print_and_save_as_new'} = 1 if ${LedgerSMB::Sysconfig::latex};
-
-            if ( $form->{type} =~ /sales_/ ) {
-                if ( $myconfig{acs} !~ /AR--Sales Invoice/ ) {
-                    $a{'sales_invoice'} = 1;
-                }
-            }
-            else {
-                if ( $myconfig{acs} !~ /AP--Vendor Invoice/ ) {
-                    $a{'vendor_invoice'} = 1;
-                }
-            }
-
-            if ( $form->{type} eq 'sales_order' ) {
-                if ( $myconfig{acs} !~ /Quotations--RFQ/ ) {
-                    $a{'quotation'} = 1;
-                }
-            }
-
-            if ( $form->{type} eq 'purchase_order' ) {
-                if ( $myconfig{acs} !~ /Quotations--RFQ/ ) {
-                    $a{'rfq'} = 1;
-                }
-            }
-
-            if ( $form->{type} eq 'sales_quotation' ) {
-                if ( $myconfig{acs} !~ /Order Entry--Sales Order/ ) {
-                    $a{'sales_order'} = 1;
-                }
-            }
-
-            if ( $myconfig{acs} !~ /Order Entry--Purchase Order/ ) {
-                if ( $form->{type} eq 'request_quotation' ) {
-                    $a{'purchase_order'} = 1;
-                }
-            }
-        }
-
-        if ( $form->{type} =~ /_order/ ) {
-            $a{'schedule'} = 1;
-        }
-
-    }
-
-    for ( keys %button ) { delete $button{$_} if !$a{$_} }
     for ( sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button ) {
         $form->print_button( \%button, $_ );
     }

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


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits