class AccountancyExport (View source)

Manage the different format accountancy export

Properties

static int $EXPORT_TYPE_CONFIGURABLE
static int $EXPORT_TYPE_AGIRIS
static int $EXPORT_TYPE_EBP
static int $EXPORT_TYPE_CEGID
static int $EXPORT_TYPE_COGILOG
static int $EXPORT_TYPE_COALA
static int $EXPORT_TYPE_BOB50
static int $EXPORT_TYPE_CIEL
static int $EXPORT_TYPE_SAGE50_SWISS
static int $EXPORT_TYPE_CHARLEMAGNE
static int $EXPORT_TYPE_QUADRATUS
static int $EXPORT_TYPE_WINFIC
static int $EXPORT_TYPE_OPENCONCERTO
static int $EXPORT_TYPE_LDCOMPTA
static int $EXPORT_TYPE_LDCOMPTA10
static int $EXPORT_TYPE_GESTIMUMV3
static int $EXPORT_TYPE_GESTIMUMV5
static int $EXPORT_TYPE_ISUITEEXPERT
static int $EXPORT_TYPE_ISTEA
static int $EXPORT_TYPE_FEC
static int $EXPORT_TYPE_FEC2
DoliDB $db
string[] $errors
string $separator
string $end_line
array{downloadFilePath: string, downloadFileMimeType: string, downloadFileFullName: string}|array{} $generatedfiledata

Methods

__construct(DoliDB $db)

Constructor

array<int|string, string>|array<int|string, array{id: int|string, label: string, position: int, disabled?: string}>
getType(int<0, 1> $mode = 0)

Array with all export type available (key + label)

static string
getFormatCode(int $type)

Return string to summarize the format (Used to generated export filename)

array{param: array<int|string, array<string, string>>, cr: array<int|string, string>, format: array<string, string>}
getTypeConfig()

Array with all export types available (key + label) and parameters for config

string
getMimeType(int $formatexportset)

Return the MIME type of a file

int
export(BookKeepingLine[] $TData, int $formatexportset, int<0, 1> $withAttachment = 0, int<1, 1> $downloadMode = 1, int<1, 2> $outputMode = 1, int<1, 1> $noouput = 1)

Function who chose which export to use with the default config, and make the export into a file

void
exportCegid(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : CEGID

void
exportCogilog(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : COGILOG Last review for this format : 2022-07-12 Alexandre Spangaro ([email protected])

void
exportCoala(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : COALA

void
exportBob50(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : BOB50

void
exportCiel(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : CIEL (Format XIMPORT) Format since 2003 compatible CIEL version > 2002 / Sage50 Last review for this format : 2021-09-13 Alexandre Spangaro ([email protected])

array<string, array{name: string, path: string}>
exportQuadratus(BookKeepingLine[] $objectLines, ?resource $exportFile = null, array<string, array{name: string, path: string}> $archiveFileList = array(), int<0, 1> $withAttachment = 0)

Export format : Quadratus (Format ASCII) Format since 2015 compatible QuadraCOMPTA Last review for this format : 2025/12/21 Alexandre Spangaro ([email protected])

void
exportWinfic(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : WinFic - eWinfic - WinSis Compta Last review for this format : 2022-11-01 Alexandre Spangaro ([email protected])

void
exportEbp(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : EBP

void
exportAgiris(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : Agiris Isacompta

void
exportOpenConcerto(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : OpenConcerto

void
exportConfigurable(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : Configurable CSV

void
exportISTEA(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : ISTEA

array<string, array{name: string, path: string}>
exportFEC(BookKeepingLine[] $objectLines, ?resource $exportFile = null, array<string, array{name: string, path: string}> $archiveFileList = array(), int<0, 1> $withAttachment = 0)

Export format : FEC Last review for this format : 2023/10/12 Alexandre Spangaro ([email protected])

array<string, array{name: string, path: string}>
exportFEC2(BookKeepingLine[] $objectLines, ?resource $exportFile = null, array<string, array{name: string, path: string}> $archiveFileList = array(), int<0, 1> $withAttachment = 0)

Export format : FEC2 Last review for this format : 2023/10/12 Alexandre Spangaro ([email protected])

void
exportSAGE50SWISS(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : SAGE50SWISS

void
exportLDCompta(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : LD Compta version 9 http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW9.pdf

void
exportLDCompta10(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : LD Compta version 10 & higher Last review for this format : 08-15-2021 Alexandre Spangaro ([email protected])

void
exportCharlemagne(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : Charlemagne

void
exportGestimumV3(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : Gestimum V3

void
exportGestimumV5(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : Gestimum V5

void
exportiSuiteExpert(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : iSuite Expert

static string
trunc(string $str, int $size)

trunc

static string
toAnsi(string $str, int $size = -1)

toAnsi

Details

__construct(DoliDB $db)

Constructor

Parameters

DoliDB $db

Database handler

array<int|string, string>|array<int|string, array{id: int|string, label: string, position: int, disabled?: string}> getType(int<0, 1> $mode = 0)

Array with all export type available (key + label)

Parameters

int<0, 1> $mode

Mode of list: 0=flat list, 1=rich list

Return Value

array<int|string, string>|array<int|string, array{id: int|string, label: string, position: int, disabled?: string}>

array of type

static string getFormatCode(int $type)

Return string to summarize the format (Used to generated export filename)

Parameters

int $type

Format id

Return Value

string

Format code

array{param: array<int|string, array<string, string>>, cr: array<int|string, string>, format: array<string, string>} getTypeConfig()

Array with all export types available (key + label) and parameters for config

Return Value

array{param: array<int|string, array<string, string>>, cr: array<int|string, string>, format: array<string, string>}

of type

string getMimeType(int $formatexportset)

Return the MIME type of a file

Parameters

int $formatexportset

Id of export format

Return Value

string

MIME type.

int export(BookKeepingLine[] $TData, int $formatexportset, int<0, 1> $withAttachment = 0, int<1, 1> $downloadMode = 1, int<1, 2> $outputMode = 1, int<1, 1> $noouput = 1)

Function who chose which export to use with the default config, and make the export into a file

Parameters

BookKeepingLine[] $TData

Array with data

int $formatexportset

Id of export format

int<0, 1> $withAttachment

[=0] Not add files or 1 to have attached in an archive (ex : Quadratus) - Force output mode to write in a file (output mode = 1)

int<1, 1> $downloadMode

[=0] Direct download. Deprecated. Always use another value. or 1 to download after writing files - Forced by default when use withAttachment = 1 or -1 not to download files

int<1, 2> $outputMode

[=0] Print on screen. Deprecated. Always use another value. or 1 to write in file and uses the temp directory - Forced by default when use withAttachment = 1 or 2 to write in file a default export directory (accounting/export/)

int<1, 1> $noouput

0=old mode. Deprecated. Always use value 1. or 1=Do not output the file on stdout with this method. This must always be done by the main page, never by a method.

Return Value

int

Return integer <0 if KO, >0 OK. The property ->generatedfile is also filled.

void exportCegid(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : CEGID

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

void exportCogilog(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : COGILOG Last review for this format : 2022-07-12 Alexandre Spangaro ([email protected])

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

void exportCoala(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : COALA

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

void exportBob50(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : BOB50

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

void exportCiel(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : CIEL (Format XIMPORT) Format since 2003 compatible CIEL version > 2002 / Sage50 Last review for this format : 2021-09-13 Alexandre Spangaro ([email protected])

Help : https://sage50c.online-help.sage.fr/aide-technique/ In sage software | Use menu : "Exchange" > "Importing entries..."

If you want to force filename to "XIMPORT.TXT" for automatically import file present in a directory : use constant ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

array<string, array{name: string, path: string}> exportQuadratus(BookKeepingLine[] $objectLines, ?resource $exportFile = null, array<string, array{name: string, path: string}> $archiveFileList = array(), int<0, 1> $withAttachment = 0)

Export format : Quadratus (Format ASCII) Format since 2015 compatible QuadraCOMPTA Last review for this format : 2025/12/21 Alexandre Spangaro ([email protected])

Information on format: https://docplayer.fr/20769649-Fichier-d-entree-ascii-dans-quadracompta.html Help to import in Quadra: https://wiki.dolibarr.org/index.php?title=Module_Comptabilit%C3%A9_en_Partie_Double#Import_vers_CEGID_Quadra In QuadraCompta | Use menu : "Outils" > "Suivi des dossiers" > "Import ASCII(Compta)"

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

array<string, array{name: string, path: string}> $archiveFileList

[=array()] Archive file list : array of ['path', 'name']

int<0, 1> $withAttachment

[=0] Not add files or 1 to have attached in an archive

Return Value

array<string, array{name: string, path: string}>

Archive file list : array of ['path', 'name']

void exportWinfic(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : WinFic - eWinfic - WinSis Compta Last review for this format : 2022-11-01 Alexandre Spangaro ([email protected])

Help : https://wiki.gestan.fr/lib/exe/fetch.php?media=wiki:v15:compta:accountancy-format_winfic-ewinfic-winsiscompta.pdf

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

void exportEbp(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : EBP

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

void exportAgiris(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : Agiris Isacompta

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

void exportOpenConcerto(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : OpenConcerto

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

void exportConfigurable(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : Configurable CSV

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

void exportISTEA(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : ISTEA

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

array<string, array{name: string, path: string}> exportFEC(BookKeepingLine[] $objectLines, ?resource $exportFile = null, array<string, array{name: string, path: string}> $archiveFileList = array(), int<0, 1> $withAttachment = 0)

Export format : FEC Last review for this format : 2023/10/12 Alexandre Spangaro ([email protected])

Help to import in your software: https://wiki.dolibarr.org/index.php?title=Module_Comptabilit%C3%A9_en_Partie_Double#Exports_avec_fichiers_sources

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

array<string, array{name: string, path: string}> $archiveFileList

[=array()] Archive file list : array of ['path', 'name']

int<0, 1> $withAttachment

[=0] Not add files or 1 to have attached in an archive

Return Value

array<string, array{name: string, path: string}>

Archive file list : array of ['path', 'name']

array<string, array{name: string, path: string}> exportFEC2(BookKeepingLine[] $objectLines, ?resource $exportFile = null, array<string, array{name: string, path: string}> $archiveFileList = array(), int<0, 1> $withAttachment = 0)

Export format : FEC2 Last review for this format : 2023/10/12 Alexandre Spangaro ([email protected])

Help to import in your software: https://wiki.dolibarr.org/index.php?title=Module_Comptabilit%C3%A9_en_Partie_Double#Exports_avec_fichiers_sources

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

array<string, array{name: string, path: string}> $archiveFileList

[=array()] Archive file list : array of ['path', 'name']

int<0, 1> $withAttachment

[=0] Not add files or 1 to have attached in an archive

Return Value

array<string, array{name: string, path: string}>

Archive file list : array of ['path', 'name']

void exportSAGE50SWISS(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

void exportLDCompta(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

void exportLDCompta10(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : LD Compta version 10 & higher Last review for this format : 08-15-2021 Alexandre Spangaro ([email protected])

Help : http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW10.pdf

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

void exportCharlemagne(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : Charlemagne

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

void exportGestimumV3(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : Gestimum V3

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

void exportGestimumV5(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : Gestimum V5

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

void exportiSuiteExpert(BookKeepingLine[] $objectLines, ?resource $exportFile = null)

Export format : iSuite Expert

by OpenSolus [https://opensolus.fr]

Parameters

BookKeepingLine[] $objectLines data
?resource $exportFile

[=null] File resource to export or print if null

Return Value

void

static string trunc(string $str, int $size)

trunc

Parameters

string $str String
int $size

Data to trunc

Return Value

string

static string toAnsi(string $str, int $size = -1)

toAnsi

Parameters

string $str

Original string to encode and optionally truncate

int $size

Truncate string after $size characters

Return Value

string

String encoded in Windows-1251 charset