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

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



Revision: 6402
          http://sourceforge.net/p/ledger-smb/code/6402
Author:   einhverfr
Date:     2014-01-06 08:11:36 +0000 (Mon, 06 Jan 2014)
Log Message:
-----------
Removing most other deletes.  I left alone setup.pm and Database.pm for now due to the complex nature of connections in these contexts.

Modified Paths:
--------------
    trunk/LedgerSMB/AA.pm
    trunk/LedgerSMB/BP.pm
    trunk/LedgerSMB/Batch.pm
    trunk/LedgerSMB/DBObject/Account.pm
    trunk/LedgerSMB/DBObject/Admin.pm
    trunk/LedgerSMB/DBObject/Asset_Report.pm
    trunk/LedgerSMB/DBObject/Payment.pm
    trunk/LedgerSMB/DBObject/Reconciliation.pm
    trunk/LedgerSMB/IC.pm
    trunk/LedgerSMB/IS.pm
    trunk/LedgerSMB/PE.pm
    trunk/LedgerSMB/Scripts/asset.pm
    trunk/LedgerSMB/Scripts/import_csv.pm
    trunk/LedgerSMB/Scripts/payment.pm
    trunk/LedgerSMB/Scripts/recon.pm

Modified: trunk/LedgerSMB/AA.pm
===================================================================
--- trunk/LedgerSMB/AA.pm	2014-01-06 07:53:06 UTC (rev 6401)
+++ trunk/LedgerSMB/AA.pm	2014-01-06 08:11:36 UTC (rev 6402)
@@ -731,10 +731,6 @@
     #$form->audittrail( $dbh, "", \%audittrail );
 
 
-    my $rc = $dbh->commit;
-
-    $rc;
-
 }
 
 =item get_files
@@ -1064,7 +1060,6 @@
         $form->{rowcount} = $i if ( $i && !$form->{type} );
     }
 
-    $dbh->commit;
 }
 
 =item taxform_exist($form, $cv_id)
@@ -1139,9 +1134,7 @@
           $sth->execute($entry_id,$report) || $form->dberror("Sada $query");
    }
 
-   $dbh->commit();
 
-
 }
 
 =item get_taxchech($entry_id,$dbh)

Modified: trunk/LedgerSMB/BP.pm
===================================================================
--- trunk/LedgerSMB/BP.pm	2014-01-06 07:53:06 UTC (rev 6401)
+++ trunk/LedgerSMB/BP.pm	2014-01-06 08:11:36 UTC (rev 6402)
@@ -108,8 +108,6 @@
 
         $sth->finish;
     }
-    $dbh->commit();
-
     $form->all_years( $myconfig, $dbh );
 
 }
@@ -277,8 +275,6 @@
     }
 
     $sth->finish;
-    $dbh->commit;
-
 }
 
 sub delete_spool {
@@ -316,19 +312,12 @@
         }
     }
 
-    # commit
-    my $rc = $dbh->commit;
-
-    if ($rc) {
-        foreach my $i ( 1 .. $form->{rowcount} ) {
-            $_ = qq|${LedgerSMB::Sysconfig::spool}/$form->{"spoolfile_$i"}|;
-            if ( $form->{"checked_$i"} ) {
-                unlink;
-            }
+    foreach my $i ( 1 .. $form->{rowcount} ) {
+        $_ = qq|${LedgerSMB::Sysconfig::spool}/$form->{"spoolfile_$i"}|;
+        if ( $form->{"checked_$i"} ) {
+            unlink;
         }
     }
-
-    $rc;
 }
 
 sub print_spool {
@@ -381,7 +370,6 @@
 
             $form->audittrail( $dbh, "", \%audittrail );
 
-            $dbh->commit;
         }
     }
 

Modified: trunk/LedgerSMB/Batch.pm
===================================================================
--- trunk/LedgerSMB/Batch.pm	2014-01-06 07:53:06 UTC (rev 6401)
+++ trunk/LedgerSMB/Batch.pm	2014-01-06 08:11:36 UTC (rev 6402)
@@ -28,7 +28,6 @@
     my $cc_object = LedgerSMB::Setting->new({base => $self});
     $cc_object->{key} = 'batch_cc';
     $self->{batch_number} = $cc_object->increment;
-    $self->{dbh}->commit;
 }
 
 =item create
@@ -41,7 +40,6 @@
     $self = shift @_;
     my ($ref) = $self->exec_method(funcname => 'batch_create');
     $self->{id} = $ref->{batch_create};
-    $self->{dbh}->commit;
     return $ref->{id};
 }
 
@@ -54,7 +52,6 @@
 sub delete_voucher {
     my ($self, $voucher_id) = @_;
     $self->call_procedure(procname => 'voucher__delete', args => [$voucher_id]);
-    $self->{dbh}->commit;
 }
 
 =item get_search_criteria
@@ -171,7 +168,6 @@
 sub post {
     my ($self) = @_;
     ($self->{post_return_ref}) = $self->exec_method(funcname => 'batch_post');
-    $self->{dbh}->commit;
     return $self->{post_return_ref};
 }
 
@@ -184,7 +180,6 @@
 sub delete {
     my ($self) = @_;
     ($self->{delete_ref}) = $self->exec_method(funcname => 'batch_delete');
-    $self->{dbh}->commit;
     return $self->{delete_ref};
 }
 

Modified: trunk/LedgerSMB/DBObject/Account.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Account.pm	2014-01-06 07:53:06 UTC (rev 6401)
+++ trunk/LedgerSMB/DBObject/Account.pm	2014-01-06 08:11:36 UTC (rev 6402)
@@ -82,7 +82,6 @@
     if (defined $self->{recon}){
         $self->call_procedure(procname => 'cr_coa_to_account_save', args =>[ $self->{accno}, $self->{description}]);
     }
-    $self->{dbh}->commit;
 }
 
 =item get()
@@ -151,7 +150,6 @@
 sub delete {
     my $self = shift @_;
     $self->exec_method(funcname => 'account__delete');
-    $self->{dbh}->commit;
 }
 
 =item list()

Modified: trunk/LedgerSMB/DBObject/Admin.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Admin.pm	2014-01-06 07:53:06 UTC (rev 6401)
+++ trunk/LedgerSMB/DBObject/Admin.pm	2014-01-06 08:11:36 UTC (rev 6402)
@@ -60,7 +60,6 @@
 sub delete_session {
    my $self = shift @_;
    my @sessions = $self->exec_method(funcname => 'admin__drop_session');
-   return $self->{dbh}->commit;
 }
 
 =item save_roles 
@@ -113,7 +112,6 @@
             );
         }         
     }
-    $self->{dbh}->commit;
 }
 
 =item get_salutations

Modified: trunk/LedgerSMB/DBObject/Asset_Report.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Asset_Report.pm	2014-01-06 07:53:06 UTC (rev 6401)
+++ trunk/LedgerSMB/DBObject/Asset_Report.pm	2014-01-06 08:11:36 UTC (rev 6402)
@@ -113,7 +113,6 @@
           }
        }
     }
-    $self->{dbh}->commit;
 }
 
 =item get
@@ -182,7 +181,6 @@
 sub approve {
     my ($self) = @_;
     $self->exec_method(funcname => 'asset_report__approve');
-    $self->{dbh}->commit;
 }
 
 =item search

Modified: trunk/LedgerSMB/DBObject/Payment.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Payment.pm	2014-01-06 07:53:06 UTC (rev 6401)
+++ trunk/LedgerSMB/DBObject/Payment.pm	2014-01-06 08:11:36 UTC (rev 6402)
@@ -246,7 +246,6 @@
 sub reverse {
     my ($self) = @_;
     $self->exec_method(funcname => 'payment__reverse');
-    return $self->{dbh}->commit;
 }  
 
 =over
@@ -595,7 +594,6 @@
         }
     }
  
-    $self->{dbh}->commit; # Commit locks
 }    
 
 =item post_bulk
@@ -711,7 +709,6 @@
         }
     }
     $self->{queue_payments} = $queue_payments;
-    return $self->{dbh}->commit;
 }
 
 =item check_job
@@ -755,7 +752,6 @@
    }
  }
  my @TMParray = $self->exec_method(funcname => 'payment_post');
- $self->{dbh}->commit();
  $self->{payment_id} = $TMParray[0]->{payment_post};
  return $self->{payment_id};
 }

Modified: trunk/LedgerSMB/DBObject/Reconciliation.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Reconciliation.pm	2014-01-06 07:53:06 UTC (rev 6401)
+++ trunk/LedgerSMB/DBObject/Reconciliation.pm	2014-01-06 08:11:36 UTC (rev 6402)
@@ -90,7 +90,6 @@
     my $self = shift @_;
     $self->_pre_save;
     $self->exec_method(funcname=>'reconciliation__submit_set');
-    $self->{dbh}->commit; 
 }
 
 
@@ -105,7 +104,6 @@
     my $self = shift @_;
     $self->_pre_save;
     $self->exec_method(funcname=>'reconciliation__save_set');
-    $self->{dbh}->commit; 
 }
 
 =item import_file
@@ -154,7 +152,6 @@
         
         $self->error("User $self->{user}->{name} cannot approve report, must be a different user.");
     }
-    $self->{dbh}->commit;
 }
 
 =item new_report
@@ -180,7 +177,6 @@
     # Now that we have this, we need to create the internal report representation.
     # Ideally, we OUGHT to not return anything here, save the report number.
    
-    $self->{dbh}->commit;
     
     return ($report_id, $entries); # returns the report ID.
 }
@@ -215,7 +211,6 @@
                                args => [$report_id]);
         
     }
-    $self->{dbh}->commit;
     if ($found){
         $retval = '0';
     } else {
@@ -260,7 +255,6 @@
         );
         $entry{report_id} = $report_id;        
     }
-    $self->{dbh}->commit;
 }
 
 =item get
@@ -313,7 +307,6 @@
         $self->exec_method(
 		funcname=>'reconciliation__pending_transactions'
         );
-        $self->{dbh}->commit;
     }
     @{$self->{report_lines}} = $self->exec_method(
 		funcname=>'reconciliation__report_details_payee'

Modified: trunk/LedgerSMB/IC.pm
===================================================================
--- trunk/LedgerSMB/IC.pm	2014-01-06 07:53:06 UTC (rev 6401)
+++ trunk/LedgerSMB/IC.pm	2014-01-06 08:11:36 UTC (rev 6402)
@@ -822,7 +822,6 @@
 
 sub adjust_inventory {
 
-    # Private method.  Do not commit transaction at end of function...
     my ( $dbh, $form, $id, $qty ) = @_;
 
     my $query = qq|

Modified: trunk/LedgerSMB/IS.pm
===================================================================
--- trunk/LedgerSMB/IS.pm	2014-01-06 07:53:06 UTC (rev 6401)
+++ trunk/LedgerSMB/IS.pm	2014-01-06 08:11:36 UTC (rev 6402)
@@ -740,8 +740,6 @@
 
     $form->{paid} = $form->format_amount( $myconfig, $form->{paid}, 2 );
 
-    $dbh->commit;
-
 }
 
 sub assembly_details {
@@ -1679,10 +1677,6 @@
 
     $form->audittrail( $dbh, "", \%audittrail );
 
-    my $rc = $dbh->commit;
-
-    $rc;
-
 }
 
 sub process_assembly {
@@ -1893,8 +1887,6 @@
     $sth   = $dbh->prepare($query);
     $sth->execute( $form->{id} ) || $form->dberror($query);
 
-    $dbh->commit;
-
 }
 
 sub retrieve_invoice {
@@ -2072,8 +2064,6 @@
     }
 
     @queries = $form->run_custom_queries( 'ar', 'SELECT' );
-    my $rc = $dbh->commit;
-    $rc;
 
 }
 
@@ -2467,8 +2457,6 @@
 
   $sth->finish();
 
-  $dbh->commit();
-
 }
 
 
@@ -2488,8 +2476,6 @@
 
   $sth->finish();
 
-  $dbh->commit();
-
 }
 
 
@@ -2549,8 +2535,6 @@
           $sth->execute($invoice_id,$report) || $form->dberror("$query");
    }
 
-   $dbh->commit();
-
 }
 
 

Modified: trunk/LedgerSMB/PE.pm
===================================================================
--- trunk/LedgerSMB/PE.pm	2014-01-06 07:53:06 UTC (rev 6401)
+++ trunk/LedgerSMB/PE.pm	2014-01-06 08:11:36 UTC (rev 6402)
@@ -162,7 +162,6 @@
     }
 
     $sth->finish;
-    $dbh->commit;
 
     $i;
 
@@ -270,10 +269,6 @@
     $sth   = $dbh->prepare($query);
     $sth->execute( $form->{id} ) || $form->dberror($query);
 
-    my $rc = $dbh->commit;
-
-    $rc;
-
 }
 
 =item PE->delete_pricegroup($myconfig, $form);
@@ -293,10 +288,7 @@
     $sth   = $dbh->prepare($query);
     $sth->execute( $form->{id} ) || $form->dberror($query);
 
-    my $rc = $dbh->commit;
 
-    $rc;
-
 }
 
 
@@ -362,8 +354,6 @@
     }
     $dbh->do($query, undef, @group) || $form->dberror($query);
 
-    $dbh->commit;
-
 }
 
 =item PE->get_partsgroup($myconfig, $form);
@@ -401,8 +391,6 @@
 
     $sth->finish;
 
-    $dbh->commit;
-
 }
 
 =item PE->save_pricegroup($myconfig, $form);
@@ -434,8 +422,6 @@
     $sth = $dbh->prepare($query);
     $sth->execute( $form->{pricegroup} ) || $form->dberror($query);
 
-    $dbh->commit;
-
 }
 
 =item PE->get_pricegroup($myconfig, $form);
@@ -471,8 +457,6 @@
 
     $sth->finish;
 
-    $dbh->commit;
-
 }
 
 =item PE::description_translations('', $myconfig, $form);
@@ -553,8 +537,6 @@
 
     &get_language( "", $dbh, $form ) if $form->{id};
 
-    $dbh->commit;
-
 }
 
 =item PE::partsgroup_translations("", $myconfig, $form)
@@ -626,8 +608,6 @@
 
     &get_language( "", $dbh, $form ) if $form->{id};
 
-    $dbh->commit;
-
 }
 
 =item PE::project_translations("", $myconfig, $form)
@@ -707,8 +687,6 @@
 
     &get_language( "", $dbh, $form ) if $form->{id};
 
-    $dbh->commit;
-
 }
 
 =item PE::get_language("", $dbh, $form)
@@ -778,8 +756,6 @@
             $sth->finish;
         }
     }
-    $dbh->commit;
-
 }
 
 =item PE::delete_translation("", $myconfig, $form);
@@ -807,8 +783,6 @@
     $sth = $dbh->prepare($query);
     $sth->execute( $form->{id} ) || $form->dberror($query);
 
-    $dbh->commit;
-
 }
 
 =item PE->timecard_get_currency($form);
@@ -852,8 +826,6 @@
 
     $form->all_employees( $myconfig, $dbh, $transdate );
 
-    $dbh->commit;
-
 }
 
 =item PE->get_jcitems($myconfig, $form);
@@ -1000,8 +972,6 @@
     chop $form->{taxaccounts};
     $sth->finish;
 
-    $dbh->commit;
-
 }
 
 =item PE->allocate_projectitems($myconfig, $form);
@@ -1030,10 +1000,6 @@
         }
     }
 
-    $rc = $dbh->commit;
-
-    $rc;
-
 }
 
 1;

Modified: trunk/LedgerSMB/Scripts/asset.pm
===================================================================
--- trunk/LedgerSMB/Scripts/asset.pm	2014-01-06 07:53:06 UTC (rev 6401)
+++ trunk/LedgerSMB/Scripts/asset.pm	2014-01-06 08:11:36 UTC (rev 6402)
@@ -1101,7 +1101,6 @@
         }
         $ai->import_asset;
     }
-    $request->{dbh}->commit;
     $request->{info} = $request->{_locale}->text('File Imported');
     begin_import($request);
 }

Modified: trunk/LedgerSMB/Scripts/import_csv.pm
===================================================================
--- trunk/LedgerSMB/Scripts/import_csv.pm	2014-01-06 07:53:06 UTC (rev 6401)
+++ trunk/LedgerSMB/Scripts/import_csv.pm	2014-01-06 08:11:36 UTC (rev 6402)
@@ -184,7 +184,6 @@
                foreach my $entry (@$entries) {
                  $sth->execute($entry->[0], $entry->[1]) || die $sth->errstr();
                }
-               $dbh->commit;
              },
     sic   => sub {
                my ($request, $entries) = @_;
@@ -195,7 +194,6 @@
                  $sth->execute($entry->[0], $entry->[1], $entry->[2])
                     || die $sth->errstr();
                }
-               $dbh->commit;
              },
  timecard => sub {
                use LedgerSMB::Timecard;

Modified: trunk/LedgerSMB/Scripts/payment.pm
===================================================================
--- trunk/LedgerSMB/Scripts/payment.pm	2014-01-06 07:53:06 UTC (rev 6401)
+++ trunk/LedgerSMB/Scripts/payment.pm	2014-01-06 08:11:36 UTC (rev 6402)
@@ -444,7 +444,6 @@
     $payment->{default_currency} =  $payment->get_default_currency();;
     $payment->get_payment_detail_data();
     $payment->open_form();
-    $payment->{dbh}->commit;
     my $db_fx = $payment->get_exchange_rate($payment->{currency}, 
                                             $payment->{batch_date});
     if ($db_fx){

Modified: trunk/LedgerSMB/Scripts/recon.pm
===================================================================
--- trunk/LedgerSMB/Scripts/recon.pm	2014-01-06 07:53:06 UTC (rev 6401)
+++ trunk/LedgerSMB/Scripts/recon.pm	2014-01-06 08:11:36 UTC (rev 6402)
@@ -72,7 +72,6 @@
     my ($request) = shift;
     my $recon = LedgerSMB::DBObject::Reconciliation->new(base => $request);
     $recon->{their_total} = $recon->parse_amount(amount => $recon->{their_total}) if defined $recon->{their_total}; 
-    $recon->{dbh}->commit;
     if ($recon->{line_order}){
        $recon->set_ordering(
 		{method => 'reconciliation__report_details_payee', 
@@ -197,7 +196,7 @@
         delete $recon->{reverse} unless $recon->{account_info}->{category}
                                         eq 'A';
         $recon->close_form;
-        $recon->open_form({commit => 1});
+        $recon->open_form;
         $recon->add_entries($recon->import_file('csv_file')) if !$recon->{submitted};
         $recon->{can_approve} = $recon->is_allowed_role({allowed_roles => ['reconciliation_approve']});
         $recon->get();
@@ -342,7 +341,6 @@
         
         # Why isn't this testing for errors?
         my ($report_id, $entries) = $recon->new_report($recon->import_file());
-        $recon->{dbh}->commit;
         if ($recon->{error}) {
             #$recon->{error};
             

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


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits