FacturaScripts

AccountingCreation
in package

Class to create accounting subaccounts automatically:

  • General
  • Customer
  • Supplier

Table of Contents

Properties

$exercise  : Ejercicio

Methods

__construct()  : mixed
copyAccountToExercise()  : Cuenta
Create an account into informed exercise.
copySubAccountToExercise()  : Subcuenta
Create a subaccount into informed exercise.
createFromAccount()  : Subcuenta
Create a subaccount with the code and the reported description belonging to the group and exercise.
createSubjectAccount()  : Subcuenta
Create the accounting subaccount for the informed customer or supplier.
fillToLength()  : string
Complete to the indicated length with zeros.
getFreeSubjectSubaccount()  : string
Calculate an accounting subaccount from the customer or supplier code
checkExercise()  : bool
Load exercise and check if it can be used

Properties

Methods

copyAccountToExercise()

Create an account into informed exercise.

public copyAccountToExercise(Cuenta $account, string $codejercicio) : Cuenta
Parameters
$account : Cuenta
$codejercicio : string
Return values
Cuenta

copySubAccountToExercise()

Create a subaccount into informed exercise.

public copySubAccountToExercise(Subcuenta $subAccount, string $codejercicio) : Subcuenta
  • Check exercise is open.
    • Check subaccount exists.

For new subaccount:

  • Search account and copy from source subaccount if it don't exist.
  • Save new subaccount.
Parameters
$subAccount : Subcuenta
$codejercicio : string
Return values
Subcuenta

createFromAccount()

Create a subaccount with the code and the reported description belonging to the group and exercise.

public createFromAccount(Cuenta $account, string $code[, string $description = '' ]) : Subcuenta
Parameters
$account : Cuenta

Parent group account

$code : string

The code of the subaccount

$description : string = ''

The description of the subaccount

Return values
Subcuenta

createSubjectAccount()

Create the accounting subaccount for the informed customer or supplier.

public createSubjectAccount(Cliente|Proveedor &$subject, Cuenta $account) : Subcuenta

If the customer or supplier does not have an associated accounting subaccount, one is calculated automatically.

Parameters
$subject : Cliente|Proveedor

Customer or Supplier model

$account : Cuenta

Parent group account model

Return values
Subcuenta

fillToLength()

Complete to the indicated length with zeros.

public fillToLength(int $length, string $value[, string $prefix = '' ]) : string
Parameters
$length : int
$value : string
$prefix : string = ''
Return values
string

getFreeSubjectSubaccount()

Calculate an accounting subaccount from the customer or supplier code

public getFreeSubjectSubaccount(Cliente|Proveedor $subject, Cuenta $account) : string
Parameters
$subject : Cliente|Proveedor

Customer or Supplier model

$account : Cuenta

Parent group account model

Return values
string

checkExercise()

Load exercise and check if it can be used

private checkExercise(string $code) : bool
Parameters
$code : string
Return values
bool

        
On this page

Search results