SupplierOrderHandler

This class contains the functions to perform the following:

Retrieve:

  • Supplier Order(s)
Insert:
  • Supplier Order(s)
Update:
  • Supplier Order(s)

api
package simPROAPI
subpackage Supplier
author Edgar Luzardo
version 2013-07-03

 Methods

SupplierOrderInsert

Insert(int $CompanyID, array $SupplierOrderDetails) : int
Static

Currently only possible to create Catalogue orders.

<?php
$SupplierOrderDetails =
array(
"OrderStage"=>"Pending"|"Approved"|"Archived",//Required
"IssuedDate"=>"2010-01-01",
"DueDate"=>"2010-01-01",
"SupplierID"=>0,//Required
"SupplierQuoteID"=>0,
"Reference"=>"",
"Notes"=>"",
"StatusID" => 0,
"CustomFields"=>array(
    "FieldName"=>value,
),
"StockItems"=>array(
    array(
        "StockItemID"=>0,//Required
        "Quantity"=>0,//Required
        "AmountExTax"=>0
        "StorageDeviceID"=>0,
        "JobNo"=>0,//0=Stock, Null=Order Default
        "SectionCostCentreID"=>0//0=Stock, Null=Order Default
    ),
)
);>

Parameters

$CompanyID

int

the company id

$SupplierOrderDetails

array

an associative array of order information

Returns

int

LogSearch

LogSearch(int $CompanyID, int $OrderNo = null, string $StartDate = null, string $EndDate = null, int $StaffID = null, string $Search = '%', int $Limit = 1000, int $Offset = 0) : array
Static

This function retrieves logs from Purchase Orders whether a specific number is supplied or not.

Parameters

$CompanyID

int

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

$OrderNo = null

int

The Supplier Order Number to retrieve (Optional). Null/Empty will ignore this parameter.

$StartDate = null

string

Date start (inclusive) to search. Null/Empty will ignore this parameter.

$EndDate = null

string

Date end (inclusive) to search. Null/Empty will ignore this parameter.

$StaffID = null

int

The employee ID. Null/Empty will ignore this parameter.

$Search = '%'

string

The search text for the log message. Can use % for wildcards.

$Limit = 1000

int

the total number of logs to return (0 - 1000)

$Offset = 0

int

how many results to skip, before returning {@link $Limit}

Returns

array

SupplierOrderRetrieve

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

This function retrieves an order with a specific ID

uses \SupplierOrderHandler::RetrieveList()

Parameters

$CompanyID

int

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

$OrderID

int

the order id to retrieve

Returns

array

SupplierOrderRetrieveApproved

RetrieveApproved(int $CompanyID, string $StartDate = null, string $EndDate = null, array $Detail = null) : array
Static

This function retrieves details of the approved supplier orders for a company

uses \SupplierOrderHandler::RetrieveList()

Parameters

$CompanyID

int

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

$StartDate = null

string

date start (inclusive) to search for the specified supplier order. Null/Empty will ignore this parameter. {@link http://php.net/manual/en/function.strtotime.php}

$EndDate = null

string

date end (inclusive) to search for the specified supplier order. Null/Empty will ignore this parameter. {@link http://php.net/manual/en/function.strtotime.php}

$Detail = null

array

the detail to be returned about the supplier orders {@see SupplierOrderHandler::RetrieveList}

Returns

array

SupplierOrderRetrieveList

RetrieveList(int $CompanyID, array $SupplierOrderIDs, array $Detail = null) : array
Static

This function retrieves details of the provided list of supplier orders

used_by \SupplierOrderHandler::Search()
used_by \SupplierOrderHandler::Retrieve()
used_by \SupplierOrderHandler::RetrieveApproved()
used_by \SupplierOrderHandler::RetrievePending()

Parameters

$CompanyID

int

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

$SupplierOrderIDs

array

list of Supplier Order Numbers to search for.

$Detail = null

array

the specification of which details to return - ("Allocations", "OrderReceiptIDs"). Null will return all details, empty array will return none.

Returns

array

SupplierOrderRetrievePending

RetrievePending(int $CompanyID, string $StartDate = null, string $EndDate = null, array $Detail = null) : array
Static

This function retrieves details of the pending supplier orders for a company

uses \SupplierOrderHandler::RetrieveList()

Parameters

$CompanyID

int

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

$StartDate = null

string

date start (inclusive) to search for the specified supplier order. Null/Empty will ignore this parameter. {@link http://php.net/manual/en/function.strtotime.php}

$EndDate = null

string

date end (inclusive) to search for the specified supplier order. Null/Empty will ignore this parameter. {@link http://php.net/manual/en/function.strtotime.php}

$Detail = null

array

the detail to be returned about the supplier orders {@see SupplierOrderHandler::RetrieveList}

Returns

array

SupplierOrderUpdate

Update(int $CompanyID, int $SupplierOrderID, array $SupplierOrderDetails) : int
Static
<?php
$SupplierOrderDetails =
array(
"OrderStage"=>"Pending"|"Approved"|"Archived",
"IssuedDate"=>"2010-01-01",
"DueDate"=>"2010-01-01",
"SupplierQuoteID"=>0,
"Reference"=>"",
"Notes"=>"",
"StatusID" => 0,
"CustomFields"=>array(
    "FieldName"=>value,
),
"ClearItems"=>false,
"StockItems"=>array(
    array(
        "StockItemID"=>0,//Required
        "Quantity"=>0,//Required
        "AmountExTax"=>0
        "StorageDeviceID"=>0,
        "JobNo"=>0,//0=Stock, Null=Order Default
        "SectionCostCentreID"=>0//0=Stock, Null=Order Default
    ),
)
);>

Parameters

$CompanyID

int

the company id

$SupplierOrderID

int

the order ID

$SupplierOrderDetails

array

an associative array of order information

Returns

int