CustomerInvoiceHandler

This class contains the functions to perform the following:

Retrieve:

  • Customer Invoice(s)

api
package simPROAPI
subpackage Invoice
author Nathan Muir, Michael West
version 2011-07-18

 Methods

CustomerInvoiceInsert

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

This function allows creation of Invoices and Progress Claims

<?php
$InvoiceDetails = array(
    "CustomerID"        => 0,
    "JobNos"            => array(0,1),
    "Description"       => "",
    "IssuedDate"        => "Y-m-d",
    "PaymentTerm"       => 0,
    "PaymentTermType"   => "invoice"|"month",
    "CustomFields"      => array(Name => Value),
    "LatePayment"       => 0,
    "Approved"          => true|false,
    "ProgressClaim"     => true|false,
    "ClaimDetails"      => array(array(SectionCostCentreID => 0, Claim => 0)), // claim in percentage
    "Deposit"           => true|false,
     "StatusID"          => 0,
);
?>

Parameters

$CompanyID

int

the company id

$InvoiceDetails

array

an associative array of invoice information.

Returns

int

CustomerInvoiceInsertCredit

InsertCredit(int $CompanyID, int $InvoiceNo, array $CreditDetails) : int
Static
<?php
$CreditDetails =
array(
"CreditNoteNo"=>"",
"Description"=>"",
"Notes"=>"",
"DateIssued"=>"Y-m-d",
"Approved"=>1,
"CostCentres"=>array(
    "CostCentreID"=>0,
        "CreditAmount"=>0.00
)
);
?>

Parameters

$CompanyID

int

the company id

$InvoiceNo

int

the invoice number to be credited

$CreditDetails

array

an associative array of credit information.

Returns

int

LogSearch

LogSearch(int $CompanyID, int $InvoiceNo = 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 Invoices whether a specific number is supplied or not.

Parameters

$CompanyID

int

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

$InvoiceNo = null

int

The Invoice 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

CustomerInvoiceRetrieve

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

This function retrieves a invoice with a specific ID

uses \CustomerInvoiceHandler::RetrieveList()

Parameters

$CompanyID

int

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

$InvoiceNo

int

The Invoice Number to retrieve

Returns

array

CustomerInvoiceRetrieveAll

RetrieveAll(int $CompanyID) : array
StaticNot Implemented

This function retrieves a list of all customer invoices

uses \CustomerInvoiceHandler::RetrieveList()

Parameters

$CompanyID

int

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

Returns

array

CustomerInvoiceRetrieveCredit

RetrieveCredit(int $CompanyID, int $CreditID) : array
Static

This function retrieves details of a particular credit

uses \CustomerInvoiceHandler::RetrieveList()

Parameters

$CompanyID

int

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

$CreditID

int

the Credit ID

Returns

array

CustomerInvoiceRetrieveList

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

This function retrieves details on the provided list of invoice ids

used_by \CustomerPaymentHandler::Search()
used_by \CustomerPaymentHandler::SearchInvoice()
used_by \CustomerPaymentHandler::Retrieve()
used_by \CustomerInvoiceHandler::Search()
used_by \CustomerInvoiceHandler::SearchJob()
used_by \CustomerInvoiceHandler::Retrieve()
used_by \CustomerInvoiceHandler::RetrieveAll()
used_by \CustomerInvoiceHandler::RetrieveOutstanding()
used_by \CustomerInvoiceHandler::RetrievePaid()
used_by \CustomerInvoiceHandler::RetrieveCredit()

Parameters

$CompanyID

int

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

$InvoiceNos

array

list of Invoice ID's to retrieve.

Returns

array

CustomerInvoiceRetrieveOutstanding

RetrieveOutstanding(int $CompanyID) : array
Static

This function retrieves a list of all outstanding customer invoices

uses \CustomerInvoiceHandler::RetrieveList()

Parameters

$CompanyID

int

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

Returns

array

CustomerInvoiceRetrievePaid

RetrievePaid(int $CompanyID) : array
Static

This function retrieves a list of all outstanding customer invoices

uses \CustomerInvoiceHandler::RetrieveList()

Parameters

$CompanyID

int

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

Returns

array

CustomerInvoiceSearchJob

SearchJob(int $CompanyID, int $JobNo) : array
Static

This function searches for the list of invoices for a customerID

uses \CustomerInvoiceHandler::RetrieveList()

Parameters

$CompanyID

int

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

$JobNo

int

The Job Number

Returns

array

CustomerInvoiceUpdate

Update(int $CompanyID, int $InvoiceNo, array $InvoiceDetails) : boolean
Static

This function allows updating of custom fields on any invoice and the updating of other fields on un-approved Progress Claims

<?php
$InvoiceDetails = array(
    "Description"       => "",
    "IssuedDate"        => "Y-m-d",
    "PaymentTerm"       => 0,
    "PaymentTermType"   => "invoice"|"month",
    "CustomFields"      => array(Name => Value),
     "StatusID"          => 0,
    "LatePayment"       => 0,
);
?>

Parameters

$CompanyID

int

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

$InvoiceNo

int

the invoice number

$InvoiceDetails

array

an associative array of invoice information.

Returns

boolean

CustomerInvoiceUpdateCredit

UpdateCredit(int $CompanyID, int $CreditID, array $CreditDetails) : int
Static
<?php
$CreditDetails =
array(
"Description"=>"",
"Notes"=>"",
"DateIssued"=>"Y-m-d",
"Approved"=>1,
"CostCentres"=>array(
    "CostCentreID"=>0,
        "CreditAmount"=>0.00
)
);
?>

Parameters

$CompanyID

int

the company id

$CreditID

int

the credit id to be updated

$CreditDetails

array

an associative array of credit information.

Returns

int