summaryrefslogtreecommitdiff
path: root/LedgerSMB/DBObject
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-11-21 05:42:22 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-11-21 05:42:22 +0000
commiteb7e5f65f488f890c1d9fb6d56bed8a40fe8a595 (patch)
treeca581deabbbae5cc59c7df22b9ed77c095e8fccb /LedgerSMB/DBObject
parentff6f935be468458483306b06a827ccc82564c496 (diff)
More Customer Fixes
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1885 4979c152-3d1c-0410-bac9-87ea11338e46
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 {