[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Save account headers to 'account_header' table (instead of 'account' table)
- Subject: [PATCH] Save account headers to 'account_header' table (instead of 'account' table)
 
- From: Erik Huelsmann <..hidden..>
 
- Date: Sun, 29 May 2011 18:27:56 +0200
 
While trying to fix one of the bugs in the SF bug tracker, I ran into
the problem that account headers are currently being saved to the
accounts table.
This patch fixes that:
Index: LedgerSMB/DBObject/Account.pm
===================================================================
--- LedgerSMB/DBObject/Account.pm       (revision 3187)
+++ LedgerSMB/DBObject/Account.pm       (working copy)
@@ -29,7 +29,12 @@
         $self->{contra} = '0';
     }
     $self->generate_links;
-    $self->exec_method(funcname => 'account_save');
+
+    my $func = 'account_save';
+    if ($self->{charttype} and $self->{charttype} eq 'H') {
+        $func = 'account_heading_save';
+    }
+    $self->exec_method(funcname => $func);
     if (defined $self->{recon}){
         $self->call_procedure(procname => 'cr_coa_to_account_save',
args =>[ $self->{accno}, $self->{description}]);
     }
Bye,
Erik.