class AccountancyImport (View source)

Manage the different format accountancy import

Properties

DoliDB $db
string[] $errors

Methods

__construct(DoliDB $db)

Constructor

float
cleanAmount(array<array{val: null|int|float|string, type: int<-1, 1>}> $arrayrecord, array<string, string> $listfields, int $record_key)

Clean amount

mixed
cleanValue(array<array{val: null|int|float|string, type: int<-1, 1>}> $arrayrecord, array<string, string> $listfields, int $record_key)

Clean value with trim

string
computeAmount(array<array{val: null|int|float|string, type: int<-1, 1>}> $arrayrecord, array<string, string> $listfields, int $record_key)

Compute amount

string
computeDirection(array<array{val: null|int|float|string, type: int<-1, 1>}> $arrayrecord, array<string, string> $listfields, int $record_key)

Compute direction

string
computePieceNum(array<array{val: null|int|float|string, type: int<-1, 1>}> $arrayrecord, array<string, string> $listfields, int $record_key)

Compute piece number

Details

__construct(DoliDB $db)

Constructor

Parameters

DoliDB $db

Database handler

float cleanAmount(array<array{val: null|int|float|string, type: int<-1, 1>}> $arrayrecord, array<string, string> $listfields, int $record_key)

Clean amount

Parameters

array<array{val: null|int|float|string, type: int<-1, 1>}> $arrayrecord

Array of read values: [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string), [fieldpos+1]...

array<string, string> $listfields

Fields list to add

int $record_key

Record key

Return Value

float Value

mixed cleanValue(array<array{val: null|int|float|string, type: int<-1, 1>}> $arrayrecord, array<string, string> $listfields, int $record_key)

Clean value with trim

Parameters

array<array{val: null|int|float|string, type: int<-1, 1>}> $arrayrecord

Array of read values: [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string), [fieldpos+1]...

array<string, string> $listfields

Fields list to add

int $record_key

Record key

Return Value

mixed Value

string computeAmount(array<array{val: null|int|float|string, type: int<-1, 1>}> $arrayrecord, array<string, string> $listfields, int $record_key)

Compute amount

Parameters

array<array{val: null|int|float|string, type: int<-1, 1>}> $arrayrecord

Array of read values: [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string), [fieldpos+1]...

array<string, string> $listfields

Fields list to add

int $record_key

Record key

Return Value

string Value

string computeDirection(array<array{val: null|int|float|string, type: int<-1, 1>}> $arrayrecord, array<string, string> $listfields, int $record_key)

Compute direction

Parameters

array<array{val: null|int|float|string, type: int<-1, 1>}> $arrayrecord

Array of read values: [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string), [fieldpos+1]...

array<string, string> $listfields

Fields list to add

int $record_key

Record key

Return Value

string

Value D or C or ""

string computePieceNum(array<array{val: null|int|float|string, type: int<-1, 1>}> $arrayrecord, array<string, string> $listfields, int $record_key)

Compute piece number

Parameters

array<array{val: null|int|float|string, type: int<-1, 1>}> $arrayrecord

Array of read values: [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string), [fieldpos+1]...

array<string, string> $listfields

Fields list to add

int $record_key

Record key

Return Value

string Value