Skip to content

Commit

Permalink
Ensuring that new transactions are detected on update, for unsubmitte…
Browse files Browse the repository at this point in the history
…d reports only.

git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2482 4979c152-3d1c-0410-bac9-87ea11338e46
  • Loading branch information
einhverfr committed Mar 9, 2009
1 parent a04693c commit 634b51e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
15 changes: 11 additions & 4 deletions LedgerSMB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -780,12 +780,19 @@ sub _db_init {
# 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 {
Expand Down
6 changes: 6 additions & 0 deletions LedgerSMB/DBObject/Reconciliation.pm
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ sub get {
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'
);
Expand Down

0 comments on commit 634b51e

Please sign in to comment.