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';
63$langs->loadLangs(array(
'products',
'bills',
'companies',
'projects'));
65$action =
GETPOST(
'action',
'aZ09');
66$massaction =
GETPOST(
'massaction',
'alpha');
68$confirm =
GETPOST(
'confirm',
'alpha');
69$toselect =
GETPOST(
'toselect',
'array');
70$optioncss =
GETPOST(
'optioncss',
'alpha');
71$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'supplierinvoicelist';
74$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
75$search_label =
GETPOST(
"search_label",
"alpha");
76$search_amount_no_tax =
GETPOST(
"search_amount_no_tax",
"alpha");
77$search_amount_all_tax =
GETPOST(
"search_amount_all_tax",
"alpha");
79$search_refsupplier =
GETPOST(
'search_refsupplier',
'alpha');
80$search_type =
GETPOST(
'search_type',
'intcomma');
81$search_subtype =
GETPOST(
'search_subtype',
'intcomma');
82$search_project =
GETPOST(
'search_project',
'alpha');
83$search_company =
GETPOST(
'search_company',
'alpha');
84$search_company_alias =
GETPOST(
'search_company_alias',
'alpha');
85$search_montant_ht =
GETPOST(
'search_montant_ht',
'alpha');
86$search_montant_vat =
GETPOST(
'search_montant_vat',
'alpha');
87$search_montant_localtax1 =
GETPOST(
'search_montant_localtax1',
'alpha');
88$search_montant_localtax2 =
GETPOST(
'search_montant_localtax2',
'alpha');
89$search_montant_ttc =
GETPOST(
'search_montant_ttc',
'alpha');
90$search_login =
GETPOST(
'search_login',
'alpha');
91$search_multicurrency_code =
GETPOST(
'search_multicurrency_code',
'alpha');
92$search_multicurrency_tx =
GETPOST(
'search_multicurrency_tx',
'alpha');
93$search_multicurrency_montant_ht =
GETPOST(
'search_multicurrency_montant_ht',
'alpha');
94$search_multicurrency_montant_vat =
GETPOST(
'search_multicurrency_montant_vat',
'alpha');
95$search_multicurrency_montant_ttc =
GETPOST(
'search_multicurrency_montant_ttc',
'alpha');
96$search_status =
GETPOST(
'search_status',
'intcomma');
97$search_paymentmode =
GETPOST(
'search_paymentmode',
'intcomma');
98$search_paymentcond =
GETPOST(
'search_paymentcond',
'intcomma');
99$search_town =
GETPOST(
'search_town',
'alpha');
100$search_zip =
GETPOST(
'search_zip',
'alpha');
101$search_state =
GETPOST(
"search_state");
102$search_country =
GETPOST(
"search_country",
'aZ09');
103$search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'intcomma');
104$search_user =
GETPOST(
'search_user',
'intcomma');
105$search_sale =
GETPOST(
'search_sale',
'intcomma');
106$search_date_start =
GETPOSTDATE(
'search_date_start',
'',
'tzserver');
107$search_date_end =
GETPOSTDATE(
'search_date_end',
'23:59:59',
'tzserver');
108$search_datelimit_startday =
GETPOSTINT(
'search_datelimit_startday');
109$search_datelimit_startmonth =
GETPOSTINT(
'search_datelimit_startmonth');
110$search_datelimit_startyear =
GETPOSTINT(
'search_datelimit_startyear');
111$search_datelimit_endday =
GETPOSTINT(
'search_datelimit_endday');
112$search_datelimit_endmonth =
GETPOSTINT(
'search_datelimit_endmonth');
113$search_datelimit_endyear =
GETPOSTINT(
'search_datelimit_endyear');
114$search_datelimit_start =
dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear);
115$search_datelimit_end =
dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear);
116$search_categ_sup =
GETPOST(
"search_categ_sup",
'intcomma');
117$search_product_category =
GETPOST(
'search_product_category',
'intcomma');
118$search_fk_fac_rec_source =
GETPOST(
'search_fk_fac_rec_source',
'int');
120$option =
GETPOST(
'search_option');
121if ($option ==
'late') {
122 $search_status =
'1';
124$filter =
GETPOST(
'filtre',
'alpha');
128$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
129$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
131if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
135$offset = $limit * $page;
140 $sortfield =
"f.datef,f.rowid";
142$pageprev = $page - 1;
143$pagenext = $page + 1;
148if ($user->socid > 0) {
150 $socid = $user->socid;
153$diroutputmassaction =
$conf->fournisseur->facture->dir_output.
'/temp/massgeneration/'.$user->id;
159$hookmanager->initHooks(array(
'supplierinvoicelist'));
163$extrafields->fetch_name_optionals_label(
$object->table_element);
165$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
168$fieldstosearchall = array(
170 'f.ref_supplier' =>
'RefSupplier',
171 'f.note_public' =>
'NotePublic',
172 's.nom' =>
"ThirdParty",
173 's.code_fournisseur' =>
"SupplierCodeShort",
174 'pd.description' =>
'Description',
176if (empty($user->socid)) {
177 $fieldstosearchall[
"f.note_private"] =
"NotePrivate";
180$checkedtypetiers = 0;
182 'f.ref' => array(
'label' =>
"Ref",
'checked' => 1,
'position' => 5),
183 'f.ref_supplier' => array(
'label' =>
"RefSupplier",
'checked' => 1,
'position' => 7),
184 'f.type' => array(
'label' =>
"Type",
'checked' => 0,
'position' => 15),
185 'f.subtype' => array(
'label' =>
"InvoiceSubtype",
'checked' => 0,
'position' => 17),
186 'f.label' => array(
'label' =>
"Label",
'checked' => 0,
'position' => 20),
187 'f.datef' => array(
'label' =>
"DateInvoice",
'checked' => 1,
'position' => 25),
188 'f.date_lim_reglement' => array(
'label' =>
"DateDue",
'checked' => 1,
'position' => 27),
189 'p.ref' => array(
'label' =>
"ProjectRef",
'checked' => 0,
'position' => 30),
190 's.nom' => array(
'label' =>
"ThirdParty",
'checked' => 1,
'position' => 41),
191 's.name_alias' => array(
'label' =>
"AliasNameShort",
'checked' => 0,
'position' => 42),
192 's.town' => array(
'label' =>
"Town",
'checked' => -1,
'position' => 43),
193 's.zip' => array(
'label' =>
"Zip",
'checked' => -1,
'position' => 44),
194 'state.nom' => array(
'label' =>
"StateShort",
'checked' => 0,
'position' => 45),
195 'country.code_iso' => array(
'label' =>
"Country",
'checked' => 0,
'position' => 46),
196 'typent.code' => array(
'label' =>
"ThirdPartyType",
'checked' => $checkedtypetiers,
'position' => 49),
197 'f.fk_mode_reglement' => array(
'label' =>
"PaymentMode",
'checked' => 1,
'position' => 52),
198 'f.fk_cond_reglement' => array(
'label' =>
"PaymentConditionsShort",
'checked' => 1,
'position' => 50),
199 'f.total_ht' => array(
'label' =>
"AmountHT",
'checked' => 1,
'position' => 105),
200 'f.total_vat' => array(
'label' =>
"AmountVAT",
'checked' => 0,
'position' => 110),
201 'f.total_localtax1' => array(
'label' => $langs->transcountry(
"AmountLT1", $mysoc->country_code),
'checked' => 0,
'enabled' => $mysoc->localtax1_assuj ==
"1",
'position' => 95),
202 'f.total_localtax2' => array(
'label' => $langs->transcountry(
"AmountLT2", $mysoc->country_code),
'checked' => 0,
'enabled' => $mysoc->localtax2_assuj ==
"1",
'position' => 100),
203 'f.total_ttc' => array(
'label' =>
"AmountTTC",
'checked' => 1,
'position' => 115),
204 'dynamount_payed' => array(
'label' =>
"Paid",
'checked' => 0,
'position' => 116),
205 'rtp' => array(
'label' =>
"Rest",
'checked' => 0,
'position' => 117),
206 'f.multicurrency_code' => array(
'label' =>
'Currency',
'checked' => 0,
'position' => 205,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
207 'f.multicurrency_tx' => array(
'label' =>
'CurrencyRate',
'checked' => 0,
'position' => 206,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
208 'f.multicurrency_total_ht' => array(
'label' =>
'MulticurrencyAmountHT',
'position' => 207,
'checked' => 0,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
209 'f.multicurrency_total_vat' => array(
'label' =>
'MulticurrencyAmountVAT',
'position' => 208,
'checked' => 0,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
210 'f.multicurrency_total_ttc' => array(
'label' =>
'MulticurrencyAmountTTC',
'position' => 209,
'checked' => 0,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
211 'multicurrency_dynamount_payed' => array(
'label' =>
'MulticurrencyAlreadyPaid',
'position' => 210,
'checked' => 0,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
212 'multicurrency_rtp' => array(
'label' =>
'MulticurrencyRemainderToPay',
'checked' => 0,
'position' => 211,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
213 'u.login' => array(
'label' =>
"Author",
'checked' => -1,
'position' => 500),
214 'f.datec' => array(
'label' =>
"DateCreation",
'checked' => 0,
'position' => 501),
215 'f.tms' => array(
'label' =>
"DateModificationShort",
'checked' => 0,
'position' => 502),
216 'f.nb_docs' => array(
'label' =>
"Documents",
'checked' => -1,
'position' => 510),
217 'f.fk_statut' => array(
'label' =>
"Status",
'checked' => 1,
'position' => 1000),
220include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
222$subtypearray =
$object->getArrayOfInvoiceSubtypes(0);
223if (empty($subtypearray)) {
224 unset($arrayfields[
'f.subtype']);
229'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
231if (!isModEnabled(
'supplier_invoice')) {
234if ((!$user->hasRight(
"fournisseur",
"facture",
"lire") && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD'))
235 || (!$user->hasRight(
"supplier_invoice",
"lire") &&
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD'))) {
240if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
241 $search_sale = $user->id;
244$permissiontoread = ($user->hasRight(
"fournisseur",
"facture",
"lire") || $user->hasRight(
"supplier_invoice",
"lire"));
245$permissiontoadd = ($user->hasRight(
"fournisseur",
"facture",
"creer") || $user->hasRight(
"supplier_invoice",
"creer"));
246$permissiontodelete = ($user->hasRight(
"fournisseur",
"facture",
"supprimer") || $user->hasRight(
"supplier_invoice",
"supprimer"));
253if (
GETPOST(
'cancel',
'alpha')) {
257if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
261$parameters = array(
'socid' => $socid,
'arrayfields' => &$arrayfields);
262$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
267if (empty($reshook)) {
269 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
272 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha')) {
276 $search_product_category =
'';
278 $search_refsupplier =
"";
280 $search_subtype =
'';
282 $search_project =
'';
283 $search_company =
"";
284 $search_company_alias =
"";
285 $search_amount_no_tax =
"";
286 $search_amount_all_tax =
"";
287 $search_montant_ht =
'';
288 $search_montant_vat =
'';
289 $search_montant_localtax1 =
'';
290 $search_montant_localtax2 =
'';
291 $search_montant_ttc =
'';
293 $search_multicurrency_code =
'';
294 $search_multicurrency_tx =
'';
295 $search_multicurrency_montant_ht =
'';
296 $search_multicurrency_montant_vat =
'';
297 $search_multicurrency_montant_ttc =
'';
299 $search_paymentmode =
'';
300 $search_paymentcond =
'';
304 $search_country =
'';
305 $search_type_thirdparty =
'';
306 $search_date_start =
'';
307 $search_date_end =
'';
308 $search_datelimit_startday =
'';
309 $search_datelimit_startmonth =
'';
310 $search_datelimit_startyear =
'';
311 $search_datelimit_endday =
'';
312 $search_datelimit_endmonth =
'';
313 $search_datelimit_endyear =
'';
314 $search_datelimit_start =
'';
315 $search_datelimit_end =
'';
317 $search_array_options = array();
318 $search_categ_sup = 0;
324 $objectclass =
'FactureFournisseur';
325 $objectlabel =
'SupplierInvoices';
327 $uploaddir =
$conf->fournisseur->facture->dir_output;
329 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
331 if ($massaction ==
'banktransfertrequest') {
332 $langs->load(
"withdrawals");
334 if (!$user->hasRight(
"paymentbybanktransfer",
"create")) {
341 $arrayofselected = is_array($toselect) ? $toselect : array();
342 $listofbills = array();
343 foreach ($arrayofselected as $toselectid) {
345 $result = $objecttmp->fetch($toselectid);
347 $totalpaid = $objecttmp->getSommePaiement();
348 $totalcreditnotes = $objecttmp->getSumCreditNotesUsed();
349 $totaldeposits = $objecttmp->getSumDepositsUsed();
350 $objecttmp->resteapayer =
price2num($objecttmp->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits,
'MT');
353 $parameters = array(
'remaintopay' => $objecttmp->resteapayer);
354 $reshook = $hookmanager->executeHooks(
'finalizeAmountOfInvoice', $parameters, $objecttmp, $action);
357 if (!empty($remaintopay = $hookmanager->resArray[
'remaintopay'])) {
358 $objecttmp->resteapayer = $remaintopay;
360 } elseif ($reshook < 0) {
362 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"ProcessingError"), $hookmanager->errors,
'errors');
367 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"Draft"), $objecttmp->errors,
'errors');
368 } elseif ($objecttmp->paid || $objecttmp->resteapayer == 0) {
370 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"AlreadyPaid"), $objecttmp->errors,
'errors');
371 } elseif ($objecttmp->resteapayer < 0) {
373 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"AmountMustBePositive"), $objecttmp->errors,
'errors');
376 $rsql =
"SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande";
377 $rsql .=
" , pfd.date_traite as date_traite";
378 $rsql .=
" , pfd.amount";
379 $rsql .=
" , u.rowid as user_id, u.lastname, u.firstname, u.login";
380 $rsql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_demande as pfd";
381 $rsql .=
" , ".MAIN_DB_PREFIX.
"user as u";
382 $rsql .=
" WHERE fk_facture_fourn = ".((int) $objecttmp->id);
383 $rsql .=
" AND pfd.fk_user_demande = u.rowid";
384 $rsql .=
" AND pfd.traite = 0";
385 $rsql .=
" ORDER BY pfd.date_demande DESC";
387 $result_sql = $db->query($rsql);
389 $numprlv = $db->num_rows($result_sql);
394 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"RequestAlreadyDone"), $objecttmp->errors,
'warnings');
395 } elseif (!empty($objecttmp->mode_reglement_code) && $objecttmp->mode_reglement_code !=
'VIR') {
396 $langs->load(
"errors");
398 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"ErrorThisPaymentModeIsNotCreditTransfer"), $objecttmp->errors,
'errors');
400 $listofbills[] = $objecttmp;
406 if (!empty($listofbills)) {
407 $nbwithdrawrequestok = 0;
408 foreach ($listofbills as $aBill) {
410 $result = $aBill->demande_prelevement($user, $aBill->resteapayer,
'bank-transfer',
'supplier_invoice');
413 $nbwithdrawrequestok++;
419 if ($nbwithdrawrequestok > 0) {
420 setEventMessages($langs->trans(
"WithdrawRequestsDone", $nbwithdrawrequestok),
null,
'mesgs');
432$form =
new Form($db);
435$bankaccountstatic =
new Account($db);
439$subtypearray =
$object->getArrayOfInvoiceSubtypes(0);
445 if (empty($search_company)) {
446 $search_company = $soc->name;
450$title = $langs->trans(
"BillsSuppliers").($socid ?
' - '.$soc->name :
'');
451$help_url =
'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores';
457 $sql =
'SELECT DISTINCT';
459$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,";
460$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,";
461$sql .=
" f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,";
462$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,';
463$sql .=
" f.note_public, f.note_private,";
464$sql .=
" f.fk_user_author,";
465$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,";
466$sql .=
" typent.code as typent_code,";
467$sql .=
" state.code_departement as state_code, state.nom as state_name,";
468$sql .=
" country.code as country_code,";
469$sql .=
" p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
470$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';
472if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
473 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
474 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
478$parameters = array();
479$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
480$sql .= $hookmanager->resPrint;
481$sql = preg_replace(
'/,\s*$/',
'', $sql);
486 $sql .=
', SUM(pf.amount) as dynamount_payed';
491$sql .=
' FROM '.MAIN_DB_PREFIX.
'societe as s';
492$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
493$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
494$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
495$sql .=
', '.MAIN_DB_PREFIX.
'facture_fourn as f';
496if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
497 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (f.rowid = ef.fk_object)";
500 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
503 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'facture_fourn_det as pd ON f.rowid=pd.fk_facture_fourn';
505$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user AS u ON f.fk_user_author = u.rowid';
506$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as p ON p.rowid = f.fk_projet";
507if ($search_user > 0) {
508 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ec";
509 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
512$parameters = array();
513$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
514$sql .= $hookmanager->resPrint;
515$sql .=
' WHERE f.fk_soc = s.rowid';
516$sql .=
' AND f.entity IN ('.getEntity(
'facture_fourn').
')';
518 $sql .=
' AND s.rowid = '.((int) $socid);
521 if (is_numeric($search_ref)) {
530if ($search_refsupplier) {
533if ($search_type !=
'' && $search_type >= 0) {
534 if ($search_type ==
'0') {
535 $sql .=
" AND f.type = 0";
537 if ($search_type ==
'1') {
538 $sql .=
" AND f.type = 1";
540 if ($search_type ==
'2') {
541 $sql .=
" AND f.type = 2";
543 if ($search_type ==
'3') {
544 $sql .=
" AND f.type = 3";
549if ($search_subtype !=
'' && $search_subtype !=
'-1') {
550 $sql .=
" AND f.subtype IN (".$db->sanitize($db->escape($search_subtype)).
")";
552if ($search_project) {
555if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_company) {
556 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_company);
558 if ($search_company) {
561 if ($search_company_alias) {
574if (strlen(trim($search_country))) {
576 $country_code_in_EEC = $country_code_in_EEC_without_me =
'';
577 foreach ($arrayofcode as $key => $value) {
578 $country_code_in_EEC .= ($country_code_in_EEC ?
"," :
"").
"'".$value.
"'";
579 if ($value != $mysoc->country_code) {
580 $country_code_in_EEC_without_me .= ($country_code_in_EEC_without_me ?
"," :
"").
"'".$value.
"'";
583 if ($search_country ==
'special_allnotme') {
584 $sql .=
" AND country.code <> '".$db->escape($mysoc->country_code).
"'";
585 } elseif ($search_country ==
'special_eec') {
586 $sql .=
" AND country.code IN (".$db->sanitize($country_code_in_EEC, 1).
")";
587 } elseif ($search_country ==
'special_eecnotme') {
588 $sql .=
" AND country.code IN (".$db->sanitize($country_code_in_EEC_without_me, 1).
")";
589 } elseif ($search_country ==
'special_noteec') {
590 $sql .=
" AND country.code NOT IN (".$db->sanitize($country_code_in_EEC, 1).
")";
595if ($search_type_thirdparty !=
'' && $search_type_thirdparty >= 0) {
596 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
598if ($search_montant_ht !=
'') {
601if ($search_montant_vat !=
'') {
604if ($search_montant_localtax1 !=
'') {
605 $sql .=
natural_search(
'f.localtax1', $search_montant_localtax1, 1);
607if ($search_montant_localtax2 !=
'') {
608 $sql .=
natural_search(
'f.localtax2', $search_montant_localtax2, 1);
610if ($search_montant_ttc !=
'') {
613if ($search_multicurrency_code !=
'') {
614 $sql .=
" AND f.multicurrency_code = '".$db->escape($search_multicurrency_code).
"'";
616if ($search_multicurrency_tx !=
'') {
617 $sql .=
natural_search(
'f.multicurrency_tx', $search_multicurrency_tx, 1);
619if ($search_multicurrency_montant_ht !=
'') {
620 $sql .=
natural_search(
'f.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
622if ($search_multicurrency_montant_vat !=
'') {
623 $sql .=
natural_search(
'f.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
625if ($search_multicurrency_montant_ttc !=
'') {
626 $sql .=
natural_search(
'f.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
629 $sql .=
natural_search(array(
'u.login',
'u.lastname',
'u.firstname'), $search_login);
631if ($search_status !=
'' && $search_status >= 0) {
632 $sql .=
" AND f.fk_statut = ".((int) $search_status);
634if ($search_paymentmode > 0) {
635 $sql .=
" AND f.fk_mode_reglement = ".((int) $search_paymentmode);
637if ($search_paymentcond > 0) {
638 $sql .=
" AND f.fk_cond_reglement = ".((int) $search_paymentcond);
640if ($search_date_start) {
641 $sql .=
" AND f.datef >= '" . $db->idate($search_date_start) .
"'";
643if ($search_date_end) {
644 $sql .=
" AND f.datef <= '" . $db->idate($search_date_end) .
"'";
646if ($search_datelimit_start) {
647 $sql .=
" AND f.date_lim_reglement >= '" . $db->idate($search_datelimit_start) .
"'";
649if ($search_datelimit_end) {
650 $sql .=
" AND f.date_lim_reglement <= '" . $db->idate($search_datelimit_end) .
"'";
652if ($option ==
'late') {
653 $sql .=
" AND f.date_lim_reglement < '".$db->idate(
dol_now() -
$conf->facture->fournisseur->warning_delay).
"'";
658if ($search_fk_fac_rec_source) {
659 $sql .=
" AND f.fk_fac_rec_source = ".(int) $search_fk_fac_rec_source;
662if ($search_sale && $search_sale !=
'-1') {
663 if ($search_sale == -2) {
664 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc)";
665 } elseif ($search_sale > 0) {
666 $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).
")";
669$searchCategorySupplierList = $search_categ_sup ? array($search_categ_sup) : array();
670$searchCategorySupplierOperator = 0;
672if (!empty($searchCategorySupplierList)) {
673 $searchCategorySupplierSqlList = array();
674 $listofcategoryid =
'';
675 foreach ($searchCategorySupplierList as $searchCategorySupplier) {
676 if (intval($searchCategorySupplier) == -2) {
677 $searchCategorySupplierSqlList[] =
"NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)";
678 } elseif (intval($searchCategorySupplier) > 0) {
679 if ($searchCategorySupplierOperator == 0) {
680 $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).
")";
682 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategorySupplier);
686 if ($listofcategoryid) {
687 $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).
"))";
689 if ($searchCategorySupplierOperator == 1) {
690 if (!empty($searchCategorySupplierSqlList)) {
691 $sql .=
" AND (".implode(
' OR ', $searchCategorySupplierSqlList).
")";
694 if (!empty($searchCategorySupplierSqlList)) {
695 $sql .=
" AND (".implode(
' AND ', $searchCategorySupplierSqlList).
")";
700$searchCategoryProductList = $search_product_category ? array($search_product_category) : array();
701$searchCategoryProductOperator = 0;
702if (!empty($searchCategoryProductList)) {
703 $searchCategoryProductSqlList = array();
704 $listofcategoryid =
'';
705 foreach ($searchCategoryProductList as $searchCategoryProduct) {
706 if (intval($searchCategoryProduct) == -2) {
707 $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)";
708 } elseif (intval($searchCategoryProduct) > 0) {
709 if ($searchCategoryProductOperator == 0) {
710 $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).
")";
712 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
716 if ($listofcategoryid) {
717 $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).
"))";
719 if ($searchCategoryProductOperator == 1) {
720 if (!empty($searchCategoryProductSqlList)) {
721 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
724 if (!empty($searchCategoryProductSqlList)) {
725 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
729if ($filter && $filter != -1) {
730 $aFilter = explode(
',', $filter);
731 foreach ($aFilter as $fil) {
732 $filt = explode(
':', $fil);
733 $sql .=
" AND ".$db->escape(trim($filt[0])).
" = '".$db->escape(trim($filt[1])).
"'";
740if ($search_user > 0) {
741 $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);
744include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
746$parameters = array();
747$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
748$sql .= $hookmanager->resPrint;
751 $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,";
752 $sql .=
" f.total_ht, f.total_ttc, f.total_tva, f.paye, f.close_code, f.fk_statut, f.libelle, f.datec, f.tms,";
753 $sql .=
" f.localtax1, f.localtax2,";
754 $sql .=
' f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc,';
755 $sql .=
" f.note_public, f.note_private,";
756 $sql .=
" f.fk_user_author,";
757 $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,';
758 $sql .=
" typent.code,";
759 $sql .=
" state.code_departement, state.nom,";
760 $sql .=
' country.code,';
761 $sql .=
" p.rowid, p.ref, p.title,";
762 $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";
763 if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
764 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
766 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
",ef.".$key :
'');
770 $parameters = array(
'all' => $search_all,
'fieldstosearchall' => $fieldstosearchall);
771 $reshook = $hookmanager->executeHooks(
'printFieldListGroupBy', $parameters, $object, $action);
772 $sql .= $hookmanager->resPrint;
774 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
778$parameters = array();
779$reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object, $action);
780$sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
783$nbtotalofrecords =
'';
786 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(DISTINCT f.rowid) as nbtotalofrecords', $sql);
788 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
789 $sqlforcount = preg_replace(
'/LEFT JOIN '.MAIN_DB_PREFIX.
'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid/',
'', $sqlforcount);
791 $resql = $db->query($sqlforcount);
793 $objforcount = $db->fetch_object($resql);
794 $nbtotalofrecords = $objforcount->nbtotalofrecords;
799 if (($page * $limit) > $nbtotalofrecords) {
807$sql .= $db->order($sortfield, $sortorder);
809 $sql .= $db->plimit($limit + 1, $offset);
813$resql = $db->query($sql);
819$num = $db->num_rows($resql);
822if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
823 $obj = $db->fetch_object($resql);
825 header(
"Location: ".DOL_URL_ROOT.
'/fourn/facture/card.php?facid='.
$id);
832llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist mod-fourn-facture page-list');
834if ($search_fk_fac_rec_source) {
835 require_once DOL_DOCUMENT_ROOT .
'/fourn/class/fournisseur.facture-rec.class.php';
836 require_once DOL_DOCUMENT_ROOT .
'/core/lib/invoice.lib.php';
838 $object->fetch((
int) $search_fk_fac_rec_source);
841 print
dol_get_fiche_head($head,
'generated', $langs->trans(
'InvoicesGeneratedFromRec'), -1,
'bill');
847 if (empty($search_company)) {
848 $search_company = $soc->name;
849 $search_company_alias = $soc->name_alias;
853$arrayofselected = is_array($toselect) ? $toselect : array();
855$param =
'&socid='.$socid;
857 $param .=
'&mode='.urlencode($mode);
859if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
860 $param .=
'&contextpage='.urlencode($contextpage);
862if ($limit > 0 && $limit !=
$conf->liste_limit) {
863 $param .=
'&limit='.((int) $limit);
865if ($optioncss !=
'') {
866 $param .=
'&optioncss='.urlencode($optioncss);
869 $param .=
'&search_all='.urlencode($search_all);
871if ($search_date_start) {
872 $param .=
buildParamDate(
'search_date_start',
null,
'',
'tzserver');
874if ($search_date_end) {
875 $param .=
buildParamDate(
'search_date_end',
null,
'',
'tzserver');
877if ($search_datelimit_startday) {
878 $param .=
'&search_datelimit_startday='.urlencode((
string) ($search_datelimit_startday));
880if ($search_datelimit_startmonth) {
881 $param .=
'&search_datelimit_startmonth='.urlencode((
string) ($search_datelimit_startmonth));
883if ($search_datelimit_startyear) {
884 $param .=
'&search_datelimit_startyear='.urlencode((
string) ($search_datelimit_startyear));
886if ($search_datelimit_endday) {
887 $param .=
'&search_datelimit_endday='.urlencode((
string) ($search_datelimit_endday));
889if ($search_datelimit_endmonth) {
890 $param .=
'&search_datelimit_endmonth='.urlencode((
string) ($search_datelimit_endmonth));
892if ($search_datelimit_endyear) {
893 $param .=
'&search_datelimit_endyear='.urlencode((
string) ($search_datelimit_endyear));
896 $param .=
'&search_ref='.urlencode($search_ref);
898if ($search_refsupplier) {
899 $param .=
'&search_refsupplier='.urlencode($search_refsupplier);
901if ($search_type !=
'') {
902 $param .=
'&search_type='.urlencode($search_type);
904if ($search_subtype !=
'') {
905 $param .=
'&search_subtype='.urlencode($search_subtype);
908 $param .=
'&search_label='.urlencode($search_label);
910if ($search_company) {
911 $param .=
'&search_company='.urlencode($search_company);
913if ($search_company_alias) {
914 $param .=
'&search_company_alias='.urlencode($search_company_alias);
917 $param .=
'&search_login='.urlencode($search_login);
919if ($search_montant_ht !=
'') {
920 $param .=
'&search_montant_ht='.urlencode($search_montant_ht);
922if ($search_montant_vat !=
'') {
923 $param .=
'&search_montant_vat='.urlencode($search_montant_vat);
925if ($search_montant_localtax1 !=
'') {
926 $param .=
'&search_montant_localtax1='.urlencode($search_montant_localtax1);
928if ($search_montant_localtax2 !=
'') {
929 $param .=
'&search_montant_localtax2='.urlencode($search_montant_localtax2);
931if ($search_montant_ttc !=
'') {
932 $param .=
'&search_montant_ttc='.urlencode($search_montant_ttc);
934if ($search_multicurrency_code !=
'') {
935 $param .=
'&search_multicurrency_code='.urlencode($search_multicurrency_code);
937if ($search_multicurrency_tx !=
'') {
938 $param .=
'&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
940if ($search_multicurrency_montant_ht !=
'') {
941 $param .=
'&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
943if ($search_multicurrency_montant_vat !=
'') {
944 $param .=
'&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
946if ($search_multicurrency_montant_ttc !=
'') {
947 $param .=
'&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
949if ($search_amount_no_tax) {
950 $param .=
'&search_amount_no_tax='.urlencode($search_amount_no_tax);
952if ($search_amount_all_tax) {
953 $param .=
'&search_amount_all_tax='.urlencode($search_amount_all_tax);
955if ($search_status >= 0) {
956 $param .=
"&search_status=".urlencode($search_status);
958if ($search_paymentmode) {
959 $param .=
'&search_paymentmode='.urlencode((
string) ($search_paymentmode));
961if ($search_paymentcond) {
962 $param .=
'&search_paymentcond='.urlencode((
string) ($search_paymentcond));
965 $param .=
'&show_files='.urlencode((
string) ($show_files));
968 $param .=
"&search_option=".urlencode($option);
970if ($search_categ_sup > 0) {
971 $param .=
'&search_categ_sup='.$search_categ_sup;
973if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
974 $param .=
'&search_type_thirdparty='.$search_type_thirdparty;
976if ($search_fk_fac_rec_source) {
977 $param .=
'&search_fk_fac_rec_source=' . (int) $search_fk_fac_rec_source;
981include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
983$parameters = array(
'param' => &$param);
984$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
985$param .= $hookmanager->resPrint;
988$arrayofmassactions = array(
989 'validate' =>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate"),
990 'generate_doc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
991 'builddoc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
995if (isModEnabled(
'paymentbybanktransfer') && $user->hasRight(
"paymentbybanktransfer",
"create")) {
996 $langs->load(
'withdrawals');
997 $arrayofmassactions[
'banktransfertrequest'] =
img_picto(
'',
'payment',
'class="pictofixedwidth"').$langs->trans(
"MakeBankTransferOrder");
999if (!empty($permissiontodelete)) {
1000 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
1002if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
1003 $arrayofmassactions = array();
1005$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1007$url = DOL_URL_ROOT.
'/fourn/facture/card.php?action=create';
1009 $url .=
'&socid='.urlencode((
string) (
$object->socid));
1012 $url .=
'&fac_rec='.urlencode((
string)
$object->id);
1015print
'<form method="POST" id="searchFormList" name="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
1016if ($optioncss !=
'') {
1017 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1019print
'<input type="hidden" name="token" value="'.newToken().
'">';
1020print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1021print
'<input type="hidden" name="action" value="list">';
1022print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1023print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1024print
'<input type="hidden" name="socid" value="'.$socid.
'">';
1025print
'<input type="hidden" name="page" value="'.$page.
'">';
1026print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
1027print
'<input type="hidden" name="page_y" value="">';
1028print
'<input type="hidden" name="mode" value="'.$mode.
'">';
1031$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'));
1032$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'));
1034$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewBill'),
'',
'fa fa-plus-circle', $url,
'', (
int) ($user->hasRight(
"fournisseur",
"facture",
"creer") || $user->hasRight(
"supplier_invoice",
"creer")));
1036print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_invoice', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1039$topicmail =
"SendBillRef";
1040$modelmail =
"invoice_supplier_send";
1042$trackid =
'sinv'.$object->id;
1043include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1047 foreach ($fieldstosearchall as $key => $val) {
1048 $fieldstosearchall[$key] = $langs->trans($val);
1049 $setupstring .= $key.
"=".$val.
";";
1051 print
'<!-- Search done like if SUPPLIER_INVOICE_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
1052 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
1057if ($user->hasRight(
"user",
"user",
"lire")) {
1058 $langs->load(
"commercial");
1059 $moreforfilter .=
'<div class="divsearchfield">';
1060 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1061 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth200');
1062 $moreforfilter .=
'</div>';
1065if ($user->hasRight(
"user",
"user",
"lire")) {
1066 $moreforfilter .=
'<div class="divsearchfield">';
1067 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
1068 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$form->select_dolusers($search_user,
'search_user', $tmptitle,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth200');
1069 $moreforfilter .=
'</div>';
1072if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire') && ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire'))) {
1073 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1074 $moreforfilter .=
'<div class="divsearchfield">';
1075 $tmptitle = $langs->trans(
'IncludingProductWithTag');
1076 $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT,
null,
'parent',
null,
null, 1);
1077 $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);
1078 $moreforfilter .=
'</div>';
1081if (isModEnabled(
'category')) {
1082 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1083 $moreforfilter .=
'<div class="divsearchfield">';
1084 $tmptitle = $langs->trans(
'SuppliersCategoriesShort');
1085 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$formother->select_categories(
'supplier', $search_categ_sup,
'search_categ_sup', 1, $tmptitle);
1086 $moreforfilter .=
'</div>';
1088$parameters = array();
1089$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1090if (empty($reshook)) {
1091 $moreforfilter .= $hookmanager->resPrint;
1093 $moreforfilter = $hookmanager->resPrint;
1096if (!empty($moreforfilter)) {
1097 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1098 print $moreforfilter;
1102$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1103$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1104$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
1105$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1107print
'<div class="div-table-responsive">';
1108print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1112print
'<tr class="liste_titre_filter">';
1115 print
'<td class="liste_titre center maxwidthsearch">';
1116 $searchpicto = $form->showFilterButtons(
'left');
1121if (!empty($arrayfields[
'f.ref'][
'checked'])) {
1122 print
'<td class="liste_titre left">';
1123 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
1127if (!empty($arrayfields[
'f.ref_supplier'][
'checked'])) {
1128 print
'<td class="liste_titre">';
1129 print
'<input class="flat maxwidth75" type="text" name="search_refsupplier" value="'.dol_escape_htmltag($search_refsupplier).
'">';
1133if (!empty($arrayfields[
'f.type'][
'checked'])) {
1134 print
'<td class="liste_titre maxwidthonsmartphone">';
1141 print $form->selectarray(
'search_type', $typearray, $search_type, 1, 0, 0,
'', 0, 0, 0,
'ASC',
'maxwidth100');
1145if (!empty($arrayfields[
'f.subtype'][
'checked'])) {
1146 print
'<td class="liste_titre maxwidthonsmartphone" align="center">';
1147 print $form->selectarray(
'search_subtype', $subtypearray, $search_subtype, 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth100');
1151if (!empty($arrayfields[
'f.label'][
'checked'])) {
1152 print
'<td class="liste_titre">';
1153 print
'<input class="flat maxwidth75" type="text" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
1157if (!empty($arrayfields[
'f.datef'][
'checked'])) {
1158 print
'<td class="liste_titre center">';
1159 print
'<div class="nowrapfordate">';
1160 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1162 print
'<div class="nowrapfordate">';
1163 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1168if (!empty($arrayfields[
'f.date_lim_reglement'][
'checked'])) {
1169 print
'<td class="liste_titre center">';
1170 print
'<div class="">';
1177 print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1,
'search_datelimit_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"Before"));
1179 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>';
1184if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1185 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_project" value="'.dol_escape_htmltag($search_project).
'"></td>';
1188if (!empty($arrayfields[
's.nom'][
'checked'])) {
1189 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).
'"'.($socid > 0 ?
" disabled" :
"").
'></td>';
1192if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1193 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_company_alias" value="'.dol_escape_htmltag($search_company_alias).
'"></td>';
1196if (!empty($arrayfields[
's.town'][
'checked'])) {
1197 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).
'"></td>';
1200if (!empty($arrayfields[
's.zip'][
'checked'])) {
1201 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'"></td>';
1204if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1205 print
'<td class="liste_titre">';
1206 print
'<input class="flat maxwidth50imp" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1210if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1211 print
'<td class="liste_titre center">';
1212 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth150imp maxwidth150',
'code2', 1, 0, 1,
null, 1);
1216if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1217 print
'<td class="liste_titre maxwidthonsmartphone center">';
1218 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);
1222if (!empty($arrayfields[
'f.fk_cond_reglement'][
'checked'])) {
1223 print
'<td class="liste_titre left">';
1224 print $form->getSelectConditionsPaiements($search_paymentcond,
'search_paymentcond', -1, 1, 1,
'maxwidth100');
1228if (!empty($arrayfields[
'f.fk_mode_reglement'][
'checked'])) {
1229 print
'<td class="liste_titre">';
1230 print $form->select_types_paiements($search_paymentmode,
'search_paymentmode',
'', 0, 1, 1, 20, 1,
'maxwidth100', 1);
1233if (!empty($arrayfields[
'f.total_ht'][
'checked'])) {
1235 print
'<td class="liste_titre right">';
1236 print
'<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).
'">';
1239if (!empty($arrayfields[
'f.total_vat'][
'checked'])) {
1241 print
'<td class="liste_titre right">';
1242 print
'<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).
'">';
1245if (!empty($arrayfields[
'f.total_localtax1'][
'checked'])) {
1247 print
'<td class="liste_titre right">';
1248 print
'<input class="flat" type="text" size="5" name="search_montant_localtax1" value="'.dol_escape_htmltag($search_montant_localtax1).
'">';
1251if (!empty($arrayfields[
'f.total_localtax2'][
'checked'])) {
1253 print
'<td class="liste_titre right">';
1254 print
'<input class="flat" type="text" size="5" name="search_montant_localtax2" value="'.dol_escape_htmltag($search_montant_localtax2).
'">';
1257if (!empty($arrayfields[
'f.total_ttc'][
'checked'])) {
1259 print
'<td class="liste_titre right">';
1260 print
'<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).
'">';
1263if (!empty($arrayfields[
'f.nb_docs'][
'checked'])) {
1265 print
'<td class="liste_titre" align="center">';
1268if (!empty($arrayfields[
'u.login'][
'checked'])) {
1270 print
'<td class="liste_titre" align="center">';
1271 print
'<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1274if (!empty($arrayfields[
'dynamount_payed'][
'checked'])) {
1275 print
'<td class="liste_titre right">';
1278if (!empty($arrayfields[
'rtp'][
'checked'])) {
1279 print
'<td class="liste_titre">';
1282if (!empty($arrayfields[
'f.multicurrency_code'][
'checked'])) {
1284 print
'<td class="liste_titre">';
1285 print $form->selectMultiCurrency($search_multicurrency_code,
'search_multicurrency_code', 1);
1288if (!empty($arrayfields[
'f.multicurrency_tx'][
'checked'])) {
1290 print
'<td class="liste_titre">';
1291 print
'<input class="flat" type="text" size="4" name="search_multicurrency_tx" value="'.dol_escape_htmltag($search_multicurrency_tx).
'">';
1294if (!empty($arrayfields[
'f.multicurrency_total_ht'][
'checked'])) {
1296 print
'<td class="liste_titre right">';
1297 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ht" value="'.dol_escape_htmltag($search_multicurrency_montant_ht).
'">';
1300if (!empty($arrayfields[
'f.multicurrency_total_vat'][
'checked'])) {
1302 print
'<td class="liste_titre right">';
1303 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_vat" value="'.dol_escape_htmltag($search_multicurrency_montant_vat).
'">';
1306if (!empty($arrayfields[
'f.multicurrency_total_ttc'][
'checked'])) {
1308 print
'<td class="liste_titre right">';
1309 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ttc" value="'.dol_escape_htmltag($search_multicurrency_montant_ttc).
'">';
1312if (!empty($arrayfields[
'multicurrency_dynamount_payed'][
'checked'])) {
1313 print
'<td class="liste_titre">';
1316if (!empty($arrayfields[
'multicurrency_rtp'][
'checked'])) {
1317 print
'<td class="liste_titre right">';
1321include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1324$parameters = array(
'arrayfields' => $arrayfields);
1325$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1326print $hookmanager->resPrint;
1328if (!empty($arrayfields[
'f.datec'][
'checked'])) {
1329 print
'<td class="liste_titre">';
1333if (!empty($arrayfields[
'f.tms'][
'checked'])) {
1334 print
'<td class="liste_titre">';
1338if (!empty($arrayfields[
'f.fk_statut'][
'checked'])) {
1339 print
'<td class="liste_titre center parentonrightofpage">';
1340 $liststatus = array(
'0' => $langs->trans(
"Draft"),
'1' => $langs->trans(
"Unpaid"),
'2' => $langs->trans(
"Paid"));
1342 print $form->selectarray(
'search_status', $liststatus, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'center search_status width100 onrightofpage', 1);
1347 print
'<td class="liste_titre center maxwidthsearch">';
1348 $searchpicto = $form->showFilterButtons();
1355$totalarray = array();
1356$totalarray[
'nbfield'] = 0;
1360print
'<tr class="liste_titre">';
1363 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1364 $totalarray[
'nbfield']++;
1366if (!empty($arrayfields[
'f.ref'][
'checked'])) {
1367 print_liste_field_titre($arrayfields[
'f.ref'][
'label'], $_SERVER[
'PHP_SELF'],
'f.ref,f.rowid',
'', $param,
'', $sortfield, $sortorder);
1368 $totalarray[
'nbfield']++;
1370if (!empty($arrayfields[
'f.ref_supplier'][
'checked'])) {
1371 print_liste_field_titre($arrayfields[
'f.ref_supplier'][
'label'], $_SERVER[
"PHP_SELF"],
'f.ref_supplier',
'', $param,
'', $sortfield, $sortorder);
1372 $totalarray[
'nbfield']++;
1374if (!empty($arrayfields[
'f.type'][
'checked'])) {
1375 print_liste_field_titre($arrayfields[
'f.type'][
'label'], $_SERVER[
"PHP_SELF"],
'f.type',
'', $param,
'', $sortfield, $sortorder);
1376 $totalarray[
'nbfield']++;
1378if (!empty($arrayfields[
'f.subtype'][
'checked'])) {
1379 print_liste_field_titre($arrayfields[
'f.subtype'][
'label'], $_SERVER[
"PHP_SELF"],
'f.subtype',
'', $param,
'', $sortfield, $sortorder);
1381if (!empty($arrayfields[
'f.label'][
'checked'])) {
1382 print_liste_field_titre($arrayfields[
'f.label'][
'label'], $_SERVER[
'PHP_SELF'],
"f.libelle,f.rowid",
'', $param,
'', $sortfield, $sortorder);
1383 $totalarray[
'nbfield']++;
1385if (!empty($arrayfields[
'f.datef'][
'checked'])) {
1386 print_liste_field_titre($arrayfields[
'f.datef'][
'label'], $_SERVER[
'PHP_SELF'],
'f.datef,f.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1387 $totalarray[
'nbfield']++;
1389if (!empty($arrayfields[
'f.date_lim_reglement'][
'checked'])) {
1390 print_liste_field_titre($arrayfields[
'f.date_lim_reglement'][
'label'], $_SERVER[
'PHP_SELF'],
"f.date_lim_reglement",
'', $param,
'', $sortfield, $sortorder,
'center ');
1391 $totalarray[
'nbfield']++;
1393if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1394 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
'PHP_SELF'],
"p.ref",
'', $param,
'', $sortfield, $sortorder);
1395 $totalarray[
'nbfield']++;
1397if (!empty($arrayfields[
's.nom'][
'checked'])) {
1398 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
'PHP_SELF'],
's.nom',
'', $param,
'', $sortfield, $sortorder);
1399 $totalarray[
'nbfield']++;
1401if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1403 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
'PHP_SELF'],
's.name_alias',
'', $param,
'', $sortfield, $sortorder);
1404 $totalarray[
'nbfield']++;
1406if (!empty($arrayfields[
's.town'][
'checked'])) {
1407 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1408 $totalarray[
'nbfield']++;
1410if (!empty($arrayfields[
's.zip'][
'checked'])) {
1411 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1412 $totalarray[
'nbfield']++;
1414if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1415 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.name_alias",
"", $param,
'', $sortfield, $sortorder);
1416 $totalarray[
'nbfield']++;
1418if (!empty($arrayfields[
'state.name_alias'][
'checked'])) {
1419 print_liste_field_titre($arrayfields[
'state.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1420 $totalarray[
'nbfield']++;
1422if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1423 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1424 $totalarray[
'nbfield']++;
1426if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1427 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1428 $totalarray[
'nbfield']++;
1430if (!empty($arrayfields[
'f.fk_cond_reglement'][
'checked'])) {
1431 print_liste_field_titre($arrayfields[
'f.fk_cond_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"f.fk_cond_reglement",
"", $param,
"", $sortfield, $sortorder);
1432 $totalarray[
'nbfield']++;
1434if (!empty($arrayfields[
'f.fk_mode_reglement'][
'checked'])) {
1435 print_liste_field_titre($arrayfields[
'f.fk_mode_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"f.fk_mode_reglement",
"", $param,
"", $sortfield, $sortorder);
1436 $totalarray[
'nbfield']++;
1438if (!empty($arrayfields[
'f.total_ht'][
'checked'])) {
1439 print_liste_field_titre($arrayfields[
'f.total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'f.total_ht',
'', $param,
'', $sortfield, $sortorder,
'right ');
1440 $totalarray[
'nbfield']++;
1442if (!empty($arrayfields[
'f.total_vat'][
'checked'])) {
1443 print_liste_field_titre($arrayfields[
'f.total_vat'][
'label'], $_SERVER[
'PHP_SELF'],
'f.total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1444 $totalarray[
'nbfield']++;
1446if (!empty($arrayfields[
'f.total_localtax1'][
'checked'])) {
1447 print_liste_field_titre($arrayfields[
'f.total_localtax1'][
'label'], $_SERVER[
'PHP_SELF'],
'f.localtax1',
'', $param,
'', $sortfield, $sortorder,
'right ');
1448 $totalarray[
'nbfield']++;
1450if (!empty($arrayfields[
'f.total_localtax2'][
'checked'])) {
1451 print_liste_field_titre($arrayfields[
'f.total_localtax2'][
'label'], $_SERVER[
'PHP_SELF'],
'f.localtax2',
'', $param,
'', $sortfield, $sortorder,
'right ');
1452 $totalarray[
'nbfield']++;
1454if (!empty($arrayfields[
'f.total_ttc'][
'checked'])) {
1455 print_liste_field_titre($arrayfields[
'f.total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'f.total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1456 $totalarray[
'nbfield']++;
1458if (!empty($arrayfields[
'f.nb_docs'][
'checked'])) {
1459 print_liste_field_titre($arrayfields[
'f.nb_docs'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1460 $totalarray[
'nbfield']++;
1462if (!empty($arrayfields[
'u.login'][
'checked'])) {
1463 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'', $sortfield, $sortorder);
1464 $totalarray[
'nbfield']++;
1466if (!empty($arrayfields[
'dynamount_payed'][
'checked'])) {
1467 print_liste_field_titre($arrayfields[
'dynamount_payed'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1468 $totalarray[
'nbfield']++;
1470if (!empty($arrayfields[
'rtp'][
'checked'])) {
1471 print_liste_field_titre($arrayfields[
'rtp'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder);
1472 $totalarray[
'nbfield']++;
1474if (!empty($arrayfields[
'f.multicurrency_code'][
'checked'])) {
1475 print_liste_field_titre($arrayfields[
'f.multicurrency_code'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_code',
'', $param,
'', $sortfield, $sortorder);
1476 $totalarray[
'nbfield']++;
1478if (!empty($arrayfields[
'f.multicurrency_tx'][
'checked'])) {
1479 print_liste_field_titre($arrayfields[
'f.multicurrency_tx'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_tx',
'', $param,
'', $sortfield, $sortorder);
1480 $totalarray[
'nbfield']++;
1482if (!empty($arrayfields[
'f.multicurrency_total_ht'][
'checked'])) {
1483 print_liste_field_titre($arrayfields[
'f.multicurrency_total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_total_ht',
'', $param,
'"', $sortfield, $sortorder,
'right ');
1484 $totalarray[
'nbfield']++;
1486if (!empty($arrayfields[
'f.multicurrency_total_vat'][
'checked'])) {
1487 print_liste_field_titre($arrayfields[
'f.multicurrency_total_vat'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1488 $totalarray[
'nbfield']++;
1490if (!empty($arrayfields[
'f.multicurrency_total_ttc'][
'checked'])) {
1491 print_liste_field_titre($arrayfields[
'f.multicurrency_total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1492 $totalarray[
'nbfield']++;
1494if (!empty($arrayfields[
'multicurrency_dynamount_payed'][
'checked'])) {
1495 print_liste_field_titre($arrayfields[
'multicurrency_dynamount_payed'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1496 $totalarray[
'nbfield']++;
1498if (!empty($arrayfields[
'multicurrency_rtp'][
'checked'])) {
1499 print_liste_field_titre($arrayfields[
'multicurrency_rtp'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1500 $totalarray[
'nbfield']++;
1503include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1505$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1506$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1507print $hookmanager->resPrint;
1508if (!empty($arrayfields[
'f.datec'][
'checked'])) {
1509 print_liste_field_titre($arrayfields[
'f.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"f.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1510 $totalarray[
'nbfield']++;
1512if (!empty($arrayfields[
'f.tms'][
'checked'])) {
1513 print_liste_field_titre($arrayfields[
'f.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"f.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1514 $totalarray[
'nbfield']++;
1516if (!empty($arrayfields[
'f.fk_statut'][
'checked'])) {
1517 print_liste_field_titre($arrayfields[
'f.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"fk_statut,paye,type",
"", $param,
'', $sortfield, $sortorder,
'center ');
1518 $totalarray[
'nbfield']++;
1522 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1523 $totalarray[
'nbfield']++;
1529$projectstatic =
new Project($db);
1530$userstatic =
new User($db);
1536$savnbfield = $totalarray[
'nbfield'];
1537$totalarray = array();
1538$totalarray[
'nbfield'] = 0;
1539$totalarray[
'val'] = array();
1540$totalarray[
'val'][
'f.total_ht'] = 0;
1541$totalarray[
'val'][
'f.total_vat'] = 0;
1542$totalarray[
'val'][
'f.total_localtax1'] = 0;
1543$totalarray[
'val'][
'f.total_localtax1'] = 0;
1544$totalarray[
'val'][
'f.total_ttc'] = 0;
1545$totalarray[
'val'][
'totalam'] = 0;
1546$totalarray[
'val'][
'rtp'] = 0;
1548$imaxinloop = ($limit ? min($num, $limit) : $num);
1549while ($i < $imaxinloop) {
1550 $obj = $db->fetch_object($resql);
1555 $datelimit = $db->jdate($obj->datelimite);
1557 $userstatic->id = $obj->fk_user_author;
1558 $userstatic->login = $obj->login;
1559 $userstatic->lastname = $obj->lastname;
1560 $userstatic->firstname = $obj->firstname;
1561 $userstatic->email = $obj->user_email;
1562 $userstatic->statut = $obj->user_statut;
1563 $userstatic->status = $obj->user_statut;
1564 $userstatic->entity = $obj->entity;
1565 $userstatic->photo = $obj->photo;
1566 $userstatic->office_phone = $obj->office_phone;
1567 $userstatic->office_fax = $obj->office_fax;
1568 $userstatic->user_mobile = $obj->user_mobile;
1569 $userstatic->job = $obj->job;
1570 $userstatic->gender = $obj->gender;
1571 $facturestatic->id = $obj->facid;
1572 $facturestatic->ref = $obj->ref;
1573 $facturestatic->type = $obj->type;
1574 $facturestatic->subtype = $obj->subtype;
1575 $facturestatic->total_ht = $obj->total_ht;
1576 $facturestatic->total_tva = $obj->total_vat;
1577 $facturestatic->total_ttc = $obj->total_ttc;
1578 $facturestatic->close_code = $obj->close_code;
1579 $facturestatic->ref_supplier = $obj->ref_supplier;
1580 $facturestatic->date_echeance = $db->jdate($obj->datelimite);
1581 $facturestatic->statut = $obj->fk_statut;
1582 $facturestatic->status = $obj->fk_statut;
1583 $facturestatic->note_public = $obj->note_public;
1584 $facturestatic->note_private = $obj->note_private;
1585 $facturestatic->multicurrency_code = $obj->multicurrency_code;
1586 $facturestatic->multicurrency_tx = $obj->multicurrency_tx;
1587 $facturestatic->multicurrency_total_ht = $obj->multicurrency_total_ht;
1588 $facturestatic->multicurrency_total_tva = $obj->multicurrency_total_vat;
1589 $facturestatic->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
1590 $thirdparty->id = $obj->socid;
1591 $thirdparty->name = $obj->name;
1592 $thirdparty->name_alias = $obj->alias;
1593 $thirdparty->client = $obj->client;
1594 $thirdparty->fournisseur = $obj->fournisseur;
1595 $thirdparty->code_client = $obj->code_client;
1596 $thirdparty->code_compta_client = $obj->code_compta_client;
1597 $thirdparty->code_fournisseur = $obj->code_fournisseur;
1598 $thirdparty->code_compta_fournisseur = $obj->code_compta_fournisseur;
1599 $thirdparty->email = $obj->email;
1600 $thirdparty->country_code = $obj->country_code;
1602 $paiement = $facturestatic->getSommePaiement();
1603 $totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
1604 $totaldeposits = $facturestatic->getSumDepositsUsed();
1605 $totalpay = $paiement + $totalcreditnotes + $totaldeposits;
1606 $remaintopay = $obj->total_ttc - $totalpay;
1608 $multicurrency_paiement = $facturestatic->getSommePaiement(1);
1609 $multicurrency_totalcreditnotes = $facturestatic->getSumCreditNotesUsed(1);
1610 $multicurrency_totaldeposits = $facturestatic->getSumDepositsUsed(1);
1612 $totalpay = $paiement + $totalcreditnotes + $totaldeposits;
1613 $remaintopay =
price2num($facturestatic->total_ttc - $totalpay);
1615 $multicurrency_totalpay = $multicurrency_paiement + $multicurrency_totalcreditnotes + $multicurrency_totaldeposits;
1616 $multicurrency_remaintopay =
price2num($facturestatic->multicurrency_total_ttc - $multicurrency_totalpay);
1620 $multicurrency_remaintopay = 0;
1623 $remaincreditnote = $discount->getAvailableDiscounts($thirdparty,
'',
'rc.fk_facture_source='.$facturestatic->id);
1624 $remaintopay = -$remaincreditnote;
1625 $totalpay =
price2num($facturestatic->total_ttc - $remaintopay);
1626 $multicurrency_remaincreditnote = $discount->getAvailableDiscounts($thirdparty,
'',
'rc.fk_facture_source='.$facturestatic->id, 0, 0, 1);
1627 $multicurrency_remaintopay = -$multicurrency_remaincreditnote;
1628 $multicurrency_totalpay =
price2num($facturestatic->multicurrency_total_ttc - $multicurrency_remaintopay);
1631 $facturestatic->alreadypaid = ($paiement ? $paiement : 0);
1633 $facturestatic->paye = $obj->paye;
1634 $facturestatic->paid = $obj->paye;
1636 $facturestatic->date = $db->jdate($obj->datef);
1642 if ($facturestatic->isCreditNoteUsed()) {
1643 $remaintopay = -$facturestatic->getSumFromThisCreditNotesNotUsed();
1647 if ($mode ==
'kanban') {
1649 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1650 print
'<div class="box-flex-container kanban">';
1653 if ($massactionbutton || $massaction) {
1655 if (in_array(
$object->id, $arrayofselected)) {
1660 $arraydata = array(
'alreadypaid' => $paiement,
'thirdparty' => $thirdparty->getNomUrl(1,
'', 12),
'selected' => in_array(
$object->id, $arrayofselected));
1661 print $facturestatic->getKanbanView(
'', $arraydata);
1662 if ($i == ($imaxinloop - 1)) {
1669 print
'<tr data-rowid="'.$object->id.
'" class="oddeven '.((
getDolGlobalInt(
'MAIN_FINISHED_LINES_OPACITY') == 1 && $obj->fk_statut > 1) ?
'opacitymedium' :
'').
'">';
1673 print
'<td class="nowrap center">';
1674 if ($massactionbutton || $massaction) {
1676 if (in_array($obj->facid, $arrayofselected)) {
1679 print
'<input id="cb'.$obj->facid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->facid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1683 $totalarray[
'nbfield']++;
1686 if (!empty($arrayfields[
'f.ref'][
'checked'])) {
1687 print
'<td class="nowraponall">';
1689 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1691 print
'<td class="nobordernopadding nowraponall">';
1692 print $facturestatic->getNomUrl(1,
'', 0, 0,
'', 0, -1, 1);
1695 $filedir =
$conf->fournisseur->facture->dir_output.
'/'.
get_exdir($obj->facid, 2, 0, 0, $facturestatic,
'invoice_supplier').dol_sanitizeFileName($obj->ref);
1696 $subdir =
get_exdir($obj->facid, 2, 0, 0, $facturestatic,
'invoice_supplier').dol_sanitizeFileName($obj->ref);
1697 print $formfile->getDocumentsLink(
'facture_fournisseur', $subdir, $filedir);
1698 print
'</td></tr></table>';
1702 $totalarray[
'nbfield']++;
1707 if (!empty($arrayfields[
'f.ref_supplier'][
'checked'])) {
1708 print
'<td class="nowrap tdoverflowmax150" title="'.dol_escape_htmltag($obj->ref_supplier).
'">';
1709 print $obj->ref_supplier;
1712 $totalarray[
'nbfield']++;
1717 if (!empty($arrayfields[
'f.type'][
'checked'])) {
1718 print
'<td class="nowrap">';
1719 print $facturestatic->getLibType();
1722 $totalarray[
'nbfield']++;
1727 if (!empty($arrayfields[
'f.subtype'][
'checked'])) {
1729 if ($facturestatic->subtype > 0) {
1730 $labeltoshow = $facturestatic->getSubtypeLabel(
'facture_fourn');
1732 print
'<td class="nowraponall tdoverflowmax300" title="'.$labeltoshow.
'">';
1736 $totalarray[
'nbfield']++;
1741 if (!empty($arrayfields[
'f.label'][
'checked'])) {
1742 print
'<td class="nowrap tdoverflowmax125" title="'.dol_escape_htmltag($obj->label).
'">';
1746 $totalarray[
'nbfield']++;
1751 if (!empty($arrayfields[
'f.datef'][
'checked'])) {
1752 print
'<td class="center nowrap">';
1756 $totalarray[
'nbfield']++;
1761 if (!empty($arrayfields[
'f.date_lim_reglement'][
'checked'])) {
1762 print
'<td class="center nowraponall">'.dol_print_date($datelimit,
'day');
1763 if ($facturestatic->hasDelay()) {
1764 print
img_warning($langs->trans(
'Alert').
' - '.$langs->trans(
'Late'));
1768 $totalarray[
'nbfield']++;
1773 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1774 print
'<td class="nowrap">';
1775 if ($obj->project_id > 0) {
1776 $projectstatic->id = $obj->project_id;
1777 $projectstatic->ref = $obj->project_ref;
1778 $projectstatic->title = $obj->project_label;
1779 print $projectstatic->getNomUrl(1);
1783 $totalarray[
'nbfield']++;
1788 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1789 print
'<td class="tdoverflowmax125">';
1790 print $thirdparty->getNomUrl(1,
'supplier', 0, 0, -1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
1793 $totalarray[
'nbfield']++;
1797 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1798 print
'<td class="tdoverflowmax150">';
1802 $totalarray[
'nbfield']++;
1806 if (!empty($arrayfields[
's.town'][
'checked'])) {
1807 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->town).
'">';
1811 $totalarray[
'nbfield']++;
1815 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1816 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->zip).
'">';
1820 $totalarray[
'nbfield']++;
1824 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1825 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->state_name).
'">';
1829 $totalarray[
'nbfield']++;
1833 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1834 print
'<td class="center">';
1835 $tmparray =
getCountry($obj->fk_pays,
'all');
1836 print $tmparray[
'label'];
1839 $totalarray[
'nbfield']++;
1843 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1844 print
'<td class="center">';
1845 if (empty($typenArray)) {
1846 $typenArray = $formcompany->typent_array(1);
1848 print $typenArray[$obj->typent_code];
1851 $totalarray[
'nbfield']++;
1856 if (!empty($arrayfields[
'f.fk_cond_reglement'][
'checked'])) {
1857 $s = $form->form_conditions_reglement($_SERVER[
'PHP_SELF'], $obj->fk_cond_reglement,
'none', 1,
'', -1, -1, 1);
1858 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).
'">';
1862 $totalarray[
'nbfield']++;
1866 if (!empty($arrayfields[
'f.fk_mode_reglement'][
'checked'])) {
1867 $s = $form->form_modes_reglement($_SERVER[
'PHP_SELF'], $obj->fk_mode_reglement,
'none',
'', -1, 0,
'', 1);
1868 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).
'">';
1872 $totalarray[
'nbfield']++;
1877 if (!empty($arrayfields[
'f.total_ht'][
'checked'])) {
1878 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_ht).
"</span></td>\n";
1880 $totalarray[
'nbfield']++;
1881 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_ht';
1883 $totalarray[
'val'][
'f.total_ht'] += $obj->total_ht;
1886 if (!empty($arrayfields[
'f.total_vat'][
'checked'])) {
1887 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_vat).
"</span></td>\n";
1889 $totalarray[
'nbfield']++;
1890 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_vat';
1892 $totalarray[
'val'][
'f.total_vat'] += $obj->total_vat;
1895 if (!empty($arrayfields[
'f.total_localtax1'][
'checked'])) {
1896 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_localtax1).
"</span></td>\n";
1898 $totalarray[
'nbfield']++;
1899 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_localtax1';
1901 $totalarray[
'val'][
'f.total_localtax1'] += $obj->total_localtax1;
1904 if (!empty($arrayfields[
'f.total_localtax2'][
'checked'])) {
1905 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_localtax2).
"</span></td>\n";
1907 $totalarray[
'nbfield']++;
1908 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_localtax2';
1910 $totalarray[
'val'][
'f.total_localtax2'] += $obj->total_localtax2;
1913 if (!empty($arrayfields[
'f.total_ttc'][
'checked'])) {
1914 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_ttc).
"</span></td>\n";
1916 $totalarray[
'nbfield']++;
1917 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_ttc';
1919 $totalarray[
'val'][
'f.total_ttc'] += $obj->total_ttc;
1923 if (!empty($arrayfields[
'f.nb_docs'][
'checked'])) {
1924 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
1925 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
1926 $upload_dir =
$conf->fournisseur->facture->dir_output.
'/'.
get_exdir($facturestatic->id, 2, 0, 0, $facturestatic,
'invoice_supplier').$facturestatic->ref;
1927 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
1928 $nbLinks =
Link::count($db, $facturestatic->element, $facturestatic->id);
1929 $nbTotal = $nbFiles + $nbLinks;
1930 echo
'<td class="center">'.(empty($nbTotal) ?
'' : $nbTotal).
'</td>';
1932 $totalarray[
'nbfield']++;
1937 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1938 print
'<td class="tdoverflowmax100">';
1939 if ($userstatic->id) {
1940 print $userstatic->getNomUrl(-1);
1946 $totalarray[
'nbfield']++;
1951 if (!empty($arrayfields[
'dynamount_payed'][
'checked'])) {
1952 print
'<td class="right nowrap"><span class="amount">'.(!empty($totalpay) ?
price($totalpay, 0, $langs) :
'').
'</span></td>';
1954 $totalarray[
'nbfield']++;
1955 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalam';
1957 if (empty($totalarray[
'val'][
'totalam'])) {
1958 $totalarray[
'val'][
'totalam'] = 0;
1960 $totalarray[
'val'][
'totalam'] += $totalpay;
1964 if (!empty($arrayfields[
'rtp'][
'checked'])) {
1965 print
'<td class="right nowrap">'.(!empty($remaintopay) ?
price($remaintopay, 0, $langs) :
' ').
'</td>';
1967 $totalarray[
'nbfield']++;
1968 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'rtp';
1970 $totalarray[
'val'][
'rtp'] += $remaintopay;
1974 if (!empty($arrayfields[
'f.multicurrency_code'][
'checked'])) {
1975 print
'<td class="nowrap">'.$obj->multicurrency_code.
' - '.$langs->trans(
'Currency'.$obj->multicurrency_code).
"</td>\n";
1977 $totalarray[
'nbfield']++;
1982 if (!empty($arrayfields[
'f.multicurrency_tx'][
'checked'])) {
1983 print
'<td class="nowrap">';
1984 $form->form_multicurrency_rate($_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid, $obj->multicurrency_tx,
'none', $obj->multicurrency_code);
1987 $totalarray[
'nbfield']++;
1991 if (!empty($arrayfields[
'f.multicurrency_total_ht'][
'checked'])) {
1992 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht).
"</span></td>\n";
1994 $totalarray[
'nbfield']++;
1998 if (!empty($arrayfields[
'f.multicurrency_total_vat'][
'checked'])) {
1999 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_vat).
"</span></td>\n";
2001 $totalarray[
'nbfield']++;
2005 if (!empty($arrayfields[
'f.multicurrency_total_ttc'][
'checked'])) {
2006 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc).
"</span></td>\n";
2008 $totalarray[
'nbfield']++;
2012 if (!empty($arrayfields[
'multicurrency_dynamount_payed'][
'checked'])) {
2013 print
'<td class="right nowrap"><span class="amount">'.(!empty($multicurrency_totalpay) ?
price($multicurrency_totalpay, 0, $langs) :
'').
'</span></td>';
2015 $totalarray[
'nbfield']++;
2020 if (!empty($arrayfields[
'multicurrency_rtp'][
'checked'])) {
2021 print
'<td class="right nowrap"><span class="amount">';
2022 print(!empty($multicurrency_remaintopay) ?
price($multicurrency_remaintopay, 0, $langs) :
'');
2023 print
'</span></td>';
2025 $totalarray[
'nbfield']++;
2031 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
2033 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
2034 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
2035 print $hookmanager->resPrint;
2038 if (!empty($arrayfields[
'f.datec'][
'checked'])) {
2039 print
'<td class="center nowraponall">';
2040 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
2043 $totalarray[
'nbfield']++;
2047 if (!empty($arrayfields[
'f.tms'][
'checked'])) {
2048 print
'<td class="center nowraponall">';
2049 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
2052 $totalarray[
'nbfield']++;
2056 if (!empty($arrayfields[
'f.fk_statut'][
'checked'])) {
2057 print
'<td class="center nowrap">';
2058 print $facturestatic->getLibStatut(5, $paiement);
2061 $totalarray[
'nbfield']++;
2067 print
'<td class="nowrap center">';
2068 if ($massactionbutton || $massaction) {
2070 if (in_array($obj->facid, $arrayofselected)) {
2073 print
'<input id="cb'.$obj->facid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->facid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2077 $totalarray[
'nbfield']++;
2088include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2093 foreach ($arrayfields as $key => $val) {
2094 if (!empty($val[
'checked'])) {
2098 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2103$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
2104$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2105print $hookmanager->resPrint;
2107print
'</table>'.
"\n";
2110print
'</form>'.
"\n";
2112if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
2113 $hidegeneratedfilelistifempty = 1;
2114 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2115 $hidegeneratedfilelistifempty = 0;
2118 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
2122 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2123 $urlsource .= str_replace(
'&',
'&', $param);
2125 $filedir = $diroutputmassaction;
2126 $genallowed = $permissiontoread;
2127 $delallowed = $permissiontoadd;
2130 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
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
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 invoice templates.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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...
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a 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...
supplier_invoice_rec_prepare_head($object)
Return array head with list of tabs to view object information.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.