From 5a1b3f62d0b7babc2443518d88e129cd9faf0711 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Wed, 29 Aug 2007 21:35:46 +0000 Subject: Correcting a few issues with customers. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1473 4979c152-3d1c-0410-bac9-87ea11338e46 --- scripts/customer.pl | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/customer.pl b/scripts/customer.pl index 8b476995..dfef02cd 100644 --- a/scripts/customer.pl +++ b/scripts/customer.pl @@ -17,7 +17,7 @@ Save customer will update or create as needed. =cut -package LedgerSMB::Scripts::Customer; +package LedgerSMB::Scripts::customer; use LedgerSMB::Template; use LedgerSMB::DBObject::Customer; @@ -40,7 +40,7 @@ of the customer informations. sub get { - my ($class, $request) = @_; + my ($request) = @_; my $customer = LedgerSMB::DBObject::Customer->new(base => $request, copy => 'all'); my $result = $customer->get($customer->{id}); @@ -51,6 +51,16 @@ sub get { } +sub add { + my ($request) = @_; + my $customer = LedgerSMB::DBObject::Customer->new(base => $request, copy => 'all'); + + my $template = LedgerSMB::Template->new( user => $user, + template => 'customer.html', language => $user->{language}, + format => 'html'); + $template->render($results); +} + =pod =over @@ -68,7 +78,7 @@ as well as customer/Company name. =cut sub search { - my ($class, $request) = @_; + my ($request) = @_; my $customer = LedgerSMB::DBObject::Customer->new(base => $request, copy => 'all'); my $results = $customer->search($customer->{search_pattern}); @@ -93,7 +103,7 @@ customer as needed, and will generate a new Company ID for the customer if neede sub save { - my ($class, $request) = @_; + my ($request) = @_; my $customer = LedgerSMB::DBObject::Customer->new(base => $request, copy => 'all'); my $result = $customer->save_to_db(); @@ -103,4 +113,4 @@ sub save { $template->render($result); } -1; \ No newline at end of file +1; -- cgit v1.2.3