Overview

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • auth
        • ldap
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
      • exchange
        • rates
          • currency
            • layer
          • fixer
          • open
            • exchange
              • rates
          • x
            • rates
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • perforated
            • invoice
          • quickbooks
            • invoice
          • templates
            • default
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • reports
        • aging
          • invoices
        • client
          • data
            • portability
        • custom
          • report
        • invoice
          • creation
        • package
          • revenue
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • core
      • Automation
        • Tasks
          • Common
          • Task
        • Type
          • Common
          • Cron
      • Pricing
        • ItemComparator
        • MetaItem
        • Modifier
          • Type
            • Description
              • Type
                • Discount
                • Option
                • Service
                • Tax
            • Discount
            • Price
            • Proration
        • Presenter
          • Build
            • Invoice
            • InvoiceData
            • Options
            • Service
            • ServiceChange
            • ServiceData
          • Collection
          • Format
            • Fields
            • Type
              • Discount
              • Item
              • Option
              • Options
              • Package
              • Pricing
              • Service
              • Tax
          • Items
            • Invoice
            • Service
          • Type
      • ServiceProviders
      • Util
        • Captcha
          • Captchas
          • Common
        • Common
          • Traits
        • Events
          • Common
          • Handlers
          • Observers
        • Filters
          • Common
        • GeoIp
        • Input
          • Fields
            • Common
        • Tax
        • Widgets
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • helpers
      • color
      • data
        • structure
  • None
  • PHP

Classes

  • Accounts
  • Actions
  • ApiKeys
  • Backup
  • CalendarEvents
  • ClientGroups
  • Clients
  • Companies
  • Contacts
  • Countries
  • Coupons
  • CouponTerms
  • CronTasks
  • Currencies
  • EmailGroups
  • Emails
  • EmailVerifications
  • Encryption
  • GatewayManager
  • Invoices
  • InvoiceTemplateManager
  • Languages
  • Logs
  • Marketplace
  • MessageGroups
  • Messages
  • MessengerManager
  • ModuleClientMeta
  • ModuleManager
  • ModuleTypes
  • Navigation
  • PackageGroups
  • PackageOptionGroups
  • PackageOptions
  • Packages
  • Payments
  • Permissions
  • PluginManager
  • Pricings
  • ReportManager
  • ServiceChanges
  • ServiceInvoices
  • Services
  • Settings
  • Staff
  • StaffGroups
  • States
  • SystemEvents
  • Taxes
  • Themes
  • Transactions
  • Users
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class Taxes

Tax rule management

Model
Extended by AppModel uses Blesta\Core\Util\Common\Traits\Container
Extended by Taxes
Package: blesta\app\models
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at app/models/taxes.php
Methods summary
public
# __construct( )

Initialize Taxes

Initialize Taxes

Overrides

AppModel::__construct()
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

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

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

Fetches all tax types

Returns

array
A key=>value array of tax types
public array
# getTaxLevels( )

Fetches all tax levels

Fetches all tax levels

Returns

array
A key=>value array of tax levels
public array
# getTaxStatus( )

Fetchas all status types

Fetchas all status types

Returns

array
A key=>value array of tax statuses
public mixed
# get( integer $tax_id )

Fetches a tax

Fetches a tax

Parameters

$tax_id
The tax ID

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

$type
The type to check

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
Methods inherited from AppModel
_(), boolToInt(), currencyToDecimal(), dateToUtc(), errors(), getPerPage(), ifSet(), loadCrypto(), setDefaultIfEmpty(), setPerPage(), setRulesIfSet(), strToBool(), systemDecrypt(), systemEncrypt(), systemHash(), truncateDecimal(), validateExists(), validateStateCountry()
Methods used from Blesta\Core\Util\Common\Traits\Container
getFromContainer()
Properties inherited from AppModel
$logger, $replacement_keys
Blesta API documentation generated by ApiGen