summaryrefslogtreecommitdiff
path: root/LedgerSMB/DBObject
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB/DBObject')
-rw-r--r--LedgerSMB/DBObject/Customer.pm36
1 files changed, 35 insertions, 1 deletions
diff --git a/LedgerSMB/DBObject/Customer.pm b/LedgerSMB/DBObject/Customer.pm
index aa4404ce..7cd550dc 100644
--- a/LedgerSMB/DBObject/Customer.pm
+++ b/LedgerSMB/DBObject/Customer.pm
@@ -4,11 +4,13 @@ use base qw(LedgerSMB::DBObject);
use LedgerSMB::DBObject;
use LedgerSMB::Entity;
+my $CUSTOMER_ENTITY_CLASS = 2;
+
sub save {
my $self = shift @_;
# This saves both the entity and the credit account. -- CT
- $self->{entity_class} = 2;
+ $self->{entity_class} = $CUSTOMER_ENTITY_CLASS;
$self->{entity_id} = $self->exec_method(funcname => 'entity_credit_save');
$self->{dbh}->commit;
@@ -27,6 +29,38 @@ sub get_metadata {
$self->exec_method(funcname => 'entity_list_contact_class');
}
+sub save_location {
+ $self = shift @_;
+ $self->{entity_class} = $CUSTOMER_ENTITY_CLASS;
+ $self->exec_method(funcname => 'customer_location_save');
+}
+
+sub save_contact {
+}
+
+sub save_bank_acct {
+}
+
+sub get {
+ my $self = shift @_;
+ $self->merge(shift @{$self->exec_method(funcname => 'customer__retrieve')});
+
+ $self->{name} = $self->{legal_name};
+
+ @{$self->{locations}} = $self->exec_method(
+ funcname => 'company__list_locations');
+
+ @{$self->{contacts}} = $self->exec_method(
+ funcname => 'company__list_contacts');
+
+ @{$self->{contacts}} = $self->exec_method(
+ funcname => 'company__list_bank_accounts');
+
+ @{$self->{notes}} = $self->exec_method(
+ funcname => 'company__list_notes');
+}
+
+
sub search {