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

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



Revision: 2482
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2482&view=rev
Author:   einhverfr
Date:     2009-03-09 01:06:00 +0000 (Mon, 09 Mar 2009)

Log Message:
-----------
Ensuring that new transactions are detected on update, for unsubmitted reports only.

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Reconciliation.pm
    trunk/LedgerSMB.pm

Modified: trunk/LedgerSMB/DBObject/Reconciliation.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Reconciliation.pm	2009-03-07 01:22:54 UTC (rev 2481)
+++ trunk/LedgerSMB/DBObject/Reconciliation.pm	2009-03-09 01:06:00 UTC (rev 2482)
@@ -289,6 +289,12 @@
     my ($self) = shift @_;
     my ($ref) = $self->exec_method(funcname=>'reconciliation__report_summary');
     $self->merge($ref);
+    if (!$self->{submitted}){
+        $self->exec_method(
+		funcname=>'reconciliation__pending_transactions'
+        );
+        $self->{dbh}->commit;
+    }
     @{$self->{report_lines}} = $self->exec_method(
 		funcname=>'reconciliation__report_details'
     );

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2009-03-07 01:22:54 UTC (rev 2481)
+++ trunk/LedgerSMB.pm	2009-03-09 01:06:00 UTC (rev 2482)
@@ -780,12 +780,19 @@
 # Deprecated, only here for old code
 sub dberror{
    my $self = shift @_;
-   if ($self->{dbh}->state eq '42501'){
-      $_[0] = $self->{_locale}->text('Access Denied'); 
-   }
+   my $state_error = {
+	'42401' => $self->{_locale}->text('Access Denied'),
+	'22008' => $self->{_locale}->text('Invalid date/time entered'),
+	'22012' => $self->{_locale}->text('Division by 0 error'),
+	'22004' => $self->{_locale}->text('Required input not provided')
+	#'23502' => $self->{_locale}->text('Required input not provided')
+   };
    print STDERR "Logging SQL State ".$self->{dbh}->state.", error ".
            $self->{dbh}->err . ", string " .$self->{dbh}->errstr . "\n";
-   $self->error(@_);
+   if (scalar grep /^$self->{dbh}->state$/, keys %$state_error){
+       $self->error($state_error->{$self->{dbh}->state});
+   }
+   $self->error($self->{dbh}->state . ":" . $self->{dbh}->errstr);
 }
 
 sub redo_rows {


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