SupplierHandler

This class contains the functions to perform the following:

Retrieve:

  • Supplier(s)
  • Custom Fields
  • Supplier Invoice(s)
Insert:
  • Supplier(s)
  • Custom Fields
Update:
  • Supplier(s)
  • Custom Fields

api
package simPROAPI
subpackage Supplier
author Nathan Muir, Michael West, Daniel Sanders [add other contributors]
version 2011-07-18

 Methods

SupplierBranchInsert

BranchInsert(int $CompanyID, int $SupplierID, array $SupplierBranchDetails) : bool
Static
<?php
array_keys($SupplierBranchDetails) == array(
"Name",
"PhoneNumber",
"Mobile",
"Fax",
"Email",
"MailAddress",
"MailSuburb",
"MailState",
"MailPostcode",
"MailCountry"
);
?>

Parameters

$CompanyID

int

the company id

$SupplierID

int

the supplier to add the branch to.

$SupplierBranchDetails

array

an associative array of supplier branches' information.

Returns

bool

SupplierBranchRetrieve

BranchRetrieve(int $CompanyID, int $SupplierID) : array
Static
uses \SupplierHandler::BranchRetrieveList()

Parameters

$CompanyID

int

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

$SupplierID

int

the supplier id, to retrieve Supplier Branchs for

Returns

array

SupplierBranchRetrieveList

BranchRetrieveList(int $CompanyID, array $SupplierIDs) : array
Static
used_by \SupplierHandler::BranchRetrieve()

Parameters

$CompanyID

int

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

$SupplierIDs

array

list of Supplier ID's to retrieve Supplier Branchs for

Returns

array

SupplierContactInsert

ContactInsert(int $CompanyID, int $SupplierID, array $SupplierContactDetails) : bool
Static
<?php
array_keys($SupplierContactDetails) == array(
 "Name",
 "Position",
 "PhoneNumber",
 "Mobile",
 "Fax",
 "Email"
);
?>

Parameters

$CompanyID

int

the company id

$SupplierID

int

the supplier to add the contact to.

$SupplierContactDetails

array

an associative array of supplier contacts' information.

Returns

bool

SupplierContactRetrieve

ContactRetrieve(int $CompanyID, int $SupplierID) : array
Static
uses \SupplierHandler::ContactRetrieveList()

Parameters

$CompanyID

int

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

$SupplierID

int

the supplier id, to retrieve Supplier Contacts for

Returns

array

SupplierContactRetrieveList

ContactRetrieveList(int $CompanyID, array $SupplierIDs) : array
Static
used_by \SupplierHandler::ContactRetrieve()

Parameters

$CompanyID

int

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

$SupplierIDs

array

list of Supplier ID's to retrieve Supplier Contacts for

Returns

array

SupplierInsert

Insert(int $CompanyID, array $SupplierDetails) : int
Static
<?php
array_keys($SupplierDetails) == array(
   "SupplierName",
   "MailAddress",
   "MailSuburb",
   "MailState",
   "MailPostcode",
   "MailCountry",
   "HomeAddress",
   "HomeSuburb",
   "HomeState",
   "HomePostcode",
   "HomeCountry",
   "Phone1",
   "Fax",
   "Email",
   "PaymentTerm",
   "PaymentTermType",
   "Website",
   "Notes",
   "TaxNumber",
   "SupplierAccountNo",
   "AccountName",
   "BSB",
   "AccountNo",
   "Tax",
   "Currency"
   );
?>

Parameters

$CompanyID

int

the company id

$SupplierDetails

array

an associative array of supplier information.

Returns

int

SupplierRetrieve

Retrieve(int $CompanyID, int $SupplierID) : array
Static

This function retrieves a supplier with a specific ID

uses \SupplierHandler::RetrieveList()

Parameters

$CompanyID

int

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

$SupplierID

int

the supplier id

Returns

array

SupplierRetrieveList

RetrieveList(int $CompanyID, array $SupplierIDs) : array
Static

This function retrieves details on the provided list of supplier ids

used_by \AccPayContactHandler::Retrieve()
used_by \AccPayContactHandler::RetrieveExport()
used_by \AccPayContactHandler::RetrieveAll()
used_by \SupplierHandler::Search()
used_by \SupplierHandler::Retrieve()

Parameters

$CompanyID

int

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

$SupplierIDs

array

list of Supplier ID's to retrieve.

Returns

array

SupplierTotalCount

TotalCount(int $CompanyID) : array
Static

This function returns the total number of Suppliers that are not archived

used_by \AccPayContactHandler::TotalCount()

Parameters

$CompanyID

int

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

Returns

array

SupplierUpdate

Update(int $CompanyID, int $SupplierID, array $SupplierDetails) : bool
Static
<?php
array_keys($SupplierDetails) == array(
   "SupplierName",
   "MailAddress",
   "MailSuburb",
   "MailState",
   "MailPostcode",
   "MailCountry",
   "HomeAddress",
   "HomeSuburb",
   "HomeState",
   "HomePostcode",
   "HomeCountry",
   "Phone1",
   "Fax",
   "Email",
   "PaymentTerm",
   "PaymentTermType",
   "Website",
   "Notes",
   "Active",
   "TaxNumber",
   "SupplierAccountNo",
   "AccountName",
   "BSB",
   "AccountNo",
   "Tax",
   "Currency"
   );
?>

Parameters

$CompanyID

int

the company id

$SupplierID

int

The supplier id to update with the supplied information

$SupplierDetails

array

an associative array of supplier information.

Returns

bool