From afc48e01665120367736ffdbe33ca52252a42704 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Sun, 25 Nov 2007 08:12:12 +0000 Subject: Contact management postfactoring git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1899 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/DBObject/Company.pm | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 LedgerSMB/DBObject/Company.pm (limited to 'LedgerSMB/DBObject/Company.pm') 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; -- cgit v1.2.3