summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-31 06:53:40 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-31 06:53:40 +0000
commit3330cb2101ee3a6234e82744256cd675dd4e1e19 (patch)
tree882103de634e7cc6c255364e24740306c6d0a593 /LedgerSMB
parentd40b973fe0cbaba908c67168a59804c78e2a7fc7 (diff)
System -> Defaults now properly saves defaults and retrieves accounts. other functionality not working.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@423 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-xLedgerSMB/AM.pm25
1 files changed, 14 insertions, 11 deletions
diff --git a/LedgerSMB/AM.pm b/LedgerSMB/AM.pm
index 0cb319c1..25415a15 100755
--- a/LedgerSMB/AM.pm
+++ b/LedgerSMB/AM.pm
@@ -1370,30 +1370,33 @@ sub save_defaults {
FROM chart
WHERE accno = ?)
WHERE setting_key = ?|);
- my %translation = {
+ my %translation = (
inventory_accno_id => 'IC',
income_accno_id => 'IC_income',
expense_accno_id => 'IC_expense',
fxgain_accno_id => 'FX_gain',
fxloss_accno_id => 'FX_loss'
- };
+ );
for (
qw(inventory_accno_id income_accno_id expense_accno_id
fxgain_accno_id fxloss_accno_id glnumber sinumber vinumber
sonumber ponumber sqnumber rfqnumber partnumber employeenumber
customernumber vendornumber projectnumber yearend curr
- weightunit businessnumber yearend)
+ weightunit businessnumber)
){
- my $name;
+ my $val = $form->{$_};
+
if ($translation{$_}){
- $name = $translation{$_};
- } else {
- $name = $_;
- }
- if ($_ =~ /accno_id/){
- $sth_accno->execute($form->{$name}, $_);
+ $val = $form->{$translation{$_}};
+ print STDERR $val;
+ }
+ if ($_ =~ /accno/){
+ print STDERR "Account $_: $translation{$_}";
+ $sth_accno->execute($val, $_)
+ || $form->dberror("Saving $_");
} else {
- $sth_plain->execute($form->{$name}, $_);
+ $sth_plain->execute($val, $_)
+ || $form->dberror("Saving $_");
}
}