From 3d8c7a3a98a3dfa05864b79e6cc2396871f20199 Mon Sep 17 00:00:00 2001 From: aurynn_cmd Date: Tue, 19 Aug 2008 23:00:35 +0000 Subject: Copious Admin and Reconciliation changes. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2283 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/DBObject/Reconciliation.pm | 25 +++++++++++++++++++++---- LedgerSMB/DBObject/User.pm | 20 +++++++++++--------- 2 files changed, 32 insertions(+), 13 deletions(-) (limited to 'LedgerSMB/DBObject') diff --git a/LedgerSMB/DBObject/Reconciliation.pm b/LedgerSMB/DBObject/Reconciliation.pm index 7a7ba313..1b5e9b97 100644 --- a/LedgerSMB/DBObject/Reconciliation.pm +++ b/LedgerSMB/DBObject/Reconciliation.pm @@ -160,15 +160,24 @@ sub new_report { # 0 is success # 1 is found, but mismatch # 2 is not found + + # in_scn INT, + #in_amount INT, + #in_account INT, + #in_user TEXT, + #in_date TIMESTAMP $code = $self->exec_method( funcname=>'reconciliation__add_entry', args=>[ $report_id, + $entry->{scn}, + $entry->{amount}, # needs leading 0's trimmed. + $entry->{account}, + $self->{user}, + $self->{date} ] ); - $entry{report_id} = $report_id; - $entry{code} = $self->add_entry( $entry ); - + $entry{report_id} = $report_id; } $self->exec_method(funcname=>'reconciliation__pending_transactions', args=>[$report_id, $date]); @@ -221,7 +230,7 @@ sub entry { sub search { my $self = shift @_; - + my $type = shift; return $self->exec_method( funcname=>'reconciliation__search', args=>[$self->{date_begin}, $self->{date_end}, $self->{account}, $self->{status}] @@ -246,4 +255,12 @@ sub get_report_list { args=>[$self->{account},$self->{report}] ); } + +sub get_accounts { + + my $self = shift @_; + return $self->exec_method( + funcname=>'reconciliation__account_list', + ); +} 1; \ No newline at end of file diff --git a/LedgerSMB/DBObject/User.pm b/LedgerSMB/DBObject/User.pm index c84c6336..b09951a9 100644 --- a/LedgerSMB/DBObject/User.pm +++ b/LedgerSMB/DBObject/User.pm @@ -1,6 +1,7 @@ package LedgerSMB::DBObject::User; use base qw/LedgerSMB::DBObject/; +use Data::Dumper; sub save { @@ -11,7 +12,7 @@ sub save { if ( $user->{id} && $self->{is_a_user} ) { # doesn't check for the password - that's done in the sproc. - $self->{id} = shift @{ $self->exec_method(procname=>'admin__save_user', + $self->{id} = shift @{ $self->exec_method(funcname=>'admin__save_user', args=>[$user->{id}, $self->{username}, $self->{password}] ) }; if (!$self->{id}) { @@ -29,7 +30,7 @@ sub save { elsif ($self->{is_a_user}) { # No user ID, meaning, creating a new one. - $self->{id} = shift @{ $self->exec_method(procname=>'admin__save_user', + $self->{id} = shift @{ $self->exec_method(funcname=>'admin__save_user', args=>[undef, $self->{username}, $self->{password}] ) }; } return 1; @@ -38,18 +39,18 @@ sub save { sub get { my $self = shift @_; - - my ($user_id, $username) = @{ $self->exec_method(procname=>'admin__get_user', - args=>[$self->{id}])}; + my $id = shift; + my $user = @{ $self->exec_method(funcname=>'admin__get_user', + args=>[$id])}[0]; - return {id=>$user_id, username=>$username}; + return $user; } sub remove { my $self = shift; - my $code = $self->exec_method(procname=>"admin__delete_user", args=>[$self->{id}, $self->{username}]); + my $code = $self->exec_method(funcname=>"admin__delete_user", args=>[$self->{id}, $self->{username}]); $self->{id} = undef; # never existed.. return $code->[0]; @@ -59,7 +60,7 @@ sub save_prefs { my $self = shift @_; - my $pref_id = $self->exec_method(procname=>"admin__save_preferences", + my $pref_id = $self->exec_method(funcname=>"admin__save_preferences", args=>[ 'language', 'stylesheet', @@ -74,7 +75,8 @@ sub get_all_users { my $self = shift @_; - $self->{users} = $self->exec_method( procname=>"user__get_all_users" ); + my @ret = $self->exec_method( funcname=>"user__get_all_users" ); + $self->{users} = \@ret; } 1; -- cgit v1.2.3