39require
'../../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
48require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/class/discount.class.php';
52$langs->loadLangs(array(
'products',
'bills',
'companies',
'projects'));
54$action =
GETPOST(
'action',
'aZ09');
55$massaction =
GETPOST(
'massaction',
'alpha');
56$show_files =
GETPOST(
'show_files',
'int');
57$confirm =
GETPOST(
'confirm',
'alpha');
58$toselect =
GETPOST(
'toselect',
'array');
59$optioncss =
GETPOST(
'optioncss',
'alpha');
60$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'supplierinvoicelist';
63$search_all = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
64$search_label =
GETPOST(
"search_label",
"alpha");
65$search_amount_no_tax =
GETPOST(
"search_amount_no_tax",
"alpha");
66$search_amount_all_tax =
GETPOST(
"search_amount_all_tax",
"alpha");
68$search_refsupplier =
GETPOST(
'search_refsupplier',
'alpha');
69$search_type =
GETPOST(
'search_type',
'int');
70$search_subtype =
GETPOST(
'search_subtype',
'int');
71$search_project =
GETPOST(
'search_project',
'alpha');
72$search_company =
GETPOST(
'search_company',
'alpha');
73$search_company_alias =
GETPOST(
'search_company_alias',
'alpha');
74$search_montant_ht =
GETPOST(
'search_montant_ht',
'alpha');
75$search_montant_vat =
GETPOST(
'search_montant_vat',
'alpha');
76$search_montant_localtax1 =
GETPOST(
'search_montant_localtax1',
'alpha');
77$search_montant_localtax2 =
GETPOST(
'search_montant_localtax2',
'alpha');
78$search_montant_ttc =
GETPOST(
'search_montant_ttc',
'alpha');
79$search_login =
GETPOST(
'search_login',
'alpha');
80$search_multicurrency_code =
GETPOST(
'search_multicurrency_code',
'alpha');
81$search_multicurrency_tx =
GETPOST(
'search_multicurrency_tx',
'alpha');
82$search_multicurrency_montant_ht =
GETPOST(
'search_multicurrency_montant_ht',
'alpha');
83$search_multicurrency_montant_vat =
GETPOST(
'search_multicurrency_montant_vat',
'alpha');
84$search_multicurrency_montant_ttc =
GETPOST(
'search_multicurrency_montant_ttc',
'alpha');
85$search_status =
GETPOST(
'search_status',
'int');
86$search_paymentmode =
GETPOST(
'search_paymentmode',
'int');
87$search_paymentcond =
GETPOST(
'search_paymentcond',
'int');
88$search_town =
GETPOST(
'search_town',
'alpha');
89$search_zip =
GETPOST(
'search_zip',
'alpha');
90$search_state =
GETPOST(
"search_state");
91$search_country =
GETPOST(
"search_country",
'int');
92$search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'int');
93$search_user =
GETPOST(
'search_user',
'int');
94$search_sale =
GETPOST(
'search_sale',
'int');
95$search_date_start =
GETPOSTDATE(
'search_date_start',
'',
'tzserver');
96$search_date_end =
GETPOSTDATE(
'search_date_end',
'23:59:59',
'tzserver');
97$search_datelimit_startday =
GETPOST(
'search_datelimit_startday',
'int');
98$search_datelimit_startmonth =
GETPOST(
'search_datelimit_startmonth',
'int');
99$search_datelimit_startyear =
GETPOST(
'search_datelimit_startyear',
'int');
100$search_datelimit_endday =
GETPOST(
'search_datelimit_endday',
'int');
101$search_datelimit_endmonth =
GETPOST(
'search_datelimit_endmonth',
'int');
102$search_datelimit_endyear =
GETPOST(
'search_datelimit_endyear',
'int');
103$search_datelimit_start =
dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear);
104$search_datelimit_end =
dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear);
105$search_btn =
GETPOST(
'button_search',
'alpha');
106$search_remove_btn =
GETPOST(
'button_removefilter',
'alpha');
107$search_categ_sup = trim(
GETPOST(
"search_categ_sup",
'int'));
108$search_product_category =
GETPOST(
'search_product_category',
'int');
110$option =
GETPOST(
'search_option');
111if ($option ==
'late') {
112 $search_status =
'1';
114$filter =
GETPOST(
'filtre',
'alpha');
117$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
118$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
119$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
120$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
121if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
125$offset = $limit * $page;
130 $sortfield =
"f.datef,f.rowid";
132$pageprev = $page - 1;
133$pagenext = $page + 1;
135$socid =
GETPOST(
'socid',
'int');
138if ($user->socid > 0) {
140 $_GET[
"action"] =
'';
141 $socid = $user->socid;
144$diroutputmassaction = $conf->fournisseur->facture->dir_output.
'/temp/massgeneration/'.$user->id;
150$hookmanager->initHooks(array(
'supplierinvoicelist'));
154$extrafields->fetch_name_optionals_label($object->table_element);
156$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
159$fieldstosearchall = array(
161 'f.ref_supplier'=>
'RefSupplier',
162 'f.note_public'=>
'NotePublic',
163 's.nom'=>
"ThirdParty",
164 's.code_fournisseur'=>
"SupplierCodeShort",
165 'pd.description'=>
'Description',
167if (empty($user->socid)) {
168 $fieldstosearchall[
"f.note_private"] =
"NotePrivate";
171$checkedtypetiers = 0;
173 'f.ref'=>array(
'label'=>
"Ref",
'checked'=>1),
174 'f.ref_supplier'=>array(
'label'=>
"RefSupplier",
'checked'=>1),
175 'f.type'=>array(
'label'=>
"Type",
'checked'=>0),
176 'f.subtype'=>array(
'label'=>
"InvoiceSubtype",
'checked'=>0,),
177 'f.label'=>array(
'label'=>
"Label",
'checked'=>0),
178 'f.datef'=>array(
'label'=>
"DateInvoice",
'checked'=>1),
179 'f.date_lim_reglement'=>array(
'label'=>
"DateDue",
'checked'=>1),
180 'p.ref'=>array(
'label'=>
"ProjectRef",
'checked'=>0),
181 's.nom'=>array(
'label'=>
"ThirdParty",
'checked'=>1,
'position'=>41),
182 's.name_alias'=>array(
'label'=>
"AliasNameShort",
'checked'=>0,
'position'=>42),
183 's.town'=>array(
'label'=>
"Town",
'checked'=>-1,
'position'=>43),
184 's.zip'=>array(
'label'=>
"Zip",
'checked'=>1,
'position'=>44),
185 'state.nom'=>array(
'label'=>
"StateShort",
'checked'=>0,
'position'=>45),
186 'country.code_iso'=>array(
'label'=>
"Country",
'checked'=>0,
'position'=>46),
187 'typent.code'=>array(
'label'=>
"ThirdPartyType",
'checked'=>$checkedtypetiers,
'position'=>49),
188 'f.fk_mode_reglement'=>array(
'label'=>
"PaymentMode",
'checked'=>1,
'position'=>52),
189 'f.fk_cond_reglement'=>array(
'label'=>
"PaymentConditionsShort",
'checked'=>1,
'position'=>50),
190 'f.total_ht'=>array(
'label'=>
"AmountHT",
'checked'=>1,
'position'=>105),
191 'f.total_vat'=>array(
'label'=>
"AmountVAT",
'checked'=>0,
'position'=>110),
192 'f.total_localtax1'=>array(
'label'=>$langs->transcountry(
"AmountLT1", $mysoc->country_code),
'checked'=>0,
'enabled'=>$mysoc->localtax1_assuj ==
"1",
'position'=>95),
193 'f.total_localtax2'=>array(
'label'=>$langs->transcountry(
"AmountLT2", $mysoc->country_code),
'checked'=>0,
'enabled'=>$mysoc->localtax2_assuj ==
"1",
'position'=>100),
194 'f.total_ttc'=>array(
'label'=>
"AmountTTC",
'checked'=>0,
'position'=>115),
195 'dynamount_payed'=>array(
'label'=>
"Paid",
'checked'=>0,
'position'=>116),
196 'rtp'=>array(
'label'=>
"Rest",
'checked'=>0,
'position'=>117),
197 'f.multicurrency_code'=>array(
'label'=>
'Currency',
'checked'=>0,
'position'=>205,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
198 'f.multicurrency_tx'=>array(
'label'=>
'CurrencyRate',
'checked'=>0,
'position'=>206,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
199 'f.multicurrency_total_ht'=>array(
'label'=>
'MulticurrencyAmountHT',
'position'=>207,
'checked'=>0,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
200 'f.multicurrency_total_vat'=>array(
'label'=>
'MulticurrencyAmountVAT',
'position'=>208,
'checked'=>0,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
201 'f.multicurrency_total_ttc'=>array(
'label'=>
'MulticurrencyAmountTTC',
'position'=>209,
'checked'=>0,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
202 'multicurrency_dynamount_payed'=>array(
'label'=>
'MulticurrencyAlreadyPaid',
'position'=>210,
'checked'=>0,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
203 'multicurrency_rtp'=>array(
'label'=>
'MulticurrencyRemainderToPay',
'checked'=>0,
'position'=>211,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
204 'u.login'=>array(
'label'=>
"Author",
'checked'=>1,
'position'=>500),
205 'f.datec'=>array(
'label'=>
"DateCreation",
'checked'=>0,
'position'=>501),
206 'f.tms'=>array(
'label'=>
"DateModificationShort",
'checked'=>0,
'position'=>502),
207 'f.fk_statut'=>array(
'label'=>
"Status",
'checked'=>1,
'position'=>1000),
208 'f.nb_docs'=>array(
'label'=>
"Documents",
'checked'=>1,
'position'=>510),
211include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
216if (!isModEnabled(
'supplier_invoice')) {
219if ((!$user->hasRight(
"fournisseur",
"facture",
"lire") && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD'))
220 || (!$user->hasRight(
"supplier_invoice",
"lire") &&
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD'))) {
224if (!$user->hasRight(
'societe',
'client',
'voir')) {
225 $search_sale = $user->id;
228$permissiontoread = ($user->hasRight(
"fournisseur",
"facture",
"lire") || $user->hasRight(
"supplier_invoice",
"lire"));
229$permissiontoadd = ($user->hasRight(
"fournisseur",
"facture",
"creer") || $user->hasRight(
"supplier_invoice",
"creer"));
230$permissiontodelete = ($user->hasRight(
"fournisseur",
"facture",
"supprimer") || $user->hasRight(
"supplier_invoice",
"supprimer"));
237if (
GETPOST(
'cancel',
'alpha')) {
241if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
245$parameters = array(
'socid'=>$socid,
'arrayfields'=>&$arrayfields);
246$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
251if (empty($reshook)) {
253 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
256 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha')) {
260 $search_product_category =
'';
262 $search_refsupplier =
"";
264 $search_subtype =
'';
266 $search_project =
'';
267 $search_company =
"";
268 $search_company_alias =
"";
269 $search_amount_no_tax =
"";
270 $search_amount_all_tax =
"";
271 $search_montant_ht =
'';
272 $search_montant_vat =
'';
273 $search_montant_localtax1 =
'';
274 $search_montant_localtax2 =
'';
275 $search_montant_ttc =
'';
277 $search_multicurrency_code =
'';
278 $search_multicurrency_tx =
'';
279 $search_multicurrency_montant_ht =
'';
280 $search_multicurrency_montant_vat =
'';
281 $search_multicurrency_montant_ttc =
'';
283 $search_paymentmode =
'';
284 $search_paymentcond =
'';
288 $search_country =
'';
289 $search_type_thirdparty =
'';
290 $search_date_start =
'';
291 $search_date_end =
'';
292 $search_datelimit_startday =
'';
293 $search_datelimit_startmonth =
'';
294 $search_datelimit_startyear =
'';
295 $search_datelimit_endday =
'';
296 $search_datelimit_endmonth =
'';
297 $search_datelimit_endyear =
'';
298 $search_datelimit_start =
'';
299 $search_datelimit_end =
'';
301 $search_array_options = array();
302 $search_categ_sup = 0;
309 $objectclass =
'FactureFournisseur';
310 $objectlabel =
'SupplierInvoices';
311 $uploaddir = $conf->fournisseur->facture->dir_output;
312 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
314 if ($massaction ==
'banktransfertrequest') {
315 $langs->load(
"withdrawals");
317 if (!$user->hasRight(
"paymentbybanktransfer",
"create")) {
324 $arrayofselected = is_array($toselect) ? $toselect : array();
325 $listofbills = array();
326 foreach ($arrayofselected as $toselectid) {
328 $result = $objecttmp->fetch($toselectid);
330 $totalpaid = $objecttmp->getSommePaiement();
331 $totalcreditnotes = $objecttmp->getSumCreditNotesUsed();
332 $totaldeposits = $objecttmp->getSumDepositsUsed();
333 $objecttmp->resteapayer =
price2num($objecttmp->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits,
'MT');
336 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"Draft"), $objecttmp->errors,
'errors');
337 } elseif ($objecttmp->paye || $objecttmp->resteapayer == 0) {
339 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"AlreadyPaid"), $objecttmp->errors,
'errors');
340 } elseif ($objecttmp->resteapayer < 0) {
342 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"AmountMustBePositive"), $objecttmp->errors,
'errors');
345 $rsql =
"SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande";
346 $rsql .=
" , pfd.date_traite as date_traite";
347 $rsql .=
" , pfd.amount";
348 $rsql .=
" , u.rowid as user_id, u.lastname, u.firstname, u.login";
349 $rsql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_demande as pfd";
350 $rsql .=
" , ".MAIN_DB_PREFIX.
"user as u";
351 $rsql .=
" WHERE fk_facture_fourn = ".((int) $objecttmp->id);
352 $rsql .=
" AND pfd.fk_user_demande = u.rowid";
353 $rsql .=
" AND pfd.traite = 0";
354 $rsql .=
" ORDER BY pfd.date_demande DESC";
356 $result_sql = $db->query($rsql);
358 $numprlv = $db->num_rows($result_sql);
363 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"RequestAlreadyDone"), $objecttmp->errors,
'warnings');
364 } elseif (!empty($objecttmp->mode_reglement_code) && $objecttmp->mode_reglement_code !=
'VIR') {
366 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"BadPaymentMethod"), $objecttmp->errors,
'errors');
368 $listofbills[] = $objecttmp;
374 if (!empty($listofbills)) {
375 $nbwithdrawrequestok = 0;
376 foreach ($listofbills as $aBill) {
378 $result = $aBill->demande_prelevement($user, $aBill->resteapayer,
'bank-transfer',
'supplier_invoice');
381 $nbwithdrawrequestok++;
387 if ($nbwithdrawrequestok > 0) {
388 setEventMessages($langs->trans(
"WithdrawRequestsDone", $nbwithdrawrequestok),
null,
'mesgs');
400$form =
new Form($db);
403$bankaccountstatic =
new Account($db);
407$subtypearray = $object->getArrayOfInvoiceSubtypes(0);
413 if (empty($search_company)) {
414 $search_company = $soc->name;
418$title = $langs->trans(
"BillsSuppliers").($socid ?
' - '.$soc->name :
'');
419$help_url =
'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores';
425 $sql =
'SELECT DISTINCT';
427$sql .=
" f.rowid as facid, f.ref, f.ref_supplier, f.type, f.subtype, f.datef, f.date_lim_reglement as datelimite, f.fk_mode_reglement, f.fk_cond_reglement,";
428$sql .=
" f.total_ht, f.total_ttc, f.total_tva as total_vat, f.paye as paye, f.close_code, f.fk_statut as fk_statut, f.libelle as label, f.datec as date_creation, f.tms as date_update,";
429$sql .=
" f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,";
430$sql .=
' f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva as multicurrency_total_vat, f.multicurrency_total_ttc,';
431$sql .=
" f.note_public, f.note_private,";
432$sql .=
" f.fk_user_author,";
433$sql .=
" s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,";
434$sql .=
" typent.code as typent_code,";
435$sql .=
" state.code_departement as state_code, state.nom as state_name,";
436$sql .=
" country.code as country_code,";
437$sql .=
" p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
438$sql .=
' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
440if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
441 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
442 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
446$parameters = array();
447$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
448$sql .= $hookmanager->resPrint;
449$sql = preg_replace(
'/,\s*$/',
'', $sql);
454 $sql .=
', SUM(pf.amount) as dynamount_payed';
459$sql .=
' FROM '.MAIN_DB_PREFIX.
'societe as s';
460$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
461$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
462$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
463$sql .=
', '.MAIN_DB_PREFIX.
'facture_fourn as f';
464if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
465 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (f.rowid = ef.fk_object)";
468 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
471 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'facture_fourn_det as pd ON f.rowid=pd.fk_facture_fourn';
473$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user AS u ON f.fk_user_author = u.rowid';
474$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as p ON p.rowid = f.fk_projet";
475if ($search_user > 0) {
476 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ec";
477 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
480$parameters = array();
481$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
482$sql .= $hookmanager->resPrint;
483$sql .=
' WHERE f.fk_soc = s.rowid';
484$sql .=
' AND f.entity IN ('.getEntity(
'facture_fourn').
')';
486 $sql .=
' AND s.rowid = '.((int) $socid);
489 if (is_numeric($search_ref)) {
498if ($search_refsupplier) {
501if ($search_type !=
'' && $search_type >= 0) {
502 if ($search_type ==
'0') {
503 $sql .=
" AND f.type = 0";
505 if ($search_type ==
'1') {
506 $sql .=
" AND f.type = 1";
508 if ($search_type ==
'2') {
509 $sql .=
" AND f.type = 2";
511 if ($search_type ==
'3') {
512 $sql .=
" AND f.type = 3";
517if ($search_subtype !=
'' && $search_subtype !=
'-1') {
518 $sql .=
" AND f.subtype IN (".$db->sanitize($db->escape($search_subtype)).
")";
520if ($search_project) {
523if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_company) {
524 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_company);
526 if ($search_company) {
529 if ($search_company_alias) {
542if ($search_country) {
543 $sql .=
" AND s.fk_pays IN (".$db->sanitize($search_country).
')';
545if ($search_type_thirdparty !=
'' && $search_type_thirdparty >= 0) {
546 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
548if ($search_montant_ht !=
'') {
551if ($search_montant_vat !=
'') {
554if ($search_montant_localtax1 !=
'') {
555 $sql .=
natural_search(
'f.localtax1', $search_montant_localtax1, 1);
557if ($search_montant_localtax2 !=
'') {
558 $sql .=
natural_search(
'f.localtax2', $search_montant_localtax2, 1);
560if ($search_montant_ttc !=
'') {
563if ($search_multicurrency_code !=
'') {
564 $sql .=
" AND f.multicurrency_code = '".$db->escape($search_multicurrency_code).
"'";
566if ($search_multicurrency_tx !=
'') {
567 $sql .=
natural_search(
'f.multicurrency_tx', $search_multicurrency_tx, 1);
569if ($search_multicurrency_montant_ht !=
'') {
570 $sql .=
natural_search(
'f.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
572if ($search_multicurrency_montant_vat !=
'') {
573 $sql .=
natural_search(
'f.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
575if ($search_multicurrency_montant_ttc !=
'') {
576 $sql .=
natural_search(
'f.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
579 $sql .=
natural_search(array(
'u.login',
'u.lastname',
'u.firstname'), $search_login);
581if ($search_status !=
'' && $search_status >= 0) {
582 $sql .=
" AND f.fk_statut = ".((int) $search_status);
584if ($search_paymentmode > 0) {
585 $sql .=
" AND f.fk_mode_reglement = ".((int) $search_paymentmode);
587if ($search_paymentcond > 0) {
588 $sql .=
" AND f.fk_cond_reglement = ".((int) $search_paymentcond);
590if ($search_date_start) {
591 $sql .=
" AND f.datef >= '" . $db->idate($search_date_start) .
"'";
593if ($search_date_end) {
594 $sql .=
" AND f.datef <= '" . $db->idate($search_date_end) .
"'";
596if ($search_datelimit_start) {
597 $sql .=
" AND f.date_lim_reglement >= '" . $db->idate($search_datelimit_start) .
"'";
599if ($search_datelimit_end) {
600 $sql .=
" AND f.date_lim_reglement <= '" . $db->idate($search_datelimit_end) .
"'";
602if ($option ==
'late') {
603 $sql .=
" AND f.date_lim_reglement < '".$db->idate(
dol_now() - $conf->facture->fournisseur->warning_delay).
"'";
609if ($search_sale && $search_sale !=
'-1') {
610 if ($search_sale == -2) {
611 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc)";
612 } elseif ($search_sale > 0) {
613 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc AND sc.fk_user = ".((int) $search_sale).
")";
616$searchCategorySupplierList = $search_categ_sup ? array($search_categ_sup) : array();
617$searchCategorySupplierOperator = 0;
619if (!empty($searchCategorySupplierList)) {
620 $searchCategorySupplierSqlList = array();
621 $listofcategoryid =
'';
622 foreach ($searchCategorySupplierList as $searchCategorySupplier) {
623 if (intval($searchCategorySupplier) == -2) {
624 $searchCategorySupplierSqlList[] =
"NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)";
625 } elseif (intval($searchCategorySupplier) > 0) {
626 if ($searchCategorySupplierOperator == 0) {
627 $searchCategorySupplierSqlList[] =
" EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).
")";
629 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategorySupplier);
633 if ($listofcategoryid) {
634 $searchCategorySupplierSqlList[] =
" EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
636 if ($searchCategorySupplierOperator == 1) {
637 if (!empty($searchCategorySupplierSqlList)) {
638 $sql .=
" AND (".implode(
' OR ', $searchCategorySupplierSqlList).
")";
641 if (!empty($searchCategorySupplierSqlList)) {
642 $sql .=
" AND (".implode(
' AND ', $searchCategorySupplierSqlList).
")";
647$searchCategoryProductList = $search_product_category ? array($search_product_category) : array();
648$searchCategoryProductOperator = 0;
649if (!empty($searchCategoryProductList)) {
650 $searchCategoryProductSqlList = array();
651 $listofcategoryid =
'';
652 foreach ($searchCategoryProductList as $searchCategoryProduct) {
653 if (intval($searchCategoryProduct) == -2) {
654 $searchCategoryProductSqlList[] =
"NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND fd.fk_product = ck.fk_product)";
655 } elseif (intval($searchCategoryProduct) > 0) {
656 if ($searchCategoryProductOperator == 0) {
657 $searchCategoryProductSqlList[] =
" EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND fd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).
")";
659 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
663 if ($listofcategoryid) {
664 $searchCategoryProductSqlList[] =
" EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND fd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
666 if ($searchCategoryProductOperator == 1) {
667 if (!empty($searchCategoryProductSqlList)) {
668 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
671 if (!empty($searchCategoryProductSqlList)) {
672 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
676if ($filter && $filter != -1) {
677 $aFilter = explode(
',', $filter);
678 foreach ($aFilter as $fil) {
679 $filt = explode(
':', $fil);
680 $sql .=
" AND ".$db->escape(trim($filt[0])).
" = '".$db->escape(trim($filt[1])).
"'";
687if ($search_user > 0) {
688 $sql .=
" AND ec.fk_c_type_contact = tc.rowid AND tc.element='invoice_supplier' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".((int) $search_user);
691include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
693$parameters = array();
694$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
695$sql .= $hookmanager->resPrint;
698 $sql .=
" GROUP BY f.rowid, f.ref, f.ref_supplier, f.type, f.subtype, f.datef, f.date_lim_reglement, f.fk_mode_reglement, f.fk_cond_reglement,";
699 $sql .=
" f.total_ht, f.total_ttc, f.total_tva, f.paye, f.close_code, f.fk_statut, f.libelle, f.datec, f.tms,";
700 $sql .=
" f.localtax1, f.localtax2,";
701 $sql .=
' f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc,';
702 $sql .=
" f.note_public, f.note_private,";
703 $sql .=
" f.fk_user_author,";
704 $sql .=
' s.rowid, s.nom, s.name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,';
705 $sql .=
" typent.code,";
706 $sql .=
" state.code_departement, state.nom,";
707 $sql .=
' country.code,';
708 $sql .=
" p.rowid, p.ref, p.title,";
709 $sql .=
" u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender";
710 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
711 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
713 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
",ef.".$key :
'');
717 $parameters = array(
'all' => $search_all,
'fieldstosearchall' => $fieldstosearchall);
718 $reshook = $hookmanager->executeHooks(
'printFieldListGroupBy', $parameters, $object, $action);
719 $sql .= $hookmanager->resPrint;
721 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
725$parameters = array();
726$reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object, $action);
727$sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
730$nbtotalofrecords =
'';
733 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
734 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
735 $sqlforcount = preg_replace(
'/LEFT JOIN '.MAIN_DB_PREFIX.
'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid/',
'', $sqlforcount);
737 $resql = $db->query($sqlforcount);
739 $objforcount = $db->fetch_object($resql);
740 $nbtotalofrecords = $objforcount->nbtotalofrecords;
745 if (($page * $limit) > $nbtotalofrecords) {
753$sql .= $db->order($sortfield, $sortorder);
755 $sql .= $db->plimit($limit + 1, $offset);
759$resql = $db->query($sql);
765$num = $db->num_rows($resql);
768if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
769 $obj = $db->fetch_object($resql);
771 header(
"Location: ".DOL_URL_ROOT.
'/fourn/facture/card.php?facid='.$id);
783 if (empty($search_company)) {
784 $search_company = $soc->name;
785 $search_company_alias = $soc->name_alias;
789$arrayofselected = is_array($toselect) ? $toselect : array();
791$param =
'&socid='.$socid;
793 $param .=
'&mode='.urlencode($mode);
795if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
796 $param .=
'&contextpage='.urlencode($contextpage);
798if ($limit > 0 && $limit != $conf->liste_limit) {
799 $param .=
'&limit='.((int) $limit);
801if ($optioncss !=
'') {
802 $param .=
'&optioncss='.urlencode($optioncss);
805 $param .=
'&search_all='.urlencode($search_all);
807if ($search_date_start) {
808 $param .=
buildParamDate(
'search_date_start',
null,
'',
'tzserver');
810if ($search_date_end) {
811 $param .=
buildParamDate(
'search_date_end',
null,
'',
'tzserver');
813if ($search_datelimit_startday) {
814 $param .=
'&search_datelimit_startday='.urlencode($search_datelimit_startday);
816if ($search_datelimit_startmonth) {
817 $param .=
'&search_datelimit_startmonth='.urlencode($search_datelimit_startmonth);
819if ($search_datelimit_startyear) {
820 $param .=
'&search_datelimit_startyear='.urlencode($search_datelimit_startyear);
822if ($search_datelimit_endday) {
823 $param .=
'&search_datelimit_endday='.urlencode($search_datelimit_endday);
825if ($search_datelimit_endmonth) {
826 $param .=
'&search_datelimit_endmonth='.urlencode($search_datelimit_endmonth);
828if ($search_datelimit_endyear) {
829 $param .=
'&search_datelimit_endyear='.urlencode($search_datelimit_endyear);
832 $param .=
'&search_ref='.urlencode($search_ref);
834if ($search_refsupplier) {
835 $param .=
'&search_refsupplier='.urlencode($search_refsupplier);
837if ($search_type !=
'') {
838 $param .=
'&search_type='.urlencode($search_type);
840if ($search_subtype !=
'') {
841 $param .=
'&search_subtype='.urlencode($search_subtype);
844 $param .=
'&search_label='.urlencode($search_label);
846if ($search_company) {
847 $param .=
'&search_company='.urlencode($search_company);
849if ($search_company_alias) {
850 $param .=
'&search_company_alias='.urlencode($search_company_alias);
853 $param .=
'&search_login='.urlencode($search_login);
855if ($search_montant_ht !=
'') {
856 $param .=
'&search_montant_ht='.urlencode($search_montant_ht);
858if ($search_montant_vat !=
'') {
859 $param .=
'&search_montant_vat='.urlencode($search_montant_vat);
861if ($search_montant_localtax1 !=
'') {
862 $param .=
'&search_montant_localtax1='.urlencode($search_montant_localtax1);
864if ($search_montant_localtax2 !=
'') {
865 $param .=
'&search_montant_localtax2='.urlencode($search_montant_localtax2);
867if ($search_montant_ttc !=
'') {
868 $param .=
'&search_montant_ttc='.urlencode($search_montant_ttc);
870if ($search_multicurrency_code !=
'') {
871 $param .=
'&search_multicurrency_code='.urlencode($search_multicurrency_code);
873if ($search_multicurrency_tx !=
'') {
874 $param .=
'&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
876if ($search_multicurrency_montant_ht !=
'') {
877 $param .=
'&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
879if ($search_multicurrency_montant_vat !=
'') {
880 $param .=
'&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
882if ($search_multicurrency_montant_ttc !=
'') {
883 $param .=
'&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
885if ($search_amount_no_tax) {
886 $param .=
'&search_amount_no_tax='.urlencode($search_amount_no_tax);
888if ($search_amount_all_tax) {
889 $param .=
'&search_amount_all_tax='.urlencode($search_amount_all_tax);
891if ($search_status >= 0) {
892 $param .=
"&search_status=".urlencode($search_status);
894if ($search_paymentmode) {
895 $param .=
'&search_paymentmode='.urlencode($search_paymentmode);
897if ($search_paymentcond) {
898 $param .=
'&search_paymentcond='.urlencode($search_paymentcond);
901 $param .=
'&show_files='.urlencode($show_files);
904 $param .=
"&search_option=".urlencode($option);
906if ($search_categ_sup > 0) {
907 $param .=
'&search_categ_sup='.urlencode($search_categ_sup);
909if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
910 $param .=
'&search_type_thirdparty='.urlencode($search_type_thirdparty);
914include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
916$parameters = array(
'param' => &$param);
917$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
918$param .= $hookmanager->resPrint;
921$arrayofmassactions = array(
922 'validate'=>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate"),
923 'generate_doc'=>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
928if (isModEnabled(
'paymentbybanktransfer') && $user->hasRight(
"paymentbybanktransfer",
"create")) {
929 $langs->load(
'withdrawals');
930 $arrayofmassactions[
'banktransfertrequest'] =
img_picto(
'',
'payment',
'class="pictofixedwidth"').$langs->trans(
"MakeBankTransferOrder");
932if (!empty($permissiontodelete)) {
933 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
935if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
936 $arrayofmassactions = array();
938$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
940$url = DOL_URL_ROOT.
'/fourn/facture/card.php?action=create';
942 $url .=
'&socid='.urlencode($socid);
946print
'<form method="POST" id="searchFormList" name="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
947if ($optioncss !=
'') {
948 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
950print
'<input type="hidden" name="token" value="'.newToken().
'">';
951print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
952print
'<input type="hidden" name="action" value="list">';
953print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
954print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
955print
'<input type="hidden" name="socid" value="'.$socid.
'">';
956print
'<input type="hidden" name="page" value="'.$page.
'">';
957print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
958print
'<input type="hidden" name="page_y" value="">';
959print
'<input type="hidden" name="mode" value="'.$mode.
'">';
962$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss'=>
'reposition'));
963$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=kanban'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss'=>
'reposition'));
965$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewBill'),
'',
'fa fa-plus-circle', $url,
'', ($user->hasRight(
"fournisseur",
"facture",
"creer") || $user->hasRight(
"supplier_invoice",
"creer")));
967print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_invoice', 0, $newcardbutton,
'', $limit, 0, 0, 1);
970$topicmail =
"SendBillRef";
971$modelmail =
"invoice_supplier_send";
973$trackid =
'sinv'.$object->id;
974include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
978 foreach ($fieldstosearchall as $key => $val) {
979 $fieldstosearchall[$key] = $langs->trans($val);
980 $setupstring .= $key.
"=".$val.
";";
982 print
'<!-- Search done like if SUPPLIER_INVOICE_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
983 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>'.
"\n";
988if ($user->hasRight(
"user",
"user",
"lire")) {
989 $langs->load(
"commercial");
990 $moreforfilter .=
'<div class="divsearchfield">';
991 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
992 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth200');
993 $moreforfilter .=
'</div>';
996if ($user->hasRight(
"user",
"user",
"lire")) {
997 $moreforfilter .=
'<div class="divsearchfield">';
998 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
999 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$form->select_dolusers($search_user,
'search_user', $tmptitle,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth200');
1000 $moreforfilter .=
'</div>';
1003if (isModEnabled(
'categorie') && $user->hasRight(
'categorie',
'lire') && ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire'))) {
1004 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1005 $moreforfilter .=
'<div class="divsearchfield">';
1006 $tmptitle = $langs->trans(
'IncludingProductWithTag');
1007 $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT,
null,
'parent',
null,
null, 1);
1008 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$form->selectarray(
'search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0,
'', 0, 0, 0, 0,
'maxwidth300 widthcentpercentminusx', 1);
1009 $moreforfilter .=
'</div>';
1012if (isModEnabled(
'categorie')) {
1013 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1014 $moreforfilter .=
'<div class="divsearchfield">';
1015 $tmptitle = $langs->trans(
'SuppliersCategoriesShort');
1016 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$formother->select_categories(
'supplier', $search_categ_sup,
'search_categ_sup', 1, $tmptitle);
1017 $moreforfilter .=
'</div>';
1019$parameters = array();
1020$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1021if (empty($reshook)) {
1022 $moreforfilter .= $hookmanager->resPrint;
1024 $moreforfilter = $hookmanager->resPrint;
1027if (!empty($moreforfilter)) {
1028 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1029 print $moreforfilter;
1030 $parameters = array();
1031 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1032 print $hookmanager->resPrint;
1036$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1037$selectedfields = ($mode !=
'kanban' ? $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
'')) :
'');
1038$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1040print
'<div class="div-table-responsive">';
1041print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1045print
'<tr class="liste_titre_filter">';
1048 print
'<td class="liste_titre center maxwidthsearch">';
1049 $searchpicto = $form->showFilterButtons(
'left');
1054if (!empty($arrayfields[
'f.ref'][
'checked'])) {
1055 print
'<td class="liste_titre left">';
1056 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
1060if (!empty($arrayfields[
'f.ref_supplier'][
'checked'])) {
1061 print
'<td class="liste_titre">';
1062 print
'<input class="flat maxwidth75" type="text" name="search_refsupplier" value="'.dol_escape_htmltag($search_refsupplier).
'">';
1066if (!empty($arrayfields[
'f.type'][
'checked'])) {
1067 print
'<td class="liste_titre maxwidthonsmartphone">';
1081 print $form->selectarray(
'search_type', $listtype, $search_type, 1, 0, 0,
'', 0, 0, 0,
'ASC',
'maxwidth100');
1085if (!empty($arrayfields[
'f.subtype'][
'checked'])) {
1086 print
'<td class="liste_titre maxwidthonsmartphone" align="center">';
1087 print $form->selectarray(
'search_subtype', $subtypearray, $search_subtype, 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth100');
1091if (!empty($arrayfields[
'f.label'][
'checked'])) {
1092 print
'<td class="liste_titre">';
1093 print
'<input class="flat maxwidth75" type="text" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
1097if (!empty($arrayfields[
'f.datef'][
'checked'])) {
1098 print
'<td class="liste_titre center">';
1099 print
'<div class="nowrapfordate">';
1100 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1102 print
'<div class="nowrapfordate">';
1103 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1108if (!empty($arrayfields[
'f.date_lim_reglement'][
'checked'])) {
1109 print
'<td class="liste_titre center">';
1110 print
'<div class="">';
1117 print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1,
'search_datelimit_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"Before"));
1119 print
'<div class="nowraponall inline-block valignmiddle"><input type="checkbox" class="valignmiddle" name="search_option" id="search_option" value="late"'.($option ==
'late' ?
' checked' :
'').
'><label for="search_option" class="valignmiddle">'.$langs->trans(
"Alert").
'</label></div>';
1124if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1125 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_project" value="'.dol_escape_htmltag($search_project).
'"></td>';
1128if (!empty($arrayfields[
's.nom'][
'checked'])) {
1129 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).
'"'.($socid > 0 ?
" disabled" :
"").
'></td>';
1132if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1133 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_company_alias" value="'.dol_escape_htmltag($search_company_alias).
'"></td>';
1136if (!empty($arrayfields[
's.town'][
'checked'])) {
1137 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).
'"></td>';
1140if (!empty($arrayfields[
's.zip'][
'checked'])) {
1141 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'"></td>';
1144if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1145 print
'<td class="liste_titre">';
1146 print
'<input class="flat maxwidth50imp" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1150if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1151 print
'<td class="liste_titre center">';
1152 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1156if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1157 print
'<td class="liste_titre maxwidthonsmartphone center">';
1158 print $form->selectarray(
"search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0,
'', 0, 0, 0, (!
getDolGlobalString(
'SOCIETE_SORT_ON_TYPEENT') ?
'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT),
'', 1);
1162if (!empty($arrayfields[
'f.fk_cond_reglement'][
'checked'])) {
1163 print
'<td class="liste_titre left">';
1164 print $form->getSelectConditionsPaiements($search_paymentcond,
'search_paymentcond', -1, 1, 1,
'maxwidth100');
1168if (!empty($arrayfields[
'f.fk_mode_reglement'][
'checked'])) {
1169 print
'<td class="liste_titre">';
1170 print $form->select_types_paiements($search_paymentmode,
'search_paymentmode',
'', 0, 1, 1, 20, 1,
'maxwidth100', 1);
1173if (!empty($arrayfields[
'f.total_ht'][
'checked'])) {
1175 print
'<td class="liste_titre right">';
1176 print
'<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).
'">';
1179if (!empty($arrayfields[
'f.total_vat'][
'checked'])) {
1181 print
'<td class="liste_titre right">';
1182 print
'<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).
'">';
1185if (!empty($arrayfields[
'f.total_localtax1'][
'checked'])) {
1187 print
'<td class="liste_titre right">';
1188 print
'<input class="flat" type="text" size="5" name="search_montant_localtax1" value="'.dol_escape_htmltag($search_montant_localtax1).
'">';
1191if (!empty($arrayfields[
'f.total_localtax2'][
'checked'])) {
1193 print
'<td class="liste_titre right">';
1194 print
'<input class="flat" type="text" size="5" name="search_montant_localtax2" value="'.dol_escape_htmltag($search_montant_localtax2).
'">';
1197if (!empty($arrayfields[
'f.total_ttc'][
'checked'])) {
1199 print
'<td class="liste_titre right">';
1200 print
'<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).
'">';
1203if (!empty($arrayfields[
'f.nb_docs'][
'checked'])) {
1205 print
'<td class="liste_titre" align="center">';
1208if (!empty($arrayfields[
'u.login'][
'checked'])) {
1210 print
'<td class="liste_titre" align="center">';
1211 print
'<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1214if (!empty($arrayfields[
'dynamount_payed'][
'checked'])) {
1215 print
'<td class="liste_titre right">';
1218if (!empty($arrayfields[
'rtp'][
'checked'])) {
1219 print
'<td class="liste_titre">';
1222if (!empty($arrayfields[
'f.multicurrency_code'][
'checked'])) {
1224 print
'<td class="liste_titre">';
1225 print $form->selectMultiCurrency($search_multicurrency_code,
'search_multicurrency_code', 1);
1228if (!empty($arrayfields[
'f.multicurrency_tx'][
'checked'])) {
1230 print
'<td class="liste_titre">';
1231 print
'<input class="flat" type="text" size="4" name="search_multicurrency_tx" value="'.dol_escape_htmltag($search_multicurrency_tx).
'">';
1234if (!empty($arrayfields[
'f.multicurrency_total_ht'][
'checked'])) {
1236 print
'<td class="liste_titre right">';
1237 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ht" value="'.dol_escape_htmltag($search_multicurrency_montant_ht).
'">';
1240if (!empty($arrayfields[
'f.multicurrency_total_vat'][
'checked'])) {
1242 print
'<td class="liste_titre right">';
1243 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_vat" value="'.dol_escape_htmltag($search_multicurrency_montant_vat).
'">';
1246if (!empty($arrayfields[
'f.multicurrency_total_ttc'][
'checked'])) {
1248 print
'<td class="liste_titre right">';
1249 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ttc" value="'.dol_escape_htmltag($search_multicurrency_montant_ttc).
'">';
1252if (!empty($arrayfields[
'multicurrency_dynamount_payed'][
'checked'])) {
1253 print
'<td class="liste_titre">';
1256if (!empty($arrayfields[
'multicurrency_rtp'][
'checked'])) {
1257 print
'<td class="liste_titre right">';
1261include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1264$parameters = array(
'arrayfields'=>$arrayfields);
1265$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1266print $hookmanager->resPrint;
1268if (!empty($arrayfields[
'f.datec'][
'checked'])) {
1269 print
'<td class="liste_titre">';
1273if (!empty($arrayfields[
'f.tms'][
'checked'])) {
1274 print
'<td class="liste_titre">';
1278if (!empty($arrayfields[
'f.fk_statut'][
'checked'])) {
1279 print
'<td class="liste_titre center parentonrightofpage">';
1280 $liststatus = array(
'0'=>$langs->trans(
"Draft"),
'1'=>$langs->trans(
"Unpaid"),
'2'=>$langs->trans(
"Paid"));
1281 print $form->selectarray(
'search_status', $liststatus, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'center search_status width100 onrightofpage', 1);
1286 print
'<td class="liste_titre center maxwidthsearch">';
1287 $searchpicto = $form->showFilterButtons();
1294$totalarray = array();
1295$totalarray[
'nbfield'] = 0;
1299print
'<tr class="liste_titre">';
1302 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1303 $totalarray[
'nbfield']++;
1305if (!empty($arrayfields[
'f.ref'][
'checked'])) {
1306 print_liste_field_titre($arrayfields[
'f.ref'][
'label'], $_SERVER[
'PHP_SELF'],
'f.ref,f.rowid',
'', $param,
'', $sortfield, $sortorder);
1307 $totalarray[
'nbfield']++;
1309if (!empty($arrayfields[
'f.ref_supplier'][
'checked'])) {
1310 print_liste_field_titre($arrayfields[
'f.ref_supplier'][
'label'], $_SERVER[
"PHP_SELF"],
'f.ref_supplier',
'', $param,
'', $sortfield, $sortorder);
1311 $totalarray[
'nbfield']++;
1313if (!empty($arrayfields[
'f.type'][
'checked'])) {
1314 print_liste_field_titre($arrayfields[
'f.type'][
'label'], $_SERVER[
"PHP_SELF"],
'f.type',
'', $param,
'', $sortfield, $sortorder);
1315 $totalarray[
'nbfield']++;
1317if (!empty($arrayfields[
'f.subtype'][
'checked'])) {
1318 print_liste_field_titre($arrayfields[
'f.subtype'][
'label'], $_SERVER[
"PHP_SELF"],
'f.subtype',
'', $param,
'', $sortfield, $sortorder);
1320if (!empty($arrayfields[
'f.label'][
'checked'])) {
1321 print_liste_field_titre($arrayfields[
'f.label'][
'label'], $_SERVER[
'PHP_SELF'],
"f.libelle,f.rowid",
'', $param,
'', $sortfield, $sortorder);
1322 $totalarray[
'nbfield']++;
1324if (!empty($arrayfields[
'f.datef'][
'checked'])) {
1325 print_liste_field_titre($arrayfields[
'f.datef'][
'label'], $_SERVER[
'PHP_SELF'],
'f.datef,f.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1326 $totalarray[
'nbfield']++;
1328if (!empty($arrayfields[
'f.date_lim_reglement'][
'checked'])) {
1329 print_liste_field_titre($arrayfields[
'f.date_lim_reglement'][
'label'], $_SERVER[
'PHP_SELF'],
"f.date_lim_reglement",
'', $param,
'', $sortfield, $sortorder,
'center ');
1330 $totalarray[
'nbfield']++;
1332if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1333 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
'PHP_SELF'],
"p.ref",
'', $param,
'', $sortfield, $sortorder);
1334 $totalarray[
'nbfield']++;
1336if (!empty($arrayfields[
's.nom'][
'checked'])) {
1337 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
'PHP_SELF'],
's.nom',
'', $param,
'', $sortfield, $sortorder);
1338 $totalarray[
'nbfield']++;
1340if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1341 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
'PHP_SELF'],
's.name_alias',
'', $param,
'', $sortfield, $sortorder);
1342 $totalarray[
'nbfield']++;
1344if (!empty($arrayfields[
's.town'][
'checked'])) {
1345 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1346 $totalarray[
'nbfield']++;
1348if (!empty($arrayfields[
's.zip'][
'checked'])) {
1349 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder,
'center ');
1350 $totalarray[
'nbfield']++;
1352if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1353 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.name_alias",
"", $param,
'', $sortfield, $sortorder);
1354 $totalarray[
'nbfield']++;
1356if (!empty($arrayfields[
'state.name_alias'][
'checked'])) {
1357 print_liste_field_titre($arrayfields[
'state.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1358 $totalarray[
'nbfield']++;
1360if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1361 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1362 $totalarray[
'nbfield']++;
1364if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1365 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1366 $totalarray[
'nbfield']++;
1368if (!empty($arrayfields[
'f.fk_cond_reglement'][
'checked'])) {
1369 print_liste_field_titre($arrayfields[
'f.fk_cond_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"f.fk_cond_reglement",
"", $param,
"", $sortfield, $sortorder);
1370 $totalarray[
'nbfield']++;
1372if (!empty($arrayfields[
'f.fk_mode_reglement'][
'checked'])) {
1373 print_liste_field_titre($arrayfields[
'f.fk_mode_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"f.fk_mode_reglement",
"", $param,
"", $sortfield, $sortorder);
1374 $totalarray[
'nbfield']++;
1376if (!empty($arrayfields[
'f.total_ht'][
'checked'])) {
1377 print_liste_field_titre($arrayfields[
'f.total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'f.total_ht',
'', $param,
'', $sortfield, $sortorder,
'right ');
1378 $totalarray[
'nbfield']++;
1380if (!empty($arrayfields[
'f.total_vat'][
'checked'])) {
1381 print_liste_field_titre($arrayfields[
'f.total_vat'][
'label'], $_SERVER[
'PHP_SELF'],
'f.total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1382 $totalarray[
'nbfield']++;
1384if (!empty($arrayfields[
'f.total_localtax1'][
'checked'])) {
1385 print_liste_field_titre($arrayfields[
'f.total_localtax1'][
'label'], $_SERVER[
'PHP_SELF'],
'f.localtax1',
'', $param,
'', $sortfield, $sortorder,
'right ');
1386 $totalarray[
'nbfield']++;
1388if (!empty($arrayfields[
'f.total_localtax2'][
'checked'])) {
1389 print_liste_field_titre($arrayfields[
'f.total_localtax2'][
'label'], $_SERVER[
'PHP_SELF'],
'f.localtax2',
'', $param,
'', $sortfield, $sortorder,
'right ');
1390 $totalarray[
'nbfield']++;
1392if (!empty($arrayfields[
'f.total_ttc'][
'checked'])) {
1393 print_liste_field_titre($arrayfields[
'f.total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'f.total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1394 $totalarray[
'nbfield']++;
1396if (!empty($arrayfields[
'f.nb_docs'][
'checked'])) {
1397 print_liste_field_titre($arrayfields[
'f.nb_docs'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1398 $totalarray[
'nbfield']++;
1400if (!empty($arrayfields[
'u.login'][
'checked'])) {
1401 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'', $sortfield, $sortorder);
1402 $totalarray[
'nbfield']++;
1404if (!empty($arrayfields[
'dynamount_payed'][
'checked'])) {
1405 print_liste_field_titre($arrayfields[
'dynamount_payed'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1406 $totalarray[
'nbfield']++;
1408if (!empty($arrayfields[
'rtp'][
'checked'])) {
1409 print_liste_field_titre($arrayfields[
'rtp'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder);
1410 $totalarray[
'nbfield']++;
1412if (!empty($arrayfields[
'f.multicurrency_code'][
'checked'])) {
1413 print_liste_field_titre($arrayfields[
'f.multicurrency_code'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_code',
'', $param,
'', $sortfield, $sortorder);
1414 $totalarray[
'nbfield']++;
1416if (!empty($arrayfields[
'f.multicurrency_tx'][
'checked'])) {
1417 print_liste_field_titre($arrayfields[
'f.multicurrency_tx'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_tx',
'', $param,
'', $sortfield, $sortorder);
1418 $totalarray[
'nbfield']++;
1420if (!empty($arrayfields[
'f.multicurrency_total_ht'][
'checked'])) {
1421 print_liste_field_titre($arrayfields[
'f.multicurrency_total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_total_ht',
'', $param,
'"', $sortfield, $sortorder,
'right ');
1422 $totalarray[
'nbfield']++;
1424if (!empty($arrayfields[
'f.multicurrency_total_vat'][
'checked'])) {
1425 print_liste_field_titre($arrayfields[
'f.multicurrency_total_vat'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1426 $totalarray[
'nbfield']++;
1428if (!empty($arrayfields[
'f.multicurrency_total_ttc'][
'checked'])) {
1429 print_liste_field_titre($arrayfields[
'f.multicurrency_total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1430 $totalarray[
'nbfield']++;
1432if (!empty($arrayfields[
'multicurrency_dynamount_payed'][
'checked'])) {
1433 print_liste_field_titre($arrayfields[
'multicurrency_dynamount_payed'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1434 $totalarray[
'nbfield']++;
1436if (!empty($arrayfields[
'multicurrency_rtp'][
'checked'])) {
1437 print_liste_field_titre($arrayfields[
'multicurrency_rtp'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1438 $totalarray[
'nbfield']++;
1441include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1443$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
1444$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1445print $hookmanager->resPrint;
1446if (!empty($arrayfields[
'f.datec'][
'checked'])) {
1447 print_liste_field_titre($arrayfields[
'f.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"f.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1448 $totalarray[
'nbfield']++;
1450if (!empty($arrayfields[
'f.tms'][
'checked'])) {
1451 print_liste_field_titre($arrayfields[
'f.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"f.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1452 $totalarray[
'nbfield']++;
1454if (!empty($arrayfields[
'f.fk_statut'][
'checked'])) {
1455 print_liste_field_titre($arrayfields[
'f.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"fk_statut,paye,type",
"", $param,
'', $sortfield, $sortorder,
'center ');
1456 $totalarray[
'nbfield']++;
1460 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1461 $totalarray[
'nbfield']++;
1467$projectstatic =
new Project($db);
1468$userstatic =
new User($db);
1474$savnbfield = $totalarray[
'nbfield'];
1475$totalarray = array();
1476$totalarray[
'nbfield'] = 0;
1477$totalarray[
'val'] = array();
1478$totalarray[
'val'][
'f.total_ht']=0;
1479$totalarray[
'val'][
'f.total_vat']=0;
1480$totalarray[
'val'][
'f.total_localtax1']=0;
1481$totalarray[
'val'][
'f.total_localtax1']=0;
1482$totalarray[
'val'][
'f.total_ttc']=0;
1483$totalarray[
'val'][
'totalam']=0;
1484$totalarray[
'val'][
'rtp']=0;
1485$imaxinloop = ($limit ? min($num, $limit) : $num);
1486while ($i < $imaxinloop) {
1487 $obj = $db->fetch_object($resql);
1492 $datelimit = $db->jdate($obj->datelimite);
1494 $userstatic->id = $obj->fk_user_author;
1495 $userstatic->login = $obj->login;
1496 $userstatic->lastname = $obj->lastname;
1497 $userstatic->firstname = $obj->firstname;
1498 $userstatic->email = $obj->user_email;
1499 $userstatic->statut = $obj->user_statut;
1500 $userstatic->status = $obj->user_statut;
1501 $userstatic->entity = $obj->entity;
1502 $userstatic->photo = $obj->photo;
1503 $userstatic->office_phone = $obj->office_phone;
1504 $userstatic->office_fax = $obj->office_fax;
1505 $userstatic->user_mobile = $obj->user_mobile;
1506 $userstatic->job = $obj->job;
1507 $userstatic->gender = $obj->gender;
1508 $facturestatic->id = $obj->facid;
1509 $facturestatic->ref = $obj->ref;
1510 $facturestatic->type = $obj->type;
1511 $facturestatic->subtype = $obj->subtype;
1512 $facturestatic->total_ht = $obj->total_ht;
1513 $facturestatic->total_tva = $obj->total_vat;
1514 $facturestatic->total_ttc = $obj->total_ttc;
1515 $facturestatic->close_code = $obj->close_code;
1516 $facturestatic->ref_supplier = $obj->ref_supplier;
1517 $facturestatic->date_echeance = $db->jdate($obj->datelimite);
1518 $facturestatic->statut = $obj->fk_statut;
1519 $facturestatic->status = $obj->fk_statut;
1520 $facturestatic->note_public = $obj->note_public;
1521 $facturestatic->note_private = $obj->note_private;
1522 $facturestatic->multicurrency_code = $obj->multicurrency_code;
1523 $facturestatic->multicurrency_tx = $obj->multicurrency_tx;
1524 $facturestatic->multicurrency_total_ht = $obj->multicurrency_total_ht;
1525 $facturestatic->multicurrency_total_tva = $obj->multicurrency_total_vat;
1526 $facturestatic->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
1527 $thirdparty->id = $obj->socid;
1528 $thirdparty->name = $obj->name;
1529 $thirdparty->name_alias = $obj->alias;
1530 $thirdparty->client = $obj->client;
1531 $thirdparty->fournisseur = $obj->fournisseur;
1532 $thirdparty->code_client = $obj->code_client;
1533 $thirdparty->code_compta_client = $obj->code_compta_client;
1534 $thirdparty->code_fournisseur = $obj->code_fournisseur;
1535 $thirdparty->code_compta_fournisseur = $obj->code_compta_fournisseur;
1536 $thirdparty->email = $obj->email;
1537 $thirdparty->country_code = $obj->country_code;
1539 $paiement = $facturestatic->getSommePaiement();
1540 $totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
1541 $totaldeposits = $facturestatic->getSumDepositsUsed();
1542 $totalpay = $paiement + $totalcreditnotes + $totaldeposits;
1543 $remaintopay = $obj->total_ttc - $totalpay;
1545 $multicurrency_paiement = $facturestatic->getSommePaiement(1);
1546 $multicurrency_totalcreditnotes = $facturestatic->getSumCreditNotesUsed(1);
1547 $multicurrency_totaldeposits = $facturestatic->getSumDepositsUsed(1);
1549 $totalpay = $paiement + $totalcreditnotes + $totaldeposits;
1550 $remaintopay =
price2num($facturestatic->total_ttc - $totalpay);
1552 $multicurrency_totalpay = $multicurrency_paiement + $multicurrency_totalcreditnotes + $multicurrency_totaldeposits;
1553 $multicurrency_remaintopay =
price2num($facturestatic->multicurrency_total_ttc - $multicurrency_totalpay);
1557 $multicurrency_remaintopay = 0;
1560 $remaincreditnote = $discount->getAvailableDiscounts($thirdparty,
'',
'rc.fk_facture_source='.$facturestatic->id);
1561 $remaintopay = -$remaincreditnote;
1562 $totalpay =
price2num($facturestatic->total_ttc - $remaintopay);
1563 $multicurrency_remaincreditnote = $discount->getAvailableDiscounts($thirdparty,
'',
'rc.fk_facture_source='.$facturestatic->id, 0, 0, 1);
1564 $multicurrency_remaintopay = -$multicurrency_remaincreditnote;
1565 $multicurrency_totalpay =
price2num($facturestatic->multicurrency_total_ttc - $multicurrency_remaintopay);
1568 $facturestatic->alreadypaid = ($paiement ? $paiement : 0);
1570 $facturestatic->paye = $obj->paye;
1571 $facturestatic->socid = $thirdparty->getNomUrl(1,
'supplier', 3);
1573 $facturestatic->date = $db->jdate($obj->datef);
1575 $object = $facturestatic;
1579 if ($facturestatic->isCreditNoteUsed()) {
1580 $remaintopay = -$facturestatic->getSumFromThisCreditNotesNotUsed();
1584 if ($mode ==
'kanban') {
1586 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1587 print
'<div class="box-flex-container kanban">';
1590 if ($massactionbutton || $massaction) {
1592 if (in_array($object->id, $arrayofselected)) {
1597 $arraydata = array(
'alreadypaid' => $paiement,
'thirdparty' => $thirdparty->getNomUrl(1,
'', 12),
'selected' => in_array($object->id, $arrayofselected));
1598 print $facturestatic->getKanbanView(
'', $arraydata);
1599 if ($i == ($imaxinloop - 1)) {
1606 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
1610 print
'<td class="nowrap center">';
1611 if ($massactionbutton || $massaction) {
1613 if (in_array($obj->facid, $arrayofselected)) {
1616 print
'<input id="cb'.$obj->facid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->facid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1620 $totalarray[
'nbfield']++;
1623 if (!empty($arrayfields[
'f.ref'][
'checked'])) {
1624 print
'<td class="nowraponall">';
1626 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1628 print
'<td class="nobordernopadding nowraponall">';
1629 print $facturestatic->getNomUrl(1,
'', 0, 0,
'', 0, -1, 1);
1632 $filedir = $conf->fournisseur->facture->dir_output.
'/'.
get_exdir($obj->facid, 2, 0, 0, $facturestatic,
'invoice_supplier').dol_sanitizeFileName($obj->ref);
1633 $subdir =
get_exdir($obj->facid, 2, 0, 0, $facturestatic,
'invoice_supplier').dol_sanitizeFileName($obj->ref);
1634 print $formfile->getDocumentsLink(
'facture_fournisseur', $subdir, $filedir);
1635 print
'</td></tr></table>';
1639 $totalarray[
'nbfield']++;
1644 if (!empty($arrayfields[
'f.ref_supplier'][
'checked'])) {
1645 print
'<td class="nowrap tdoverflowmax150" title="'.dol_escape_htmltag($obj->ref_supplier).
'">';
1646 print $obj->ref_supplier;
1649 $totalarray[
'nbfield']++;
1654 if (!empty($arrayfields[
'f.type'][
'checked'])) {
1655 print
'<td class="nowrap">';
1656 print $facturestatic->getLibType();
1659 $totalarray[
'nbfield']++;
1664 if (!empty($arrayfields[
'f.subtype'][
'checked'])) {
1666 if ($facturestatic->subtype > 0) {
1667 $labeltoshow = $facturestatic->getSubtypeLabel(
'facture_fourn');
1669 print
'<td class="nowraponall tdoverflowmax300" title="'.$labeltoshow.
'">';
1673 $totalarray[
'nbfield']++;
1678 if (!empty($arrayfields[
'f.label'][
'checked'])) {
1679 print
'<td class="nowrap">';
1683 $totalarray[
'nbfield']++;
1688 if (!empty($arrayfields[
'f.datef'][
'checked'])) {
1689 print
'<td class="center nowrap">';
1693 $totalarray[
'nbfield']++;
1698 if (!empty($arrayfields[
'f.date_lim_reglement'][
'checked'])) {
1699 print
'<td class="center nowraponall">'.dol_print_date($datelimit,
'day');
1700 if ($facturestatic->hasDelay()) {
1701 print
img_warning($langs->trans(
'Alert').
' - '.$langs->trans(
'Late'));
1705 $totalarray[
'nbfield']++;
1710 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1711 print
'<td class="nowrap">';
1712 if ($obj->project_id > 0) {
1713 $projectstatic->id = $obj->project_id;
1714 $projectstatic->ref = $obj->project_ref;
1715 $projectstatic->title = $obj->project_label;
1716 print $projectstatic->getNomUrl(1);
1720 $totalarray[
'nbfield']++;
1725 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1726 print
'<td class="tdoverflowmax150">';
1727 print $thirdparty->getNomUrl(1,
'supplier', 0, 0, -1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
1730 $totalarray[
'nbfield']++;
1734 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1735 print
'<td class="tdoverflowmax150">';
1739 $totalarray[
'nbfield']++;
1743 if (!empty($arrayfields[
's.town'][
'checked'])) {
1744 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->town).
'">';
1748 $totalarray[
'nbfield']++;
1752 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1753 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->zip).
'">';
1757 $totalarray[
'nbfield']++;
1761 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1762 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->state_name).
'">';
1766 $totalarray[
'nbfield']++;
1770 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1771 print
'<td class="center">';
1772 $tmparray =
getCountry($obj->fk_pays,
'all');
1773 print $tmparray[
'label'];
1776 $totalarray[
'nbfield']++;
1780 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1781 print
'<td class="center">';
1782 if (empty($typenArray)) {
1783 $typenArray = $formcompany->typent_array(1);
1785 print $typenArray[$obj->typent_code];
1788 $totalarray[
'nbfield']++;
1793 if (!empty($arrayfields[
'f.fk_cond_reglement'][
'checked'])) {
1794 $s = $form->form_conditions_reglement($_SERVER[
'PHP_SELF'], $obj->fk_cond_reglement,
'none', 1,
'', -1, -1, 1);
1795 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).
'">';
1799 $totalarray[
'nbfield']++;
1803 if (!empty($arrayfields[
'f.fk_mode_reglement'][
'checked'])) {
1804 $s = $form->form_modes_reglement($_SERVER[
'PHP_SELF'], $obj->fk_mode_reglement,
'none',
'', -1, 0,
'', 1);
1805 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).
'">';
1809 $totalarray[
'nbfield']++;
1814 if (!empty($arrayfields[
'f.total_ht'][
'checked'])) {
1815 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_ht).
"</span></td>\n";
1817 $totalarray[
'nbfield']++;
1818 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_ht';
1820 $totalarray[
'val'][
'f.total_ht'] += $obj->total_ht;
1823 if (!empty($arrayfields[
'f.total_vat'][
'checked'])) {
1824 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_vat).
"</span></td>\n";
1826 $totalarray[
'nbfield']++;
1827 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_vat';
1829 $totalarray[
'val'][
'f.total_vat'] += $obj->total_vat;
1832 if (!empty($arrayfields[
'f.total_localtax1'][
'checked'])) {
1833 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_localtax1).
"</span></td>\n";
1835 $totalarray[
'nbfield']++;
1836 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_localtax1';
1838 $totalarray[
'val'][
'f.total_localtax1'] += $obj->total_localtax1;
1841 if (!empty($arrayfields[
'f.total_localtax2'][
'checked'])) {
1842 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_localtax2).
"</span></td>\n";
1844 $totalarray[
'nbfield']++;
1845 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_localtax2';
1847 $totalarray[
'val'][
'f.total_localtax2'] += $obj->total_localtax2;
1850 if (!empty($arrayfields[
'f.total_ttc'][
'checked'])) {
1851 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_ttc).
"</span></td>\n";
1853 $totalarray[
'nbfield']++;
1854 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_ttc';
1856 $totalarray[
'val'][
'f.total_ttc'] += $obj->total_ttc;
1860 if (!empty($arrayfields[
'f.nb_docs'][
'checked'])) {
1861 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
1862 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
1863 $upload_dir = $conf->fournisseur->facture->dir_output.
'/'.
get_exdir($facturestatic->id, 2, 0, 0, $facturestatic,
'invoice_supplier').$facturestatic->ref;
1864 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
1865 $nbLinks =
Link::count($db, $facturestatic->element, $facturestatic->id);
1866 $nbTotal = $nbFiles + $nbLinks;
1867 echo
'<td class="center">'.(empty($nbTotal) ?
'' : $nbTotal).
'</td>';
1869 $totalarray[
'nbfield']++;
1874 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1875 print
'<td class="tdoverflowmax125">';
1876 if ($userstatic->id) {
1877 print $userstatic->getNomUrl(-1);
1883 $totalarray[
'nbfield']++;
1887 if (!empty($arrayfields[
'dynamount_payed'][
'checked'])) {
1888 print
'<td class="right nowrap"><span class="amount">'.(!empty($totalpay) ?
price($totalpay, 0, $langs) :
'').
'</span></td>';
1890 $totalarray[
'nbfield']++;
1891 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalam';
1893 if (empty($totalarray[
'val'][
'totalam'])) {
1894 $totalarray[
'val'][
'totalam'] = 0;
1896 $totalarray[
'val'][
'totalam'] += $totalpay;
1899 if (!empty($arrayfields[
'rtp'][
'checked'])) {
1900 print
'<td class="right nowrap">'.(!empty($remaintopay) ?
price($remaintopay, 0, $langs) :
' ').
'</td>';
1902 $totalarray[
'nbfield']++;
1903 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'rtp';
1905 $totalarray[
'val'][
'rtp'] += $remaintopay;
1909 if (!empty($arrayfields[
'f.multicurrency_code'][
'checked'])) {
1910 print
'<td class="nowrap">'.$obj->multicurrency_code.
' - '.$langs->trans(
'Currency'.$obj->multicurrency_code).
"</td>\n";
1912 $totalarray[
'nbfield']++;
1917 if (!empty($arrayfields[
'f.multicurrency_tx'][
'checked'])) {
1918 print
'<td class="nowrap">';
1919 $form->form_multicurrency_rate($_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid, $obj->multicurrency_tx,
'none', $obj->multicurrency_code);
1922 $totalarray[
'nbfield']++;
1926 if (!empty($arrayfields[
'f.multicurrency_total_ht'][
'checked'])) {
1927 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht).
"</span></td>\n";
1929 $totalarray[
'nbfield']++;
1933 if (!empty($arrayfields[
'f.multicurrency_total_vat'][
'checked'])) {
1934 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_vat).
"</span></td>\n";
1936 $totalarray[
'nbfield']++;
1940 if (!empty($arrayfields[
'f.multicurrency_total_ttc'][
'checked'])) {
1941 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc).
"</span></td>\n";
1943 $totalarray[
'nbfield']++;
1946 if (!empty($arrayfields[
'multicurrency_dynamount_payed'][
'checked'])) {
1947 print
'<td class="right nowrap"><span class="amount">'.(!empty($multicurrency_totalpay) ?
price($multicurrency_totalpay, 0, $langs) :
'').
'</span></td>';
1949 $totalarray[
'nbfield']++;
1954 if (!empty($arrayfields[
'multicurrency_rtp'][
'checked'])) {
1955 print
'<td class="right nowrap"><span class="amount">';
1956 print(!empty($multicurrency_remaintopay) ?
price($multicurrency_remaintopay, 0, $langs) :
'');
1957 print
'</span></td>';
1959 $totalarray[
'nbfield']++;
1965 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1967 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1968 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1969 print $hookmanager->resPrint;
1972 if (!empty($arrayfields[
'f.datec'][
'checked'])) {
1973 print
'<td class="center nowraponll">';
1974 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
1977 $totalarray[
'nbfield']++;
1981 if (!empty($arrayfields[
'f.tms'][
'checked'])) {
1982 print
'<td class="center nowraponall">';
1983 print
dol_print_date($db->jdate($obj->date_update),
'dayhour',
'tzuser');
1986 $totalarray[
'nbfield']++;
1990 if (!empty($arrayfields[
'f.fk_statut'][
'checked'])) {
1991 print
'<td class="center nowrap">';
1992 print $facturestatic->getLibStatut(5, $paiement);
1995 $totalarray[
'nbfield']++;
2001 print
'<td class="nowrap center">';
2002 if ($massactionbutton || $massaction) {
2004 if (in_array($obj->facid, $arrayofselected)) {
2007 print
'<input id="cb'.$obj->facid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->facid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2011 $totalarray[
'nbfield']++;
2022include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2027 foreach ($arrayfields as $key => $val) {
2028 if (!empty($val[
'checked'])) {
2032 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2037$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
2038$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2039print $hookmanager->resPrint;
2041print
'</table>'.
"\n";
2044print
'</form>'.
"\n";
2046if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
2047 $hidegeneratedfilelistifempty = 1;
2048 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2049 $hidegeneratedfilelistifempty = 0;
2052 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
2056 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2057 $urlsource .= str_replace(
'&',
'&', $param);
2059 $filedir = $diroutputmassaction;
2060 $genallowed = $permissiontoread;
2061 $delallowed = $permissiontoadd;
2064 print $formfile->showdocuments(
'massfilesarea_supplier_invoice',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage bank accounts.
Class to manage absolute discounts.
Class to manage suppliers invoices.
const TYPE_DEPOSIT
Deposit invoice.
const TYPE_CREDIT_NOTE
Credit note invoice.
const TYPE_REPLACEMENT
Replacement invoice.
const TYPE_STANDARD
Standard invoice.
const STATUS_CLOSED
Classified paid.
Class to manage suppliers.
static count($dbs, $objecttype, $objectid)
Return nb of links.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
getCountry($searchkey, $withcode='', $dbtouse=0, $outputlangs='', $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
GETPOSTDATE($prefix, $hourTime='', $gm='auto')
Helper function that combines values of a dolibarr DatePicker (such as Form\selectDate) for year,...
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_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
buildParamDate($prefix, $timestamp=null, $hourTime='', $gm='auto')
Helper function that combines values of a dolibarr DatePicker (such as Form\selectDate) for year,...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.