diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-11-22 06:19:05 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-11-22 06:19:05 +0000 |
commit | 08e1b04d20e4f328638fbde9f7a2ae54a3dca966 (patch) | |
tree | 1191bd1b7d8bad8873a95b864e108e8358ae2345 /LedgerSMB/DBObject | |
parent | a7badcbfb8db7f379590d66031137efb9f65717c (diff) |
First (unsuccessful) attempt to automatically handle number formatting in the template engine..
Customer screen enhancements as well.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1890 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/DBObject')
-rw-r--r-- | LedgerSMB/DBObject/Customer.pm | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/LedgerSMB/DBObject/Customer.pm b/LedgerSMB/DBObject/Customer.pm index 7bae0a9c..3805762f 100644 --- a/LedgerSMB/DBObject/Customer.pm +++ b/LedgerSMB/DBObject/Customer.pm @@ -3,6 +3,7 @@ package LedgerSMB::DBObject::Customer; use base qw(LedgerSMB::DBObject); use LedgerSMB::DBObject; use LedgerSMB::Entity; +use strict; my $CUSTOMER_ENTITY_CLASS = 2; @@ -12,7 +13,7 @@ sub save { # This saves both the entity and the credit account. -- CT $self->{entity_class} = $CUSTOMER_ENTITY_CLASS; - ($ref) = $self->exec_method(funcname => 'entity_credit_save'); + my ($ref) = $self->exec_method(funcname => 'entity_credit_save'); $self->{entity_id} = $ref->{entity_credit_save}; $self->{dbh}->commit; } @@ -20,18 +21,18 @@ sub save { sub get_metadata { my $self = shift @_; - @{$self->{location_class}} = + @{$self->{location_class_list}} = $self->exec_method(funcname => 'location_list_class'); - @{$self->{country}} = + @{$self->{country_list}} = $self->exec_method(funcname => 'location_list_country'); - @{$self->{contact_class}} = + @{$self->{contact_class_list}} = $self->exec_method(funcname => 'entity_list_contact_class'); } sub save_location { - $self = shift @_; + my $self = shift @_; $self->{entity_class} = $CUSTOMER_ENTITY_CLASS; $self->{country_id} = $self->{country}; $self->exec_method(funcname => 'customer_location_save'); @@ -40,14 +41,20 @@ sub save_location { } sub save_contact { + my ($self) = @_; + $self->exec_method(funcname => 'company__save_contact'); + $self->{dbh}->commit; } -sub save_bank_acct { +sub save_bank_account { + my $self = shift @_; + $self->exec_method(funcname => 'entity__save_bank_account'); + $self->{dbh}->commit; } sub get { my $self = shift @_; - ($ref) = $self->exec_method(funcname => 'customer__retrieve'); + my ($ref) = $self->exec_method(funcname => 'customer__retrieve'); $self->merge($ref); $self->{name} = $self->{legal_name}; @@ -58,7 +65,7 @@ sub get { @{$self->{contacts}} = $self->exec_method( funcname => 'company__list_contacts'); - @{$self->{contacts}} = $self->exec_method( + @{$self->{bank_account}} = $self->exec_method( funcname => 'company__list_bank_account'); @{$self->{notes}} = $self->exec_method( |