Methods summary
public
|
#
__construct( )
Initialize Taxes
Overrides
|
public
integer
|
#
add( array $vars )
Adds a tax rule to the system
Adds a tax rule to the system
Parameters
- $vars
An array of tax info including:
- company_id The company ID this tax rule applies to.
- level The tax level this rule will be apart of.
- name The name of the tax rule (optional, default NULL)
- amount The tax amount (optional, default 0.00)
- type The tax type (optional, default 'exclusive')
- country The country this tax rule will apply to (optional, defalut NULL)
- state The state this tax rule will apply to (optional, default NULL)
- status The status of this tax rule (optional, default 'active')
Returns
integer The ID of the tax rule created, void on error
|
public
integer
|
#
edit( integer $tax_id, array $vars )
Updates a tax rule
Parameters
- $tax_id
- The tax ID
- $vars
An array of tax info including:
- company_id The company ID this tax rule applies to.
- level The tax level this rule will be apart of.
- name The name of the tax rule (optional, default NULL)
- amount The tax amount (optional, default 0.00)
- type The tax type (optional, default 'exclusive')
- country The country this tax rule will apply to (optional, default NULL)
- state The state tis tax rule will apply to (optional, default NULL)
- status The status of this tax rule (optional, default 'active')
Returns
integer The ID of the tax rule created, void on error
|
public
|
#
delete( integer $tax_id )
Sets a tax to inactive
Parameters
- $tax_id
- The ID of the tax rule to mark deleted (inactive)
|
public
array
|
#
getTaxTypes( )
Fetches all tax types
Returns
array A key=>value array of tax types
|
public
array
|
#
getTaxLevels( )
Fetches all tax levels
Returns
array A key=>value array of tax levels
|
public
array
|
#
getTaxStatus( )
Fetchas all status types
Returns
array A key=>value array of tax statuses
|
public
mixed
|
#
get( integer $tax_id )
Fetches a tax
Parameters
Returns
mixed A stdClass objects representing the tax, false if it does not exist
|
public
mixed
|
#
getAll( integer $company_id )
Retrieves a list of all tax rules for a particular company
Retrieves a list of all tax rules for a particular company
Parameters
- $company_id
- The company ID
Returns
mixed An array of stdClass objects representing tax rules, or false if none exist
|
public
boolean
|
#
validateType( string $type )
Validates a tax's 'type' field
Validates a tax's 'type' field
Parameters
Returns
boolean True if the type is validated, false otherwise
|
public
boolean
|
#
validateStatus( string $status )
Validates a tax's 'status' field
Validates a tax's 'status' field
Parameters
- $status
- The status to check
Returns
boolean True if the status is validated, false otherwise
|