ContractorHandler

This class contains the functions to perform the following:

  • Retrieve, Insert and Update Contractors

api
package simPROAPI
subpackage Staff
author Nathan Muir, Michael West, Daniel Sanders [add other contributors]
version 2011-08-15
uses \global\StaffHandler
uses \global\InvoiceHandler
used-by AccPayContactHandler

 Methods

ContractorAttachmentsRetrieve

AttachmentsRetrieve(int $CompanyID, int $ContractorStaffID) : array
Static

This function retrieves the list of attachemnts for the provided contractor id

uses \StaffHandler::RetrieveAttachments()

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

$ContractorStaffID

int

The contractor staff member to retrieve attachments for

Returns

array

ContractorInsert

Insert(int $CompanyID, array $ContractorDetails) : int
Static
<?php
array_keys($ContractorDetails) == array(
                                "CompanyName",
                                "MailAddress",
                                "MailSuburb",
                                "MailState",
                                "MailPostcode",
                                "MailCountry",
                                "Phone1",
                                "Mobile",
                                "Fax",
                                "Email",
                                "TaxNumber",
                                "AccountName",
                                "BSB",
                                "AccountNo",
                                "PaymentTerm",
                                "PaymentTermType",
                                "Tax"
                                );
?>

Parameters

$CompanyID

int

the company id

$ContractorDetails

array

an associative array of supplier information.

Returns

int

ContractorLicencesRetrieve

LicencesRetrieve(int $CompanyID, int $ContractorStaffID) : array
Static

This function retrieves licences for the provided employee id

uses \StaffHandler::RetrieveLicences()

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

$ContractorStaffID

int

The contractor to retrieve licences for

Returns

array

ContractorLicencesSearch

LicencesSearch(int $CompanyID, string $Search = '') : array
Static

This function retrieves licences for all employees under a company

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

$Search = ''

string

The search string for the licence name.

Returns

array

ContractorRetrieve

Retrieve(mixed $CompanyID, int $ContractorStaffID) : array
Static

This function retrieves a contractor with a specific ID

uses \ContractorHandler::RetrieveList()

Parameters

$CompanyID

mixed

the Company IDs. Can be a single Company ID or an array of Company IDs. In single company builds, this is 0.

$ContractorStaffID

int

the contractor's staff id.

Returns

array

ContractorRetrieveList

RetrieveList(mixed $CompanyID, array $ContractorStaffIDs, array $Detail = array()) : array
Static

This function retrieves details on the provided list of contractor ids

used_by \AccPayContactHandler::Search()
used_by \AccPayContactHandler::Retrieve()
used_by \AccPayContactHandler::RetrieveExport()
used_by \AccPayContactHandler::RetrieveAll()
used_by \StaffHandler::RetrieveList()
used_by \ContractorHandler::Search()
used_by \ContractorHandler::SearchFields()
used_by \ContractorHandler::RetrieveStaff()
used_by \ContractorHandler::Retrieve()
used_by \InventoryJournalHandler::RetrieveExport()

Parameters

$CompanyID

mixed

the Company IDs. Can be a single Company ID or an array of Company IDs. In single company builds, this is 0.

$ContractorStaffIDs

array

list of Contractor Staff ID's to retrieve.

$Detail = array()

array

the specification of which details to return - ("Zones","Departments","Companies","BillRates"). Null/Empty/Empty array will return none.

Returns

array

ContractorRetrieveStaff

RetrieveStaff(mixed $CompanyID, int $ContractorID) : array
Static

This function retrieves a list of staff under a contractor company.

uses \ContractorHandler::RetrieveList()

Parameters

$CompanyID

mixed

the Company IDs. Can be a single Company ID or an array of Company IDs. In single company builds, this is 0.

$ContractorID

int

the ContractorID to retreive their staff for.

Returns

array

ContractorSearchFields

SearchFields(mixed $CompanyID, array $SearchTerms) : array
Static

This function retrieve's a list of contractors who's set of fields match their associated values

Implemented Search Terms are: CompanyName,ContactName,Zone,ZoneName,Export

uses \ContractorHandler::RetrieveList()

Parameters

$CompanyID

mixed

the Company IDs. Can be a single Company ID or an array of Company IDs. In single company builds, this is 0.

$SearchTerms

array

An associative array of Search Fields[key] and their search terms [value]

Returns

array

ContractorTotalCount

TotalCount(mixed $CompanyID) : int
Static

This function retrieves the total number of contractors in the system

used_by \AccPayContactHandler::TotalCount()

Parameters

$CompanyID

mixed

the Company IDs. Can be a single Company ID or an array of Company IDs. In single company builds, this is 0.

Returns

int

ContractorUpdate

Update(int $CompanyID, int $ContractorStaffID, array $ContractorDetails) : bool
Static
<?php
array_keys($ContractorDetails) == array(
                                "CompanyName",
                                "MailAddress",
                                "MailSuburb",
                                "MailState",
                                "MailPostcode",
                                "Country",
                                "Phone1",
                                "Mobile",
                                "Fax",
                                "Email",
                                "id",
                                "Active",
                                "TaxNumber",
                                "AccountName",
                                "bsb",
                                "AccountNo",
                                "PaymentTerm",
                                "PaymentTermType"
                                );
?>

Parameters

$CompanyID

int

the company id

$ContractorStaffID

int

The contractor id to update with the supplied information

$ContractorDetails

array

an associative array of contractor information.

Returns

bool