FacturaScripts

AccountingClosingOpening extends AccountingClosingOpening
in package

Class created by Core/Base/PluginDeploy

Tags
author

FacturaScripts [email protected]

Table of Contents

$copySubAccounts  : bool
indicates whether the accounting account plan should be copied to the new fiscal year.
$dataBase  : DataBase
It provides direct access to the database.
$exercise  : Ejercicio
$newExercise  : Ejercicio
$subAccount  : Subcuenta
Subaccount for special process
__construct()  : mixed
Class Constructor
delete()  : bool
Delete special accounting entry from exercise.
exec()  : bool
Execute main process.
setCopySubAccounts()  : mixed
Establish whether the accounting account plan should be copied to the new fiscal year.
getConcept()  : string
Get the concept for the accounting entry and its lines.
getDate()  : mixed
Get the date for the accounting entry.
getOperation()  : string
Get the special operation identifier for the accounting entry.
getSQL()  : string
Get the sql with balance data for operation.
loadSubAccount()  : bool
Search and load data account from a special account code
saveBalanceLine()  : bool
Add accounting entry line with balance override.
saveLines()  : bool
Create each of the lines of the accounting entry with the accounts that have a balance.
setData()  : mixed
Establishes the common data of the accounting entry
setDataLine()  : mixed
Establishes the common data of the entries of the accounting entry
toolBox()  : ToolBox
copyAccounts()  : bool
Copy accounts and subaccounts from exercise to new exercise
copySubAccount()  : int|null
Copy existing subaccount into new exercise.
deleteAccountEntry()  : bool
Delete accounting entry of type indicated.
getBalance()  : array<string|int, mixed>
Returns an array with the balances of the accounting sub-accounts for each channel.
isProfitLossAccount()  : bool
Check if subaccount is a special profit and loss account
loadNewExercise()  : mixed
Search and load next exercise of indicated exercise.
newAccountEntry()  : bool
Create new accounting entry for channel and journal.
setResultAccountData()  : mixed
Set the subaccount data based on the result of the previous exercise

Properties

$copySubAccounts

indicates whether the accounting account plan should be copied to the new fiscal year.

protected bool $copySubAccounts = true

Methods

exec()

Execute main process.

public exec(Ejercicio $exercise, int $idjournal) : bool

Create a new account entry for channel with a one line by account balance. For each channel: - Create an account - Create the lines with balance - Create a line to canceling the balance (if necessary) - Update account totals

Parameters
$exercise : Ejercicio
$idjournal : int
Return values
bool

setCopySubAccounts()

Establish whether the accounting account plan should be copied to the new fiscal year.

public setCopySubAccounts(bool $value) : mixed
Parameters
$value : bool
Return values
mixed

getConcept()

Get the concept for the accounting entry and its lines.

protected abstract getConcept() : string
Return values
string

getDate()

Get the date for the accounting entry.

protected abstract getDate() : mixed
Return values
mixed

getOperation()

Get the special operation identifier for the accounting entry.

protected abstract getOperation() : string
Return values
string

getSQL()

Get the sql with balance data for operation.

protected abstract getSQL() : string
Return values
string

loadSubAccount()

Search and load data account from a special account code

protected loadSubAccount(Ejercicio $exercise, string $specialAccount) : bool
Parameters
$exercise : Ejercicio
$specialAccount : string
Return values
bool

saveBalanceLine()

Add accounting entry line with balance override.

protected saveBalanceLine(Asiento $accountEntry, float $debit, float $credit) : bool

Return true without doing anything, if you do not need balance override.

Parameters
$accountEntry : Asiento
$debit : float
$credit : float
Return values
bool

saveLines()

Create each of the lines of the accounting entry with the accounts that have a balance.

protected saveLines(Asiento $accountEntry, array<string|int, mixed> $balance, float &$debit, float &$credit) : bool
Parameters
$accountEntry : Asiento
$balance : array<string|int, mixed>
$debit : float
$credit : float
Return values
bool

setDataLine()

Establishes the common data of the entries of the accounting entry

protected setDataLine(Partida &$line, array<string|int, mixed> $data) : mixed
Parameters
$line : Partida
$data : array<string|int, mixed>
Return values
mixed

copyAccounts()

Copy accounts and subaccounts from exercise to new exercise

private copyAccounts() : bool
Return values
bool

copySubAccount()

Copy existing subaccount into new exercise.

private copySubAccount(int $idSubAccount) : int|null
Parameters
$idSubAccount : int
Return values
int|null

deleteAccountEntry()

Delete accounting entry of type indicated.

private deleteAccountEntry(Ejercicio $exercise, string $type) : bool
Parameters
$exercise : Ejercicio
$type : string
Return values
bool

getBalance()

Returns an array with the balances of the accounting sub-accounts for each channel.

private getBalance() : array<string|int, mixed>

Structure: [channel] ['id' => value, 'code' => value, 'debit' => amount, 'credit' => amount] ['id' => value, 'code' => value, 'debit' => amount, 'credit' => amount]

Return values
array<string|int, mixed>

isProfitLossAccount()

Check if subaccount is a special profit and loss account

private isProfitLossAccount(string $subaccount) : bool
Parameters
$subaccount : string
Return values
bool

loadNewExercise()

Search and load next exercise of indicated exercise.

private loadNewExercise() : mixed
Return values
mixed

newAccountEntry()

Create new accounting entry for channel and journal.

private newAccountEntry(Asiento &$accountEntry, int $channel, int $idjournal) : bool

New accounting it's set into accountEntry param.

Parameters
$accountEntry : Asiento
$channel : int
$idjournal : int
Return values
bool

setResultAccountData()

Set the subaccount data based on the result of the previous exercise

private setResultAccountData(array<string|int, mixed> &$data) : mixed
Parameters
$data : array<string|int, mixed>
Return values
mixed

Search results