CustomerInvoiceHandler
This class contains the functions to perform the following:
Retrieve:
api | |
---|---|
package | simPROAPI |
subpackage | Invoice |
author | Nathan Muir, Michael West |
version | 2011-07-18 |
Insert(int $CompanyID, array $InvoiceDetails) : int
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,
);
?>
int
the company id
array
an associative array of invoice information.
int
InsertCredit(int $CompanyID, int $InvoiceNo, array $CreditDetails) : int
<?php
$CreditDetails =
array(
"CreditNoteNo"=>"",
"Description"=>"",
"Notes"=>"",
"DateIssued"=>"Y-m-d",
"Approved"=>1,
"CostCentres"=>array(
"CostCentreID"=>0,
"CreditAmount"=>0.00
)
);
?>
int
the company id
int
the invoice number to be credited
array
an associative array of credit information.
int
LogSearch(int $CompanyID, int $InvoiceNo = null, string $StartDate = null, string $EndDate = null, int $StaffID = null, string $Search = '%', int $Limit = 1000, int $Offset = 0) : array
This function retrieves logs from Invoices whether a specific number is supplied or not.
int
The Company ID. In single company builds, this is 0.
int
The Invoice Number to retrieve (Optional). Null/Empty will ignore this parameter.
string
Date start (inclusive) to search. Null/Empty will ignore this parameter.
string
Date end (inclusive) to search. Null/Empty will ignore this parameter.
int
The employee ID. Null/Empty will ignore this parameter.
string
The search text for the log message. Can use % for wildcards.
int
the total number of logs to return (0 - 1000)
int
how many results to skip, before returning {@link $Limit}
array
Retrieve(int $CompanyID, int $InvoiceNo) : array
This function retrieves a invoice with a specific ID
uses | \CustomerInvoiceHandler::RetrieveList() |
---|
int
the Company ID. In single company builds, this is 0.
int
The Invoice Number to retrieve
array
RetrieveAll(int $CompanyID) : array
This function retrieves a list of all customer invoices
uses | \CustomerInvoiceHandler::RetrieveList() |
---|
int
the Company ID. In single company builds, this is 0.
array
RetrieveCredit(int $CompanyID, int $CreditID) : array
This function retrieves details of a particular credit
uses | \CustomerInvoiceHandler::RetrieveList() |
---|
int
the Company ID. In single company builds, this is 0.
int
the Credit ID
array
RetrieveList(int $CompanyID, array $InvoiceNos) : array
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() |
int
the Company ID. In single company builds, this is 0.
array
list of Invoice ID's to retrieve.
array
RetrieveOutstanding(int $CompanyID) : array
This function retrieves a list of all outstanding customer invoices
uses | \CustomerInvoiceHandler::RetrieveList() |
---|
int
the Company ID. In single company builds, this is 0.
array
RetrievePaid(int $CompanyID) : array
This function retrieves a list of all outstanding customer invoices
uses | \CustomerInvoiceHandler::RetrieveList() |
---|
int
the Company ID. In single company builds, this is 0.
array
Search(int $CompanyID, string $Search = '', string $StartDate = null, string $EndDate = null, string $Stage = 'approved', string $Status = null) : array
This function searches for the list of invoices for a customerID
uses | \CustomerInvoiceHandler::RetrieveList() |
---|
int
the Company ID. In single company builds, this is 0.
string
string
Date start (inclusive) to search for the specified customer invoice. Null/Empty will ignore this parameter. {@link http://php.net/manual/en/function.strtotime.php}
string
Date end (inclusive) to search for the specified customer invoice. Null/Empty will ignore this parameter. {@link http://php.net/manual/en/function.strtotime.php}
string
Retrieve "approved" (normal invoice) or "unapproved" (request for claim). Default is "approved".
string
Retrieve based on Invoice Status
array
SearchJob(int $CompanyID, int $JobNo) : array
This function searches for the list of invoices for a customerID
uses | \CustomerInvoiceHandler::RetrieveList() |
---|
int
the Company ID. In single company builds, this is 0.
int
The Job Number
array
Update(int $CompanyID, int $InvoiceNo, array $InvoiceDetails) : boolean
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,
);
?>
int
the Company ID. In single company builds, this is 0.
int
the invoice number
array
an associative array of invoice information.
boolean
UpdateCredit(int $CompanyID, int $CreditID, array $CreditDetails) : int
<?php
$CreditDetails =
array(
"Description"=>"",
"Notes"=>"",
"DateIssued"=>"Y-m-d",
"Approved"=>1,
"CostCentres"=>array(
"CostCentreID"=>0,
"CreditAmount"=>0.00
)
);
?>
int
the company id
int
the credit id to be updated
array
an associative array of credit information.
int