AccountingClass
extends AccountingAccounts
in package
Base class for creation of accounting processes
Tags
Table of Contents
- SPECIAL_CREDITOR_ACCOUNT = 'ACREED'
- SPECIAL_CUSTOMER_ACCOUNT = 'CLIENT'
- SPECIAL_EXPENSE_ACCOUNT = 'GTOBAN'
- SPECIAL_IRPF_PURCHASE_ACCOUNT = 'IRPFPR'
- SPECIAL_IRPF_SALES_ACCOUNT = 'IRPF'
- SPECIAL_NEGATIVE_PREV_ACCOUNT = 'PRENEG'
- SPECIAL_PAYMENT_ACCOUNT = 'CAJA'
- SPECIAL_POSITIVE_PREV_ACCOUNT = 'PREVIO'
- SPECIAL_PROFIT_LOSS_ACCOUNT = 'PYG'
- SPECIAL_SUPPLIER_ACCOUNT = 'PROVEE'
- SPECIAL_TAX_IMPACTED_ACCOUNT = 'IVAREP'
- SPECIAL_TAX_SUPPORTED_ACCOUNT = 'IVASOP'
- $exercise : Ejercicio
- $creation : AccountingCreation
- $document : ModelClass
- __construct() : mixed
- Class constructor
- generate() : mixed
- Method to launch the accounting process
- getCustomerAccount() : Subcuenta
- Get the accounting sub-account for the customer and the fiscal year.
- getCustomerGroupAccount() : Subcuenta
- Get the accounting sub-account for the group's customer and the fiscal year.
- getExpenseAccount() : Subcuenta
- Get the banking expenses sub-account for payments in the fiscal year.
- getIRPFPurchaseAccount() : Subcuenta
- Get the accounting sub-account for Purchase Retention.
- getIRPFSalesAccount() : Subcuenta
- Get the accounting sub-account for Sales Retention.
- getPaymentAccount() : Subcuenta
- Get the accounting sub-account for the payment method in the fiscal year.
- getSpecialAccount() : Cuenta
- Get the accounting account set as special.
- getSpecialSubAccount() : Subcuenta
- Get an accounting sub-account for the special type indicated If there is no, search within the group of accounts for the special type
- getSubAccount() : Subcuenta
- Get the indicated accounting sub-account.
- getSupplierAccount() : Subcuenta
- Get the accounting sub-account for the supplier and the fiscal year.
- getTaxImpactedAccount() : Subcuenta
- Get the accounting sub-account for Impacted Tax.
- getTaxSupportedAccount() : Subcuenta
- Get the accounting sub-account for Supported Tax.
- addBasicLine() : bool
- Add a standard line to the accounting entry based on the reported sub-account
- addLinesFromTotals() : bool
- Add a group of lines from array of subaccounts/amount.
- addSurchargeLine() : bool
- Add a line of taxes to the accounting entry based on the sub-account and values reported
- addTaxLine() : bool
- Add a line of taxes to the accounting entry based on the sub-account and values reported
- getBasicLine() : Partida
- Obtain a standard line to the accounting entry based on the reported sub-account
- toolBox() : ToolBox
- getAccountFromCode() : Subcuenta
- Get the accounting sub-account according to the indicated code sub-account.
Constants
SPECIAL_CREDITOR_ACCOUNT
public
mixed
SPECIAL_CREDITOR_ACCOUNT
= 'ACREED'
SPECIAL_CUSTOMER_ACCOUNT
public
mixed
SPECIAL_CUSTOMER_ACCOUNT
= 'CLIENT'
SPECIAL_EXPENSE_ACCOUNT
public
mixed
SPECIAL_EXPENSE_ACCOUNT
= 'GTOBAN'
SPECIAL_IRPF_PURCHASE_ACCOUNT
public
mixed
SPECIAL_IRPF_PURCHASE_ACCOUNT
= 'IRPFPR'
SPECIAL_IRPF_SALES_ACCOUNT
public
mixed
SPECIAL_IRPF_SALES_ACCOUNT
= 'IRPF'
SPECIAL_NEGATIVE_PREV_ACCOUNT
public
mixed
SPECIAL_NEGATIVE_PREV_ACCOUNT
= 'PRENEG'
SPECIAL_PAYMENT_ACCOUNT
public
mixed
SPECIAL_PAYMENT_ACCOUNT
= 'CAJA'
SPECIAL_POSITIVE_PREV_ACCOUNT
public
mixed
SPECIAL_POSITIVE_PREV_ACCOUNT
= 'PREVIO'
SPECIAL_PROFIT_LOSS_ACCOUNT
public
mixed
SPECIAL_PROFIT_LOSS_ACCOUNT
= 'PYG'
SPECIAL_SUPPLIER_ACCOUNT
public
mixed
SPECIAL_SUPPLIER_ACCOUNT
= 'PROVEE'
SPECIAL_TAX_IMPACTED_ACCOUNT
public
mixed
SPECIAL_TAX_IMPACTED_ACCOUNT
= 'IVAREP'
SPECIAL_TAX_SUPPORTED_ACCOUNT
public
mixed
SPECIAL_TAX_SUPPORTED_ACCOUNT
= 'IVASOP'
Properties
$exercise
public
Ejercicio
$exercise
$creation
protected
AccountingCreation
$creation
$document
protected
ModelClass
$document
Methods
__construct()
Class constructor
public
__construct() : mixed
Return values
mixed —generate()
Method to launch the accounting process
public
generate(ModelClass $model) : mixed
Parameters
- $model : ModelClass
Return values
mixed —getCustomerAccount()
Get the accounting sub-account for the customer and the fiscal year.
public
getCustomerAccount(Cliente &$customer[, string $specialAccount = self::SPECIAL_CUSTOMER_ACCOUNT ]) : Subcuenta
- First check the customer
- Second check the customer group
- Third search for the sub-account classified as a special account for customers
- Fourth search for the general account classified as a special account for customers and then search for a sub account belonging to the account
Parameters
- $customer : Cliente
- $specialAccount : string = self::SPECIAL_CUSTOMER_ACCOUNT
Return values
Subcuenta —getCustomerGroupAccount()
Get the accounting sub-account for the group's customer and the fiscal year.
public
getCustomerGroupAccount(GrupoClientes $group[, string $specialAccount = self::SPECIAL_CUSTOMER_ACCOUNT ]) : Subcuenta
Parameters
- $group : GrupoClientes
- $specialAccount : string = self::SPECIAL_CUSTOMER_ACCOUNT
Return values
Subcuenta —getExpenseAccount()
Get the banking expenses sub-account for payments in the fiscal year.
public
getExpenseAccount(string $codpago[, string $specialAccount = self::SPECIAL_EXPENSE_ACCOUNT ]) : Subcuenta
Parameters
- $codpago : string
- $specialAccount : string = self::SPECIAL_EXPENSE_ACCOUNT
Return values
Subcuenta —getIRPFPurchaseAccount()
Get the accounting sub-account for Purchase Retention.
public
getIRPFPurchaseAccount(Retencion $retention[, string $specialAccount = self::SPECIAL_IRPF_PURCHASE_ACCOUNT ]) : Subcuenta
Parameters
- $retention : Retencion
- $specialAccount : string = self::SPECIAL_IRPF_PURCHASE_ACCOUNT
Return values
Subcuenta —getIRPFSalesAccount()
Get the accounting sub-account for Sales Retention.
public
getIRPFSalesAccount(Retencion $retention[, string $specialAccount = self::SPECIAL_IRPF_SALES_ACCOUNT ]) : Subcuenta
Parameters
- $retention : Retencion
- $specialAccount : string = self::SPECIAL_IRPF_SALES_ACCOUNT
Return values
Subcuenta —getPaymentAccount()
Get the accounting sub-account for the payment method in the fiscal year.
public
getPaymentAccount(string $codpago[, string $specialAccount = self::SPECIAL_PAYMENT_ACCOUNT ]) : Subcuenta
Parameters
- $codpago : string
- $specialAccount : string = self::SPECIAL_PAYMENT_ACCOUNT
Return values
Subcuenta —getSpecialAccount()
Get the accounting account set as special.
public
getSpecialAccount(string $specialAccount) : Cuenta
Parameters
- $specialAccount : string
Return values
Cuenta —getSpecialSubAccount()
Get an accounting sub-account for the special type indicated If there is no, search within the group of accounts for the special type
public
getSpecialSubAccount(string $specialAccount) : Subcuenta
Parameters
- $specialAccount : string
Return values
Subcuenta —getSubAccount()
Get the indicated accounting sub-account.
public
getSubAccount(string $code) : Subcuenta
Parameters
- $code : string
Return values
Subcuenta —getSupplierAccount()
Get the accounting sub-account for the supplier and the fiscal year.
public
getSupplierAccount(Proveedor $supplier[, string $specialAccount = self::SPECIAL_SUPPLIER_ACCOUNT ]) : Subcuenta
If it does not exist, search for the sub-account associated with the special type indicated
Parameters
- $supplier : Proveedor
- $specialAccount : string = self::SPECIAL_SUPPLIER_ACCOUNT
Return values
Subcuenta —getTaxImpactedAccount()
Get the accounting sub-account for Impacted Tax.
public
getTaxImpactedAccount(Impuesto $tax[, string $specialAccount = self::SPECIAL_TAX_IMPACTED_ACCOUNT ]) : Subcuenta
Parameters
- $tax : Impuesto
- $specialAccount : string = self::SPECIAL_TAX_IMPACTED_ACCOUNT
Return values
Subcuenta —getTaxSupportedAccount()
Get the accounting sub-account for Supported Tax.
public
getTaxSupportedAccount(Impuesto $tax[, string $specialAccount = self::SPECIAL_TAX_SUPPORTED_ACCOUNT ]) : Subcuenta
Parameters
- $tax : Impuesto
- $specialAccount : string = self::SPECIAL_TAX_SUPPORTED_ACCOUNT
Return values
Subcuenta —addBasicLine()
Add a standard line to the accounting entry based on the reported sub-account
protected
addBasicLine(Asiento $accountEntry, Subcuenta $subaccount, bool $isDebit[, float $amount = null ]) : bool
Parameters
Return values
bool —addLinesFromTotals()
Add a group of lines from array of subaccounts/amount.
protected
addLinesFromTotals(Asiento $accountEntry, array<string|int, mixed> $totals, bool $isDebit, Subcuenta $counterpart, string $accountError, string $saveError) : bool
Parameters
- $accountEntry : Asiento
- $totals : array<string|int, mixed>
- $isDebit : bool
- $counterpart : Subcuenta
- $accountError : string
- $saveError : string
Return values
bool —addSurchargeLine()
Add a line of taxes to the accounting entry based on the sub-account and values reported
protected
addSurchargeLine(Asiento $accountEntry, Subcuenta $subaccount, Subcuenta $counterpart, bool $isDebit, array<string|int, mixed> $values) : bool
Parameters
- $accountEntry : Asiento
- $subaccount : Subcuenta
- $counterpart : Subcuenta
- $isDebit : bool
- $values : array<string|int, mixed>
Return values
bool —addTaxLine()
Add a line of taxes to the accounting entry based on the sub-account and values reported
protected
addTaxLine(Asiento $accountEntry, Subcuenta $subaccount, Subcuenta $counterpart, bool $isDebit, array<string|int, mixed> $values) : bool
Parameters
- $accountEntry : Asiento
- $subaccount : Subcuenta
- $counterpart : Subcuenta
- $isDebit : bool
- $values : array<string|int, mixed>
Return values
bool —getBasicLine()
Obtain a standard line to the accounting entry based on the reported sub-account
protected
getBasicLine(Asiento $accountEntry, Subcuenta $subaccount, bool $isDebit[, float $amount = null ]) : Partida
Parameters
Return values
Partida —toolBox()
protected
toolBox() : ToolBox
Tags
Return values
ToolBox —getAccountFromCode()
Get the accounting sub-account according to the indicated code sub-account.
private
getAccountFromCode(string $code, string $specialAccount) : Subcuenta
- First check the tax
- Second check the special account
Parameters
- $code : string
- $specialAccount : string