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

SF.net SVN: ledger-smb:[3257] trunk/LedgerSMB



Revision: 3257
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3257&view=rev
Author:   einhverfr
Date:     2011-06-16 00:04:35 +0000 (Thu, 16 Jun 2011)

Log Message:
-----------
Correcting sales orders closed before consolidation completes

Modified Paths:
--------------
    trunk/LedgerSMB/Form.pm
    trunk/LedgerSMB/OE.pm

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2011-06-15 23:59:14 UTC (rev 3256)
+++ trunk/LedgerSMB/Form.pm	2011-06-16 00:04:35 UTC (rev 3257)
@@ -3199,7 +3199,7 @@
     $dbh->commit;
 }
 
-=item $form->update_defaults($myconfig, $fld[, $dbh]);
+=item $form->update_defaults($myconfig, $fld[, $dbh [, $nocommit]);
 
 Updates the defaults entry for the setting $fld following rules specified by
 the existing value and returns the processed value that results.  If $form is
@@ -3209,6 +3209,8 @@
 executing this function and this update function does not handle the general
 case of updating the defaults table.
 
+Note that nocommit prevents the db from committing in this function.
+
 B<NOTE>: rules handling is currently broken.
 
 Rules followed by this function's processing:
@@ -3235,7 +3237,7 @@
 
 sub update_defaults {
 
-    my ( $self, $myconfig, $fld ) = @_;
+    my ( $self, $myconfig, $fld, $nocommit) = @_;
 
     if ( !$self->{dbh} && $self ) {
         $self->db_init($myconfig);
@@ -3377,7 +3379,7 @@
     $sth = $dbh->prepare($query);
     $sth->execute( $dbvar, $fld ) || $self->dberror($query);
 
-    $dbh->commit;
+    $dbh->commit if !defined $nocommit;
 
     $var;
 }

Modified: trunk/LedgerSMB/OE.pm
===================================================================
--- trunk/LedgerSMB/OE.pm	2011-06-15 23:59:14 UTC (rev 3256)
+++ trunk/LedgerSMB/OE.pm	2011-06-16 00:04:35 UTC (rev 3257)
@@ -2588,7 +2588,7 @@
             }
 
             $ordnumber ||=
-              $form->update_defaults( $myconfig, $numberfld, $dbh );
+              $form->update_defaults( $myconfig, $numberfld, $dbh, 1);
 
             #fixme:  Change this
             #also $credit_account is safe since it is local to this function


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