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

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



Revision: 5473
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5473&view=rev
Author:   einhverfr
Date:     2013-01-04 10:03:20 +0000 (Fri, 04 Jan 2013)
Log Message:
-----------
Moving to label/button system to show that partnumbers are not editable on invoices and orders.  Note this has minor workflow breaking changes when Javascript is disabled only.  Javascript has been tested in Chrome and Firefox and should work for other browsers.  The framework changes should also make elinks more usable for these screens as well

Modified Paths:
--------------
    trunk/Changelog
    trunk/bin/io.pl
    trunk/bin/ir.pl
    trunk/bin/is.pl
    trunk/bin/oe.pl
    trunk/old-handler.pl

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2013-01-04 09:19:15 UTC (rev 5472)
+++ trunk/Changelog	2013-01-04 10:03:20 UTC (rev 5473)
@@ -89,6 +89,7 @@
 * Fixing is_zero errors on ar/ap transaction screens w/tax incldued (Chris T)
 * Fixing csv ar transactions not showing taxes (Chris T, 3589640)
 * Fixing demo quotations having descriptions taking too much space (Chris T)
+* Moved to label/button system for deleting lines on invoices (Chris T)
 
 Changelog for 1.3.27
 * Detect whether ledgersmb.conf exists during Makefile.PL run and create if

Modified: trunk/bin/io.pl
===================================================================
--- trunk/bin/io.pl	2013-01-04 09:19:15 UTC (rev 5472)
+++ trunk/bin/io.pl	2013-01-04 10:03:20 UTC (rev 5473)
@@ -86,6 +86,7 @@
 # $locale->text('Oct')
 # $locale->text('Nov')
 # $locale->text('Dec')
+#
 
 sub _calc_taxes {
     $form->{subtotal} = $form->{invsubtotal};
@@ -375,8 +376,17 @@
 
 $column_data{runningnumber} =
           qq|<td><input name="runningnumber_$i" size=3 value=$i></td>|;
-        $column_data{partnumber} =
+        if ($form->{"partnumber_$i"}){
+           $column_data{partnumber} =
+           qq|<td> $form->{"partnumber_$i"} 
+                 <button type="submit" class="submit" value="$i" 
+                         name="delete_line">X</button>
+                 <input type="hidden" name="partnumber_$i"
+                       value="$form->{"partnumber_$i"}" /></td>|;
+        } else {
+            $column_data{partnumber} =
 qq|<td><input name="partnumber_$i" size=15 value="$form->{"partnumber_$i"}" accesskey="$i" title="[Alt-$i]">$skunumber</td>|;
+        }
         $column_data{qty} =
 qq|<td align=right><input name="qty_$i" title="$form->{"onhand_$i"}" size="5" value="|
           . $form->format_amount( \%myconfig, $form->{"qty_$i"} )

Modified: trunk/bin/ir.pl
===================================================================
--- trunk/bin/ir.pl	2013-01-04 09:19:15 UTC (rev 5472)
+++ trunk/bin/ir.pl	2013-01-04 10:03:20 UTC (rev 5473)
@@ -344,6 +344,7 @@
 
 sub form_header {
 
+    $form->{nextsub} = 'update';
 
     # set option selected
     for (qw(AP currency)) {
@@ -437,6 +438,14 @@
     print qq|
 <body onLoad="document.forms[0].${focus}.focus()" />
 | . $form->open_status_div . qq|
+<script> 
+function on_return_submit(){
+    if (window.event.keyCode == 13){
+        document.forms[0].submit()
+    }
+}
+</script>
+<form method=post action="$form->{script}" onkeypress="on_return_submit()">
 
 <form method=post action="$form->{script}">
 |;
@@ -444,10 +453,11 @@
          print qq|$form->{notice}<br/>|;
     }
     $form->{vc} = "vendor";
+    $form->{nextsub} = 'update';
     $form->hide_form(
         qw(id title vc type terms creditlimit creditremaining closedto locked 
            shipped oldtransdate recurring reverse batch_id subtype form_id
-           separate_duties)
+           separate_duties nextsub)
     );
 
     print qq|
@@ -1108,6 +1118,7 @@
     if ( $form->{import_text} ) {
         &import_text;
     }
+    delete $form->{"partnumber_$form->{delete_line}"} if $form->{delete_line};
     $form->{exchangerate} =
       $form->parse_amount( \%myconfig, $form->{exchangerate} );
 

Modified: trunk/bin/is.pl
===================================================================
--- trunk/bin/is.pl	2013-01-04 09:19:15 UTC (rev 5472)
+++ trunk/bin/is.pl	2013-01-04 10:03:20 UTC (rev 5473)
@@ -341,6 +341,7 @@
 }
 
 sub form_header {
+    $form->{nextsub} = 'update';
 
     # set option selected
     for (qw(AR currency)) {
@@ -440,15 +441,21 @@
     print qq|
 <body onLoad="document.forms[0].${focus}.focus()" /> 
 | . $form->open_status_div . qq|
-
-<form method=post action="$form->{script}">
+<script> 
+function on_return_submit(){
+    if (window.event.keyCode == 13){
+        document.forms[0].submit()
+    }
+}
+</script>
+<form method=post action="$form->{script}" onkeypress="on_return_submit()">
 |;
 
     $form->hide_form(
         qw(form_id id type printed emailed queued title vc terms discount 
            creditlimit creditremaining tradediscount business closedto locked 
            shipped oldtransdate recurring reverse batch_id subtype 
-           meta_number separate_duties)
+           meta_number separate_duties nextsub)
     );
 
     if ($form->{notice}){
@@ -1114,6 +1121,8 @@
 
 sub update {
     on_update(); # Used for overrides for POS invoices --CT
+    delete $form->{"partnumber_$form->{delete_line}"} if $form->{delete_line};
+
     $form->{taxes} = {};
     $form->{exchangerate} =
       $form->parse_amount( \%myconfig, $form->{exchangerate} );

Modified: trunk/bin/oe.pl
===================================================================
--- trunk/bin/oe.pl	2013-01-04 09:19:15 UTC (rev 5472)
+++ trunk/bin/oe.pl	2013-01-04 10:03:20 UTC (rev 5473)
@@ -333,7 +333,7 @@
 
 sub form_header {
 
-
+    $form->{nextsub} = 'update';
    
     $checkedopen   = ( $form->{closed} ) ? ""        : "checked";
     $checkedclosed = ( $form->{closed} ) ? "checked" : "";
@@ -590,6 +590,14 @@
     print qq|
 <body onLoad="document.forms[0].${focus}.focus()" />
 | . $form->open_status_div . qq|
+<script> 
+function on_return_submit(){
+    if (window.event.keyCode == 13){
+        document.forms[0].submit()
+    }
+}
+</script>
+<form method=post action="$form->{script}" onkeypress="on_return_submit()">
 
 <form method=post action="$form->{script}">
 |;
@@ -599,7 +607,7 @@
     }
     $form->hide_form(qw(entity_control_code meta_number));
     $form->hide_form(
-        qw(id type formname media format printed emailed queued vc title discount creditlimit creditremaining tradediscount business recurring form_id)
+        qw(id type formname media format printed emailed queued vc title discount creditlimit creditremaining tradediscount business recurring form_id nextsub)
     );
 
     print qq|
@@ -974,7 +982,9 @@
 }
 
 sub update {
+    $form->{nextsub} = 'update';
 
+    delete $form->{"partnumber_$form->{delete_line}"} if $form->{delete_line};
     if ( $form->{type} eq 'generate_purchase_order' ) {
 
         for ( 1 .. $form->{rowcount} ) {

Modified: trunk/old-handler.pl
===================================================================
--- trunk/old-handler.pl	2013-01-04 09:19:15 UTC (rev 5472)
+++ trunk/old-handler.pl	2013-01-04 10:03:20 UTC (rev 5473)
@@ -112,6 +112,7 @@
 $locale = LedgerSMB::Locale->get_handle( ${LedgerSMB::Sysconfig::language} )
   or $form->error( __FILE__ . ':' . __LINE__ . ": Locale not loaded: $!\n" );
 
+$form->{action} = $form->{nextsub} if (!$form->{action} and $form->{nextsub});
 
 # we use $script for the language module
 $form->{script} = $script;

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