summaryrefslogtreecommitdiff
path: root/LedgerSMB/DBObject/Company.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-11-25 08:12:12 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-11-25 08:12:12 +0000
commitafc48e01665120367736ffdbe33ca52252a42704 (patch)
treee241d4ef077065fe92d3258dfe606659b9ad81da /LedgerSMB/DBObject/Company.pm
parent7c9b5fcafe0769499fc7fc3b9bea1365ed82d8d4 (diff)
Contact management postfactoring
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1899 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/DBObject/Company.pm')
-rw-r--r--LedgerSMB/DBObject/Company.pm55
1 files changed, 55 insertions, 0 deletions
diff --git a/LedgerSMB/DBObject/Company.pm b/LedgerSMB/DBObject/Company.pm
new file mode 100644
index 00000000..30023c92
--- /dev/null
+++ b/LedgerSMB/DBObject/Company.pm
@@ -0,0 +1,55 @@
+
+package LedgerSMB::DBObject::Company;
+
+use base qw(LedgerSMB::DBObject);
+use strict;
+
+sub save_credit {
+ my $self = shift @_;
+
+ my ($ref) = $self->exec_method(funcname => 'entity_credit_save');
+ $self->{entity_id} = $ref->{entity_credit_save};
+ $self->{dbh}->commit;
+}
+
+sub get_metadata {
+ my $self = shift @_;
+
+ @{$self->{location_class_list}} =
+ $self->exec_method(funcname => 'location_list_class');
+
+ @{$self->{country_list}} =
+ $self->exec_method(funcname => 'location_list_country');
+
+ @{$self->{contact_class_list}} =
+ $self->exec_method(funcname => 'entity_list_contact_class');
+}
+
+sub save_contact {
+ my ($self) = @_;
+ $self->exec_method(funcname => 'company__save_contact');
+ $self->{dbh}->commit;
+}
+
+sub save_bank_account {
+ my $self = shift @_;
+ $self->exec_method(funcname => 'entity__save_bank_account');
+ $self->{dbh}->commit;
+}
+
+sub get_company{
+ my $self = shift @_;
+ @{$self->{locations}} = $self->exec_method(
+ funcname => 'company__list_locations');
+
+ @{$self->{contacts}} = $self->exec_method(
+ funcname => 'company__list_contacts');
+
+ @{$self->{bank_account}} = $self->exec_method(
+ funcname => 'company__list_bank_account');
+
+ @{$self->{notes}} = $self->exec_method(
+ funcname => 'company__list_notes');
+};
+
+1;