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 /LedgerSMB/DBObject/Customer.pm | |
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 'LedgerSMB/DBObject/Customer.pm')
-rw-r--r-- | LedgerSMB/DBObject/Customer.pm | 47 |
1 files changed, 16 insertions, 31 deletions
diff --git a/LedgerSMB/DBObject/Customer.pm b/LedgerSMB/DBObject/Customer.pm index 09f8e3dd..9a120f91 100644 --- a/LedgerSMB/DBObject/Customer.pm +++ b/LedgerSMB/DBObject/Customer.pm @@ -5,39 +5,24 @@ use LedgerSMB::DBObject; use LedgerSMB::Entity; sub save { - - # this is doing way too much. - my $self = shift @_; - - my $entity; - - # this is a fairly effective way of telling if we need to create a new - # entity or not. - - if (!$self->{entity_id}) { - - $entity = LedgerSMB::Entity->new(base=>$request); - } - else { - - $entity = LedgerSMB::Entity->get(id=>$self->{entity_id}); - } - - $entity->set(name=> $reqeust->{first_name}." ".$request->{last_name} ); - $entity->set(entity_class=>2); - $self->set(entity_id=>$entity->{id}); - $self->set(entity_class=> 2); - - $entity->save(); - if (!self->{entity_id}) { - - $self->{entity_id} = $entity->{id}; - } - $self->SUPER::save(); - - return $self->{id}; + # This saves both the entity and the credit account. -- CT + $self->{entity_class} = 2; + $self->{id} = $self->exec_method(funcname => 'entity_credit_save'); +} + +sub get_metadata { + my $self = shift @_; + + @{$self->{location_class}} = + $self->exec_method(funcname => 'location_list_class'); + + @{$self->{country}} = + $self->exec_method(funcname => 'location_list_country'); + + @{$self->{contact_class}} = + $self->exec_method(funcname => 'entity_list_contact_class'); } sub search { |