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

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



Revision: 3611
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3611&view=rev
Author:   einhverfr
Date:     2011-08-02 17:06:04 +0000 (Tue, 02 Aug 2011)

Log Message:
-----------
Reloading page no longer double posts invoice

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

Modified: trunk/bin/io.pl
===================================================================
--- trunk/bin/io.pl	2011-08-01 03:21:04 UTC (rev 3610)
+++ trunk/bin/io.pl	2011-08-02 17:06:04 UTC (rev 3611)
@@ -815,6 +815,10 @@
 
 sub display_form {
 
+    $form->close_form();
+    $form->open_form();
+    $form->{dbh}->commit;
+
     # if we have a display_form
     if ( $form->{display_form} ) {
 	

Modified: trunk/bin/ir.pl
===================================================================
--- trunk/bin/ir.pl	2011-08-01 03:21:04 UTC (rev 3610)
+++ trunk/bin/ir.pl	2011-08-02 17:06:04 UTC (rev 3611)
@@ -403,11 +403,13 @@
 
 <form method=post action="$form->{script}">
 |;
-
+    if ($form->{notice}){
+         print qq|$form->{notice}<br/>|;
+    }
     $form->{vc} = "vendor";
     $form->hide_form(
         qw(id title vc type terms creditlimit creditremaining closedto locked 
-           shipped oldtransdate recurring reverse batch_id subtype)
+           shipped oldtransdate recurring reverse batch_id subtype form_id)
     );
 
     print qq|
@@ -1173,6 +1175,13 @@
 }
 
 sub post {
+    if (!$form->close_form()){
+       $form->{notice} = $locale->text(
+             'Could not save the data.  Please try again'
+       );
+       &update;
+       $form->finalize_request();
+    }
 
     $form->isblank( "transdate", $locale->text('Invoice Date missing!') );
     $form->isblank( "vendor",    $locale->text('Vendor missing!') );

Modified: trunk/bin/is.pl
===================================================================
--- trunk/bin/is.pl	2011-08-01 03:21:04 UTC (rev 3610)
+++ trunk/bin/is.pl	2011-08-02 17:06:04 UTC (rev 3611)
@@ -441,11 +441,14 @@
 |;
 
     $form->hide_form(
-        qw(id type printed emailed queued title vc terms discount 
+        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)
     );
 
+    if ($form->{notice}){
+         print qq|<th>$form->{notice}</th>|;
+    }
     my $manual_tax;
     if ($form->{id}){
         $manual_tax = 
@@ -1239,6 +1242,13 @@
 }
 
 sub post {
+    if (!$form->close_form()){
+       $form->{notice} = $locale->text(
+                'Could not save the data.  Please try again'
+       );
+       &update;
+       $form->finalize_request();
+    }
     $form->isblank( "transdate", $locale->text('Invoice Date missing!') );
     $form->isblank( "customer",  $locale->text('Customer missing!') );
 

Modified: trunk/bin/oe.pl
===================================================================
--- trunk/bin/oe.pl	2011-08-01 03:21:04 UTC (rev 3610)
+++ trunk/bin/oe.pl	2011-08-02 17:06:04 UTC (rev 3611)
@@ -571,8 +571,11 @@
 <form method=post action="$form->{script}">
 |;
 
+    if ($form->{notice}){
+         print qq|$form->{notice}<br/>|;
+    }
     $form->hide_form(
-        qw(id type formname media format printed emailed queued vc title discount creditlimit creditremaining tradediscount business recurring)
+        qw(id type formname media format printed emailed queued vc title discount creditlimit creditremaining tradediscount business recurring form_id)
     );
 
     print qq|
@@ -2102,6 +2105,13 @@
 }
 
 sub save {
+    if (!$form->close_form()){
+       $form->{notice} = $locale->text(
+                'Could not save the data.  Please try again'
+       );
+       &update;
+       $form->finalize_request();
+    }
 
      
     if ( $form->{type} =~ /_order$/ ) {


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