diff --git a/doc/images/dolibarr_screenshot5_1920x1080_b.jpg b/doc/images/dolibarr_screenshot5_1920x1080_b.jpg index 5f7d8a5b573..0b5c749cb5c 100644 Binary files a/doc/images/dolibarr_screenshot5_1920x1080_b.jpg and b/doc/images/dolibarr_screenshot5_1920x1080_b.jpg differ diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 2b263ca166c..fe797cc3e06 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -42,6 +42,21 @@ $page = GETPOST("page"); $sortorder = GETPOST("sortorder", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha'); $action = GETPOST('action', 'alpha'); +if (GETPOST("exportcsv",'alpha')) $action = 'export_csv'; + +// Load variable for pagination +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); +$page = GETPOST('page','int'); +if (empty($page) || $page == -1 || GETPOST('button_search','alpha') || GETPOST('button_removefilter','alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +//if (! $sortfield) $sortfield="p.date_fin"; +//if (! $sortorder) $sortorder="DESC"; + + $search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); $search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); @@ -54,14 +69,6 @@ if ($search_accountancy_code_end == - 1) { $search_accountancy_code_end = ''; } -if (GETPOST("exportcsv",'alpha')) $action = 'export_csv'; - - -$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit; -if (empty($page) || $page < 0) { $page = 0; } - -$offset = $limit * $page; - $object = new BookKeeping($db); $formaccounting = new FormAccounting($db); @@ -97,23 +104,27 @@ if ($sortorder == "") if ($sortfield == "") $sortfield = "t.numero_compte"; -$options = ''; + +$param=''; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); +if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); + $filter = array (); if (! empty($search_date_start)) { $filter['t.doc_date>='] = $search_date_start; - $options .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int'); + $param .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int'); } if (! empty($search_date_end)) { $filter['t.doc_date<='] = $search_date_end; - $options .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int'); + $param .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int'); } if (! empty($search_accountancy_code_start)) { $filter['t.numero_compte>='] = $search_accountancy_code_start; - $options .= '&search_accountancy_code_start=' . $search_accountancy_code_start; + $param .= '&search_accountancy_code_start=' . $search_accountancy_code_start; } if (! empty($search_accountancy_code_end)) { $filter['t.numero_compte<='] = $search_accountancy_code_end; - $options .= '&search_accountancy_code_end=' . $search_accountancy_code_end; + $param .= '&search_accountancy_code_end=' . $search_accountancy_code_end; } @@ -130,8 +141,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $filter = array(); } -if ($action == 'export_csv') { - +if ($action == 'export_csv') +{ $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $filename = 'balance'; @@ -193,7 +204,8 @@ if ($action != 'export_csv') print ''; $button = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; - print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, $button, $result, $result, 'title_accountancy', 0); + + print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); $moreforfilter = ''; @@ -231,12 +243,12 @@ if ($action != 'export_csv') print ''; print ''; - print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder); - print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $options, "", $sortfield, $sortorder); - print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder); - print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder); + print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'align="right"', $sortfield, $sortorder); + print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); print "\n"; $total_debit = 0; @@ -262,7 +274,7 @@ if ($action != 'export_csv') { // Affiche un Sous-Total par compte comptable if ($displayed_account != "") { - print '' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price($sous_total_credit - $sous_total_debit) . ''; + print '' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . ''; print " \n"; print ''; } @@ -293,11 +305,11 @@ if ($action != 'export_csv') $sous_total_credit += $line->credit; } - print '' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price($sous_total_credit - $sous_total_debit) . ''; + print '' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . ''; print " \n"; print ''; - print '' . $langs->trans("AccountBalance") . ':' . price($total_debit) . '' . price($total_credit) . '' . price($total_credit - $total_debit) . ''; + print '' . $langs->trans("AccountBalance") . ':' . price($total_debit) . '' . price($total_credit) . '' . price(price2num($total_credit - $total_debit)) . ''; print " \n"; print ''; diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 060efab591c..13fec3cf388 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -651,19 +651,39 @@ class AccountancyExport */ public function exportFEC($objectLines) { - $separator = ';'; + $separator = "\t"; $end_line = "\n"; + print "JournalCode" . $separator; + print "JournalLib" . $separator; + print "EcritureNum" . $separator; + print "EcritureDate" . $separator; + print "CompteNum" . $separator; + print "CompteLib" . $separator; + print "CompAuxNum" . $separator; + print "CompAuxLib" . $separator; + print "PieceRef" . $separator; + print "PieceDate" . $separator; + print "EcritureLib" . $separator; + print "Debit" . $separator; + print "Credit" . $separator; + print "EcritureLet" . $separator; + print "DateLet" . $separator; + print "ValidDate" . $separator; + print "Montantdevise" . $separator; + print "Idevise"; + print $end_line; + foreach ( $objectLines as $line ) { $date_creation = dol_print_date($line->date_creation, '%d%m%Y'); $date_doc = dol_print_date($line->doc_date, '%d%m%Y'); $date_valid = dol_print_date($line->date_validated, '%d%m%Y'); // FEC:JournalCode - print $line->code_journal; + print $line->code_journal . $separator; // FEC:JournalLib - print $line->journal_label; + print $line->journal_label . $separator; // FEC:EcritureNum print $line->piece_num . $separator; @@ -693,10 +713,10 @@ class AccountancyExport print $line->label_operation . $separator; // FEC:Debit - print price($line->debit) . $separator; + print price2num($line->debit) . $separator; // FEC:Credit - print price($line->credit) . $separator; + print price2num($line->credit) . $separator; // FEC:EcritureLet print $line->lettering_code . $separator; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 5e9350b0366..b228588b90f 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1016,16 +1016,21 @@ class BookKeeping extends CommonObject } $resql = $this->db->query($sql); - if ($resql) { + if ($resql) + { $num = $this->db->num_rows($resql); - while ( $obj = $this->db->fetch_object($resql) ) { + $i = 0; + while (($obj = $this->db->fetch_object($resql)) && ($i < min($limit, $num))) + { $line = new BookKeepingLine(); $line->numero_compte = $obj->numero_compte; $line->debit = $obj->debit; $line->credit = $obj->credit; $this->lines[] = $line; + + $i++; } $this->db->free($resql); diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index ac674eb95e0..4dec253cb90 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -146,9 +146,12 @@ if ($conf->accounting->enabled) print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'')."\n"; print "
\n"; - $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'')."\n"; - print "
\n"; + if (! empty($conf->expensereport->enabled) || ! empty($conf->deplacement->enabled)) + { + $step++; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'')."\n"; + print "
\n"; + } $step++; print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n"; diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php index 773f7a7ff68..1d7e7fd6f54 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2016 Charlie Benke +/* Copyright (C) 2015-2018 Alexandre Spangaro + * Copyright (C) 2016 Charlie Benke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,11 +27,21 @@ $code = $conf->global->MAIN_INFO_ACCOUNTANT_CODE; $prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC; $format = $conf->global->ACCOUNTING_EXPORT_FORMAT; $nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME; +$siren = $conf->global->MAIN_INFO_SIREN; $date_export = "_" . dol_print_date(dol_now(), '%Y%m%d%H%M%S'); +$endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d'); header('Content-Type: text/csv'); -$completefilename = ($code?$code . "_":"") . ($prefix?$prefix . "_":"") . $filename . ($nodateexport?"":$date_export) . "." . $format; + +if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == "11") // Specific filename for FEC model export +{ + $completefilename = $siren . "FEC" . $search_date_end . $endaccountingperiod . "." . $format; +} +else +{ + $completefilename = ($code?$code . "_":"") . ($prefix?$prefix . "_":"") . $filename . ($nodateexport?"":$date_export) . "." . $format; +} header('Content-Disposition: attachment;filename=' . $completefilename); diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index bc29c67c244..908a46c91d1 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -301,6 +301,8 @@ if (empty($reshook)) $object->phone_mobile= trim(GETPOST("phone_mobile",'alpha')); $object->email = preg_replace('/\s+/', '', GETPOST("member_email",'alpha')); $object->skype = trim(GETPOST("skype",'alpha')); + $object->twitter = trim(GETPOST("twitter",'alpha')); + $object->facebook = trim(GETPOST("facebook",'alpha')); $object->birth = $birthdate; $object->typeid = GETPOST("typeid",'int'); @@ -443,6 +445,8 @@ if (empty($reshook)) $phone_perso=GETPOST("phone_perso",'alpha'); $phone_mobile=GETPOST("phone_mobile",'alpha'); $skype=GETPOST("member_skype",'alpha'); + $twitter=GETPOST("member_twitter",'alpha'); + $facebook=GETPOST("member_facebook",'alpha'); $email=preg_replace('/\s+/', '', GETPOST("member_email",'alpha')); $login=GETPOST("member_login",'alpha'); $pass=GETPOST("password",'alpha'); @@ -467,7 +471,11 @@ if (empty($reshook)) $object->phone = $phone; $object->phone_perso = $phone_perso; $object->phone_mobile= $phone_mobile; + $object->skype = $skype; + $object->twitter = $twitter; + $object->facebook = $facebook; + $object->email = $email; $object->login = $login; $object->pass = $pass; @@ -980,12 +988,24 @@ else print ''.$langs->trans("PhoneMobile").''; // Skype - if (! empty($conf->skype->enabled)) + if (! empty($conf->socialnetworks->enabled)) { print ''.$langs->trans("Skype").''; } - // Birthday + // Twitter + if (! empty($conf->socialnetworks->enabled)) + { + print ''.$langs->trans("Twitter").''; + } + + // Facebook + if (! empty($conf->socialnetworks->enabled)) + { + print ''.$langs->trans("Facebook").''; + } + + // Birthday print "".$langs->trans("Birthday")."\n"; print $form->selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc'); print "\n"; @@ -1218,12 +1238,24 @@ else print ''.$langs->trans("PhoneMobile").'phone_mobile).'">'; // Skype - if (! empty($conf->skype->enabled)) + if (! empty($conf->socialnetworks->enabled)) { - print ''.$langs->trans("Skype").'skype).'">'; + print ''.$langs->trans("Skype").'skype).'">'; } - // Birthday + // Twitter + if (! empty($conf->socialnetworks->enabled)) + { + print ''.$langs->trans("Twitter").'twitter).'">'; + } + + // Facebook + if (! empty($conf->socialnetworks->enabled)) + { + print ''.$langs->trans("Facebook").'facebook).'">'; + } + + // Birthday print "".$langs->trans("Birthday")."\n"; print $form->selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc'); print "\n"; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 21f6c3407d9..888e3043de1 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -88,7 +88,11 @@ class Adherent extends CommonObject public $state; // Label of department public $email; + public $skype; + public $twitter; + public $facebook; + public $phone; public $phone_perso; public $phone_mobile; @@ -468,6 +472,8 @@ class Adherent extends CommonObject $sql.= ", state_id = ".($this->state_id>0?$this->db->escape($this->state_id):"null"); $sql.= ", email = '".$this->db->escape($this->email)."'"; $sql.= ", skype = '".$this->db->escape($this->skype)."'"; + $sql.= ", twitter = '".$this->db->escape($this->twitter)."'"; + $sql.= ", facebook = '".$this->db->escape($this->facebook)."'"; $sql.= ", phone = ".($this->phone?"'".$this->db->escape($this->phone)."'":"null"); $sql.= ", phone_perso = ".($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null"); $sql.= ", phone_mobile = ".($this->phone_mobile?"'".$this->db->escape($this->phone_mobile)."'":"null"); @@ -574,6 +580,8 @@ class Adherent extends CommonObject $luser->email=$this->email; $luser->skype=$this->skype; + $luser->twitter=$this->twitter; + $luser->facebook=$this->facebook; $luser->office_phone=$this->phone; $luser->user_mobile=$this->phone_mobile; @@ -613,6 +621,8 @@ class Adherent extends CommonObject $lthirdparty->town=$this->town; $lthirdparty->email=$this->email; $lthirdparty->skype=$this->skype; + $lthirdparty->twitter=$this->twitter; + $lthirdparty->facebook=$this->facebook; $lthirdparty->phone=$this->phone; $lthirdparty->state_id=$this->state_id; $lthirdparty->country_id=$this->country_id; @@ -1100,7 +1110,7 @@ class Adherent extends CommonObject $sql = "SELECT d.rowid, d.ref_ext, d.civility as civility_id, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note_private,"; $sql.= " d.note_public,"; - $sql.= " d.email, d.skype, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass, d.pass_crypted,"; + $sql.= " d.email, d.skype, d.twitter, d.facebook, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass, d.pass_crypted,"; $sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,"; $sql.= " d.datec as datec,"; $sql.= " d.tms as datem,"; @@ -1172,7 +1182,10 @@ class Adherent extends CommonObject $this->phone_perso = $obj->phone_perso; $this->phone_mobile = $obj->phone_mobile; $this->email = $obj->email; + $this->skype = $obj->skype; + $this->twitter = $obj->twitter; + $this->facebook = $obj->facebook; $this->photo = $obj->photo; $this->statut = $obj->statut; @@ -2265,7 +2278,9 @@ class Adherent extends CommonObject $this->country = 'France'; $this->morphy = 1; $this->email = 'specimen@specimen.com'; - $this->skype = 'tom.hanson'; + $this->skype = 'skypepseudo'; + $this->twitter = 'twitterpseudo'; + $this->facebook = 'facebookpseudo'; $this->phone = '0999999999'; $this->phone_perso = '0999999998'; $this->phone_mobile = '0999999997'; @@ -2372,6 +2387,8 @@ class Adherent extends CommonObject if ($this->town && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->town; if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code; if ($this->skype && ! empty($conf->global->LDAP_MEMBER_FIELD_SKYPE)) $info[$conf->global->LDAP_MEMBER_FIELD_SKYPE] = $this->skype; + if ($this->twitter && ! empty($conf->global->LDAP_MEMBER_FIELD_TWITTER)) $info[$conf->global->LDAP_MEMBER_FIELD_TWITTER] = $this->twitter; + if ($this->facebook && ! empty($conf->global->LDAP_MEMBER_FIELD_FACEBOOK)) $info[$conf->global->LDAP_MEMBER_FIELD_FACEBOOK] = $this->facebook; if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone; if ($this->phone_perso && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso; if ($this->phone_mobile && ! empty($conf->global->LDAP_MEMBER_FIELD_MOBILE)) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 6c28081e6fc..cd84dbf65a5 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -238,6 +238,32 @@ if ($action == 'setforcedate') } } +if ($action == 'setDefaultPDFModulesByType') +{ + $invoicetypemodels = GETPOST('invoicetypemodels'); + + if(!empty($invoicetypemodels) && is_array($invoicetypemodels)) + { + $error = 0; + + foreach ($invoicetypemodels as $type => $value) + { + $res = dolibarr_set_const($db, 'FACTURE_ADDON_PDF_'.intval($type),$value,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + } + + if (! $error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } + } + + +} /* @@ -465,6 +491,8 @@ print "\n"; clearstatcache(); +$activatedModels = array(); + foreach ($dirmodels as $reldir) { foreach (array('','/doc') as $valdir) @@ -580,6 +608,47 @@ foreach ($dirmodels as $reldir) } print ''; +if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf +{ + /* + * Document templates generators + */ + print '
'; + print load_fiche_titre($langs->trans("BillsPDFModulesAccordindToInvoiceType"),'',''); + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + $listtype=array( + Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), + Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), + Facture::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"), + Facture::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), + ); + if (! empty($conf->global->INVOICE_USE_SITUATION)) + { + $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); + } + + foreach ($listtype as $type => $trans) + { + $thisTypeConfName = 'FACTURE_ADDON_PDF_'.$type; + $current = !empty($conf->global->{$thisTypeConfName})?$conf->global->{$thisTypeConfName}:$conf->global->FACTURE_ADDON_PDF; + print ''; + print ''; + print ''; + print "\n"; + } + + print '
'.$langs->trans("Type").''.$langs->trans("Name").'
'.$trans.''.$form->selectarray('invoicetypemodels['.$type.']', ModelePDFFactures::liste_modeles($db), $current,0,0, 0).'
'; + print "
"; +} /* * Modes de reglement @@ -662,6 +731,7 @@ if ($resql) $i = 0; while ($i < $num) { + $row = $db->fetch_row($resql); print '