41require
'../../main.inc.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
50require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/core/class/discount.class.php';
54$langs->loadLangs(array(
'products',
'bills',
'companies',
'projects'));
56$action =
GETPOST(
'action',
'aZ09');
57$massaction =
GETPOST(
'massaction',
'alpha');
59$confirm =
GETPOST(
'confirm',
'alpha');
60$toselect =
GETPOST(
'toselect',
'array');
61$optioncss =
GETPOST(
'optioncss',
'alpha');
62$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'supplierinvoicelist';
65$search_all = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
66$search_label =
GETPOST(
"search_label",
"alpha");
67$search_amount_no_tax =
GETPOST(
"search_amount_no_tax",
"alpha");
68$search_amount_all_tax =
GETPOST(
"search_amount_all_tax",
"alpha");
70$search_refsupplier =
GETPOST(
'search_refsupplier',
'alpha');
71$search_type =
GETPOST(
'search_type',
'intcomma');
72$search_subtype =
GETPOST(
'search_subtype',
'intcomma');
73$search_project =
GETPOST(
'search_project',
'alpha');
74$search_company =
GETPOST(
'search_company',
'alpha');
75$search_company_alias =
GETPOST(
'search_company_alias',
'alpha');
76$search_montant_ht =
GETPOST(
'search_montant_ht',
'alpha');
77$search_montant_vat =
GETPOST(
'search_montant_vat',
'alpha');
78$search_montant_localtax1 =
GETPOST(
'search_montant_localtax1',
'alpha');
79$search_montant_localtax2 =
GETPOST(
'search_montant_localtax2',
'alpha');
80$search_montant_ttc =
GETPOST(
'search_montant_ttc',
'alpha');
81$search_login =
GETPOST(
'search_login',
'alpha');
82$search_multicurrency_code =
GETPOST(
'search_multicurrency_code',
'alpha');
83$search_multicurrency_tx =
GETPOST(
'search_multicurrency_tx',
'alpha');
84$search_multicurrency_montant_ht =
GETPOST(
'search_multicurrency_montant_ht',
'alpha');
85$search_multicurrency_montant_vat =
GETPOST(
'search_multicurrency_montant_vat',
'alpha');
86$search_multicurrency_montant_ttc =
GETPOST(
'search_multicurrency_montant_ttc',
'alpha');
87$search_status =
GETPOST(
'search_status',
'intcomma');
88$search_paymentmode =
GETPOST(
'search_paymentmode',
'intcomma');
89$search_paymentcond =
GETPOST(
'search_paymentcond',
'intcomma');
90$search_town =
GETPOST(
'search_town',
'alpha');
91$search_zip =
GETPOST(
'search_zip',
'alpha');
92$search_state =
GETPOST(
"search_state");
93$search_country =
GETPOST(
"search_country",
'aZ09');
94$search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'intcomma');
95$search_user =
GETPOST(
'search_user',
'intcomma');
96$search_sale =
GETPOST(
'search_sale',
'intcomma');
97$search_date_start =
GETPOSTDATE(
'search_date_start',
'',
'tzserver');
98$search_date_end =
GETPOSTDATE(
'search_date_end',
'23:59:59',
'tzserver');
99$search_datelimit_startday =
GETPOSTINT(
'search_datelimit_startday');
100$search_datelimit_startmonth =
GETPOSTINT(
'search_datelimit_startmonth');
101$search_datelimit_startyear =
GETPOSTINT(
'search_datelimit_startyear');
102$search_datelimit_endday =
GETPOSTINT(
'search_datelimit_endday');
103$search_datelimit_endmonth =
GETPOSTINT(
'search_datelimit_endmonth');
104$search_datelimit_endyear =
GETPOSTINT(
'search_datelimit_endyear');
105$search_datelimit_start =
dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear);
106$search_datelimit_end =
dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear);
107$search_categ_sup =
GETPOST(
"search_categ_sup",
'intcomma');
108$search_product_category =
GETPOST(
'search_product_category',
'intcomma');
110$option =
GETPOST(
'search_option');
111if ($option ==
'late') {
112 $search_status =
'1';
114$filter =
GETPOST(
'filtre',
'alpha');
118$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
119$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
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;
138if ($user->socid > 0) {
140 $socid = $user->socid;
143$diroutputmassaction = $conf->fournisseur->facture->dir_output.
'/temp/massgeneration/'.$user->id;
149$hookmanager->initHooks(array(
'supplierinvoicelist'));
153$extrafields->fetch_name_optionals_label(
$object->table_element);
155$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
158$fieldstosearchall = array(
160 'f.ref_supplier' =>
'RefSupplier',
161 'f.note_public' =>
'NotePublic',
162 's.nom' =>
"ThirdParty",
163 's.code_fournisseur' =>
"SupplierCodeShort",
164 'pd.description' =>
'Description',
166if (empty($user->socid)) {
167 $fieldstosearchall[
"f.note_private"] =
"NotePrivate";
170$checkedtypetiers = 0;
172 'f.ref' => array(
'label' =>
"Ref",
'checked' => 1,
'position' => 5),
173 'f.ref_supplier' => array(
'label' =>
"RefSupplier",
'checked' => 1,
'position' => 7),
174 'f.type' => array(
'label' =>
"Type",
'checked' => 0,
'position' => 15),
175 'f.subtype' => array(
'label' =>
"InvoiceSubtype",
'checked' => 0,
'position' => 17),
176 'f.label' => array(
'label' =>
"Label",
'checked' => 0,
'position' => 20),
177 'f.datef' => array(
'label' =>
"DateInvoice",
'checked' => 1,
'position' => 25),
178 'f.date_lim_reglement' => array(
'label' =>
"DateDue",
'checked' => 1,
'position' => 27),
179 'p.ref' => array(
'label' =>
"ProjectRef",
'checked' => 0,
'position' => 30),
180 's.nom' => array(
'label' =>
"ThirdParty",
'checked' => 1,
'position' => 41),
181 's.name_alias' => array(
'label' =>
"AliasNameShort",
'checked' => 0,
'position' => 42),
182 's.town' => array(
'label' =>
"Town",
'checked' => -1,
'position' => 43),
183 's.zip' => array(
'label' =>
"Zip",
'checked' => -1,
'position' => 44),
184 'state.nom' => array(
'label' =>
"StateShort",
'checked' => 0,
'position' => 45),
185 'country.code_iso' => array(
'label' =>
"Country",
'checked' => 0,
'position' => 46),
186 'typent.code' => array(
'label' =>
"ThirdPartyType",
'checked' => $checkedtypetiers,
'position' => 49),
187 'f.fk_mode_reglement' => array(
'label' =>
"PaymentMode",
'checked' => 1,
'position' => 52),
188 'f.fk_cond_reglement' => array(
'label' =>
"PaymentConditionsShort",
'checked' => 1,
'position' => 50),
189 'f.total_ht' => array(
'label' =>
"AmountHT",
'checked' => 1,
'position' => 105),
190 'f.total_vat' => array(
'label' =>
"AmountVAT",
'checked' => 0,
'position' => 110),
191 'f.total_localtax1' => array(
'label' => $langs->transcountry(
"AmountLT1", $mysoc->country_code),
'checked' => 0,
'enabled' => $mysoc->localtax1_assuj ==
"1",
'position' => 95),
192 'f.total_localtax2' => array(
'label' => $langs->transcountry(
"AmountLT2", $mysoc->country_code),
'checked' => 0,
'enabled' => $mysoc->localtax2_assuj ==
"1",
'position' => 100),
193 'f.total_ttc' => array(
'label' =>
"AmountTTC",
'checked' => 1,
'position' => 115),
194 'dynamount_payed' => array(
'label' =>
"Paid",
'checked' => 0,
'position' => 116),
195 'rtp' => array(
'label' =>
"Rest",
'checked' => 0,
'position' => 117),
196 'f.multicurrency_code' => array(
'label' =>
'Currency',
'checked' => 0,
'position' => 205,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
197 'f.multicurrency_tx' => array(
'label' =>
'CurrencyRate',
'checked' => 0,
'position' => 206,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
198 'f.multicurrency_total_ht' => array(
'label' =>
'MulticurrencyAmountHT',
'position' => 207,
'checked' => 0,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
199 'f.multicurrency_total_vat' => array(
'label' =>
'MulticurrencyAmountVAT',
'position' => 208,
'checked' => 0,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
200 'f.multicurrency_total_ttc' => array(
'label' =>
'MulticurrencyAmountTTC',
'position' => 209,
'checked' => 0,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
201 'multicurrency_dynamount_payed' => array(
'label' =>
'MulticurrencyAlreadyPaid',
'position' => 210,
'checked' => 0,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
202 'multicurrency_rtp' => array(
'label' =>
'MulticurrencyRemainderToPay',
'checked' => 0,
'position' => 211,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
203 'u.login' => array(
'label' =>
"Author",
'checked' => -1,
'position' => 500),
204 'f.datec' => array(
'label' =>
"DateCreation",
'checked' => 0,
'position' => 501),
205 'f.tms' => array(
'label' =>
"DateModificationShort",
'checked' => 0,
'position' => 502),
206 'f.nb_docs' => array(
'label' =>
"Documents",
'checked' => -1,
'position' => 510),
207 'f.fk_statut' => array(
'label' =>
"Status",
'checked' => 1,
'position' => 1000),
210include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
212$subtypearray =
$object->getArrayOfInvoiceSubtypes(0);
213if (empty($subtypearray)) {
214 unset($arrayfields[
'f.subtype']);
219'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
221if (!isModEnabled(
'supplier_invoice')) {
224if ((!$user->hasRight(
"fournisseur",
"facture",
"lire") && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD'))
225 || (!$user->hasRight(
"supplier_invoice",
"lire") &&
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD'))) {
229if (!$user->hasRight(
'societe',
'client',
'voir')) {
230 $search_sale = $user->id;
233$permissiontoread = ($user->hasRight(
"fournisseur",
"facture",
"lire") || $user->hasRight(
"supplier_invoice",
"lire"));
234$permissiontoadd = ($user->hasRight(
"fournisseur",
"facture",
"creer") || $user->hasRight(
"supplier_invoice",
"creer"));
235$permissiontodelete = ($user->hasRight(
"fournisseur",
"facture",
"supprimer") || $user->hasRight(
"supplier_invoice",
"supprimer"));
242if (
GETPOST(
'cancel',
'alpha')) {
246if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
250$parameters = array(
'socid' => $socid,
'arrayfields' => &$arrayfields);
251$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
256if (empty($reshook)) {
258 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
261 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha')) {
265 $search_product_category =
'';
267 $search_refsupplier =
"";
269 $search_subtype =
'';
271 $search_project =
'';
272 $search_company =
"";
273 $search_company_alias =
"";
274 $search_amount_no_tax =
"";
275 $search_amount_all_tax =
"";
276 $search_montant_ht =
'';
277 $search_montant_vat =
'';
278 $search_montant_localtax1 =
'';
279 $search_montant_localtax2 =
'';
280 $search_montant_ttc =
'';
282 $search_multicurrency_code =
'';
283 $search_multicurrency_tx =
'';
284 $search_multicurrency_montant_ht =
'';
285 $search_multicurrency_montant_vat =
'';
286 $search_multicurrency_montant_ttc =
'';
288 $search_paymentmode =
'';
289 $search_paymentcond =
'';
293 $search_country =
'';
294 $search_type_thirdparty =
'';
295 $search_date_start =
'';
296 $search_date_end =
'';
297 $search_datelimit_startday =
'';
298 $search_datelimit_startmonth =
'';
299 $search_datelimit_startyear =
'';
300 $search_datelimit_endday =
'';
301 $search_datelimit_endmonth =
'';
302 $search_datelimit_endyear =
'';
303 $search_datelimit_start =
'';
304 $search_datelimit_end =
'';
306 $search_array_options = array();
307 $search_categ_sup = 0;
314 $objectclass =
'FactureFournisseur';
315 $objectlabel =
'SupplierInvoices';
317 $uploaddir = $conf->fournisseur->facture->dir_output;
319 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
321 if ($massaction ==
'banktransfertrequest') {
322 $langs->load(
"withdrawals");
324 if (!$user->hasRight(
"paymentbybanktransfer",
"create")) {
331 $arrayofselected = is_array($toselect) ? $toselect : array();
332 $listofbills = array();
333 foreach ($arrayofselected as $toselectid) {
335 $result = $objecttmp->fetch($toselectid);
337 $totalpaid = $objecttmp->getSommePaiement();
338 $totalcreditnotes = $objecttmp->getSumCreditNotesUsed();
339 $totaldeposits = $objecttmp->getSumDepositsUsed();
340 $objecttmp->resteapayer =
price2num($objecttmp->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits,
'MT');
343 $parameters = array(
'remaintopay' => $objecttmp->resteapayer);
344 $reshook = $hookmanager->executeHooks(
'finalizeAmountOfInvoice', $parameters, $objecttmp, $action);
347 if (!empty($remaintopay = $hookmanager->resArray[
'remaintopay'])) {
348 $objecttmp->resteapayer = $remaintopay;
350 } elseif ($reshook < 0) {
352 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"ProcessingError"), $hookmanager->errors,
'errors');
357 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"Draft"), $objecttmp->errors,
'errors');
358 } elseif ($objecttmp->paid || $objecttmp->resteapayer == 0) {
360 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"AlreadyPaid"), $objecttmp->errors,
'errors');
361 } elseif ($objecttmp->resteapayer < 0) {
363 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"AmountMustBePositive"), $objecttmp->errors,
'errors');
366 $rsql =
"SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande";
367 $rsql .=
" , pfd.date_traite as date_traite";
368 $rsql .=
" , pfd.amount";
369 $rsql .=
" , u.rowid as user_id, u.lastname, u.firstname, u.login";
370 $rsql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_demande as pfd";
371 $rsql .=
" , ".MAIN_DB_PREFIX.
"user as u";
372 $rsql .=
" WHERE fk_facture_fourn = ".((int) $objecttmp->id);
373 $rsql .=
" AND pfd.fk_user_demande = u.rowid";
374 $rsql .=
" AND pfd.traite = 0";
375 $rsql .=
" ORDER BY pfd.date_demande DESC";
377 $result_sql = $db->query($rsql);
379 $numprlv = $db->num_rows($result_sql);
384 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"RequestAlreadyDone"), $objecttmp->errors,
'warnings');
385 } elseif (!empty($objecttmp->mode_reglement_code) && $objecttmp->mode_reglement_code !=
'VIR') {
386 $langs->load(
"errors");
388 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"ErrorThisPaymentModeIsNotCreditTransfer"), $objecttmp->errors,
'errors');
390 $listofbills[] = $objecttmp;
396 if (!empty($listofbills)) {
397 $nbwithdrawrequestok = 0;
398 foreach ($listofbills as $aBill) {
400 $result = $aBill->demande_prelevement($user, $aBill->resteapayer,
'bank-transfer',
'supplier_invoice');
403 $nbwithdrawrequestok++;
409 if ($nbwithdrawrequestok > 0) {
410 setEventMessages($langs->trans(
"WithdrawRequestsDone", $nbwithdrawrequestok),
null,
'mesgs');
422$form =
new Form($db);
425$bankaccountstatic =
new Account($db);
429$subtypearray =
$object->getArrayOfInvoiceSubtypes(0);
435 if (empty($search_company)) {
436 $search_company = $soc->name;
440$title = $langs->trans(
"BillsSuppliers").($socid ?
' - '.$soc->name :
'');
441$help_url =
'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores';
447 $sql =
'SELECT DISTINCT';
449$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,";
450$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_modification,";
451$sql .=
" f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,";
452$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,';
453$sql .=
" f.note_public, f.note_private,";
454$sql .=
" f.fk_user_author,";
455$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,";
456$sql .=
" typent.code as typent_code,";
457$sql .=
" state.code_departement as state_code, state.nom as state_name,";
458$sql .=
" country.code as country_code,";
459$sql .=
" p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
460$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';
462if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
463 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
464 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
468$parameters = array();
469$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
470$sql .= $hookmanager->resPrint;
471$sql = preg_replace(
'/,\s*$/',
'', $sql);
476 $sql .=
', SUM(pf.amount) as dynamount_payed';
481$sql .=
' FROM '.MAIN_DB_PREFIX.
'societe as s';
482$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
483$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
484$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
485$sql .=
', '.MAIN_DB_PREFIX.
'facture_fourn as f';
486if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
487 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (f.rowid = ef.fk_object)";
490 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
493 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'facture_fourn_det as pd ON f.rowid=pd.fk_facture_fourn';
495$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user AS u ON f.fk_user_author = u.rowid';
496$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as p ON p.rowid = f.fk_projet";
497if ($search_user > 0) {
498 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ec";
499 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
502$parameters = array();
503$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
504$sql .= $hookmanager->resPrint;
505$sql .=
' WHERE f.fk_soc = s.rowid';
506$sql .=
' AND f.entity IN ('.getEntity(
'facture_fourn').
')';
508 $sql .=
' AND s.rowid = '.((int) $socid);
511 if (is_numeric($search_ref)) {
520if ($search_refsupplier) {
523if ($search_type !=
'' && $search_type >= 0) {
524 if ($search_type ==
'0') {
525 $sql .=
" AND f.type = 0";
527 if ($search_type ==
'1') {
528 $sql .=
" AND f.type = 1";
530 if ($search_type ==
'2') {
531 $sql .=
" AND f.type = 2";
533 if ($search_type ==
'3') {
534 $sql .=
" AND f.type = 3";
539if ($search_subtype !=
'' && $search_subtype !=
'-1') {
540 $sql .=
" AND f.subtype IN (".$db->sanitize($db->escape($search_subtype)).
")";
542if ($search_project) {
545if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_company) {
546 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_company);
548 if ($search_company) {
551 if ($search_company_alias) {
564if (strlen(trim($search_country))) {
566 $country_code_in_EEC = $country_code_in_EEC_without_me =
'';
567 foreach ($arrayofcode as $key => $value) {
568 $country_code_in_EEC .= ($country_code_in_EEC ?
"," :
"").
"'".$value.
"'";
569 if ($value != $mysoc->country_code) {
570 $country_code_in_EEC_without_me .= ($country_code_in_EEC_without_me ?
"," :
"").
"'".$value.
"'";
573 if ($search_country ==
'special_allnotme') {
574 $sql .=
" AND country.code <> '".$db->escape($mysoc->country_code).
"'";
575 } elseif ($search_country ==
'special_eec') {
576 $sql .=
" AND country.code IN (".$db->sanitize($country_code_in_EEC, 1).
")";
577 } elseif ($search_country ==
'special_eecnotme') {
578 $sql .=
" AND country.code IN (".$db->sanitize($country_code_in_EEC_without_me, 1).
")";
579 } elseif ($search_country ==
'special_noteec') {
580 $sql .=
" AND country.code NOT IN (".$db->sanitize($country_code_in_EEC, 1).
")";
585if ($search_type_thirdparty !=
'' && $search_type_thirdparty >= 0) {
586 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
588if ($search_montant_ht !=
'') {
591if ($search_montant_vat !=
'') {
594if ($search_montant_localtax1 !=
'') {
595 $sql .=
natural_search(
'f.localtax1', $search_montant_localtax1, 1);
597if ($search_montant_localtax2 !=
'') {
598 $sql .=
natural_search(
'f.localtax2', $search_montant_localtax2, 1);
600if ($search_montant_ttc !=
'') {
603if ($search_multicurrency_code !=
'') {
604 $sql .=
" AND f.multicurrency_code = '".$db->escape($search_multicurrency_code).
"'";
606if ($search_multicurrency_tx !=
'') {
607 $sql .=
natural_search(
'f.multicurrency_tx', $search_multicurrency_tx, 1);
609if ($search_multicurrency_montant_ht !=
'') {
610 $sql .=
natural_search(
'f.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
612if ($search_multicurrency_montant_vat !=
'') {
613 $sql .=
natural_search(
'f.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
615if ($search_multicurrency_montant_ttc !=
'') {
616 $sql .=
natural_search(
'f.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
619 $sql .=
natural_search(array(
'u.login',
'u.lastname',
'u.firstname'), $search_login);
621if ($search_status !=
'' && $search_status >= 0) {
622 $sql .=
" AND f.fk_statut = ".((int) $search_status);
624if ($search_paymentmode > 0) {
625 $sql .=
" AND f.fk_mode_reglement = ".((int) $search_paymentmode);
627if ($search_paymentcond > 0) {
628 $sql .=
" AND f.fk_cond_reglement = ".((int) $search_paymentcond);
630if ($search_date_start) {
631 $sql .=
" AND f.datef >= '" . $db->idate($search_date_start) .
"'";
633if ($search_date_end) {
634 $sql .=
" AND f.datef <= '" . $db->idate($search_date_end) .
"'";
636if ($search_datelimit_start) {
637 $sql .=
" AND f.date_lim_reglement >= '" . $db->idate($search_datelimit_start) .
"'";
639if ($search_datelimit_end) {
640 $sql .=
" AND f.date_lim_reglement <= '" . $db->idate($search_datelimit_end) .
"'";
642if ($option ==
'late') {
643 $sql .=
" AND f.date_lim_reglement < '".$db->idate(
dol_now() - $conf->facture->fournisseur->warning_delay).
"'";
649if ($search_sale && $search_sale !=
'-1') {
650 if ($search_sale == -2) {
651 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc)";
652 } elseif ($search_sale > 0) {
653 $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).
")";
656$searchCategorySupplierList = $search_categ_sup ? array($search_categ_sup) : array();
657$searchCategorySupplierOperator = 0;
659if (!empty($searchCategorySupplierList)) {
660 $searchCategorySupplierSqlList = array();
661 $listofcategoryid =
'';
662 foreach ($searchCategorySupplierList as $searchCategorySupplier) {
663 if (intval($searchCategorySupplier) == -2) {
664 $searchCategorySupplierSqlList[] =
"NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)";
665 } elseif (intval($searchCategorySupplier) > 0) {
666 if ($searchCategorySupplierOperator == 0) {
667 $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).
")";
669 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategorySupplier);
673 if ($listofcategoryid) {
674 $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).
"))";
676 if ($searchCategorySupplierOperator == 1) {
677 if (!empty($searchCategorySupplierSqlList)) {
678 $sql .=
" AND (".implode(
' OR ', $searchCategorySupplierSqlList).
")";
681 if (!empty($searchCategorySupplierSqlList)) {
682 $sql .=
" AND (".implode(
' AND ', $searchCategorySupplierSqlList).
")";
687$searchCategoryProductList = $search_product_category ? array($search_product_category) : array();
688$searchCategoryProductOperator = 0;
689if (!empty($searchCategoryProductList)) {
690 $searchCategoryProductSqlList = array();
691 $listofcategoryid =
'';
692 foreach ($searchCategoryProductList as $searchCategoryProduct) {
693 if (intval($searchCategoryProduct) == -2) {
694 $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)";
695 } elseif (intval($searchCategoryProduct) > 0) {
696 if ($searchCategoryProductOperator == 0) {
697 $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).
")";
699 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
703 if ($listofcategoryid) {
704 $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).
"))";
706 if ($searchCategoryProductOperator == 1) {
707 if (!empty($searchCategoryProductSqlList)) {
708 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
711 if (!empty($searchCategoryProductSqlList)) {
712 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
716if ($filter && $filter != -1) {
717 $aFilter = explode(
',', $filter);
718 foreach ($aFilter as $fil) {
719 $filt = explode(
':', $fil);
720 $sql .=
" AND ".$db->escape(trim($filt[0])).
" = '".$db->escape(trim($filt[1])).
"'";
727if ($search_user > 0) {
728 $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);
731include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
733$parameters = array();
734$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
735$sql .= $hookmanager->resPrint;
738 $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,";
739 $sql .=
" f.total_ht, f.total_ttc, f.total_tva, f.paye, f.close_code, f.fk_statut, f.libelle, f.datec, f.tms,";
740 $sql .=
" f.localtax1, f.localtax2,";
741 $sql .=
' f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc,';
742 $sql .=
" f.note_public, f.note_private,";
743 $sql .=
" f.fk_user_author,";
744 $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,';
745 $sql .=
" typent.code,";
746 $sql .=
" state.code_departement, state.nom,";
747 $sql .=
' country.code,';
748 $sql .=
" p.rowid, p.ref, p.title,";
749 $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";
750 if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
751 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
753 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
",ef.".$key :
'');
757 $parameters = array(
'all' => $search_all,
'fieldstosearchall' => $fieldstosearchall);
758 $reshook = $hookmanager->executeHooks(
'printFieldListGroupBy', $parameters, $object, $action);
759 $sql .= $hookmanager->resPrint;
761 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
765$parameters = array();
766$reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object, $action);
767$sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
770$nbtotalofrecords =
'';
773 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
774 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
775 $sqlforcount = preg_replace(
'/LEFT JOIN '.MAIN_DB_PREFIX.
'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid/',
'', $sqlforcount);
777 $resql = $db->query($sqlforcount);
779 $objforcount = $db->fetch_object($resql);
780 $nbtotalofrecords = $objforcount->nbtotalofrecords;
785 if (($page * $limit) > $nbtotalofrecords) {
793$sql .= $db->order($sortfield, $sortorder);
795 $sql .= $db->plimit($limit + 1, $offset);
799$resql = $db->query($sql);
805$num = $db->num_rows($resql);
808if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
809 $obj = $db->fetch_object($resql);
811 header(
"Location: ".DOL_URL_ROOT.
'/fourn/facture/card.php?facid='.$id);
818llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist');
823 if (empty($search_company)) {
824 $search_company = $soc->name;
825 $search_company_alias = $soc->name_alias;
829$arrayofselected = is_array($toselect) ? $toselect : array();
831$param =
'&socid='.$socid;
833 $param .=
'&mode='.urlencode($mode);
835if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
836 $param .=
'&contextpage='.urlencode($contextpage);
838if ($limit > 0 && $limit != $conf->liste_limit) {
839 $param .=
'&limit='.((int) $limit);
841if ($optioncss !=
'') {
842 $param .=
'&optioncss='.urlencode($optioncss);
845 $param .=
'&search_all='.urlencode($search_all);
847if ($search_date_start) {
848 $param .=
buildParamDate(
'search_date_start',
null,
'',
'tzserver');
850if ($search_date_end) {
851 $param .=
buildParamDate(
'search_date_end',
null,
'',
'tzserver');
853if ($search_datelimit_startday) {
854 $param .=
'&search_datelimit_startday='.urlencode((
string) ($search_datelimit_startday));
856if ($search_datelimit_startmonth) {
857 $param .=
'&search_datelimit_startmonth='.urlencode((
string) ($search_datelimit_startmonth));
859if ($search_datelimit_startyear) {
860 $param .=
'&search_datelimit_startyear='.urlencode((
string) ($search_datelimit_startyear));
862if ($search_datelimit_endday) {
863 $param .=
'&search_datelimit_endday='.urlencode((
string) ($search_datelimit_endday));
865if ($search_datelimit_endmonth) {
866 $param .=
'&search_datelimit_endmonth='.urlencode((
string) ($search_datelimit_endmonth));
868if ($search_datelimit_endyear) {
869 $param .=
'&search_datelimit_endyear='.urlencode((
string) ($search_datelimit_endyear));
872 $param .=
'&search_ref='.urlencode($search_ref);
874if ($search_refsupplier) {
875 $param .=
'&search_refsupplier='.urlencode($search_refsupplier);
877if ($search_type !=
'') {
878 $param .=
'&search_type='.urlencode($search_type);
880if ($search_subtype !=
'') {
881 $param .=
'&search_subtype='.urlencode($search_subtype);
884 $param .=
'&search_label='.urlencode($search_label);
886if ($search_company) {
887 $param .=
'&search_company='.urlencode($search_company);
889if ($search_company_alias) {
890 $param .=
'&search_company_alias='.urlencode($search_company_alias);
893 $param .=
'&search_login='.urlencode($search_login);
895if ($search_montant_ht !=
'') {
896 $param .=
'&search_montant_ht='.urlencode($search_montant_ht);
898if ($search_montant_vat !=
'') {
899 $param .=
'&search_montant_vat='.urlencode($search_montant_vat);
901if ($search_montant_localtax1 !=
'') {
902 $param .=
'&search_montant_localtax1='.urlencode($search_montant_localtax1);
904if ($search_montant_localtax2 !=
'') {
905 $param .=
'&search_montant_localtax2='.urlencode($search_montant_localtax2);
907if ($search_montant_ttc !=
'') {
908 $param .=
'&search_montant_ttc='.urlencode($search_montant_ttc);
910if ($search_multicurrency_code !=
'') {
911 $param .=
'&search_multicurrency_code='.urlencode($search_multicurrency_code);
913if ($search_multicurrency_tx !=
'') {
914 $param .=
'&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
916if ($search_multicurrency_montant_ht !=
'') {
917 $param .=
'&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
919if ($search_multicurrency_montant_vat !=
'') {
920 $param .=
'&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
922if ($search_multicurrency_montant_ttc !=
'') {
923 $param .=
'&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
925if ($search_amount_no_tax) {
926 $param .=
'&search_amount_no_tax='.urlencode($search_amount_no_tax);
928if ($search_amount_all_tax) {
929 $param .=
'&search_amount_all_tax='.urlencode($search_amount_all_tax);
931if ($search_status >= 0) {
932 $param .=
"&search_status=".urlencode($search_status);
934if ($search_paymentmode) {
935 $param .=
'&search_paymentmode='.urlencode((
string) ($search_paymentmode));
937if ($search_paymentcond) {
938 $param .=
'&search_paymentcond='.urlencode((
string) ($search_paymentcond));
941 $param .=
'&show_files='.urlencode((
string) ($show_files));
944 $param .=
"&search_option=".urlencode($option);
946if ($search_categ_sup > 0) {
947 $param .=
'&search_categ_sup='.$search_categ_sup;
949if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
950 $param .=
'&search_type_thirdparty='.$search_type_thirdparty;
954include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
956$parameters = array(
'param' => &$param);
957$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
958$param .= $hookmanager->resPrint;
961$arrayofmassactions = array(
962 'validate' =>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate"),
963 'generate_doc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
964 'builddoc'=>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
968if (isModEnabled(
'paymentbybanktransfer') && $user->hasRight(
"paymentbybanktransfer",
"create")) {
969 $langs->load(
'withdrawals');
970 $arrayofmassactions[
'banktransfertrequest'] =
img_picto(
'',
'payment',
'class="pictofixedwidth"').$langs->trans(
"MakeBankTransferOrder");
972if (!empty($permissiontodelete)) {
973 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
975if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
976 $arrayofmassactions = array();
978$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
980$url = DOL_URL_ROOT.
'/fourn/facture/card.php?action=create';
982 $url .=
'&socid='.urlencode((
string) ($socid));
986print
'<form method="POST" id="searchFormList" name="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
987if ($optioncss !=
'') {
988 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
990print
'<input type="hidden" name="token" value="'.newToken().
'">';
991print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
992print
'<input type="hidden" name="action" value="list">';
993print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
994print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
995print
'<input type="hidden" name="socid" value="'.$socid.
'">';
996print
'<input type="hidden" name="page" value="'.$page.
'">';
997print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
998print
'<input type="hidden" name="page_y" value="">';
999print
'<input type="hidden" name="mode" value="'.$mode.
'">';
1002$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'));
1003$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'));
1005$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewBill'),
'',
'fa fa-plus-circle', $url,
'', ($user->hasRight(
"fournisseur",
"facture",
"creer") || $user->hasRight(
"supplier_invoice",
"creer")));
1007print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_invoice', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1010$topicmail =
"SendBillRef";
1011$modelmail =
"invoice_supplier_send";
1013$trackid =
'sinv'.$object->id;
1014include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1018 foreach ($fieldstosearchall as $key => $val) {
1019 $fieldstosearchall[$key] = $langs->trans($val);
1020 $setupstring .= $key.
"=".$val.
";";
1022 print
'<!-- Search done like if SUPPLIER_INVOICE_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
1023 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
1028if ($user->hasRight(
"user",
"user",
"lire")) {
1029 $langs->load(
"commercial");
1030 $moreforfilter .=
'<div class="divsearchfield">';
1031 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1032 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth200');
1033 $moreforfilter .=
'</div>';
1036if ($user->hasRight(
"user",
"user",
"lire")) {
1037 $moreforfilter .=
'<div class="divsearchfield">';
1038 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
1039 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$form->select_dolusers($search_user,
'search_user', $tmptitle,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth200');
1040 $moreforfilter .=
'</div>';
1043if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire') && ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire'))) {
1044 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1045 $moreforfilter .=
'<div class="divsearchfield">';
1046 $tmptitle = $langs->trans(
'IncludingProductWithTag');
1047 $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT,
null,
'parent',
null,
null, 1);
1048 $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);
1049 $moreforfilter .=
'</div>';
1052if (isModEnabled(
'category')) {
1053 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1054 $moreforfilter .=
'<div class="divsearchfield">';
1055 $tmptitle = $langs->trans(
'SuppliersCategoriesShort');
1056 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$formother->select_categories(
'supplier', $search_categ_sup,
'search_categ_sup', 1, $tmptitle);
1057 $moreforfilter .=
'</div>';
1059$parameters = array();
1060$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1061if (empty($reshook)) {
1062 $moreforfilter .= $hookmanager->resPrint;
1064 $moreforfilter = $hookmanager->resPrint;
1067if (!empty($moreforfilter)) {
1068 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1069 print $moreforfilter;
1073$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1074$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1075$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
1076$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1078print
'<div class="div-table-responsive">';
1079print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1083print
'<tr class="liste_titre_filter">';
1086 print
'<td class="liste_titre center maxwidthsearch">';
1087 $searchpicto = $form->showFilterButtons(
'left');
1092if (!empty($arrayfields[
'f.ref'][
'checked'])) {
1093 print
'<td class="liste_titre left">';
1094 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
1098if (!empty($arrayfields[
'f.ref_supplier'][
'checked'])) {
1099 print
'<td class="liste_titre">';
1100 print
'<input class="flat maxwidth75" type="text" name="search_refsupplier" value="'.dol_escape_htmltag($search_refsupplier).
'">';
1104if (!empty($arrayfields[
'f.type'][
'checked'])) {
1105 print
'<td class="liste_titre maxwidthonsmartphone">';
1112 print $form->selectarray(
'search_type', $typearray, $search_type, 1, 0, 0,
'', 0, 0, 0,
'ASC',
'maxwidth100');
1116if (!empty($arrayfields[
'f.subtype'][
'checked'])) {
1117 print
'<td class="liste_titre maxwidthonsmartphone" align="center">';
1118 print $form->selectarray(
'search_subtype', $subtypearray, $search_subtype, 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth100');
1122if (!empty($arrayfields[
'f.label'][
'checked'])) {
1123 print
'<td class="liste_titre">';
1124 print
'<input class="flat maxwidth75" type="text" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
1128if (!empty($arrayfields[
'f.datef'][
'checked'])) {
1129 print
'<td class="liste_titre center">';
1130 print
'<div class="nowrapfordate">';
1131 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1133 print
'<div class="nowrapfordate">';
1134 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1139if (!empty($arrayfields[
'f.date_lim_reglement'][
'checked'])) {
1140 print
'<td class="liste_titre center">';
1141 print
'<div class="">';
1148 print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1,
'search_datelimit_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"Before"));
1150 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>';
1155if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1156 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_project" value="'.dol_escape_htmltag($search_project).
'"></td>';
1159if (!empty($arrayfields[
's.nom'][
'checked'])) {
1160 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).
'"'.($socid > 0 ?
" disabled" :
"").
'></td>';
1163if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1164 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_company_alias" value="'.dol_escape_htmltag($search_company_alias).
'"></td>';
1167if (!empty($arrayfields[
's.town'][
'checked'])) {
1168 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).
'"></td>';
1171if (!empty($arrayfields[
's.zip'][
'checked'])) {
1172 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'"></td>';
1175if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1176 print
'<td class="liste_titre">';
1177 print
'<input class="flat maxwidth50imp" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1181if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1182 print
'<td class="liste_titre center">';
1183 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth150imp maxwidth150',
'code2', 1, 0, 1,
null, 1);
1187if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1188 print
'<td class="liste_titre maxwidthonsmartphone center">';
1189 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);
1193if (!empty($arrayfields[
'f.fk_cond_reglement'][
'checked'])) {
1194 print
'<td class="liste_titre left">';
1195 print $form->getSelectConditionsPaiements($search_paymentcond,
'search_paymentcond', -1, 1, 1,
'maxwidth100');
1199if (!empty($arrayfields[
'f.fk_mode_reglement'][
'checked'])) {
1200 print
'<td class="liste_titre">';
1201 print $form->select_types_paiements($search_paymentmode,
'search_paymentmode',
'', 0, 1, 1, 20, 1,
'maxwidth100', 1);
1204if (!empty($arrayfields[
'f.total_ht'][
'checked'])) {
1206 print
'<td class="liste_titre right">';
1207 print
'<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).
'">';
1210if (!empty($arrayfields[
'f.total_vat'][
'checked'])) {
1212 print
'<td class="liste_titre right">';
1213 print
'<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).
'">';
1216if (!empty($arrayfields[
'f.total_localtax1'][
'checked'])) {
1218 print
'<td class="liste_titre right">';
1219 print
'<input class="flat" type="text" size="5" name="search_montant_localtax1" value="'.dol_escape_htmltag($search_montant_localtax1).
'">';
1222if (!empty($arrayfields[
'f.total_localtax2'][
'checked'])) {
1224 print
'<td class="liste_titre right">';
1225 print
'<input class="flat" type="text" size="5" name="search_montant_localtax2" value="'.dol_escape_htmltag($search_montant_localtax2).
'">';
1228if (!empty($arrayfields[
'f.total_ttc'][
'checked'])) {
1230 print
'<td class="liste_titre right">';
1231 print
'<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).
'">';
1234if (!empty($arrayfields[
'f.nb_docs'][
'checked'])) {
1236 print
'<td class="liste_titre" align="center">';
1239if (!empty($arrayfields[
'u.login'][
'checked'])) {
1241 print
'<td class="liste_titre" align="center">';
1242 print
'<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1245if (!empty($arrayfields[
'dynamount_payed'][
'checked'])) {
1246 print
'<td class="liste_titre right">';
1249if (!empty($arrayfields[
'rtp'][
'checked'])) {
1250 print
'<td class="liste_titre">';
1253if (!empty($arrayfields[
'f.multicurrency_code'][
'checked'])) {
1255 print
'<td class="liste_titre">';
1256 print $form->selectMultiCurrency($search_multicurrency_code,
'search_multicurrency_code', 1);
1259if (!empty($arrayfields[
'f.multicurrency_tx'][
'checked'])) {
1261 print
'<td class="liste_titre">';
1262 print
'<input class="flat" type="text" size="4" name="search_multicurrency_tx" value="'.dol_escape_htmltag($search_multicurrency_tx).
'">';
1265if (!empty($arrayfields[
'f.multicurrency_total_ht'][
'checked'])) {
1267 print
'<td class="liste_titre right">';
1268 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ht" value="'.dol_escape_htmltag($search_multicurrency_montant_ht).
'">';
1271if (!empty($arrayfields[
'f.multicurrency_total_vat'][
'checked'])) {
1273 print
'<td class="liste_titre right">';
1274 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_vat" value="'.dol_escape_htmltag($search_multicurrency_montant_vat).
'">';
1277if (!empty($arrayfields[
'f.multicurrency_total_ttc'][
'checked'])) {
1279 print
'<td class="liste_titre right">';
1280 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ttc" value="'.dol_escape_htmltag($search_multicurrency_montant_ttc).
'">';
1283if (!empty($arrayfields[
'multicurrency_dynamount_payed'][
'checked'])) {
1284 print
'<td class="liste_titre">';
1287if (!empty($arrayfields[
'multicurrency_rtp'][
'checked'])) {
1288 print
'<td class="liste_titre right">';
1292include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1295$parameters = array(
'arrayfields' => $arrayfields);
1296$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1297print $hookmanager->resPrint;
1299if (!empty($arrayfields[
'f.datec'][
'checked'])) {
1300 print
'<td class="liste_titre">';
1304if (!empty($arrayfields[
'f.tms'][
'checked'])) {
1305 print
'<td class="liste_titre">';
1309if (!empty($arrayfields[
'f.fk_statut'][
'checked'])) {
1310 print
'<td class="liste_titre center parentonrightofpage">';
1311 $liststatus = array(
'0' => $langs->trans(
"Draft"),
'1' => $langs->trans(
"Unpaid"),
'2' => $langs->trans(
"Paid"));
1313 print $form->selectarray(
'search_status', $liststatus, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'center search_status width100 onrightofpage', 1);
1318 print
'<td class="liste_titre center maxwidthsearch">';
1319 $searchpicto = $form->showFilterButtons();
1326$totalarray = array();
1327$totalarray[
'nbfield'] = 0;
1331print
'<tr class="liste_titre">';
1334 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1335 $totalarray[
'nbfield']++;
1337if (!empty($arrayfields[
'f.ref'][
'checked'])) {
1338 print_liste_field_titre($arrayfields[
'f.ref'][
'label'], $_SERVER[
'PHP_SELF'],
'f.ref,f.rowid',
'', $param,
'', $sortfield, $sortorder);
1339 $totalarray[
'nbfield']++;
1341if (!empty($arrayfields[
'f.ref_supplier'][
'checked'])) {
1342 print_liste_field_titre($arrayfields[
'f.ref_supplier'][
'label'], $_SERVER[
"PHP_SELF"],
'f.ref_supplier',
'', $param,
'', $sortfield, $sortorder);
1343 $totalarray[
'nbfield']++;
1345if (!empty($arrayfields[
'f.type'][
'checked'])) {
1346 print_liste_field_titre($arrayfields[
'f.type'][
'label'], $_SERVER[
"PHP_SELF"],
'f.type',
'', $param,
'', $sortfield, $sortorder);
1347 $totalarray[
'nbfield']++;
1349if (!empty($arrayfields[
'f.subtype'][
'checked'])) {
1350 print_liste_field_titre($arrayfields[
'f.subtype'][
'label'], $_SERVER[
"PHP_SELF"],
'f.subtype',
'', $param,
'', $sortfield, $sortorder);
1352if (!empty($arrayfields[
'f.label'][
'checked'])) {
1353 print_liste_field_titre($arrayfields[
'f.label'][
'label'], $_SERVER[
'PHP_SELF'],
"f.libelle,f.rowid",
'', $param,
'', $sortfield, $sortorder);
1354 $totalarray[
'nbfield']++;
1356if (!empty($arrayfields[
'f.datef'][
'checked'])) {
1357 print_liste_field_titre($arrayfields[
'f.datef'][
'label'], $_SERVER[
'PHP_SELF'],
'f.datef,f.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1358 $totalarray[
'nbfield']++;
1360if (!empty($arrayfields[
'f.date_lim_reglement'][
'checked'])) {
1361 print_liste_field_titre($arrayfields[
'f.date_lim_reglement'][
'label'], $_SERVER[
'PHP_SELF'],
"f.date_lim_reglement",
'', $param,
'', $sortfield, $sortorder,
'center ');
1362 $totalarray[
'nbfield']++;
1364if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1365 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
'PHP_SELF'],
"p.ref",
'', $param,
'', $sortfield, $sortorder);
1366 $totalarray[
'nbfield']++;
1368if (!empty($arrayfields[
's.nom'][
'checked'])) {
1369 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
'PHP_SELF'],
's.nom',
'', $param,
'', $sortfield, $sortorder);
1370 $totalarray[
'nbfield']++;
1372if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1373 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
'PHP_SELF'],
's.name_alias',
'', $param,
'', $sortfield, $sortorder);
1374 $totalarray[
'nbfield']++;
1376if (!empty($arrayfields[
's.town'][
'checked'])) {
1377 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1378 $totalarray[
'nbfield']++;
1380if (!empty($arrayfields[
's.zip'][
'checked'])) {
1381 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1382 $totalarray[
'nbfield']++;
1384if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1385 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.name_alias",
"", $param,
'', $sortfield, $sortorder);
1386 $totalarray[
'nbfield']++;
1388if (!empty($arrayfields[
'state.name_alias'][
'checked'])) {
1389 print_liste_field_titre($arrayfields[
'state.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1390 $totalarray[
'nbfield']++;
1392if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1393 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1394 $totalarray[
'nbfield']++;
1396if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1397 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1398 $totalarray[
'nbfield']++;
1400if (!empty($arrayfields[
'f.fk_cond_reglement'][
'checked'])) {
1401 print_liste_field_titre($arrayfields[
'f.fk_cond_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"f.fk_cond_reglement",
"", $param,
"", $sortfield, $sortorder);
1402 $totalarray[
'nbfield']++;
1404if (!empty($arrayfields[
'f.fk_mode_reglement'][
'checked'])) {
1405 print_liste_field_titre($arrayfields[
'f.fk_mode_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"f.fk_mode_reglement",
"", $param,
"", $sortfield, $sortorder);
1406 $totalarray[
'nbfield']++;
1408if (!empty($arrayfields[
'f.total_ht'][
'checked'])) {
1409 print_liste_field_titre($arrayfields[
'f.total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'f.total_ht',
'', $param,
'', $sortfield, $sortorder,
'right ');
1410 $totalarray[
'nbfield']++;
1412if (!empty($arrayfields[
'f.total_vat'][
'checked'])) {
1413 print_liste_field_titre($arrayfields[
'f.total_vat'][
'label'], $_SERVER[
'PHP_SELF'],
'f.total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1414 $totalarray[
'nbfield']++;
1416if (!empty($arrayfields[
'f.total_localtax1'][
'checked'])) {
1417 print_liste_field_titre($arrayfields[
'f.total_localtax1'][
'label'], $_SERVER[
'PHP_SELF'],
'f.localtax1',
'', $param,
'', $sortfield, $sortorder,
'right ');
1418 $totalarray[
'nbfield']++;
1420if (!empty($arrayfields[
'f.total_localtax2'][
'checked'])) {
1421 print_liste_field_titre($arrayfields[
'f.total_localtax2'][
'label'], $_SERVER[
'PHP_SELF'],
'f.localtax2',
'', $param,
'', $sortfield, $sortorder,
'right ');
1422 $totalarray[
'nbfield']++;
1424if (!empty($arrayfields[
'f.total_ttc'][
'checked'])) {
1425 print_liste_field_titre($arrayfields[
'f.total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'f.total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1426 $totalarray[
'nbfield']++;
1428if (!empty($arrayfields[
'f.nb_docs'][
'checked'])) {
1429 print_liste_field_titre($arrayfields[
'f.nb_docs'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1430 $totalarray[
'nbfield']++;
1432if (!empty($arrayfields[
'u.login'][
'checked'])) {
1433 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'', $sortfield, $sortorder);
1434 $totalarray[
'nbfield']++;
1436if (!empty($arrayfields[
'dynamount_payed'][
'checked'])) {
1437 print_liste_field_titre($arrayfields[
'dynamount_payed'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1438 $totalarray[
'nbfield']++;
1440if (!empty($arrayfields[
'rtp'][
'checked'])) {
1441 print_liste_field_titre($arrayfields[
'rtp'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder);
1442 $totalarray[
'nbfield']++;
1444if (!empty($arrayfields[
'f.multicurrency_code'][
'checked'])) {
1445 print_liste_field_titre($arrayfields[
'f.multicurrency_code'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_code',
'', $param,
'', $sortfield, $sortorder);
1446 $totalarray[
'nbfield']++;
1448if (!empty($arrayfields[
'f.multicurrency_tx'][
'checked'])) {
1449 print_liste_field_titre($arrayfields[
'f.multicurrency_tx'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_tx',
'', $param,
'', $sortfield, $sortorder);
1450 $totalarray[
'nbfield']++;
1452if (!empty($arrayfields[
'f.multicurrency_total_ht'][
'checked'])) {
1453 print_liste_field_titre($arrayfields[
'f.multicurrency_total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_total_ht',
'', $param,
'"', $sortfield, $sortorder,
'right ');
1454 $totalarray[
'nbfield']++;
1456if (!empty($arrayfields[
'f.multicurrency_total_vat'][
'checked'])) {
1457 print_liste_field_titre($arrayfields[
'f.multicurrency_total_vat'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1458 $totalarray[
'nbfield']++;
1460if (!empty($arrayfields[
'f.multicurrency_total_ttc'][
'checked'])) {
1461 print_liste_field_titre($arrayfields[
'f.multicurrency_total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1462 $totalarray[
'nbfield']++;
1464if (!empty($arrayfields[
'multicurrency_dynamount_payed'][
'checked'])) {
1465 print_liste_field_titre($arrayfields[
'multicurrency_dynamount_payed'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1466 $totalarray[
'nbfield']++;
1468if (!empty($arrayfields[
'multicurrency_rtp'][
'checked'])) {
1469 print_liste_field_titre($arrayfields[
'multicurrency_rtp'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1470 $totalarray[
'nbfield']++;
1473include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1475$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1476$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1477print $hookmanager->resPrint;
1478if (!empty($arrayfields[
'f.datec'][
'checked'])) {
1479 print_liste_field_titre($arrayfields[
'f.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"f.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1480 $totalarray[
'nbfield']++;
1482if (!empty($arrayfields[
'f.tms'][
'checked'])) {
1483 print_liste_field_titre($arrayfields[
'f.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"f.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1484 $totalarray[
'nbfield']++;
1486if (!empty($arrayfields[
'f.fk_statut'][
'checked'])) {
1487 print_liste_field_titre($arrayfields[
'f.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"fk_statut,paye,type",
"", $param,
'', $sortfield, $sortorder,
'center ');
1488 $totalarray[
'nbfield']++;
1492 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1493 $totalarray[
'nbfield']++;
1499$projectstatic =
new Project($db);
1500$userstatic =
new User($db);
1506$savnbfield = $totalarray[
'nbfield'];
1507$totalarray = array();
1508$totalarray[
'nbfield'] = 0;
1509$totalarray[
'val'] = array();
1510$totalarray[
'val'][
'f.total_ht'] = 0;
1511$totalarray[
'val'][
'f.total_vat'] = 0;
1512$totalarray[
'val'][
'f.total_localtax1'] = 0;
1513$totalarray[
'val'][
'f.total_localtax1'] = 0;
1514$totalarray[
'val'][
'f.total_ttc'] = 0;
1515$totalarray[
'val'][
'totalam']=0;
1516$totalarray[
'val'][
'rtp']=0;
1518$imaxinloop = ($limit ? min($num, $limit) : $num);
1519while ($i < $imaxinloop) {
1520 $obj = $db->fetch_object($resql);
1525 $datelimit = $db->jdate($obj->datelimite);
1527 $userstatic->id = $obj->fk_user_author;
1528 $userstatic->login = $obj->login;
1529 $userstatic->lastname = $obj->lastname;
1530 $userstatic->firstname = $obj->firstname;
1531 $userstatic->email = $obj->user_email;
1532 $userstatic->statut = $obj->user_statut;
1533 $userstatic->status = $obj->user_statut;
1534 $userstatic->entity = $obj->entity;
1535 $userstatic->photo = $obj->photo;
1536 $userstatic->office_phone = $obj->office_phone;
1537 $userstatic->office_fax = $obj->office_fax;
1538 $userstatic->user_mobile = $obj->user_mobile;
1539 $userstatic->job = $obj->job;
1540 $userstatic->gender = $obj->gender;
1541 $facturestatic->id = $obj->facid;
1542 $facturestatic->ref = $obj->ref;
1543 $facturestatic->type = $obj->type;
1544 $facturestatic->subtype = $obj->subtype;
1545 $facturestatic->total_ht = $obj->total_ht;
1546 $facturestatic->total_tva = $obj->total_vat;
1547 $facturestatic->total_ttc = $obj->total_ttc;
1548 $facturestatic->close_code = $obj->close_code;
1549 $facturestatic->ref_supplier = $obj->ref_supplier;
1550 $facturestatic->date_echeance = $db->jdate($obj->datelimite);
1551 $facturestatic->statut = $obj->fk_statut;
1552 $facturestatic->status = $obj->fk_statut;
1553 $facturestatic->note_public = $obj->note_public;
1554 $facturestatic->note_private = $obj->note_private;
1555 $facturestatic->multicurrency_code = $obj->multicurrency_code;
1556 $facturestatic->multicurrency_tx = $obj->multicurrency_tx;
1557 $facturestatic->multicurrency_total_ht = $obj->multicurrency_total_ht;
1558 $facturestatic->multicurrency_total_tva = $obj->multicurrency_total_vat;
1559 $facturestatic->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
1560 $thirdparty->id = $obj->socid;
1561 $thirdparty->name = $obj->name;
1562 $thirdparty->name_alias = $obj->alias;
1563 $thirdparty->client = $obj->client;
1564 $thirdparty->fournisseur = $obj->fournisseur;
1565 $thirdparty->code_client = $obj->code_client;
1566 $thirdparty->code_compta_client = $obj->code_compta_client;
1567 $thirdparty->code_fournisseur = $obj->code_fournisseur;
1568 $thirdparty->code_compta_fournisseur = $obj->code_compta_fournisseur;
1569 $thirdparty->email = $obj->email;
1570 $thirdparty->country_code = $obj->country_code;
1572 $paiement = $facturestatic->getSommePaiement();
1573 $totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
1574 $totaldeposits = $facturestatic->getSumDepositsUsed();
1575 $totalpay = $paiement + $totalcreditnotes + $totaldeposits;
1576 $remaintopay = $obj->total_ttc - $totalpay;
1578 $multicurrency_paiement = $facturestatic->getSommePaiement(1);
1579 $multicurrency_totalcreditnotes = $facturestatic->getSumCreditNotesUsed(1);
1580 $multicurrency_totaldeposits = $facturestatic->getSumDepositsUsed(1);
1582 $totalpay = $paiement + $totalcreditnotes + $totaldeposits;
1583 $remaintopay =
price2num($facturestatic->total_ttc - $totalpay);
1585 $multicurrency_totalpay = $multicurrency_paiement + $multicurrency_totalcreditnotes + $multicurrency_totaldeposits;
1586 $multicurrency_remaintopay =
price2num($facturestatic->multicurrency_total_ttc - $multicurrency_totalpay);
1590 $multicurrency_remaintopay = 0;
1593 $remaincreditnote = $discount->getAvailableDiscounts($thirdparty,
'',
'rc.fk_facture_source='.$facturestatic->id);
1594 $remaintopay = -$remaincreditnote;
1595 $totalpay =
price2num($facturestatic->total_ttc - $remaintopay);
1596 $multicurrency_remaincreditnote = $discount->getAvailableDiscounts($thirdparty,
'',
'rc.fk_facture_source='.$facturestatic->id, 0, 0, 1);
1597 $multicurrency_remaintopay = -$multicurrency_remaincreditnote;
1598 $multicurrency_totalpay =
price2num($facturestatic->multicurrency_total_ttc - $multicurrency_remaintopay);
1601 $facturestatic->alreadypaid = ($paiement ? $paiement : 0);
1603 $facturestatic->paye = $obj->paye;
1604 $facturestatic->paid = $obj->paye;
1606 $facturestatic->date = $db->jdate($obj->datef);
1612 if ($facturestatic->isCreditNoteUsed()) {
1613 $remaintopay = -$facturestatic->getSumFromThisCreditNotesNotUsed();
1617 if ($mode ==
'kanban') {
1619 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1620 print
'<div class="box-flex-container kanban">';
1623 if ($massactionbutton || $massaction) {
1625 if (in_array(
$object->id, $arrayofselected)) {
1630 $arraydata = array(
'alreadypaid' => $paiement,
'thirdparty' => $thirdparty->getNomUrl(1,
'', 12),
'selected' => in_array(
$object->id, $arrayofselected));
1631 print $facturestatic->getKanbanView(
'', $arraydata);
1632 if ($i == ($imaxinloop - 1)) {
1639 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
1643 print
'<td class="nowrap center">';
1644 if ($massactionbutton || $massaction) {
1646 if (in_array($obj->facid, $arrayofselected)) {
1649 print
'<input id="cb'.$obj->facid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->facid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1653 $totalarray[
'nbfield']++;
1656 if (!empty($arrayfields[
'f.ref'][
'checked'])) {
1657 print
'<td class="nowraponall">';
1659 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1661 print
'<td class="nobordernopadding nowraponall">';
1662 print $facturestatic->getNomUrl(1,
'', 0, 0,
'', 0, -1, 1);
1665 $filedir = $conf->fournisseur->facture->dir_output.
'/'.
get_exdir($obj->facid, 2, 0, 0, $facturestatic,
'invoice_supplier').dol_sanitizeFileName($obj->ref);
1666 $subdir =
get_exdir($obj->facid, 2, 0, 0, $facturestatic,
'invoice_supplier').dol_sanitizeFileName($obj->ref);
1667 print $formfile->getDocumentsLink(
'facture_fournisseur', $subdir, $filedir);
1668 print
'</td></tr></table>';
1672 $totalarray[
'nbfield']++;
1677 if (!empty($arrayfields[
'f.ref_supplier'][
'checked'])) {
1678 print
'<td class="nowrap tdoverflowmax150" title="'.dol_escape_htmltag($obj->ref_supplier).
'">';
1679 print $obj->ref_supplier;
1682 $totalarray[
'nbfield']++;
1687 if (!empty($arrayfields[
'f.type'][
'checked'])) {
1688 print
'<td class="nowrap">';
1689 print $facturestatic->getLibType();
1692 $totalarray[
'nbfield']++;
1697 if (!empty($arrayfields[
'f.subtype'][
'checked'])) {
1699 if ($facturestatic->subtype > 0) {
1700 $labeltoshow = $facturestatic->getSubtypeLabel(
'facture_fourn');
1702 print
'<td class="nowraponall tdoverflowmax300" title="'.$labeltoshow.
'">';
1706 $totalarray[
'nbfield']++;
1711 if (!empty($arrayfields[
'f.label'][
'checked'])) {
1712 print
'<td class="nowrap tdoverflowmax125" title="'.dol_escape_htmltag($obj->label).
'">';
1716 $totalarray[
'nbfield']++;
1721 if (!empty($arrayfields[
'f.datef'][
'checked'])) {
1722 print
'<td class="center nowrap">';
1726 $totalarray[
'nbfield']++;
1731 if (!empty($arrayfields[
'f.date_lim_reglement'][
'checked'])) {
1732 print
'<td class="center nowraponall">'.dol_print_date($datelimit,
'day');
1733 if ($facturestatic->hasDelay()) {
1734 print
img_warning($langs->trans(
'Alert').
' - '.$langs->trans(
'Late'));
1738 $totalarray[
'nbfield']++;
1743 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1744 print
'<td class="nowrap">';
1745 if ($obj->project_id > 0) {
1746 $projectstatic->id = $obj->project_id;
1747 $projectstatic->ref = $obj->project_ref;
1748 $projectstatic->title = $obj->project_label;
1749 print $projectstatic->getNomUrl(1);
1753 $totalarray[
'nbfield']++;
1758 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1759 print
'<td class="tdoverflowmax125">';
1760 print $thirdparty->getNomUrl(1,
'supplier', 0, 0, -1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
1763 $totalarray[
'nbfield']++;
1767 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1768 print
'<td class="tdoverflowmax150">';
1772 $totalarray[
'nbfield']++;
1776 if (!empty($arrayfields[
's.town'][
'checked'])) {
1777 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->town).
'">';
1781 $totalarray[
'nbfield']++;
1785 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1786 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->zip).
'">';
1790 $totalarray[
'nbfield']++;
1794 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1795 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->state_name).
'">';
1799 $totalarray[
'nbfield']++;
1803 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1804 print
'<td class="center">';
1805 $tmparray =
getCountry($obj->fk_pays,
'all');
1806 print $tmparray[
'label'];
1809 $totalarray[
'nbfield']++;
1813 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1814 print
'<td class="center">';
1815 if (empty($typenArray)) {
1816 $typenArray = $formcompany->typent_array(1);
1818 print $typenArray[$obj->typent_code];
1821 $totalarray[
'nbfield']++;
1826 if (!empty($arrayfields[
'f.fk_cond_reglement'][
'checked'])) {
1827 $s = $form->form_conditions_reglement($_SERVER[
'PHP_SELF'], $obj->fk_cond_reglement,
'none', 1,
'', -1, -1, 1);
1828 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).
'">';
1832 $totalarray[
'nbfield']++;
1836 if (!empty($arrayfields[
'f.fk_mode_reglement'][
'checked'])) {
1837 $s = $form->form_modes_reglement($_SERVER[
'PHP_SELF'], $obj->fk_mode_reglement,
'none',
'', -1, 0,
'', 1);
1838 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).
'">';
1842 $totalarray[
'nbfield']++;
1847 if (!empty($arrayfields[
'f.total_ht'][
'checked'])) {
1848 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_ht).
"</span></td>\n";
1850 $totalarray[
'nbfield']++;
1851 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_ht';
1853 $totalarray[
'val'][
'f.total_ht'] += $obj->total_ht;
1856 if (!empty($arrayfields[
'f.total_vat'][
'checked'])) {
1857 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_vat).
"</span></td>\n";
1859 $totalarray[
'nbfield']++;
1860 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_vat';
1862 $totalarray[
'val'][
'f.total_vat'] += $obj->total_vat;
1865 if (!empty($arrayfields[
'f.total_localtax1'][
'checked'])) {
1866 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_localtax1).
"</span></td>\n";
1868 $totalarray[
'nbfield']++;
1869 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_localtax1';
1871 $totalarray[
'val'][
'f.total_localtax1'] += $obj->total_localtax1;
1874 if (!empty($arrayfields[
'f.total_localtax2'][
'checked'])) {
1875 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_localtax2).
"</span></td>\n";
1877 $totalarray[
'nbfield']++;
1878 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_localtax2';
1880 $totalarray[
'val'][
'f.total_localtax2'] += $obj->total_localtax2;
1883 if (!empty($arrayfields[
'f.total_ttc'][
'checked'])) {
1884 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_ttc).
"</span></td>\n";
1886 $totalarray[
'nbfield']++;
1887 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_ttc';
1889 $totalarray[
'val'][
'f.total_ttc'] += $obj->total_ttc;
1893 if (!empty($arrayfields[
'f.nb_docs'][
'checked'])) {
1894 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
1895 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
1896 $upload_dir = $conf->fournisseur->facture->dir_output.
'/'.
get_exdir($facturestatic->id, 2, 0, 0, $facturestatic,
'invoice_supplier').$facturestatic->ref;
1897 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
1898 $nbLinks =
Link::count($db, $facturestatic->element, $facturestatic->id);
1899 $nbTotal = $nbFiles + $nbLinks;
1900 echo
'<td class="center">'.(empty($nbTotal) ?
'' : $nbTotal).
'</td>';
1902 $totalarray[
'nbfield']++;
1907 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1908 print
'<td class="tdoverflowmax100">';
1909 if ($userstatic->id) {
1910 print $userstatic->getNomUrl(-1);
1916 $totalarray[
'nbfield']++;
1921 if (!empty($arrayfields[
'dynamount_payed'][
'checked'])) {
1922 print
'<td class="right nowrap"><span class="amount">'.(!empty($totalpay) ?
price($totalpay, 0, $langs) :
'').
'</span></td>';
1924 $totalarray[
'nbfield']++;
1925 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalam';
1927 if (empty($totalarray[
'val'][
'totalam'])) {
1928 $totalarray[
'val'][
'totalam'] = 0;
1930 $totalarray[
'val'][
'totalam'] += $totalpay;
1934 if (!empty($arrayfields[
'rtp'][
'checked'])) {
1935 print
'<td class="right nowrap">'.(!empty($remaintopay) ?
price($remaintopay, 0, $langs) :
' ').
'</td>';
1937 $totalarray[
'nbfield']++;
1938 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'rtp';
1940 $totalarray[
'val'][
'rtp'] += $remaintopay;
1944 if (!empty($arrayfields[
'f.multicurrency_code'][
'checked'])) {
1945 print
'<td class="nowrap">'.$obj->multicurrency_code.
' - '.$langs->trans(
'Currency'.$obj->multicurrency_code).
"</td>\n";
1947 $totalarray[
'nbfield']++;
1952 if (!empty($arrayfields[
'f.multicurrency_tx'][
'checked'])) {
1953 print
'<td class="nowrap">';
1954 $form->form_multicurrency_rate($_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid, $obj->multicurrency_tx,
'none', $obj->multicurrency_code);
1957 $totalarray[
'nbfield']++;
1961 if (!empty($arrayfields[
'f.multicurrency_total_ht'][
'checked'])) {
1962 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht).
"</span></td>\n";
1964 $totalarray[
'nbfield']++;
1968 if (!empty($arrayfields[
'f.multicurrency_total_vat'][
'checked'])) {
1969 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_vat).
"</span></td>\n";
1971 $totalarray[
'nbfield']++;
1975 if (!empty($arrayfields[
'f.multicurrency_total_ttc'][
'checked'])) {
1976 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc).
"</span></td>\n";
1978 $totalarray[
'nbfield']++;
1982 if (!empty($arrayfields[
'multicurrency_dynamount_payed'][
'checked'])) {
1983 print
'<td class="right nowrap"><span class="amount">'.(!empty($multicurrency_totalpay) ?
price($multicurrency_totalpay, 0, $langs) :
'').
'</span></td>';
1985 $totalarray[
'nbfield']++;
1990 if (!empty($arrayfields[
'multicurrency_rtp'][
'checked'])) {
1991 print
'<td class="right nowrap"><span class="amount">';
1992 print(!empty($multicurrency_remaintopay) ?
price($multicurrency_remaintopay, 0, $langs) :
'');
1993 print
'</span></td>';
1995 $totalarray[
'nbfield']++;
2001 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
2003 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
2004 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
2005 print $hookmanager->resPrint;
2008 if (!empty($arrayfields[
'f.datec'][
'checked'])) {
2009 print
'<td class="center nowraponall">';
2010 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
2013 $totalarray[
'nbfield']++;
2017 if (!empty($arrayfields[
'f.tms'][
'checked'])) {
2018 print
'<td class="center nowraponall">';
2019 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
2022 $totalarray[
'nbfield']++;
2026 if (!empty($arrayfields[
'f.fk_statut'][
'checked'])) {
2027 print
'<td class="center nowrap">';
2028 print $facturestatic->getLibStatut(5, $paiement);
2031 $totalarray[
'nbfield']++;
2037 print
'<td class="nowrap center">';
2038 if ($massactionbutton || $massaction) {
2040 if (in_array($obj->facid, $arrayofselected)) {
2043 print
'<input id="cb'.$obj->facid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->facid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2047 $totalarray[
'nbfield']++;
2058include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2063 foreach ($arrayfields as $key => $val) {
2064 if (!empty($val[
'checked'])) {
2068 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2073$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
2074$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2075print $hookmanager->resPrint;
2077print
'</table>'.
"\n";
2080print
'</form>'.
"\n";
2082if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
2083 $hidegeneratedfilelistifempty = 1;
2084 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2085 $hidegeneratedfilelistifempty = 0;
2088 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
2092 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2093 $urlsource .= str_replace(
'&',
'&', $param);
2095 $filedir = $diroutputmassaction;
2096 $genallowed = $permissiontoread;
2097 $delallowed = $permissiontoadd;
2100 print $formfile->showdocuments(
'massfilesarea_supplier_invoice',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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=null, $outputlangs=null, $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
getCountriesInEEC()
Return list of countries that are inside the EEC (European Economic Community) Note: Try to keep this...
dol_dir_list($utf8_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 information (by default a local PHP server timestamp) Rep...
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
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.
print_barre_liste($title, $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.
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.
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,...
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.