summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-06-10 17:33:58 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-06-10 17:33:58 +0000
commit7f553958add1eeb8a18114917d5a4b752a8dd82f (patch)
tree31f3ab9a3b96126c8079dc2dd3889f19fe774628 /LedgerSMB
parent63312c2e3ff32ecd40381a74cd5b44d927fc6790 (diff)
Adding UI support for multiple vendor/customer accounts per company.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2163 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rw-r--r--LedgerSMB/DBObject/Company.pm42
1 files changed, 40 insertions, 2 deletions
diff --git a/LedgerSMB/DBObject/Company.pm b/LedgerSMB/DBObject/Company.pm
index b2584aa0..2d538582 100644
--- a/LedgerSMB/DBObject/Company.pm
+++ b/LedgerSMB/DBObject/Company.pm
@@ -50,9 +50,26 @@ TODO: Separate company from credit account storage.
sub save {
my $self = shift @_;
$self->set_entity_class();
+ my ($ref) = $self->exec_method(funcname => 'company_save');
+ $self->{id} = $ref->{company_save};
+ $self->{dbh}->commit;
+}
+
+=over
+
+=item save_credit
+
+This method saves the credit account for the company.
+
+=back
+
+=cut
+
+sub save_credit {
+ my $self = shift @_;
+ $self->set_entity_class();
$self->{threshold} = $self->parse_amount(amount => $self->{threshold});
- my ($ref) = $self->exec_method(funcname => 'entity_credit_save');
- $self->{entity_id} = $ref->{entity_credit_save};
+ $self->exec_method(funcname => 'entity_credit_save');
$self->{threshold} = $self->format_amount(amount => $self->{threshold});
$self->{dbh}->commit;
}
@@ -77,6 +94,24 @@ sub save_location {
=over
+=item get_credit_id
+
+This method returns the current credit id from the screen.
+
+=back
+
+=cut
+
+sub get_credit_id {
+ my $self = shift @_;
+ my ($ref) = $self->exec_method(
+ funcname => 'entity_credit_get_id'
+ );
+ $self->{credit_id} = $ref->{'entity_credit_get_id'};
+}
+
+=over
+
=item get_metadata()
This retrieves various information vor building the user interface. Among other
@@ -116,6 +151,9 @@ sub get_metadata {
@{$self->{contact_class_list}} =
$self->exec_method(funcname => 'entity_list_contact_class');
+
+ @{$self->{credit_list}} =
+ $self->exec_method(funcname => 'entity__list_credit');
}
sub save_contact {