36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions.lib.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
47 public static $EXPORT_TYPE_CONFIGURABLE = 1;
48 public static $EXPORT_TYPE_AGIRIS = 10;
49 public static $EXPORT_TYPE_EBP = 15;
50 public static $EXPORT_TYPE_CEGID = 20;
51 public static $EXPORT_TYPE_COGILOG = 25;
52 public static $EXPORT_TYPE_COALA = 30;
53 public static $EXPORT_TYPE_BOB50 = 35;
54 public static $EXPORT_TYPE_CIEL = 40;
55 public static $EXPORT_TYPE_SAGE50_SWISS = 45;
56 public static $EXPORT_TYPE_CHARLEMAGNE = 50;
57 public static $EXPORT_TYPE_QUADRATUS = 60;
58 public static $EXPORT_TYPE_WINFIC = 70;
59 public static $EXPORT_TYPE_OPENCONCERTO = 100;
60 public static $EXPORT_TYPE_LDCOMPTA = 110;
61 public static $EXPORT_TYPE_LDCOMPTA10 = 120;
62 public static $EXPORT_TYPE_GESTIMUMV3 = 130;
63 public static $EXPORT_TYPE_GESTIMUMV5 = 135;
64 public static $EXPORT_TYPE_ISUITEEXPERT = 200;
66 public static $EXPORT_TYPE_FEC = 1000;
67 public static $EXPORT_TYPE_FEC2 = 1010;
77 public $errors = array();
83 public $separator =
'';
89 public $end_line =
'';
98 global $conf, $hookmanager;
101 $this->separator = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
102 $this->end_line = empty($conf->global->ACCOUNTING_EXPORT_ENDLINE) ?
"\n" : ($conf->global->ACCOUNTING_EXPORT_ENDLINE == 1 ?
"\n" :
"\r\n");
104 $hookmanager->initHooks(array(
'accountancyexport'));
114 global $langs, $hookmanager;
116 $listofexporttypes = array(
117 self::$EXPORT_TYPE_CONFIGURABLE => $langs->trans(
'Modelcsv_configurable'),
118 self::$EXPORT_TYPE_CEGID => $langs->trans(
'Modelcsv_CEGID'),
119 self::$EXPORT_TYPE_COALA => $langs->trans(
'Modelcsv_COALA'),
120 self::$EXPORT_TYPE_BOB50 => $langs->trans(
'Modelcsv_bob50'),
121 self::$EXPORT_TYPE_CIEL => $langs->trans(
'Modelcsv_ciel'),
122 self::$EXPORT_TYPE_QUADRATUS => $langs->trans(
'Modelcsv_quadratus'),
123 self::$EXPORT_TYPE_WINFIC => $langs->trans(
'Modelcsv_winfic'),
124 self::$EXPORT_TYPE_EBP => $langs->trans(
'Modelcsv_ebp'),
125 self::$EXPORT_TYPE_COGILOG => $langs->trans(
'Modelcsv_cogilog'),
126 self::$EXPORT_TYPE_AGIRIS => $langs->trans(
'Modelcsv_agiris'),
127 self::$EXPORT_TYPE_OPENCONCERTO => $langs->trans(
'Modelcsv_openconcerto'),
128 self::$EXPORT_TYPE_SAGE50_SWISS => $langs->trans(
'Modelcsv_Sage50_Swiss'),
129 self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans(
'Modelcsv_charlemagne'),
130 self::$EXPORT_TYPE_LDCOMPTA => $langs->trans(
'Modelcsv_LDCompta'),
131 self::$EXPORT_TYPE_LDCOMPTA10 => $langs->trans(
'Modelcsv_LDCompta10'),
132 self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans(
'Modelcsv_Gestinumv3'),
133 self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans(
'Modelcsv_Gestinumv5'),
134 self::$EXPORT_TYPE_FEC => $langs->trans(
'Modelcsv_FEC'),
135 self::$EXPORT_TYPE_FEC2 => $langs->trans(
'Modelcsv_FEC2'),
136 self::$EXPORT_TYPE_ISUITEEXPERT =>
'Export iSuite Expert',
140 $parameters = array();
141 $reshook = $hookmanager->executeHooks(
'getType', $parameters, $listofexporttypes);
143 ksort($listofexporttypes, SORT_NUMERIC);
145 return $listofexporttypes;
157 self::$EXPORT_TYPE_CONFIGURABLE =>
'csv',
158 self::$EXPORT_TYPE_CEGID =>
'cegid',
159 self::$EXPORT_TYPE_COALA =>
'coala',
160 self::$EXPORT_TYPE_BOB50 =>
'bob50',
161 self::$EXPORT_TYPE_CIEL =>
'ciel',
162 self::$EXPORT_TYPE_QUADRATUS =>
'quadratus',
163 self::$EXPORT_TYPE_WINFIC =>
'winfic',
164 self::$EXPORT_TYPE_EBP =>
'ebp',
165 self::$EXPORT_TYPE_COGILOG =>
'cogilog',
166 self::$EXPORT_TYPE_AGIRIS =>
'agiris',
167 self::$EXPORT_TYPE_OPENCONCERTO =>
'openconcerto',
168 self::$EXPORT_TYPE_SAGE50_SWISS =>
'sage50ch',
169 self::$EXPORT_TYPE_CHARLEMAGNE =>
'charlemagne',
170 self::$EXPORT_TYPE_LDCOMPTA =>
'ldcompta',
171 self::$EXPORT_TYPE_LDCOMPTA10 =>
'ldcompta10',
172 self::$EXPORT_TYPE_GESTIMUMV3 =>
'gestimumv3',
173 self::$EXPORT_TYPE_GESTIMUMV5 =>
'gestimumv5',
174 self::$EXPORT_TYPE_FEC =>
'fec',
175 self::$EXPORT_TYPE_FEC2 =>
'fec2',
176 self::$EXPORT_TYPE_ISUITEEXPERT =>
'isuiteexpert',
180 $code = $formatcode[$type];
181 $parameters = array(
'type' => $type);
182 $reshook = $hookmanager->executeHooks(
'getFormatCode', $parameters, $code);
194 global $conf, $langs;
196 $exporttypes = array(
198 self::$EXPORT_TYPE_CONFIGURABLE => array(
199 'label' => $langs->trans(
'Modelcsv_configurable'),
200 'ACCOUNTING_EXPORT_FORMAT' => empty($conf->global->ACCOUNTING_EXPORT_FORMAT) ?
'txt' : $conf->global->ACCOUNTING_EXPORT_FORMAT,
201 'ACCOUNTING_EXPORT_SEPARATORCSV' => empty($conf->global->ACCOUNTING_EXPORT_SEPARATORCSV) ?
',' : $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV,
202 'ACCOUNTING_EXPORT_ENDLINE' => empty($conf->global->ACCOUNTING_EXPORT_ENDLINE) ? 1 : $conf->global->ACCOUNTING_EXPORT_ENDLINE,
203 'ACCOUNTING_EXPORT_DATE' => empty($conf->global->ACCOUNTING_EXPORT_DATE) ?
'%d%m%Y' : $conf->global->ACCOUNTING_EXPORT_DATE,
205 self::$EXPORT_TYPE_CEGID => array(
206 'label' => $langs->trans(
'Modelcsv_CEGID'),
208 self::$EXPORT_TYPE_COALA => array(
209 'label' => $langs->trans(
'Modelcsv_COALA'),
211 self::$EXPORT_TYPE_BOB50 => array(
212 'label' => $langs->trans(
'Modelcsv_bob50'),
214 self::$EXPORT_TYPE_CIEL => array(
215 'label' => $langs->trans(
'Modelcsv_ciel'),
216 'ACCOUNTING_EXPORT_FORMAT' =>
'txt',
218 self::$EXPORT_TYPE_QUADRATUS => array(
219 'label' => $langs->trans(
'Modelcsv_quadratus'),
220 'ACCOUNTING_EXPORT_FORMAT' =>
'txt',
222 self::$EXPORT_TYPE_WINFIC => array(
223 'label' => $langs->trans(
'Modelcsv_winfic'),
224 'ACCOUNTING_EXPORT_FORMAT' =>
'txt',
226 self::$EXPORT_TYPE_EBP => array(
227 'label' => $langs->trans(
'Modelcsv_ebp'),
229 self::$EXPORT_TYPE_COGILOG => array(
230 'label' => $langs->trans(
'Modelcsv_cogilog'),
232 self::$EXPORT_TYPE_AGIRIS => array(
233 'label' => $langs->trans(
'Modelcsv_agiris'),
235 self::$EXPORT_TYPE_OPENCONCERTO => array(
236 'label' => $langs->trans(
'Modelcsv_openconcerto'),
238 self::$EXPORT_TYPE_SAGE50_SWISS => array(
239 'label' => $langs->trans(
'Modelcsv_Sage50_Swiss'),
241 self::$EXPORT_TYPE_CHARLEMAGNE => array(
242 'label' => $langs->trans(
'Modelcsv_charlemagne'),
243 'ACCOUNTING_EXPORT_FORMAT' =>
'txt',
245 self::$EXPORT_TYPE_LDCOMPTA => array(
246 'label' => $langs->trans(
'Modelcsv_LDCompta'),
248 self::$EXPORT_TYPE_LDCOMPTA10 => array(
249 'label' => $langs->trans(
'Modelcsv_LDCompta10'),
251 self::$EXPORT_TYPE_GESTIMUMV3 => array(
252 'label' => $langs->trans(
'Modelcsv_Gestinumv3'),
253 'ACCOUNTING_EXPORT_FORMAT' =>
'txt',
255 self::$EXPORT_TYPE_GESTIMUMV5 => array(
256 'label' => $langs->trans(
'Modelcsv_Gestinumv5'),
257 'ACCOUNTING_EXPORT_FORMAT' =>
'txt',
259 self::$EXPORT_TYPE_FEC => array(
260 'label' => $langs->trans(
'Modelcsv_FEC'),
261 'ACCOUNTING_EXPORT_FORMAT' =>
'txt',
263 self::$EXPORT_TYPE_FEC2 => array(
264 'label' => $langs->trans(
'Modelcsv_FEC2'),
265 'ACCOUNTING_EXPORT_FORMAT' =>
'txt',
267 self::$EXPORT_TYPE_ISUITEEXPERT => array(
268 'label' =>
'iSuite Expert',
269 'ACCOUNTING_EXPORT_FORMAT' =>
'csv',
273 '1' => $langs->trans(
"Unix"),
274 '2' => $langs->trans(
"Windows")
277 'csv' => $langs->trans(
"csv"),
278 'txt' => $langs->trans(
"txt")
283 $parameters = array();
284 $reshook = $hookmanager->executeHooks(
'getTypeConfig', $parameters, $exporttypes);
299 switch ($formatexportset) {
300 case self::$EXPORT_TYPE_FEC:
301 $mime =
'text/tab-separated-values';
318 public function export(&$TData, $formatexportset)
320 global $conf, $langs;
321 global $search_date_end;
324 $filename =
'general_ledger-'.$this->getFormatCode($formatexportset);
325 $type_export =
'general_ledger';
328 include DOL_DOCUMENT_ROOT.
'/accountancy/tpl/export_journal.tpl.php';
331 switch ($formatexportset) {
332 case self::$EXPORT_TYPE_CONFIGURABLE:
335 case self::$EXPORT_TYPE_CEGID:
338 case self::$EXPORT_TYPE_COALA:
341 case self::$EXPORT_TYPE_BOB50:
344 case self::$EXPORT_TYPE_CIEL:
347 case self::$EXPORT_TYPE_QUADRATUS:
350 case self::$EXPORT_TYPE_WINFIC:
353 case self::$EXPORT_TYPE_EBP:
356 case self::$EXPORT_TYPE_COGILOG:
359 case self::$EXPORT_TYPE_AGIRIS:
362 case self::$EXPORT_TYPE_OPENCONCERTO:
365 case self::$EXPORT_TYPE_SAGE50_SWISS:
368 case self::$EXPORT_TYPE_CHARLEMAGNE:
371 case self::$EXPORT_TYPE_LDCOMPTA:
374 case self::$EXPORT_TYPE_LDCOMPTA10:
377 case self::$EXPORT_TYPE_GESTIMUMV3:
380 case self::$EXPORT_TYPE_GESTIMUMV5:
383 case self::$EXPORT_TYPE_FEC:
386 case self::$EXPORT_TYPE_FEC2:
389 case self::$EXPORT_TYPE_ISUITEEXPERT :
394 $parameters = array(
'format' => $formatexportset);
396 $reshook = $hookmanager->executeHooks(
'export', $parameters, $TData);
398 $this->errors[] = $langs->trans(
'accountancy_error_modelnotfound');
413 foreach ($objectLines as $line) {
418 print $date.$separator;
419 print $line->code_journal.$separator;
422 print $line->sens.$separator;
423 print
price2fec(abs($line->debit - $line->credit)).$separator;
438 foreach ($objectLines as $line) {
443 print $line->code_journal.$separator;
444 print $date.$separator;
445 print $line->piece_num.$separator;
448 print $line->label_operation.$separator;
449 print $date.$separator;
450 if ($line->sens ==
'D') {
451 print
price($line->debit).$separator;
453 } elseif ($line->sens ==
'C') {
455 print
price($line->credit).$separator;
457 print $line->doc_ref.$separator;
458 print $line->label_operation.$separator;
475 foreach ($objectLines as $line) {
478 print $date.$separator;
479 print $line->code_journal.$separator;
481 print $line->piece_num.$separator;
482 print $line->doc_ref.$separator;
483 print
price($line->debit).$separator;
484 print
price($line->credit).$separator;
485 print
'E'.$separator;
504 foreach ($objectLines as $line) {
505 print $line->piece_num.$separator;
507 print $date.$separator;
509 if (empty($line->subledger_account)) {
510 print
'G'.$separator;
513 if (substr($line->numero_compte, 0, 3) ==
'411') {
514 print
'C'.$separator;
516 if (substr($line->numero_compte, 0, 3) ==
'401') {
517 print
'F'.$separator;
522 print
price($line->debit).$separator;
523 print
price($line->credit).$separator;
524 print
dol_trunc($line->label_operation, 32).$separator;
549 foreach ($TData as $data) {
551 if (!empty($data->subledger_account)) {
556 $date_echeance =
dol_print_date($data->date_lim_reglement,
'%Y%m%d');
559 $Tab[
'num_ecriture'] = str_pad($data->piece_num, 5);
560 $Tab[
'code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2);
561 $Tab[
'date_ecriture'] = str_pad($date_document, 8,
' ', STR_PAD_LEFT);
562 $Tab[
'date_echeance'] = str_pad($date_echeance, 8,
' ', STR_PAD_LEFT);
563 $Tab[
'num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12);
564 $Tab[
'num_compte'] = str_pad(self::trunc($code_compta, 11), 11);
565 $Tab[
'libelle_ecriture'] = str_pad(self::trunc(
dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25);
566 $Tab[
'montant'] = str_pad(
price2fec(abs($data->debit - $data->credit)), 13,
' ', STR_PAD_LEFT);
567 $Tab[
'type_montant'] = str_pad($data->sens, 1);
568 $Tab[
'vide'] = str_repeat(
' ', 18);
569 $Tab[
'intitule_compte'] = str_pad(self::trunc(
dol_string_unaccent($data->label_operation), 34), 34);
570 $Tab[
'end'] =
'O2003';
572 $Tab[
'end_line'] = $end_line;
599 foreach ($TData as $data) {
603 $data->label_operation = str_replace(array(
"\t",
"\n",
"\r"),
" ", $data->label_operation);
604 $data->label_operation = str_replace(array(
"- ",
"…",
"..."),
"", $data->label_operation);
612 $data->subledger_label = str_replace(array(
"- ",
"…",
"..."),
"", $data->subledger_label);
615 $code_compta = $data->numero_compte;
616 if (!empty($data->subledger_account)) {
617 $code_compta = $data->subledger_account;
622 if (!empty($data->subledger_account)) {
623 $Tab[
'type_ligne'] =
'C';
624 $Tab[
'num_compte'] = str_pad(self::trunc($data->subledger_account, 8), 8);
625 $Tab[
'lib_compte'] = str_pad(self::trunc($data->subledger_label, 30), 30);
627 if ($data->doc_type ==
'customer_invoice') {
628 $Tab[
'lib_alpha'] = strtoupper(str_pad(
'C'.self::trunc($data->subledger_label, 6), 7));
629 $Tab[
'filler'] = str_repeat(
' ', 52);
630 $Tab[
'coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, 8), 8);
631 } elseif ($data->doc_type ==
'supplier_invoice') {
632 $Tab[
'lib_alpha'] = strtoupper(str_pad(
'F'.self::trunc($data->subledger_label, 6), 7));
633 $Tab[
'filler'] = str_repeat(
' ', 52);
634 $Tab[
'coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, 8), 8);
636 $Tab[
'filler'] = str_repeat(
' ', 59);
637 $Tab[
'coll_compte'] = str_pad(
' ', 8);
640 $Tab[
'filler2'] = str_repeat(
' ', 110);
643 if ($data->doc_type ==
'customer_invoice') {
644 $Tab[
'type_compte'] =
'C';
645 } elseif ($data->doc_type ==
'supplier_invoice') {
646 $Tab[
'type_compte'] =
'F';
648 $Tab[
'type_compte'] =
'G';
651 $Tab[
'filler3'] = str_repeat(
' ', 235);
653 $Tab[
'end_line'] = $end_line;
659 $Tab[
'type_ligne'] =
'M';
660 $Tab[
'num_compte'] = str_pad(self::trunc($code_compta, 8), 8);
661 $Tab[
'code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2);
662 $Tab[
'folio'] =
'000';
667 $Tab[
'date_ecriture'] =
dol_print_date($data->doc_date,
'%d%m%y');
668 $Tab[
'filler'] =
' ';
669 $Tab[
'libelle_ecriture'] = str_pad(self::trunc($data->doc_ref.
' '.$data->label_operation, 20), 20);
684 $Tab[
'sens'] = $data->sens;
685 $Tab[
'signe_montant'] =
'+';
688 $Tab[
'montant'] = str_pad(abs(($data->debit - $data->credit) * 100), 12,
'0', STR_PAD_LEFT);
689 $Tab[
'contrepartie'] = str_repeat(
' ', 8);
692 if (!empty($data->date_lim_reglement)) {
694 $Tab[
'date_echeance'] =
dol_print_date($data->date_lim_reglement,
'%d%m%y');
696 $Tab[
'date_echeance'] =
'000000';
701 $Tab[
'lettrage'] = str_repeat(
' ', 2);
702 $Tab[
'codestat'] = str_repeat(
' ', 3);
703 $Tab[
'num_piece'] = str_pad(self::trunc($data->piece_num, 5), 5);
707 $Tab[
'affaire'] = str_repeat(
' ', 10);
708 $Tab[
'quantity1'] = str_repeat(
' ', 10);
709 $Tab[
'num_piece2'] = str_pad(self::trunc($data->piece_num, 8), 8);
710 $Tab[
'devis'] = str_pad($conf->currency, 3);
711 $Tab[
'code_journal2'] = str_pad(self::trunc($data->code_journal, 3), 3);
712 $Tab[
'filler3'] = str_repeat(
' ', 3);
720 $Tab[
'libelle_ecriture2'] = str_pad(self::trunc($data->label_operation, 30), 30);
721 $Tab[
'codetva'] = str_repeat(
' ', 2);
725 $Tab[
'num_piece3'] = substr(self::trunc($data->doc_ref, 20), -10);
726 $Tab[
'filler4'] = str_repeat(
' ', 73);
728 $Tab[
'end_line'] = $end_line;
757 foreach ($TData as $data) {
758 $code_compta = $data->numero_compte;
759 if (!empty($data->subledger_account)) {
760 $code_compta = $data->subledger_account;
765 $Tab[
'code_journal'] = str_pad(
dol_trunc($data->code_journal, 2,
'right',
'UTF-8', 1), 2);
770 $Tab[
'date_operation'] =
dol_print_date($data->doc_date,
'%d%m%Y');
772 $Tab[
'folio'] =
' 1';
774 $Tab[
'num_ecriture'] = str_pad(
dol_trunc($index, 6,
'right',
'UTF-8', 1), 6,
' ', STR_PAD_LEFT);
776 $Tab[
'jour_ecriture'] =
dol_print_date($data->doc_date,
'%d%m%y');
778 $Tab[
'num_compte'] = str_pad(
dol_trunc($code_compta, 6,
'right',
'UTF-8', 1), 6,
'0');
780 if ($data->sens ==
'D') {
781 $Tab[
'montant_debit'] = str_pad(number_format($data->debit, 2,
',',
''), 13,
' ', STR_PAD_LEFT);
783 $Tab[
'montant_crebit'] = str_pad(number_format(0, 2,
',',
''), 13,
' ', STR_PAD_LEFT);
785 $Tab[
'montant_debit'] = str_pad(number_format(0, 2,
',',
''), 13,
' ', STR_PAD_LEFT);
787 $Tab[
'montant_crebit'] = str_pad(number_format($data->credit, 2,
',',
''), 13,
' ', STR_PAD_LEFT);
792 $Tab[
'lettrage'] = str_repeat(
dol_trunc($data->lettering_code, 2,
'left',
'UTF-8', 1), 2);
794 $Tab[
'code_piece'] = str_pad(
dol_trunc($data->piece_num, 5,
'left',
'UTF-8', 1), 5,
' ', STR_PAD_LEFT);
796 $Tab[
'code_stat'] = str_repeat(
' ', 4);
798 if (!empty($data->date_lim_reglement)) {
800 $Tab[
'date_echeance'] =
dol_print_date($data->date_lim_reglement,
'%d%m%Y');
802 $Tab[
'date_echeance'] =
dol_print_date($data->doc_date,
'%d%m%Y');
805 $Tab[
'monnaie'] =
'1';
807 $Tab[
'filler'] =
' ';
809 $Tab[
'ind_compteur'] =
' ';
811 $Tab[
'quantite'] =
'0,000000000';
813 $Tab[
'code_pointage'] = str_repeat(
' ', 2);
815 $Tab[
'end_line'] = $end_line;
817 print implode(
'|', $Tab);
836 foreach ($objectLines as $line) {
839 print $line->id.$separator;
840 print $date.$separator;
841 print $line->code_journal.$separator;
842 if (empty($line->subledger_account)) {
843 print $line->numero_compte.$separator;
845 print $line->subledger_account.$separator;
848 print
'"'.dol_trunc($line->label_operation, 40,
'right',
'UTF-8', 1).
'"'.$separator;
849 print
'"'.dol_trunc($line->piece_num, 15,
'right',
'UTF-8', 1).
'"'.$separator;
850 print
price2num(abs($line->debit - $line->credit)).$separator;
851 print $line->sens.$separator;
852 print $date.$separator;
871 foreach ($objectLines as $line) {
874 print $line->piece_num.$separator;
876 print $date.$separator;
879 if (empty($line->subledger_account)) {
888 print
price($line->debit).$separator;
889 print
price($line->credit).$separator;
890 print
price(abs($line->debit - $line->credit)).$separator;
891 print $line->sens.$separator;
892 print $line->lettering_code.$separator;
893 print $line->code_journal;
910 foreach ($objectLines as $line) {
913 print $date.$separator;
914 print $line->code_journal.$separator;
915 if (empty($line->subledger_account)) {
920 print $line->doc_ref.$separator;
921 print $line->label_operation.$separator;
922 print
price($line->debit).$separator;
923 print
price($line->credit).$separator;
939 $separator = $this->separator;
941 foreach ($objectLines as $line) {
944 $date =
dol_print_date($line->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE);
945 $tab[] = $line->piece_num;
947 $tab[] = $line->doc_ref;
948 $tab[] = preg_match(
'/'.$separator.
'/', $line->label_operation) ?
"'".$line->label_operation.
"'" : $line->label_operation;
953 $tab[] =
price2num($line->debit - $line->credit);
954 $tab[] = $line->code_journal;
956 print implode($separator, $tab).$this->end_line;
973 print
"JournalCode".$separator;
974 print
"JournalLib".$separator;
975 print
"EcritureNum".$separator;
976 print
"EcritureDate".$separator;
977 print
"CompteNum".$separator;
978 print
"CompteLib".$separator;
979 print
"CompAuxNum".$separator;
980 print
"CompAuxLib".$separator;
981 print
"PieceRef".$separator;
982 print
"PieceDate".$separator;
983 print
"EcritureLib".$separator;
984 print
"Debit".$separator;
985 print
"Credit".$separator;
986 print
"EcritureLet".$separator;
987 print
"DateLet".$separator;
988 print
"ValidDate".$separator;
989 print
"Montantdevise".$separator;
990 print
"Idevise".$separator;
991 print
"DateLimitReglmt".$separator;
995 foreach ($objectLines as $line) {
996 if ($line->debit == 0 && $line->credit == 0) {
1001 $date_lettering =
dol_print_date($line->date_lettering,
'%Y%m%d');
1002 $date_validation =
dol_print_date($line->date_validation,
'%Y%m%d');
1003 $date_limit_payment =
dol_print_date($line->date_lim_reglement,
'%Y%m%d');
1006 if ($line->doc_type ==
'customer_invoice') {
1008 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
1010 $invoice->fetch($line->fk_doc);
1012 $refInvoice = $invoice->ref;
1013 } elseif ($line->doc_type ==
'supplier_invoice') {
1015 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
1017 $invoice->fetch($line->fk_doc);
1019 $refInvoice = $invoice->ref_supplier;
1023 print $line->code_journal . $separator;
1028 print $labeljournal . $separator;
1031 print $line->piece_num . $separator;
1034 print $date_document . $separator;
1049 print $line->doc_ref . $separator;
1056 $line->label_operation = str_replace(array(
"\t",
"\n",
"\r"),
" ", $line->label_operation);
1060 print
price2fec($line->debit) . $separator;
1063 print
price2fec($line->credit) . $separator;
1066 print $line->lettering_code . $separator;
1069 print $date_lettering . $separator;
1072 print $date_validation . $separator;
1075 print $line->multicurrency_amount . $separator;
1078 print $line->multicurrency_code . $separator;
1081 print $date_limit_payment . $separator;
1085 $refInvoice = str_replace(array(
"\t",
"\n",
"\r"),
" ", $refInvoice);
1086 print
dol_trunc(self::toAnsi($refInvoice), 17,
'right',
'UTF-8', 1);
1106 print
"JournalCode".$separator;
1107 print
"JournalLib".$separator;
1108 print
"EcritureNum".$separator;
1109 print
"EcritureDate".$separator;
1110 print
"CompteNum".$separator;
1111 print
"CompteLib".$separator;
1112 print
"CompAuxNum".$separator;
1113 print
"CompAuxLib".$separator;
1114 print
"PieceRef".$separator;
1115 print
"PieceDate".$separator;
1116 print
"EcritureLib".$separator;
1117 print
"Debit".$separator;
1118 print
"Credit".$separator;
1119 print
"EcritureLet".$separator;
1120 print
"DateLet".$separator;
1121 print
"ValidDate".$separator;
1122 print
"Montantdevise".$separator;
1123 print
"Idevise".$separator;
1124 print
"DateLimitReglmt".$separator;
1128 foreach ($objectLines as $line) {
1129 if ($line->debit == 0 && $line->credit == 0) {
1134 $date_lettering =
dol_print_date($line->date_lettering,
'%Y%m%d');
1135 $date_validation =
dol_print_date($line->date_validation,
'%Y%m%d');
1136 $date_limit_payment =
dol_print_date($line->date_lim_reglement,
'%Y%m%d');
1139 if ($line->doc_type ==
'customer_invoice') {
1141 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
1143 $invoice->fetch($line->fk_doc);
1145 $refInvoice = $invoice->ref;
1146 } elseif ($line->doc_type ==
'supplier_invoice') {
1148 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
1150 $invoice->fetch($line->fk_doc);
1152 $refInvoice = $invoice->ref_supplier;
1156 print $line->code_journal . $separator;
1161 print $labeljournal . $separator;
1164 print $line->piece_num . $separator;
1167 print $date_creation . $separator;
1182 print $line->doc_ref . $separator;
1185 print $date_document . $separator;
1189 $line->label_operation = str_replace(array(
"\t",
"\n",
"\r"),
" ", $line->label_operation);
1193 print
price2fec($line->debit) . $separator;
1196 print
price2fec($line->credit) . $separator;
1199 print $line->lettering_code . $separator;
1202 print $date_lettering . $separator;
1205 print $date_validation . $separator;
1208 print $line->multicurrency_amount . $separator;
1211 print $line->multicurrency_code . $separator;
1214 print $date_limit_payment . $separator;
1218 $refInvoice = str_replace(array(
"\t",
"\n",
"\r"),
" ", $refInvoice);
1219 print
dol_trunc(self::toAnsi($refInvoice), 17,
'right',
'UTF-8', 1);
1240 $this->separator =
',';
1241 $this->end_line =
"\r\n";
1244 print
"Blg,Datum,Kto,S/H,Grp,GKto,SId,SIdx,KIdx,BTyp,MTyp,Code,Netto,Steuer,FW-Betrag,Tx1,Tx2,PkKey,OpId,Flag";
1245 print $this->end_line;
1247 $thisPieceAccountNr =
"";
1248 $aSize = count($objectLines);
1249 foreach ($objectLines as $aIndex => $line) {
1250 $sammelBuchung =
false;
1251 if ($aIndex - 2 >= 0 && $objectLines[$aIndex - 2]->piece_num == $line->piece_num) {
1252 $sammelBuchung =
true;
1253 } elseif ($aIndex + 2 < $aSize && $objectLines[$aIndex + 2]->piece_num == $line->piece_num) {
1254 $sammelBuchung =
true;
1255 } elseif ($aIndex + 1 < $aSize
1256 && $objectLines[$aIndex + 1]->piece_num == $line->piece_num
1257 && $aIndex - 1 < $aSize
1258 && $objectLines[$aIndex - 1]->piece_num == $line->piece_num
1260 $sammelBuchung =
true;
1264 print $line->piece_num.$this->separator;
1268 print $date.$this->separator;
1273 if ($line->sens ==
'D') {
1274 print
'S'.$this->separator;
1276 print
'H'.$this->separator;
1279 print
self::trunc($line->code_journal, 1).$this->separator;
1281 if (empty($line->code_tiers)) {
1282 if ($line->piece_num == $thisPieceNum) {
1285 print
"div".$this->separator;
1291 print $this->separator;
1293 print
"0".$this->separator;
1295 print
"0".$this->separator;
1297 print
"0".$this->separator;
1300 if ($sammelBuchung) {
1301 print
"2".$this->separator;
1303 print
"1".$this->separator;
1306 print
'""'.$this->separator;
1308 print abs($line->debit - $line->credit).$this->separator;
1310 print
"0.00".$this->separator;
1312 print
"0.00".$this->separator;
1315 if ($line1 ==
"LIQ" || $line1 ==
"LIQ Beleg ok" || strlen($line1) <= 3) {
1319 if (strlen($line1) == 0) {
1323 if (strlen($line1) > 0 && strlen($line2) > 0 && (strlen($line1) + strlen($line2)) < 27) {
1324 $line1 = $line1.
' / '.$line2;
1328 print
'"'.self::toAnsi($line1).
'"'.$this->separator;
1330 print
'"'.self::toAnsi($line2).
'"'.$this->separator;
1332 print
"0".$this->separator;
1334 print $this->separator;
1339 print $this->end_line;
1341 if ($line->piece_num !== $thisPieceNum) {
1342 $thisPieceNum = $line->piece_num;
1343 $thisPieceAccountNr = $line->numero_compte;
1362 foreach ($objectLines as $line) {
1365 $date_lim_reglement =
dol_print_date($line->date_lim_reglement,
'%Y%m%d');
1368 $type_enregistrement =
'E';
1369 print $type_enregistrement.$separator;
1371 print substr($line->code_journal, 0, 2).$separator;
1373 print $line->id.$separator;
1375 print $line->piece_num.$separator;
1377 print $date_document.$separator;
1379 print $line->label_operation.$separator;
1381 print $date_lim_reglement.$separator;
1383 if ($line->doc_type ==
'supplier_invoice') {
1384 if (($line->debit - $line->credit) > 0) {
1385 $nature_piece =
'AF';
1387 $nature_piece =
'FF';
1389 } elseif ($line->doc_type ==
'customer_invoice') {
1390 if (($line->debit - $line->credit) < 0) {
1391 $nature_piece =
'AC';
1393 $nature_piece =
'FC';
1398 print $nature_piece.$separator;
1409 $racine_subledger_account =
'';
1412 print $racine_subledger_account.$separator;
1414 print
price(abs($line->debit - $line->credit), 0,
'', 1, 2, 2).$separator;
1416 print $line->sens.$separator;
1420 print $date_creation.$separator;
1422 print $line->lettering_code.$separator;
1424 print $line->date_lettering.$separator;
1426 if (!empty($line->subledger_account)) {
1432 if ($line->doc_type ==
'supplier_invoice' && !empty($line->subledger_account)) {
1433 print
'F'.$separator;
1434 } elseif ($line->doc_type ==
'customer_invoice' && !empty($line->subledger_account)) {
1435 print
'C'.$separator;
1448 print $line->doc_ref.$separator;
1454 print
'0'.$separator;
1458 print
'0'.$separator;
1492 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
1496 $last_codeinvoice =
'';
1498 foreach ($objectLines as $line) {
1500 if ($last_codeinvoice != $line->doc_ref) {
1502 $sql =
"SELECT code_client, fk_forme_juridique, nom, address, zip, town, fk_pays, phone, siret FROM ".MAIN_DB_PREFIX.
"societe";
1503 $sql .=
" WHERE code_client = '".$this->db->escape($line->thirdparty_code).
"'";
1507 $soc = $this->
db->fetch_object(
$resql);
1509 $address = array(
'',
'',
'');
1510 if (strpos($soc->address,
"\n") !==
false) {
1511 $address = explode(
"\n", $soc->address);
1512 if (is_array($address) && count($address) > 0) {
1513 foreach ($address as $key => $data) {
1514 $address[$key] = str_replace(array(
"\t",
"\n",
"\r"),
"", $data);
1515 $address[$key] =
dol_trunc($address[$key], 40,
'right',
'UTF-8', 1);
1519 $address[0] = substr(str_replace(array(
"\t",
"\r"),
" ", $soc->address), 0, 40);
1520 $address[1] = substr(str_replace(array(
"\t",
"\r"),
" ", $soc->address), 41, 40);
1521 $address[2] = substr(str_replace(array(
"\t",
"\r"),
" ", $soc->address), 82, 40);
1524 $type_enregistrement =
'C';
1526 print $type_enregistrement.$separator;
1528 print $soc->code_client.$separator;
1536 print $soc->nom.$separator;
1538 print $address[0].$separator;
1540 print $address[1].$separator;
1542 print $address[2].$separator;
1544 print $soc->zip.$separator;
1546 print substr($soc->town, 0, 40).$separator;
1550 print substr(
getCountry($soc->fk_pays), 0, 40).$separator;
1552 print $soc->phone.$separator;
1564 print str_replace(
" ",
"", $soc->siret).$separator;
1628 $date_lim_reglement =
dol_print_date($line->date_lim_reglement,
'%Y%m%d');
1631 $type_enregistrement =
'E';
1632 print $type_enregistrement.$separator;
1634 print substr($line->code_journal, 0, 2).$separator;
1636 print $line->id.$separator;
1638 print $line->piece_num.$separator;
1640 print $date_document.$separator;
1642 print
dol_trunc($line->label_operation, 25,
'right',
'UTF-8', 1).$separator;
1644 print $date_lim_reglement.$separator;
1646 if ($line->doc_type ==
'supplier_invoice') {
1647 if (($line->amount) < 0) {
1648 $nature_piece =
'AF';
1650 $nature_piece =
'FF';
1652 } elseif ($line->doc_type ==
'customer_invoice') {
1653 if (($line->amount) < 0) {
1654 $nature_piece =
'AC';
1656 $nature_piece =
'FC';
1661 print $nature_piece.$separator;
1672 $racine_subledger_account =
'';
1675 print $racine_subledger_account.$separator;
1677 print
price(abs($line->debit - $line->credit), 0,
'', 1, 2).$separator;
1679 print $line->sens.$separator;
1683 print $date_document.$separator;
1685 print $line->lettering_code.$separator;
1687 print $line->date_lettering.$separator;
1689 if (!empty($line->subledger_account)) {
1695 if ($line->doc_type ==
'supplier_invoice' && !empty($line->subledger_account)) {
1696 print
'F'.$separator;
1697 } elseif ($line->doc_type ==
'customer_invoice' && !empty($line->subledger_account)) {
1698 print
'C'.$separator;
1709 print $line->doc_ref.$separator;
1711 print
'0'.$separator;
1721 print
'0'.$separator;
1725 print
'0'.$separator;
1745 $last_codeinvoice = $line->doc_ref;
1758 $langs->load(
'compta');
1766 print $langs->transnoentitiesnoconv(
'Date').$separator;
1767 print
self::trunc($langs->transnoentitiesnoconv(
'Journal'), 6).$separator;
1768 print
self::trunc($langs->transnoentitiesnoconv(
'Account'), 15).$separator;
1769 print
self::trunc($langs->transnoentitiesnoconv(
'LabelAccount'), 60).$separator;
1770 print
self::trunc($langs->transnoentitiesnoconv(
'Piece'), 20).$separator;
1771 print
self::trunc($langs->transnoentitiesnoconv(
'LabelOperation'), 60).$separator;
1772 print $langs->transnoentitiesnoconv(
'Amount').$separator;
1773 print
'S'.$separator;
1774 print
self::trunc($langs->transnoentitiesnoconv(
'Analytic').
' 1', 15).$separator;
1775 print
self::trunc($langs->transnoentitiesnoconv(
'AnalyticLabel').
' 1', 60).$separator;
1776 print
self::trunc($langs->transnoentitiesnoconv(
'Analytic').
' 2', 15).$separator;
1777 print
self::trunc($langs->transnoentitiesnoconv(
'AnalyticLabel').
' 2', 60).$separator;
1778 print
self::trunc($langs->transnoentitiesnoconv(
'Analytic').
' 3', 15).$separator;
1779 print
self::trunc($langs->transnoentitiesnoconv(
'AnalyticLabel').
' 3', 60).$separator;
1782 foreach ($objectLines as $line) {
1784 print $date.$separator;
1786 print
self::trunc($line->code_journal, 6).$separator;
1788 if (!empty($line->subledger_account)) {
1789 $account = $line->subledger_account;
1791 $account = $line->numero_compte;
1795 print
self::trunc($line->label_compte, 60).$separator;
1798 $line->label_operation = str_replace(array(
"\t",
"\n",
"\r"),
" ", $line->label_operation);
1799 print
self::trunc($line->label_operation, 60).$separator;
1800 print
price(abs($line->debit - $line->credit)).$separator;
1801 print $line->sens.$separator;
1823 $this->separator =
',';
1825 $invoices_infos = array();
1826 $supplier_invoices_infos = array();
1827 foreach ($objectLines as $line) {
1828 if ($line->debit == 0 && $line->credit == 0) {
1833 $invoice_ref = $line->doc_ref;
1836 if (($line->doc_type ==
'customer_invoice' || $line->doc_type ==
'supplier_invoice') && $line->fk_doc > 0) {
1837 if (($line->doc_type ==
'customer_invoice' && !isset($invoices_infos[$line->fk_doc])) ||
1838 ($line->doc_type ==
'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) {
1839 if ($line->doc_type ==
'customer_invoice') {
1841 $sql =
'SELECT f.ref, s.nom FROM ' . MAIN_DB_PREFIX .
'facture as f';
1842 $sql .=
' LEFT JOIN ' . MAIN_DB_PREFIX .
'societe AS s ON f.fk_soc = s.rowid';
1843 $sql .=
' WHERE f.rowid = '.((int) $line->fk_doc);
1846 if ($obj = $this->
db->fetch_object(
$resql)) {
1848 $invoices_infos[$line->fk_doc] = array(
'ref' => $obj->ref,
'company_name' => $obj->nom);
1849 $invoice_ref = $obj->ref;
1850 $company_name = $obj->nom;
1855 $sql =
'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX .
'facture_fourn as ff';
1856 $sql .=
' LEFT JOIN ' . MAIN_DB_PREFIX .
'societe AS s ON ff.fk_soc = s.rowid';
1857 $sql .=
' WHERE ff.rowid = '.((int) $line->fk_doc);
1860 if ($obj = $this->
db->fetch_object(
$resql)) {
1862 $supplier_invoices_infos[$line->fk_doc] = array(
'ref' => $obj->ref,
'company_name' => $obj->nom);
1863 $invoice_ref = $obj->ref;
1864 $company_name = $obj->nom;
1868 } elseif ($line->doc_type ==
'customer_invoice') {
1870 $invoice_ref = $invoices_infos[$line->fk_doc][
'ref'];
1871 $company_name = $invoices_infos[$line->fk_doc][
'company_name'];
1874 $invoice_ref = $supplier_invoices_infos[$line->fk_doc][
'ref'];
1875 $company_name = $supplier_invoices_infos[$line->fk_doc][
'company_name'];
1879 print $line->id . $this->separator;
1880 print $date . $this->separator;
1881 print substr($line->code_journal, 0, 4) . $this->separator;
1883 if ((substr($line->numero_compte, 0, 3) ==
'411') || (substr($line->numero_compte, 0, 3) ==
'401')) {
1886 print substr(
length_accountg($line->numero_compte), 0, 15) . $this->separator;
1889 print $this->separator;
1892 print
dol_trunc(str_replace(
'"',
'', $invoice_ref . (!empty($company_name) ?
' - ' :
'') . $company_name), 40,
'right',
'UTF-8', 1) . $this->separator;
1894 print
dol_trunc(str_replace(
'"',
'', $line->piece_num), 10,
'right',
'UTF-8', 1) . $this->separator;
1896 print
'EUR' . $this->separator;
1898 print
price2num(abs($line->debit - $line->credit)) . $this->separator;
1900 print $line->sens . $this->separator;
1902 print $this->separator;
1905 print $this->end_line;
1920 $this->separator =
',';
1922 foreach ($objectLines as $line) {
1923 if ($line->debit == 0 && $line->credit == 0) {
1928 print $line->id . $this->separator;
1929 print $date . $this->separator;
1930 print substr($line->code_journal, 0, 4) . $this->separator;
1931 if ((substr($line->numero_compte, 0, 3) ==
'411') || (substr($line->numero_compte, 0, 3) ==
'401')) {
1934 print substr(
length_accountg($line->numero_compte), 0, 15) . $this->separator;
1936 print $this->separator;
1938 print
'"' .
dol_trunc(str_replace(
'"',
'', $line->doc_ref), 40,
'right',
'UTF-8', 1) .
'"' . $this->separator;
1939 print
'"' .
dol_trunc(str_replace(
'"',
'', $line->piece_num), 10,
'right',
'UTF-8', 1) .
'"' . $this->separator;
1940 print
price2num(abs($line->debit - $line->credit)) . $this->separator;
1941 print $line->sens . $this->separator;
1942 print $date . $this->separator;
1943 print $this->separator;
1944 print $this->separator;
1946 print $this->end_line;
1962 $this->separator =
';';
1963 $this->end_line =
"\r\n";
1966 foreach ($objectLines as $line) {
1971 $tab[] = $line->piece_num;
1973 $tab[] = substr($date, 6, 4);
1974 $tab[] = substr($date, 3, 2);
1975 $tab[] = substr($date, 0, 2);
1976 $tab[] = $line->doc_ref;
1978 $tab[] = mb_convert_encoding(str_replace(
' - Compte auxiliaire',
'', $line->label_operation),
"Windows-1252",
'UTF-8');
1984 $numero_cpt_client =
'411';
1985 for ($i = 1; $i <= ($taille_numero - 3); $i++) {
1986 $numero_cpt_client .=
'0';
1995 $nom_client = explode(
" - ", $line->label_operation);
1996 $tab[] = mb_convert_encoding($nom_client[0],
"Windows-1252",
'UTF-8');
1997 $tab[] =
price($line->debit);
1998 $tab[] =
price($line->credit);
1999 $tab[] =
price($line->montant);
2000 $tab[] = $line->code_journal;
2002 $separator = $this->separator;
2003 print implode($separator, $tab) . $this->end_line;
2014 public static function trunc($str, $size)
2016 return dol_trunc($str, $size,
'right',
'UTF-8', 1);
2026 public static function toAnsi($str, $size = -1)
2029 if ($retVal >= 0 && $size >= 0) {
2030 $retVal = mb_substr($retVal, 0, $size,
'Windows-1251');
length_accountg($account)
Return General accounting account with defined length (used for product and miscellaneous)
length_accounta($accounta)
Return Auxiliary accounting account of thirdparties with defined length.
Manage the different format accountancy export.
exportAgiris($objectLines)
Export format : Agiris Isacompta.
exportWinfic(&$TData)
Export format : WinFic - eWinfic - WinSis Compta Last review for this format : 2022-11-01 Alexandre S...
exportEbp($objectLines)
Export format : EBP.
exportCiel(&$TData)
Export format : CIEL (Format XIMPORT) Format since 2003 compatible CIEL version > 2002 / Sage50 Last ...
getTypeConfig()
Array with all export type available (key + label) and parameters for config.
exportBob50($objectLines)
Export format : BOB50.
exportGestimumV5($objectLines)
Export format : Gestimum V5.
static trunc($str, $size)
trunc
exportLDCompta10($objectLines)
Export format : LD Compta version 10 & higher Last review for this format : 08-15-2021 Alexandre Span...
exportConfigurable($objectLines)
Export format : Configurable CSV.
exportCegid($objectLines)
Export format : CEGID.
static toAnsi($str, $size=-1)
toAnsi
getType()
Array with all export type available (key + label)
static getFormatCode($type)
Return string to summarize the format (Used to generated export filename)
exportLDCompta($objectLines)
Export format : LD Compta version 9 http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Docu...
exportCoala($objectLines)
Export format : COALA.
exportCogilog($objectLines)
Export format : COGILOG.
exportCharlemagne($objectLines)
Export format : Charlemagne.
exportFEC($objectLines)
Export format : FEC.
exportFEC2($objectLines)
Export format : FEC2.
__construct(DoliDB $db)
Constructor.
exportQuadratus(&$TData)
Export format : Quadratus (Format ASCII) Format since 2015 compatible QuadraCOMPTA Last review for th...
getMimeType($formatexportset)
Return the MIME type of a file.
exportSAGE50SWISS($objectLines)
Export format : SAGE50SWISS.
exportGestimumV3($objectLines)
Export format : Gestimum V3.
exportiSuiteExpert($objectLines)
Export format : iSuite Expert.
exportOpenConcerto($objectLines)
Export format : OpenConcerto.
export(&$TData, $formatexportset)
Function who chose which export to use with the default config, and make the export into a file.
Class to manage Dolibarr database access.
Class to manage suppliers invoices.
Class to manage invoices.
getCountry($searchkey, $withcode='', $dbtouse=0, $outputlangs='', $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
price2fec($amount)
Function to format a value into a defined format for French administration (no thousand separator & d...
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_string_unaccent($str)
Clean a string from all accent characters to be used as ref, login or by dol_sanitizeFileName.
dol_string_nospecial($str, $newstr='_', $badcharstoreplace='', $badcharstoremove='')
Clean a string from all punctuation characters to use it as a ref or login.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
$conf db
API class for accounts.