AdminClients extends AppController
Admin Clients Management
Table of Contents
Properties
| $custom_field_prefix | |
| $widgets_state |
Methods
| accounts() | Manage Payment Accounts |
| accountTypes() | Manages the payment account types enabled for this client |
| add() | Add New Client |
| addAchAccount() | Add ACH account |
| addCcAccount() | Add Credit Card account |
| addContact() | Add Contact |
| addNote() | Add note |
| addService() | Add a service |
| approveQuotation() | Marks a quotation as approved |
| calcLineTotals() | Sums line items and returns the sub total, total, and tax amount based on currency and company settings for the given set of data and tax rules that apply to each. Outputs a JSON encoded array including: |
| contactLog() | Contact Log |
| createInvoice() | Create invoice |
| createQuotation() | Create quotation |
| delaySuspension() | Modal for viewing/setting delay suspension date |
| delete() | Delete Client |
| deleteAchAccount() | Delete an ACH account |
| deleteCcAccount() | Delete a CC account |
| deleteContact() | Delete Contact |
| deleteDraftInvoice() | Deletes a draft invoice |
| deleteNote() | Delete Note |
| deleteRecurInvoice() | Delete recurring invoice |
| deleteService() | Deletes a pending service |
| edit() | Edit Client |
| editAchAccount() | Edit an ACH account |
| editCcAccount() | Edit a CC account |
| editContact() | Edit Contact |
| editInvoice() | Edit invoice |
| editNote() | Edit note |
| editQuotation() | Edit quotation |
| editRecurInvoice() | Edit a recurring invoice |
| editService() | Edit service |
| editServiceAddons() | Edit service add-ons |
| editServiceAdvanced() | Advanced edit service |
| editTransaction() | Edit a Transaction |
| email() | Email Client |
| emails() | View mail log |
| getClients() | AJAX Fetch clients when searching |
| getCurrencyAmounts() | AJAX Fetches the currency amounts for the client profile sidebar |
| getCustomFields() | AJAX request for retrieving all custom fields for a client group |
| getRecordCreditFields() | AJAX Fetches a partial containing the record payment/credit fields |
| getStates() | AJAX Fetch all states belonging to a given country (json encoded ajax request) |
| index() | Browse Clients |
| invoiceApplied() | AJAX request for all transactions an invoice has applied |
| invoiceCount() | Invoice count |
| invoiceQuotation() | Generates an invoice from a quotation |
| invoices() | List invoices or perform action (deliver or void) on selected invoices |
| loginAsClient() | Login as the client |
| logoutAsClient() | Logout as the client |
| makePayment() | Processes a payment for this client |
| makePaymentInvoices() | Fetches a table of invoices for the given currency |
| merge() | Merge clients together |
| notes() | List notes |
| packageOptions() | Fetch all packages options for the given pricing ID and optional service ID |
| packages() | Sets Restricted Packages |
| passwordReset() | Send the password reset email to the client |
| preAction() | Pre-action setup method that is called before the index method, or the set controller action |
| quickUpdate() | AJAX quick update client to set status, invoice method, auto debit status, or auto suspension status |
| quotationCount() | Quotation count |
| quotationInvoices() | AJAX request for all invoices associated to a quotation |
| quotations() | List quotations or perform action (deliver or void) on selected quotations |
| recordPayment() | Manually record a payment for this client (i.e. record payment by check) |
| searchInvoices() | Search an invoice by number |
| serviceCount() | Service count |
| serviceInfo() | Service Info |
| services() | List services |
| serviceTab() | Service tab request |
| showaccount() | Renders a form to enter a passphrase for decrypting a bank account and routing number and returns the values on success |
| showcard() | Renders a form to enter a passphrase for decrypting a card and returns the card on success |
| stickyNotes() | Displays/removes sticky notes |
| transactionApplied() | AJAX request for all invoices a transaction has been applied to |
| transactionCount() | Transaction count |
| transactions() | List transactions |
| unapplyTransaction() | Unapplies a transaction from the given invoice |
| validateInvoices() | Validates if an invoice has pending services before voiding them |
| vCard() | Prompts to download a vCard of the client's address information |
| verifyAchAccount() | Verifies an ACH payment account |
| view() | View a specific client profile, may optionally set what content to view within the content view. |
| viewInvoice() | Streams the given invoice to the browser |
| viewQuotation() | Streams the given quotation to the browser |
| addCustomFields() | Attempts to add custom fields to a client |
| authorizePayment() | Attempts to create a payment authorization |
| buildPaymentConfirmation() | Authorizes a payment and builds the payment confirmation view for the gateway |
| cancelServiceChanges() | Cancel any pending queued service changes |
| createCredit() | Creates an in-house credit for the client |
| createService() | Create a service and its related addons and create or append an invoice for said services |
| deliverInvoices() | Delivers selected invoices |
| deliverQuotations() | Delivers selected quotations |
| downloadElectronicInvoices() | Download electronic invoices in bulk |
| getAchAccountInfo() | Formats ach account info for making payments |
| getCcAccountInfo() | Formats cc account info for making payments |
| getCouponId() | Fetches the coupon ID for a given coupon code and package ID |
| getCreditPaymentAmount() | Fetches the total credit amount available for the client in the given currency and payment type |
| getModuleRowFields() | Retrieves a set of module row IDs and names |
| getPackageTerms() | Returns an array of all pricing terms for the given package |
| getPlugin() | Retrieves an instance of the given plugin if it is enabled |
| getQueuedServiceChanges() | Retrieves a list of pending service changes queued |
| getServiceActions() | Gets the available actions for services |
| getServiceTabs() | Retrieves the service management tabs when editing a service |
| getTextFromHtml() | Converts the HTML given to text iff no text is currently set |
| getUserContacts() | Retrieves a list of contacts that can login to the system |
| listPackages() | List all packages available to the client |
| makeInvoice() | Creates an invoice from the given line items |
| makeLineItems() | Creates a set of line items from the given presenter |
| mergeInvoices() | Merge invoices |
| processModuleTab() | Processes and retrieves the module tab content for the given method |
| processPluginTab() | Processes and retrieves the plugin tab content for the given method |
| processServiceStep() | Process the requested step |
| queueServiceChange() | Queue's a service change for later processing |
| removeEmptyLineItems() | Removes empty line items from an invoice so that it can be auto-saved without error, when possible |
| renderClientView() | Render the given Client view element |
| renderServiceStep() | Render each add service step |
| setAchView() | Sets the ACH partial view |
| setCcView() | Sets the CC partial view |
| setContactView() | Sets the contact partial view |
| setPasswordOptions() | Sets a 'password_options' variable to the current view, which contains JSON-encoded password options for the password generator |
| setServiceTabMessages() | Sets messages to the view based on the given errors and messages provided |
| updateQuotationsStatus() | Voids selected invoices |
| updateServices() | Updates the given services to change their scheduled cancellation date |
| updateServicesRenewalForProration() | Updates the renew date for each of the given services if it meets proration criteria |
| voidInvoices() | Voids selected invoices |
Methods
accounts()
Manage Payment Accounts
public
accounts() : mixed
accountTypes()
Manages the payment account types enabled for this client
public
accountTypes() : mixed
add()
Add New Client
public
add() : mixed
addAchAccount()
Add ACH account
public
addAchAccount() : mixed
addCcAccount()
Add Credit Card account
public
addCcAccount() : mixed
addContact()
Add Contact
public
addContact() : mixed
addNote()
Add note
public
addNote() : mixed
addService()
Add a service
public
addService() : mixed
approveQuotation()
Marks a quotation as approved
public
approveQuotation() : mixed
calcLineTotals()
Sums line items and returns the sub total, total, and tax amount based on currency and company settings for the given set of data and tax rules that apply to each. Outputs a JSON encoded array including:
public
calcLineTotals() : mixed
- subtotal
- amount The decimal format for the subtotal
- amount_formatted The currency format for the subtotal
- total
- amount The decimal format for the total
- amount_formatted The currency format for the total
- total_w_tax
- amount The decimal format for the total with tax
- amount_formatted The currency format for the total with tax
- total_paid
- amount The decimal format for the total paid
- amount_formatted The currency format for the total paid
- total_due
- amount The decimal format for the total due
- amount_formatted The currency format for the total due
- tax A list of tax rules, each including:
- amount The decimal format for the total tax amount
- amount_formatted The currency format for the total tax amount
contactLog()
Contact Log
public
contactLog() : mixed
createInvoice()
Create invoice
public
createInvoice() : mixed
createQuotation()
Create quotation
public
createQuotation() : mixed
delaySuspension()
Modal for viewing/setting delay suspension date
public
delaySuspension() : mixed
delete()
Delete Client
public
delete() : mixed
deleteAchAccount()
Delete an ACH account
public
deleteAchAccount() : mixed
deleteCcAccount()
Delete a CC account
public
deleteCcAccount() : mixed
deleteContact()
Delete Contact
public
deleteContact() : mixed
deleteDraftInvoice()
Deletes a draft invoice
public
deleteDraftInvoice() : mixed
deleteNote()
Delete Note
public
deleteNote() : mixed
deleteRecurInvoice()
Delete recurring invoice
public
deleteRecurInvoice() : mixed
deleteService()
Deletes a pending service
public
deleteService() : mixed
edit()
Edit Client
public
edit() : mixed
editAchAccount()
Edit an ACH account
public
editAchAccount() : mixed
editCcAccount()
Edit a CC account
public
editCcAccount() : mixed
editContact()
Edit Contact
public
editContact() : mixed
editInvoice()
Edit invoice
public
editInvoice() : mixed
editNote()
Edit note
public
editNote() : mixed
editQuotation()
Edit quotation
public
editQuotation() : mixed
editRecurInvoice()
Edit a recurring invoice
public
editRecurInvoice() : mixed
editService()
Edit service
public
editService() : mixed
editServiceAddons()
Edit service add-ons
public
editServiceAddons() : mixed
editServiceAdvanced()
Advanced edit service
public
editServiceAdvanced() : mixed
editTransaction()
Edit a Transaction
public
editTransaction() : mixed
email()
Email Client
public
email() : mixed
emails()
View mail log
public
emails() : mixed
getClients()
AJAX Fetch clients when searching
public
getClients() : mixed
Tags
getCurrencyAmounts()
AJAX Fetches the currency amounts for the client profile sidebar
public
getCurrencyAmounts() : mixed
getCustomFields()
AJAX request for retrieving all custom fields for a client group
public
getCustomFields() : mixed
getRecordCreditFields()
AJAX Fetches a partial containing the record payment/credit fields
public
getRecordCreditFields([int $client_id = null ][, string $currency = null ][, stdClass $vars = null ]) : string
Parameters
- $client_id : int = null
-
The client ID
- $currency : string = null
-
The currency to fetch credits in
- $vars : stdClass = null
-
An stdClass object representing input vars
Tags
Return values
string —A partial of the fields
getStates()
AJAX Fetch all states belonging to a given country (json encoded ajax request)
public
getStates() : mixed
index()
Browse Clients
public
index() : mixed
invoiceApplied()
AJAX request for all transactions an invoice has applied
public
invoiceApplied() : mixed
invoiceCount()
Invoice count
public
invoiceCount() : mixed
invoiceQuotation()
Generates an invoice from a quotation
public
invoiceQuotation() : mixed
invoices()
List invoices or perform action (deliver or void) on selected invoices
public
invoices() : mixed
loginAsClient()
Login as the client
public
loginAsClient() : mixed
logoutAsClient()
Logout as the client
public
logoutAsClient() : mixed
makePayment()
Processes a payment for this client
public
makePayment() : mixed
makePaymentInvoices()
Fetches a table of invoices for the given currency
public
makePaymentInvoices() : mixed
merge()
Merge clients together
public
merge() : mixed
notes()
List notes
public
notes() : mixed
packageOptions()
Fetch all packages options for the given pricing ID and optional service ID
public
packageOptions() : mixed
packages()
Sets Restricted Packages
public
packages() : mixed
passwordReset()
Send the password reset email to the client
public
passwordReset() : mixed
preAction()
Pre-action setup method that is called before the index method, or the set controller action
public
preAction() : mixed
quickUpdate()
AJAX quick update client to set status, invoice method, auto debit status, or auto suspension status
public
quickUpdate() : mixed
quotationCount()
Quotation count
public
quotationCount() : mixed
quotationInvoices()
AJAX request for all invoices associated to a quotation
public
quotationInvoices() : mixed
quotations()
List quotations or perform action (deliver or void) on selected quotations
public
quotations() : mixed
recordPayment()
Manually record a payment for this client (i.e. record payment by check)
public
recordPayment() : mixed
searchInvoices()
Search an invoice by number
public
searchInvoices() : mixed
serviceCount()
Service count
public
serviceCount() : mixed
serviceInfo()
Service Info
public
serviceInfo() : mixed
services()
List services
public
services() : mixed
serviceTab()
Service tab request
public
serviceTab() : mixed
showaccount()
Renders a form to enter a passphrase for decrypting a bank account and routing number and returns the values on success
public
showaccount() : mixed
showcard()
Renders a form to enter a passphrase for decrypting a card and returns the card on success
public
showcard() : mixed
stickyNotes()
Displays/removes sticky notes
public
stickyNotes() : mixed
transactionApplied()
AJAX request for all invoices a transaction has been applied to
public
transactionApplied() : mixed
transactionCount()
Transaction count
public
transactionCount() : mixed
transactions()
List transactions
public
transactions() : mixed
unapplyTransaction()
Unapplies a transaction from the given invoice
public
unapplyTransaction() : mixed
validateInvoices()
Validates if an invoice has pending services before voiding them
public
validateInvoices() : mixed
vCard()
Prompts to download a vCard of the client's address information
public
vCard() : mixed
verifyAchAccount()
Verifies an ACH payment account
public
verifyAchAccount() : mixed
view()
View a specific client profile, may optionally set what content to view within the content view.
public
view([string $content = null ]) : mixed
Parameters
- $content : string = null
-
The content to set in the content view of the client profile page
viewInvoice()
Streams the given invoice to the browser
public
viewInvoice() : mixed
viewQuotation()
Streams the given quotation to the browser
public
viewQuotation() : mixed
addCustomFields()
Attempts to add custom fields to a client
private
addCustomFields(int $client_id[, array<string|int, mixed> $vars = [] ]) : mixed
Parameters
- $client_id : int
-
The client ID to add custom fields for
- $vars : array<string|int, mixed> = []
-
The post data, containing custom fields
Tags
Return values
mixed —An array of errors, or false if none exist
authorizePayment()
Attempts to create a payment authorization
private
authorizePayment(string $type, int $client_id, mixed $account_id, stdClass $vars, array<string|int, mixed> $apply_amounts, float $total) : stdClass|null
Parameters
- $type : string
-
The type of transaction ('cc', or 'ach')
- $client_id : int
-
The ID of the client making the payment
- $account_id : mixed
- $vars : stdClass
-
An stdClass object representing the payment account details
- $apply_amounts : array<string|int, mixed>
-
An array of invoice amounts to pay
- $total : float
-
The total amount to pay
Return values
stdClass|null —An stdClass object representing the transaction for this authorization if successful, otherwise null
buildPaymentConfirmation()
Authorizes a payment and builds the payment confirmation view for the gateway
private
buildPaymentConfirmation(string $type, int $client_id, mixed $account_id, stdClass $vars, array<string|int, mixed> $apply_amounts, float $total) : string
Parameters
- $type : string
-
The type of transaction ('cc', or 'ach')
- $client_id : int
-
The ID of the client making the payment
- $account_id : mixed
- $vars : stdClass
-
An stdClass object representing the payment account details
- $apply_amounts : array<string|int, mixed>
-
An array of invoice amounts to pay
- $total : float
-
The total amount to pay
Return values
string —The HTML for the payment confirmation
cancelServiceChanges()
Cancel any pending queued service changes
private
cancelServiceChanges(int $service_id) : mixed
Parameters
- $service_id : int
-
The Id of the service whose pending service changes to cancel
createCredit()
Creates an in-house credit for the client
private
createCredit(int $client_id, float $amount, string $currency) : int
Parameters
- $client_id : int
-
The ID of the client to credit
- $amount : float
-
The amount to credit
- $currency : string
-
The ISO 4217 currency code for the credit
Return values
int —$transaction_id The ID of the transaction for this credit
createService()
Create a service and its related addons and create or append an invoice for said services
private
createService(array<string|int, mixed> $details, array<string|int, mixed> $item) : mixed
Parameters
- $details : array<string|int, mixed>
-
An array of service information including:
- client_id The ID of the client to add the service item form
- coupon An coupon code used
- invoice_method 'none', 'create', 'append'
- invoice_id The invoice ID to append to (if invoice_method is 'append')
- $item : array<string|int, mixed>
-
An array of service item info including:
- parent_service_id The ID of the service this service is a child of (optional)
- package_group_id The ID of the package group this service was added from (optional)
- pricing_id The package pricing schedule ID for this service
- module_row_id The module row to add the service under (optional, default module will decide)
- use_module Whether or not to use the module when provisioning
- status The stauts of the service (active, canceled, pending, suspend, in_review)
- addons An array of addon items each including:
- package_group_id The ID of the package group this service was added from (optional)
- pricing_id The package pricing schedule ID for this service
- module_row_id The module row to add the service under (optional, default module will decide)
- use_module Whether or not to use the module when provisioning
- qty The quanity consumed by this service (optional, default 1)
- configoptions An array of key/value pair where each key is a package option ID and each value is its value
-
- Any other service field data to pass to the module
- qty The quanity consumed by this service (optional, default 1)
- configoptions An array of key/value pair where each key is a package option ID and each value is its value
-
- Any other service field data to pass to the module
deliverInvoices()
Delivers selected invoices
private
deliverInvoices(array<string|int, mixed> $invoice_ids, string $status, array<string|int, mixed> $vars, stdClass $client) : mixed
Parameters
- $invoice_ids : array<string|int, mixed>
-
An array of invoice IDs to be delivered
- $status : string
-
The current status of these invoices
- $vars : array<string|int, mixed>
-
An array of additional input, i.e., the delivery method
- $client : stdClass
-
The client to whom the invoices belongs
deliverQuotations()
Delivers selected quotations
private
deliverQuotations(array<string|int, mixed> $quotation_ids, string $status, array<string|int, mixed> $vars, stdClass $client) : mixed
Parameters
- $quotation_ids : array<string|int, mixed>
-
An array of quotation IDs to deliver
- $status : string
-
The current status of these quotations
- $vars : array<string|int, mixed>
-
An array of additional input, i.e., the delivery method
- $client : stdClass
-
The client to whom the quotations belongs
downloadElectronicInvoices()
Download electronic invoices in bulk
private
downloadElectronicInvoices(array<string|int, mixed> $invoice_ids[, string $format = null ]) : mixed
Parameters
- $invoice_ids : array<string|int, mixed>
-
A list of invoice IDs to download
- $format : string = null
-
The electronic invoice format to download
getAchAccountInfo()
Formats ach account info for making payments
private
getAchAccountInfo(stdClass $vars) : array<string|int, mixed>
Parameters
- $vars : stdClass
-
A list of payment info
Return values
array<string|int, mixed> —A formatted list of payment info
getCcAccountInfo()
Formats cc account info for making payments
private
getCcAccountInfo(stdClass $vars) : array<string|int, mixed>
Parameters
- $vars : stdClass
-
A list of payment info
Return values
array<string|int, mixed> —A formatted list of payment info
getCouponId()
Fetches the coupon ID for a given coupon code and package ID
private
getCouponId(string $coupon_code) : mixed
Parameters
- $coupon_code : string
-
The coupon code
Return values
mixed —The coupon ID if it exists, 0 if it does not exist, or null if no coupon code was given
getCreditPaymentAmount()
Fetches the total credit amount available for the client in the given currency and payment type
private
getCreditPaymentAmount(int $client_id, stdClass $vars) : float
Parameters
- $client_id : int
-
The ID of the client
- $vars : stdClass
Tags
Return values
float —The total amount of credit available
getModuleRowFields()
Retrieves a set of module row IDs and names
private
getModuleRowFields(Module $module, int $module_id[, bool $show_default = false ]) : array<string|int, mixed>
Parameters
- $module : Module
-
An instance of the module
- $module_id : int
-
The ID of the module whose module rows to fetch
- $show_default : bool = false
-
Whether or not to show the default package value as the first option (optional, default false)
Return values
array<string|int, mixed> —A key/value array where each key is a module row ID and each value is the name of the row
getPackageTerms()
Returns an array of all pricing terms for the given package
private
getPackageTerms(stdClass $package[, bool $renew = false ][, bool $upgrade = false ]) : array<string|int, mixed>
Parameters
- $package : stdClass
-
A stdClass object representing the package to fetch the terms for
- $renew : bool = false
-
Whether these terms are being fetched for an existing service (optional, default false)
- $upgrade : bool = false
-
Whether these package terms are being fetched for an upgrade (optional, default false)
Return values
array<string|int, mixed> —An array of key/value pairs where the key is the package pricing ID and the value is a string representing the price, term, and period.
getPlugin()
Retrieves an instance of the given plugin if it is enabled
private
getPlugin(int $plugin_id) : Plugin|null
Parameters
- $plugin_id : int
-
The ID of the plugin
Return values
Plugin|null —An instance of the plugin
getQueuedServiceChanges()
Retrieves a list of pending service changes queued
private
getQueuedServiceChanges(int $service_id) : array<string|int, mixed>
Parameters
- $service_id : int
-
The ID of the service whose queued service changes to fetch
Return values
array<string|int, mixed> —An array of all pending service changes
getServiceActions()
Gets the available actions for services
private
getServiceActions([mixed $status = null ]) : array<string|int, mixed>
Parameters
- $status : mixed = null
Return values
array<string|int, mixed> —An array containing the available actions for services
getServiceTabs()
Retrieves the service management tabs when editing a service
private
getServiceTabs(stdClass $service, stdClass $package, Module $module[, string|null $method = null ][, int|null $plugin_id = null ]) : mixed
Parameters
- $service : stdClass
-
An stdClass object representing the service
- $package : stdClass
-
An stdClass object representing the service's package
- $module : Module
-
An instance of the module used by the service
- $method : string|null = null
-
The method being called (i.e. the tab action, optional)
- $plugin_id : int|null = null
-
The ID of the plugin being called (optional)
getTextFromHtml()
Converts the HTML given to text iff no text is currently set
private
getTextFromHtml(string $html[, string $text = '' ][, mixed $remove_text = '' ]) : string
Parameters
- $html : string
-
The current HTML
- $text : string = ''
-
The current text (optional)
- $remove_text : mixed = ''
-
A string value, or numerically-indexed array of strings to remove from $text before attempting the conversion (optional)
Return values
string —The updated text
getUserContacts()
Retrieves a list of contacts that can login to the system
private
getUserContacts(stdClass $client) : array<string|int, mixed>
Parameters
- $client : stdClass
-
An stdClass object representing the client Id
Tags
Return values
array<string|int, mixed> —An array of key/value pairs where each key is the contact ID and the value is a language definition
listPackages()
List all packages available to the client
private
listPackages([int $client_id = null ][, int $parent_group_id = null ][, bool $return = false ]) : array<string|int, mixed>
Parameters
- $client_id : int = null
-
The ID of the client whose available packages will be listed
- $parent_group_id : int = null
-
The ID of the parent group to list packages for
- $return : bool = false
-
True to return the package options and package attributes arrays, false to set them in the view
Return values
array<string|int, mixed> —An array of package options and package attributes arrays if $return is true
makeInvoice()
Creates an invoice from the given line items
private
makeInvoice(stdClass $client, PresenterInterface $presenter, string $currency[, bool $deliver = true ][, int $service_id = null ]) : array<string|int, mixed>
Parameters
- $client : stdClass
-
An stdClass object representing the client
- $presenter : PresenterInterface
-
An instance of the PresenterInterface
- $currency : string
-
The ISO-4217 currency code
- $deliver : bool = true
-
True to set the invoice for delivery to the client's invoice method (optional, default true)
- $service_id : int = null
-
The ID of the service the items are for (optional)
Return values
array<string|int, mixed> —An key/value array containing:
- invoice_id The ID of the invoice, if created
- errors An array of errors if the invoice could not be created
makeLineItems()
Creates a set of line items from the given presenter
private
makeLineItems(PresenterInterface $presenter[, int $service_id = null ]) : array<string|int, mixed>
Parameters
- $presenter : PresenterInterface
-
An instance of the PresenterInterface
- $service_id : int = null
-
The ID of the service the items are for (optional)
Tags
Return values
array<string|int, mixed> —An array of line items
mergeInvoices()
Merge invoices
private
mergeInvoices(array<string|int, mixed> $invoices_id[, int $invoice_id = null ]) : mixed
Parameters
- $invoices_id : array<string|int, mixed>
- $invoice_id : int = null
-
The ID of the invoice where the invoice lines would be merged
processModuleTab()
Processes and retrieves the module tab content for the given method
private
processModuleTab(Module $module, string $method, stdClass $package, stdClass $service) : string
Parameters
- $module : Module
-
The module instance
- $method : string
-
The method on the module to call to retrieve the tab content
- $package : stdClass
-
An stdClass object representing the package
- $service : stdClass
-
An stdClass object representing the service being managed
Return values
string —The tab content
processPluginTab()
Processes and retrieves the plugin tab content for the given method
private
processPluginTab(int $plugin_id, string $method, stdClass $service) : string
Parameters
- $plugin_id : int
-
The ID of the plugin
- $method : string
-
The method on the plugin to call to retrieve the tab content
- $service : stdClass
-
An stdClass object representing the service being managed
Return values
string —The tab content
processServiceStep()
Process the requested step
private
processServiceStep(string $step, stdClass $package, stdClass $package_group, stdClass $client) : string
Parameters
- $step : string
-
The add services step to process
- $package : stdClass
-
A stdClass object representing the primary package being ordered
- $package_group : stdClass
-
A stdClass object representing the package group of the primary package being ordered
- $client : stdClass
-
A stdClass object representing the client for which the service is being added
Return values
string —The step to render
queueServiceChange()
Queue's a service change for later processing
private
queueServiceChange(int $service_id, int $invoice_id, array<string|int, mixed> $vars) : array<string|int, mixed>
Parameters
- $service_id : int
-
The ID of the service being queued
- $invoice_id : int
-
The ID of the invoice associated with the service change
- $vars : array<string|int, mixed>
-
An array of all data to queue to successfully update a service
Return values
array<string|int, mixed> —An array of queue info, including:
- service_change_id The ID of the service change, if created
- errors An array of errors
removeEmptyLineItems()
Removes empty line items from an invoice so that it can be auto-saved without error, when possible
private
removeEmptyLineItems(string $status[, array<string|int, mixed> $lines = [] ]) : array<string|int, mixed>
Parameters
- $status : string
-
The status of the invoice. Only 'draft' line items are changed
- $lines : array<string|int, mixed> = []
-
A list of invoice line items
Tags
Return values
array<string|int, mixed> —A numerically-indexed array of line items given, minus those that have no description
renderClientView()
Render the given Client view element
private
renderClientView(string $view[, bool $content_only = false ]) : mixed
Parameters
- $view : string
-
The view to render
- $content_only : bool = false
-
True to only return the content, false to render it
Return values
mixed —boolean false if this is an ajax request that can not be rendered within a structure, string containing the content to be rendered, or void if the content is rendered automatically
renderServiceStep()
Render each add service step
private
renderServiceStep(string $step, stdClass $package, stdClass $package_group, stdClass $client) : mixed
Parameters
- $step : string
-
The add services step to render
- $package : stdClass
-
A stdClass object representing the primary package being ordered
- $package_group : stdClass
-
A stdClass object representing the package group of the primary package being ordered
- $client : stdClass
-
A stdClass object representing the client for which the service is being added
setAchView()
Sets the ACH partial view
private
setAchView(stdClass $vars, stdClass $client[, bool $edit = false ][, bool $save_account = false ]) : mixed
Parameters
- $vars : stdClass
-
The input vars object for use in the view
- $client : stdClass
-
The client object whose contacts to use
- $edit : bool = false
-
True if this is an edit, false otherwise
- $save_account : bool = false
-
True to offer an option to save these payment details, false otherwise
Tags
setCcView()
Sets the CC partial view
private
setCcView(stdClass $vars, stdClass $client[, bool $edit = false ][, bool $save_account = false ]) : mixed
Parameters
- $vars : stdClass
-
The input vars object for use in the view
- $client : stdClass
-
The client object whose contacts to use
- $edit : bool = false
-
True if this is an edit, false otherwise
- $save_account : bool = false
-
True to offer an option to save these payment details, false otherwise
Tags
setContactView()
Sets the contact partial view
private
setContactView(stdClass $vars, stdClass $client[, bool $edit = false ]) : mixed
Parameters
- $vars : stdClass
-
The input vars object for use in the view
- $client : stdClass
-
The client object whose contacts to use
- $edit : bool = false
-
True if this is an edit, false otherwise
Tags
setPasswordOptions()
Sets a 'password_options' variable to the current view, which contains JSON-encoded password options for the password generator
private
setPasswordOptions() : mixed
setServiceTabMessages()
Sets messages to the view based on the given errors and messages provided
private
setServiceTabMessages([array<string|int, mixed>|bool|null $errors = null ][, array<string|int, mixed> $messages = null ]) : mixed
Parameters
- $errors : array<string|int, mixed>|bool|null = null
-
An array of error messages (optional)
- $messages : array<string|int, mixed> = null
-
An array of any other messages keyed by type (optional)
updateQuotationsStatus()
Voids selected invoices
private
updateQuotationsStatus(array<string|int, mixed> $quotation_ids, mixed $status, stdClass $client) : mixed
Parameters
- $quotation_ids : array<string|int, mixed>
- $status : mixed
- $client : stdClass
-
An stdClass object representing the client
updateServices()
Updates the given services to change their scheduled cancellation date
private
updateServices(stdClass $client, array<string|int, mixed> $data) : mixed
Parameters
- $client : stdClass
-
The client whose services are being updated
- $data : array<string|int, mixed>
-
An array of POST data including:
- service_ids An array of each service ID
- action The action to perform, e.g. "schedule_cancellation", "invoice_renewal" or "push_to_client"
- action_type The type of action to perform, e.g. "term", "date"
- date The cancel date if the action type is "date"
Return values
mixed —An array of errors, or false otherwise
updateServicesRenewalForProration()
Updates the renew date for each of the given services if it meets proration criteria
private
updateServicesRenewalForProration(array<string|int, mixed> $service_ids) : mixed
Parameters
- $service_ids : array<string|int, mixed>
-
A list of services to be updated
voidInvoices()
Voids selected invoices
private
voidInvoices(array<string|int, mixed> $invoice_ids, stdClass $client) : mixed
Parameters
- $invoice_ids : array<string|int, mixed>
-
A list of ids for the invoices that are being voided
- $client : stdClass
-
An stdClass object representing the client