[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1900] trunk/LedgerSMB/DBObject/Vendor.pm



Revision: 1900
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1900&view=rev
Author:   einhverfr
Date:     2007-11-25 11:47:40 -0800 (Sun, 25 Nov 2007)

Log Message:
-----------
Adding Vendor class

Added Paths:
-----------
    trunk/LedgerSMB/DBObject/Vendor.pm

Copied: trunk/LedgerSMB/DBObject/Vendor.pm (from rev 1899, trunk/LedgerSMB/DBObject/Customer.pm)
===================================================================
--- trunk/LedgerSMB/DBObject/Vendor.pm	                        (rev 0)
+++ trunk/LedgerSMB/DBObject/Vendor.pm	2007-11-25 19:47:40 UTC (rev 1900)
@@ -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;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.