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

SF.net SVN: ledger-smb:[3546] trunk



Revision: 3546
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3546&view=rev
Author:   einhverfr
Date:     2011-07-18 17:12:45 +0000 (Mon, 18 Jul 2011)

Log Message:
-----------

Removing unused LedgerSMB/Employee.pm
Docstrings for LedgerSMB/DBObject/Employee.pm

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Employee.pm
    trunk/t/98-pod-coverage.t

Removed Paths:
-------------
    trunk/LedgerSMB/Employee.pm

Modified: trunk/LedgerSMB/DBObject/Employee.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Employee.pm	2011-07-17 03:23:29 UTC (rev 3545)
+++ trunk/LedgerSMB/DBObject/Employee.pm	2011-07-18 17:12:45 UTC (rev 3546)
@@ -1,10 +1,91 @@
 package LedgerSMB::DBObject::Employee;
 
+=head1 NAME
+
+LedgerSMB::DBObject::Employee - LedgerSMB class for managing Employees 
+
+=head1 SYOPSIS
+
+This module creates object instances based on LedgerSMB's in-database ORM.  
+
+=head1 METHODS
+
+The following method is static:
+
+=over
+
+=item new ($LedgerSMB object);
+
+
+=item save
+
+Saves an employee.  Inputs required
+
+=over
+
+=item entity_id
+
+May not be undef
+
+=item start_date
+
+=item end_date
+
+=item dob date
+
+may not be undef
+
+=item role
+
+Not the database role.  Either manager or user 
+
+=item ssn
+
+=item sales
+
+=item manager_id
+
+=item employee_number
+
+=back
+
+=item search
+
+Returns a list of employees matching set criteria:
+
+=over
+
+=item employeenumber (exact match)
+
+=item startdate_from (start of date range)
+
+=item startdate_to (end of date range)
+
+=item first_name (partial match)
+
+=item middle_name (partial match)
+
+=item last_name (partial match)
+
+=item notes (partial match)
+
+=back
+
+Undef values match all values.
+
+=cut
+
 use base qw(LedgerSMB::DBObject);
 use strict;
 
 my $ENTITY_CLASS = 3;
 
+=item set_entity_class
+
+Sets the entity class to 3.
+
+=cut
+
 sub set_entity_class {
     my $self = shift @_;
     $self->{entity_class} = $ENTITY_CLASS;
@@ -19,6 +100,14 @@
    $self->{dbh}->commit;
 }
 
+=item save_location
+
+Saves the location data for the contact.
+
+Inputs are standard location inputs (line_one, line_two, etc)
+
+=cut
+
 sub save_location {
     my $self = shift @_;
 
@@ -31,6 +120,22 @@
     $self->{dbh}->commit;
 }
 
+=item save_contact
+
+Saves contact information.  Inputs are standard contact inputs:
+
+=over
+
+=item entity_id
+
+=item contact_class
+
+=item contact
+
+=item description
+
+=cut
+
 sub save_contact {
     my ($self) = @_;
     $self->{contact_new} = $self->{contact};
@@ -38,25 +143,20 @@
     $self->{dbh}->commit;
 }
 
+=item save_bank_account
+
+Saves a bank account to an employee.
+
+Standard inputs (entity_id, iban, bic)
+
+=cut
+
 sub save_bank_account {
     my $self = shift @_;
     $self->exec_method(funcname => 'entity__save_bank_account');
     $self->{dbh}->commit;
 }
 
-sub save_note {
-    my $self = shift @_;
-    if ($self->{credit_id} && $self->{note_class} eq '3'){
-        $self->exec_method(funcname => 'eca__save_notes');
-    } else {
-        $self->exec_method(funcname => 'entity__save_notes');
-    }
-    $self->{dbh}->commit;
-}
-    
-
-=over
-
 =item get_metadata()
 
 This retrieves various information vor building the user interface.  Among other
@@ -64,8 +164,6 @@
 $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 {
@@ -88,6 +186,34 @@
     $self->{default_country} = $country_setting->{value};
 }
 
+=item get
+
+Returns the employee record with all the inputs required for "save" populated.
+
+Also populates:
+
+=over
+
+=item locations
+
+List of location info
+
+=item contacts
+
+List of contact info
+
+=item notes
+
+List of notes
+
+=item bank account
+
+List of bank accounts
+
+=back
+
+=cut
+
 sub get {
     my $self = shift @_;
     my ($ref) = $self->exec_method(funcname => 'employee__get');
@@ -103,8 +229,16 @@
 
     
      
-}    
+}   
 
+=item save_notes
+
+Saves a note to an employee entity.
+
+Standard inputs (note, subject, entity_id)
+
+=cut 
+
 sub save_notes {
     my $self = shift @_;
     $self->exec_method(funcname => 'entity__save_notes');
@@ -118,8 +252,6 @@
     return @results;
 }
 
-=over 
-
 =item delete_contact
 
 required request variables:
@@ -129,8 +261,6 @@
 person_id: int of entity_credit_account.id, preferred value
 
 
-=back
-
 =cut
 
 sub delete_contact {
@@ -139,8 +269,6 @@
     $self->{dbh}->commit;
 }
 
-=over
-
 =item delete_location
 
 Deletes a record from the location side.
@@ -153,8 +281,6 @@
 
 Returns true if a record was deleted.  False otherwise.
 
-=back
-
 =cut
 
 sub delete_location {
@@ -165,8 +291,6 @@
     return $rv;
 }
 
-=over 
-
 =item delete_bank_account
 
 Deletes a bank account
@@ -192,4 +316,15 @@
     return $rv;
 }
 
+=back
+
+=head1 Copyright (C) 2007, The LedgerSMB core team.
+
+This file is licensed under the Gnu General Public License version 2, or at your
+option any later version.  A copy of the license should have been included with
+your software.
+
+=cut
+
+
 1;

Deleted: trunk/LedgerSMB/Employee.pm
===================================================================
--- trunk/LedgerSMB/Employee.pm	2011-07-17 03:23:29 UTC (rev 3545)
+++ trunk/LedgerSMB/Employee.pm	2011-07-18 17:12:45 UTC (rev 3546)
@@ -1,91 +0,0 @@
-
-=head1 NAME
-
-LedgerSMB::Employee - LedgerSMB class for managing Employees 
-
-=head1 SYOPSIS
-
-This module creates object instances based on LedgerSMB's in-database ORM.  
-
-=head1 METHODS
-
-The following method is static:
-
-=over
-
-=item new ($LedgerSMB object);
-
-=back
-
-The following methods are passed through to stored procedures via Autoload.
-
-=over
-
-=item save
-
-=item get
-
-=item search
-
-=item list_managers
-
-The above list may grow over time, and may depend on other installed modules.
-
-=back
-
-=head1 Copyright (C) 2007, The LedgerSMB core team.
-
-This file is licensed under the Gnu General Public License version 2, or at your
-option any later version.  A copy of the license should have been included with
-your software.
-
-=cut
-
-package LedgerSMB::Employee;
-use base qw(LedgerSMB::DBObject);
-use strict;
-our $VERSION = '1.0.0';
-
-sub save {
-    my $self = shift;
-        
-    my $hashref = shift @{ $self->exec_method( procname => "employee_save" ) };
-    $self->merge( $hashref, 'id' );
-}
-
-sub get {
-    my $self = shift;
-    my $hashref = shift @{ $self->exec_method( procname => "employee_get" ) };
-    $self->merge( $hashref, keys %{$hashref} );
-}
-
-sub list_managers {
-    my $self = shift;
-    $self->{manager_list} =
-      $self->exec_method( procname => "employee_list_managers" );
-}
-
-sub search {
-    my $self = shift;
-    $self->{search_results} =
-      $self->exec_method( procname => "employee_search" );
-}
-
-sub set_location {
-    
-    my $self = shift @_;
-    my $location = shift @_;
-    
-    my $code = $self->exec_method ( procname => 'employee_set_location', 
-        args=>[ $self->{id}, $location->{id} ] );
-    
-    if ($code) {
-        
-        # good, it worked.
-        
-        return 1;        
-    }
-    return 0;
-}
-
-1;

Modified: trunk/t/98-pod-coverage.t
===================================================================
--- trunk/t/98-pod-coverage.t	2011-07-17 03:23:29 UTC (rev 3545)
+++ trunk/t/98-pod-coverage.t	2011-07-18 17:12:45 UTC (rev 3546)
@@ -13,7 +13,7 @@
 if ($@){
     plan skip_all => "Test::Pod::Coverage required for testing POD coverage";
 } else {
-    plan tests => 21;
+    plan tests => 22;
 }
 pod_coverage_ok("LedgerSMB");
 pod_coverage_ok("LedgerSMB::Form");
@@ -36,3 +36,4 @@
 pod_coverage_ok("LedgerSMB::Company_Config");
 pod_coverage_ok("LedgerSMB::DBObject::Admin");
 pod_coverage_ok("LedgerSMB::ScriptLib::Company");
+pod_coverage_ok("LedgerSMB::DBObject::Employee");


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