summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LedgerSMB/DBObject/Company.pm59
1 files changed, 59 insertions, 0 deletions
diff --git a/LedgerSMB/DBObject/Company.pm b/LedgerSMB/DBObject/Company.pm
index 0e56567b..9b122b4d 100644
--- a/LedgerSMB/DBObject/Company.pm
+++ b/LedgerSMB/DBObject/Company.pm
@@ -1,9 +1,33 @@
+=head1 NAME
+
+LedgerSMB::DBObject::Company.pm, LedgerSMB Base Class for Customers/Vendors
+
+=head1 SYNOPSIS
+
+This library contains the base utility functions for creating, saving, and
+retrieving customers and vendors.
+
+=cut
package LedgerSMB::DBObject::Company;
use base qw(LedgerSMB::DBObject);
use strict;
+=head1 METHODS
+
+=over
+
+=item $company->set_entity_class()
+
+This is a stub for a private method that subclasses are expected to overwrite.
+It will be set to the account class of the entity (1 for vendor, 2 for customer,
+etc).
+
+=back
+
+=cut
+
sub set_entity_class {
my $self = shift @_;
if (!defined $self->{entity_class}){
@@ -11,6 +35,18 @@ sub set_entity_class {
}
}
+=over
+
+=item save()
+
+This stores the company record including a credit accoun tin the database.
+
+TODO: Separate company from credit account storage.
+
+=back
+
+=cut
+
sub save {
my $self = shift @_;
$self->set_entity_class();
@@ -21,6 +57,16 @@ sub save {
$self->{dbh}->commit;
}
+=over
+
+=item save_location
+
+This method saves an address for a company.
+
+=back
+
+=cut
+
sub save_location {
my $self = shift @_;
$self->{country_id} = $self->{country};
@@ -29,6 +75,19 @@ sub save_location {
$self->{dbh}->commit;
}
+=over
+
+=item get_metadata()
+
+This retrieves various information vor building the user interface. Among other
+things, it sets the following properties:
+$self->{ar_ap_acc_list} = qw(list of ar or ap accounts)
+$self->{cash_acc_list} = qw(list of cash accounts)
+
+=back
+
+=cut
+
sub get_metadata {
my $self = shift @_;