diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-12-31 20:30:08 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-12-31 20:30:08 +0000 |
commit | a44648ee2e81a965024e3036ce586aba9b852b38 (patch) | |
tree | 7645eeb93091d82a0fa3b31de0b28e55cd7c5783 | |
parent | e02d9af679fab950e040764b2872b705d44087f4 (diff) |
* Committed Tony Brummett's patch for last/avg costs
* Committing fix for User.pm error handling (1860699)
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@2025 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-x | LedgerSMB/IR.pm | 2 | ||||
-rwxr-xr-x | LedgerSMB/User.pm | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/LedgerSMB/IR.pm b/LedgerSMB/IR.pm index 69b20aea..35a0a07e 100755 --- a/LedgerSMB/IR.pm +++ b/LedgerSMB/IR.pm @@ -798,7 +798,7 @@ sub post_invoice { SET avgcost = avgcost($item), lastcost = lastcost($item) WHERE id = $item|; - $dbh->prepare($query) || $form->dberror($query); + $dbh->do($query) || $form->dberror($query); } my $rc = $dbh->commit; diff --git a/LedgerSMB/User.pm b/LedgerSMB/User.pm index 7ef25547..e935583d 100755 --- a/LedgerSMB/User.pm +++ b/LedgerSMB/User.pm @@ -35,6 +35,7 @@ package LedgerSMB::User; use LedgerSMB::Sysconfig; use LedgerSMB::Session; use Data::Dumper; +use LedgerSMB::Form; sub new { @@ -825,8 +826,11 @@ sub save_member { } else { - my ($employeenumber) = - Form::update_defaults( "", \%$self, "employeenumber", $dbh ); + my $form = {dbh => $dbh}; + bless($form, 'Form'); + + my ($employeenumber) = $form->update_defaults(\%$self, "employeenumber"); + $query = qq| INSERT INTO employee (login, employeenumber, name, |