summaryrefslogtreecommitdiff
path: root/LedgerSMB/DBObject
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB/DBObject')
-rw-r--r--LedgerSMB/DBObject/Customer.pm23
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(