diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-11-20 07:36:30 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-11-20 07:36:30 +0000 |
commit | bb74dcef1ff3d6eb73bdde38eb11320590b2c011 (patch) | |
tree | 7dfd9af353ed3cff8f6d1660a63a967d26aa2bba /scripts | |
parent | 18e15b44b4dda09f5d5a8a416e3f6524fb8b2a64 (diff) |
Customer screen now renders reasonably well.
TODO: Needs a lot of CSS work to beautify.
Also CSS/Javascript could be used to create a tabbed interface for this screen.
Also, a lot of issues with stored procedures have been fixed.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1880 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/customer.pl | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/scripts/customer.pl b/scripts/customer.pl index 76fa8a56..988538a8 100644 --- a/scripts/customer.pl +++ b/scripts/customer.pl @@ -72,6 +72,9 @@ sub add { my ($request) = @_; my $customer = LedgerSMB::DBObject::Customer->new(base => $request, copy => 'all'); $customer->set(entity_class=>2); + + $customer->get_metadata(); + my $template = LedgerSMB::Template->new( user => $user, template => 'customer', @@ -79,7 +82,7 @@ sub add { locale => $request->{_locale}, format => 'HTML'); $request->{script} = 'Customer/customer'; - $template->render($request); + $template->render($customer); } =pod @@ -145,26 +148,16 @@ customer as needed, and will generate a new Company ID for the customer if neede sub save { my ($request) = @_; - - if ($request->type() == 'POST') { - - my $customer = LedgerSMB::DBObject::Customer->get(base=>$request, copy=>'all'); - - unless ($customer) { - - $customer = LedgerSMB::DBObject::Customer->new(base=>$reqest, copy=>'all'); - } - - my $result = $customer->save(); - my $template = LedgerSMB::Template->new( user => $user, - template => 'Customer/customer', language => $user->{language}, + my $customer = LedgerSMB::DBObject::Customer->new({base => $request}); + + my $result = $customer->save(); + + my $template = LedgerSMB::Template->new( user => $request->{_user}, + template => 'customer', locale => $request->{_locale}, + path => 'UI/Customer', format => 'HTML'); - $template->render($result); - } - else { - - } + $template->render($customer); } 1; |