dolibarr 21.0.0-beta
AccountancyExport Class Reference

Manage the different format accountancy export. More...

Collaboration diagram for AccountancyExport:

Public Member Functions

 __construct (DoliDB $db)
 Constructor.
 
 getType ($mode=0)
 Array with all export type available (key + label)
 
 getTypeConfig ()
 Array with all export types available (key + label) and parameters for config.
 
 getMimeType ($formatexportset)
 Return the MIME type of a file.
 
 export (&$TData, $formatexportset, $withAttachment=0, $downloadMode=1, $outputMode=1, $noouput=1)
 Function who chose which export to use with the default config, and make the export into a file.
 
 exportCegid ($objectLines, $exportFile=null)
 Export format : CEGID.
 
 exportCogilog ($objectLines, $exportFile=null)
 Export format : COGILOG Last review for this format : 2022-07-12 Alexandre Spangaro (aspan.nosp@m.garo.nosp@m.@open.nosp@m.-dsi.nosp@m..fr)
 
 exportCoala ($objectLines, $exportFile=null)
 Export format : COALA.
 
 exportBob50 ($objectLines, $exportFile=null)
 Export format : BOB50.
 
 exportCiel ($objectLines, $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 (aspan.nosp@m.garo.nosp@m.@open.nosp@m.-dsi.nosp@m..fr)
 
 exportQuadratus ($objectLines, $exportFile=null, $archiveFileList=array(), $withAttachment=0)
 Export format : Quadratus (Format ASCII) Format since 2015 compatible QuadraCOMPTA Last review for this format : 2023/10/12 Alexandre Spangaro (aspan.nosp@m.garo.nosp@m.@open.nosp@m.-dsi.nosp@m..fr)
 
 exportWinfic ($objectLines, $exportFile=null)
 Export format : WinFic - eWinfic - WinSis Compta Last review for this format : 2022-11-01 Alexandre Spangaro (aspan.nosp@m.garo.nosp@m.@open.nosp@m.-dsi.nosp@m..fr)
 
 exportEbp ($objectLines, $exportFile=null)
 Export format : EBP.
 
 exportAgiris ($objectLines, $exportFile=null)
 Export format : Agiris Isacompta.
 
 exportOpenConcerto ($objectLines, $exportFile=null)
 Export format : OpenConcerto.
 
 exportConfigurable ($objectLines, $exportFile=null)
 Export format : Configurable CSV.
 
 exportSAGE50SWISS ($objectLines, $exportFile=null)
 Export format : SAGE50SWISS.
 
 exportLDCompta ($objectLines, $exportFile=null)
 Export format : LD Compta version 9 http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW9.pdf.
 
 exportLDCompta10 ($objectLines, $exportFile=null)
 Export format : LD Compta version 10 & higher Last review for this format : 08-15-2021 Alexandre Spangaro (aspan.nosp@m.garo.nosp@m.@open.nosp@m.-dsi.nosp@m..fr)
 
 exportCharlemagne ($objectLines, $exportFile=null)
 Export format : Charlemagne.
 
 exportGestimumV3 ($objectLines, $exportFile=null)
 Export format : Gestimum V3.
 
 exportGestimumV5 ($objectLines, $exportFile=null)
 Export format : Gestimum V5.
 
 exportiSuiteExpert ($objectLines, $exportFile=null)
 Export format : iSuite Expert.
 

Static Public Member Functions

static getFormatCode ($type)
 Return string to summarize the format (Used to generated export filename)
 
static trunc ($str, $size)
 trunc
 
static toAnsi ($str, $size=-1)
 toAnsi
 

Detailed Description

Manage the different format accountancy export.

Definition at line 49 of file accountancyexport.class.php.

Constructor & Destructor Documentation

◆ __construct()

AccountancyExport::__construct ( DoliDB $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 125 of file accountancyexport.class.php.

References $conf, getDolGlobalInt(), and getDolGlobalString().

Member Function Documentation

◆ export()

AccountancyExport::export ( & $TData,
$formatexportset,
$withAttachment = 0,
$downloadMode = 1,
$outputMode = 1,
$noouput = 1 )

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

Parameters
BookKeepingLine[]$TDataArray with data
int$formatexportsetId 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.
Returns
int Return integer <0 if KO, >0 OK. The property ->generatedfile is also filled.

Definition at line 375 of file accountancyexport.class.php.

References $conf, dol_filesize(), dol_is_dir(), dol_mkdir(), exportAgiris(), exportBob50(), exportCegid(), exportCharlemagne(), exportCiel(), exportCoala(), exportCogilog(), exportConfigurable(), exportEbp(), exportGestimumV3(), exportGestimumV5(), exportiSuiteExpert(), exportLDCompta(), exportLDCompta10(), exportOpenConcerto(), exportQuadratus(), exportSAGE50SWISS(), exportWinfic(), getMimeType(), readfileLowMemory(), and top_httphead().

◆ exportAgiris()

AccountancyExport::exportAgiris ( $objectLines,
$exportFile = null )

Export format : Agiris Isacompta.

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 1232 of file accountancyexport.class.php.

References dol_print_date(), length_accounta(), length_accountg(), price(), and toAnsi().

Referenced by export().

◆ exportBob50()

AccountancyExport::exportBob50 ( $objectLines,
$exportFile = null )

Export format : BOB50.

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 778 of file accountancyexport.class.php.

References dol_print_date(), dol_trunc(), length_accounta(), length_accountg(), and price().

Referenced by export().

◆ exportCegid()

AccountancyExport::exportCegid ( $objectLines,
$exportFile = null )

Export format : CEGID.

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 641 of file accountancyexport.class.php.

References dol_print_date(), dol_string_unaccent(), length_accounta(), length_accountg(), and price2fec().

Referenced by export().

◆ exportCharlemagne()

AccountancyExport::exportCharlemagne ( $objectLines,
$exportFile = null )

Export format : Charlemagne.

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 2360 of file accountancyexport.class.php.

References dol_print_date(), price(), and trunc().

Referenced by export().

◆ exportCiel()

AccountancyExport::exportCiel ( $objectLines,
$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 (aspan.nosp@m.garo.nosp@m.@open.nosp@m.-dsi.nosp@m..fr)

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[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 833 of file accountancyexport.class.php.

References dol_print_date(), dol_string_unaccent(), length_accounta(), length_accountg(), and price2fec().

Referenced by export().

◆ exportCoala()

AccountancyExport::exportCoala ( $objectLines,
$exportFile = null )

Export format : COALA.

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 741 of file accountancyexport.class.php.

References dol_print_date(), length_accounta(), length_accountg(), and price().

Referenced by export().

◆ exportCogilog()

AccountancyExport::exportCogilog ( $objectLines,
$exportFile = null )

Export format : COGILOG Last review for this format : 2022-07-12 Alexandre Spangaro (aspan.nosp@m.garo.nosp@m.@open.nosp@m.-dsi.nosp@m..fr)

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 677 of file accountancyexport.class.php.

References dol_print_date(), length_accounta(), length_accountg(), and price().

Referenced by export().

◆ exportConfigurable()

AccountancyExport::exportConfigurable ( $objectLines,
$exportFile = null )

Export format : Configurable CSV.

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 1317 of file accountancyexport.class.php.

References $conf, dol_print_date(), getDolGlobalString(), length_accounta(), length_accountg(), and price2num().

Referenced by export().

◆ exportEbp()

AccountancyExport::exportEbp ( $objectLines,
$exportFile = null )

Export format : EBP.

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 1189 of file accountancyexport.class.php.

References dol_print_date(), and price2num().

Referenced by export().

◆ exportGestimumV3()

AccountancyExport::exportGestimumV3 ( $objectLines,
$exportFile = null )

Export format : Gestimum V3.

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 2438 of file accountancyexport.class.php.

References dol_print_date(), dol_trunc(), length_accountg(), and price2num().

Referenced by export().

◆ exportGestimumV5()

AccountancyExport::exportGestimumV5 ( $objectLines,
$exportFile = null )

Export format : Gestimum V5.

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 2546 of file accountancyexport.class.php.

References dol_print_date(), dol_trunc(), length_accountg(), and price2num().

Referenced by export().

◆ exportiSuiteExpert()

AccountancyExport::exportiSuiteExpert ( $objectLines,
$exportFile = null )

Export format : iSuite Expert.

by OpenSolus [https://opensolus.fr]

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 2597 of file accountancyexport.class.php.

References dol_print_date(), length_accounta(), length_accountg(), and price().

Referenced by export().

◆ exportLDCompta()

AccountancyExport::exportLDCompta ( $objectLines,
$exportFile = null )

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

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 1940 of file accountancyexport.class.php.

References dol_print_date(), length_accounta(), length_accountg(), and price().

Referenced by export().

◆ exportLDCompta10()

AccountancyExport::exportLDCompta10 ( $objectLines,
$exportFile = null )

Export format : LD Compta version 10 & higher Last review for this format : 08-15-2021 Alexandre Spangaro (aspan.nosp@m.garo.nosp@m.@open.nosp@m.-dsi.nosp@m..fr)

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

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 2080 of file accountancyexport.class.php.

References dol_print_date(), dol_trunc(), getCountry(), length_accounta(), length_accountg(), and price().

Referenced by export().

◆ exportOpenConcerto()

AccountancyExport::exportOpenConcerto ( $objectLines,
$exportFile = null )

Export format : OpenConcerto.

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 1279 of file accountancyexport.class.php.

References dol_print_date(), length_accounta(), length_accountg(), and price().

Referenced by export().

◆ exportQuadratus()

AccountancyExport::exportQuadratus ( $objectLines,
$exportFile = null,
$archiveFileList = array(),
$withAttachment = 0 )

Export format : Quadratus (Format ASCII) Format since 2015 compatible QuadraCOMPTA Last review for this format : 2023/10/12 Alexandre Spangaro (aspan.nosp@m.garo.nosp@m.@open.nosp@m.-dsi.nosp@m..fr)

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[]$objectLinesdata
?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
Returns
array<string,array{name:string,path:string}> Archive file list : array of ['path', 'name']

Definition at line 888 of file accountancyexport.class.php.

References $conf, dol_dir_list(), dol_print_date(), dol_sanitizeFileName(), dol_string_unaccent(), dol_strlen(), get_exdir(), and getDolGlobalString().

Referenced by export().

◆ exportSAGE50SWISS()

AccountancyExport::exportSAGE50SWISS ( $objectLines,
$exportFile = null )

Export format : SAGE50SWISS.

https://onlinehelp.sageschweiz.ch/default.aspx?tabid=19984 http://media.topal.ch/Public/Schnittstellen/TAF/Specification/Sage50-TAF-format.pdf

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 1786 of file accountancyexport.class.php.

References dol_print_date(), length_accounta(), length_accountg(), toAnsi(), and trunc().

Referenced by export().

◆ exportWinfic()

AccountancyExport::exportWinfic ( $objectLines,
$exportFile = null )

Export format : WinFic - eWinfic - WinSis Compta Last review for this format : 2022-11-01 Alexandre Spangaro (aspan.nosp@m.garo.nosp@m.@open.nosp@m.-dsi.nosp@m..fr)

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

Parameters
BookKeepingLine[]$objectLinesdata
?resource$exportFile[=null] File resource to export or print if null
Returns
void

Definition at line 1107 of file accountancyexport.class.php.

References $conf, dol_print_date(), dol_string_unaccent(), and dol_trunc().

Referenced by export().

◆ getFormatCode()

static AccountancyExport::getFormatCode ( $type)
static

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

Parameters
int$typeFormat id
Returns
string Format code

Definition at line 203 of file accountancyexport.class.php.

◆ getMimeType()

AccountancyExport::getMimeType ( $formatexportset)

Return the MIME type of a file.

Parameters
int$formatexportsetId of export format
Returns
string MIME type.

Definition at line 344 of file accountancyexport.class.php.

Referenced by export().

◆ getType()

AccountancyExport::getType ( $mode = 0)

Array with all export type available (key + label)

Parameters
int<0,1>$mode Mode of list: 0=flat list, 1=rich list
Returns
array<int|string,string>|array<int|string,array{id:int|string,label:string,position:int,disabled?:string}> array of type

Definition at line 142 of file accountancyexport.class.php.

◆ getTypeConfig()

AccountancyExport::getTypeConfig ( )

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

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

Definition at line 241 of file accountancyexport.class.php.

References getDolGlobalString().

◆ toAnsi()

static AccountancyExport::toAnsi ( $str,
$size = -1 )
static

toAnsi

Parameters
string$strOriginal string to encode and optionally truncate
integer$sizeTruncate string after $size characters
Returns
string String encoded in Windows-1251 charset

Definition at line 2669 of file accountancyexport.class.php.

References dol_string_nohtmltag(), and dol_substr().

Referenced by exportAgiris(), and exportSAGE50SWISS().

◆ trunc()

static AccountancyExport::trunc ( $str,
$size )
static

trunc

Parameters
string$strString
integer$sizeData to trunc
Returns
string

Definition at line 2657 of file accountancyexport.class.php.

References dol_trunc().

Referenced by exportCharlemagne(), and exportSAGE50SWISS().


The documentation for this class was generated from the following file: