summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LedgerSMB/DBObject/Vendor.pm42
1 files changed, 42 insertions, 0 deletions
diff --git a/LedgerSMB/DBObject/Vendor.pm b/LedgerSMB/DBObject/Vendor.pm
new file mode 100644
index 00000000..e2fa26d8
--- /dev/null
+++ b/LedgerSMB/DBObject/Vendor.pm
@@ -0,0 +1,42 @@
+package LedgerSMB::DBObject::Vendor;
+
+use base qw(LedgerSMB::DBObject::Company);
+use strict;
+
+my $ENTITY_CLASS = 1;
+
+sub save {
+ my $self = shift @_;
+
+ $self->{entity_class} = $ENTITY_CLASS;
+ $self->save_credit(); # inherited from Company
+}
+
+
+sub save_location {
+ my $self = shift @_;
+ $self->{entity_class} = $ENTITY_CLASS;
+ $self->{country_id} = $self->{country};
+ $self->exec_method(funcname => 'company__location_save');
+
+ $self->{dbh}->commit;
+}
+
+
+
+sub get {
+ my $self = shift @_;
+ $self->{entity_class} = $ENTITY_CLASS;
+ my ($ref) = $self->exec_method(funcname => 'entity__retrieve_credit');
+ $self->merge($ref);
+
+ $self->{name} = $self->{legal_name};
+ $self->get_company();
+}
+
+
+sub search {
+
+
+}
+1;