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'))) {
239if (!$user->hasRight(
'societe',
'client',
'voir')) {
240 $search_sale = $user->id;
243$permissiontoread = ($user->hasRight(
"fournisseur",
"facture",
"lire") || $user->hasRight(
"supplier_invoice",
"lire"));
244$permissiontoadd = ($user->hasRight(
"fournisseur",
"facture",
"creer") || $user->hasRight(
"supplier_invoice",
"creer"));
245$permissiontodelete = ($user->hasRight(
"fournisseur",
"facture",
"supprimer") || $user->hasRight(
"supplier_invoice",
"supprimer"));
252if (
GETPOST(
'cancel',
'alpha')) {
256if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
260$parameters = array(
'socid' => $socid,
'arrayfields' => &$arrayfields);
261$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
266if (empty($reshook)) {
268 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
271 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha')) {
275 $search_product_category =
'';
277 $search_refsupplier =
"";
279 $search_subtype =
'';
281 $search_project =
'';
282 $search_company =
"";
283 $search_company_alias =
"";
284 $search_amount_no_tax =
"";
285 $search_amount_all_tax =
"";
286 $search_montant_ht =
'';
287 $search_montant_vat =
'';
288 $search_montant_localtax1 =
'';
289 $search_montant_localtax2 =
'';
290 $search_montant_ttc =
'';
292 $search_multicurrency_code =
'';
293 $search_multicurrency_tx =
'';
294 $search_multicurrency_montant_ht =
'';
295 $search_multicurrency_montant_vat =
'';
296 $search_multicurrency_montant_ttc =
'';
298 $search_paymentmode =
'';
299 $search_paymentcond =
'';
303 $search_country =
'';
304 $search_type_thirdparty =
'';
305 $search_date_start =
'';
306 $search_date_end =
'';
307 $search_datelimit_startday =
'';
308 $search_datelimit_startmonth =
'';
309 $search_datelimit_startyear =
'';
310 $search_datelimit_endday =
'';
311 $search_datelimit_endmonth =
'';
312 $search_datelimit_endyear =
'';
313 $search_datelimit_start =
'';
314 $search_datelimit_end =
'';
316 $search_array_options = array();
317 $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(*) as nbtotalofrecords', $sql);
787 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
788 $sqlforcount = preg_replace(
'/LEFT JOIN '.MAIN_DB_PREFIX.
'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid/',
'', $sqlforcount);
790 $resql = $db->query($sqlforcount);
792 $objforcount = $db->fetch_object($resql);
793 $nbtotalofrecords = $objforcount->nbtotalofrecords;
798 if (($page * $limit) > $nbtotalofrecords) {
806$sql .= $db->order($sortfield, $sortorder);
808 $sql .= $db->plimit($limit + 1, $offset);
812$resql = $db->query($sql);
818$num = $db->num_rows($resql);
821if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
822 $obj = $db->fetch_object($resql);
824 header(
"Location: ".DOL_URL_ROOT.
'/fourn/facture/card.php?facid='.
$id);
831llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist mod-fourn-facture page-list');
833if ($search_fk_fac_rec_source) {
834 require_once DOL_DOCUMENT_ROOT .
'/fourn/class/fournisseur.facture-rec.class.php';
835 require_once DOL_DOCUMENT_ROOT .
'/core/lib/invoice.lib.php';
837 $object->fetch((
int) $search_fk_fac_rec_source);
840 print
dol_get_fiche_head($head,
'generated', $langs->trans(
'InvoicesGeneratedFromRec'), -1,
'bill');
846 if (empty($search_company)) {
847 $search_company = $soc->name;
848 $search_company_alias = $soc->name_alias;
852$arrayofselected = is_array($toselect) ? $toselect : array();
854$param =
'&socid='.$socid;
856 $param .=
'&mode='.urlencode($mode);
858if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
859 $param .=
'&contextpage='.urlencode($contextpage);
861if ($limit > 0 && $limit !=
$conf->liste_limit) {
862 $param .=
'&limit='.((int) $limit);
864if ($optioncss !=
'') {
865 $param .=
'&optioncss='.urlencode($optioncss);
868 $param .=
'&search_all='.urlencode($search_all);
870if ($search_date_start) {
871 $param .=
buildParamDate(
'search_date_start',
null,
'',
'tzserver');
873if ($search_date_end) {
874 $param .=
buildParamDate(
'search_date_end',
null,
'',
'tzserver');
876if ($search_datelimit_startday) {
877 $param .=
'&search_datelimit_startday='.urlencode((
string) ($search_datelimit_startday));
879if ($search_datelimit_startmonth) {
880 $param .=
'&search_datelimit_startmonth='.urlencode((
string) ($search_datelimit_startmonth));
882if ($search_datelimit_startyear) {
883 $param .=
'&search_datelimit_startyear='.urlencode((
string) ($search_datelimit_startyear));
885if ($search_datelimit_endday) {
886 $param .=
'&search_datelimit_endday='.urlencode((
string) ($search_datelimit_endday));
888if ($search_datelimit_endmonth) {
889 $param .=
'&search_datelimit_endmonth='.urlencode((
string) ($search_datelimit_endmonth));
891if ($search_datelimit_endyear) {
892 $param .=
'&search_datelimit_endyear='.urlencode((
string) ($search_datelimit_endyear));
895 $param .=
'&search_ref='.urlencode($search_ref);
897if ($search_refsupplier) {
898 $param .=
'&search_refsupplier='.urlencode($search_refsupplier);
900if ($search_type !=
'') {
901 $param .=
'&search_type='.urlencode($search_type);
903if ($search_subtype !=
'') {
904 $param .=
'&search_subtype='.urlencode($search_subtype);
907 $param .=
'&search_label='.urlencode($search_label);
909if ($search_company) {
910 $param .=
'&search_company='.urlencode($search_company);
912if ($search_company_alias) {
913 $param .=
'&search_company_alias='.urlencode($search_company_alias);
916 $param .=
'&search_login='.urlencode($search_login);
918if ($search_montant_ht !=
'') {
919 $param .=
'&search_montant_ht='.urlencode($search_montant_ht);
921if ($search_montant_vat !=
'') {
922 $param .=
'&search_montant_vat='.urlencode($search_montant_vat);
924if ($search_montant_localtax1 !=
'') {
925 $param .=
'&search_montant_localtax1='.urlencode($search_montant_localtax1);
927if ($search_montant_localtax2 !=
'') {
928 $param .=
'&search_montant_localtax2='.urlencode($search_montant_localtax2);
930if ($search_montant_ttc !=
'') {
931 $param .=
'&search_montant_ttc='.urlencode($search_montant_ttc);
933if ($search_multicurrency_code !=
'') {
934 $param .=
'&search_multicurrency_code='.urlencode($search_multicurrency_code);
936if ($search_multicurrency_tx !=
'') {
937 $param .=
'&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
939if ($search_multicurrency_montant_ht !=
'') {
940 $param .=
'&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
942if ($search_multicurrency_montant_vat !=
'') {
943 $param .=
'&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
945if ($search_multicurrency_montant_ttc !=
'') {
946 $param .=
'&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
948if ($search_amount_no_tax) {
949 $param .=
'&search_amount_no_tax='.urlencode($search_amount_no_tax);
951if ($search_amount_all_tax) {
952 $param .=
'&search_amount_all_tax='.urlencode($search_amount_all_tax);
954if ($search_status >= 0) {
955 $param .=
"&search_status=".urlencode($search_status);
957if ($search_paymentmode) {
958 $param .=
'&search_paymentmode='.urlencode((
string) ($search_paymentmode));
960if ($search_paymentcond) {
961 $param .=
'&search_paymentcond='.urlencode((
string) ($search_paymentcond));
964 $param .=
'&show_files='.urlencode((
string) ($show_files));
967 $param .=
"&search_option=".urlencode($option);
969if ($search_categ_sup > 0) {
970 $param .=
'&search_categ_sup='.$search_categ_sup;
972if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
973 $param .=
'&search_type_thirdparty='.$search_type_thirdparty;
975if ($search_fk_fac_rec_source) {
976 $param .=
'&search_fk_fac_rec_source=' . (int) $search_fk_fac_rec_source;
980include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
982$parameters = array(
'param' => &$param);
983$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
984$param .= $hookmanager->resPrint;
987$arrayofmassactions = array(
988 'validate' =>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate"),
989 'generate_doc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
990 'builddoc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
994if (isModEnabled(
'paymentbybanktransfer') && $user->hasRight(
"paymentbybanktransfer",
"create")) {
995 $langs->load(
'withdrawals');
996 $arrayofmassactions[
'banktransfertrequest'] =
img_picto(
'',
'payment',
'class="pictofixedwidth"').$langs->trans(
"MakeBankTransferOrder");
998if (!empty($permissiontodelete)) {
999 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
1001if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
1002 $arrayofmassactions = array();
1004$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1006$url = DOL_URL_ROOT.
'/fourn/facture/card.php?action=create';
1008 $url .=
'&socid='.urlencode((
string) (
$object->socid));
1011 $url .=
'&fac_rec='.urlencode((
string)
$object->id);
1014print
'<form method="POST" id="searchFormList" name="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
1015if ($optioncss !=
'') {
1016 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1018print
'<input type="hidden" name="token" value="'.newToken().
'">';
1019print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1020print
'<input type="hidden" name="action" value="list">';
1021print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1022print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1023print
'<input type="hidden" name="socid" value="'.$socid.
'">';
1024print
'<input type="hidden" name="page" value="'.$page.
'">';
1025print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
1026print
'<input type="hidden" name="page_y" value="">';
1027print
'<input type="hidden" name="mode" value="'.$mode.
'">';
1030$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'));
1031$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'));
1033$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewBill'),
'',
'fa fa-plus-circle', $url,
'', (
int) ($user->hasRight(
"fournisseur",
"facture",
"creer") || $user->hasRight(
"supplier_invoice",
"creer")));
1035print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_invoice', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1038$topicmail =
"SendBillRef";
1039$modelmail =
"invoice_supplier_send";
1041$trackid =
'sinv'.$object->id;
1042include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1046 foreach ($fieldstosearchall as $key => $val) {
1047 $fieldstosearchall[$key] = $langs->trans($val);
1048 $setupstring .= $key.
"=".$val.
";";
1050 print
'<!-- Search done like if SUPPLIER_INVOICE_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
1051 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>'.
"\n";
1056if ($user->hasRight(
"user",
"user",
"lire")) {
1057 $langs->load(
"commercial");
1058 $moreforfilter .=
'<div class="divsearchfield">';
1059 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1060 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth200');
1061 $moreforfilter .=
'</div>';
1064if ($user->hasRight(
"user",
"user",
"lire")) {
1065 $moreforfilter .=
'<div class="divsearchfield">';
1066 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
1067 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$form->select_dolusers($search_user,
'search_user', $tmptitle,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth200');
1068 $moreforfilter .=
'</div>';
1071if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire') && ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire'))) {
1072 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1073 $moreforfilter .=
'<div class="divsearchfield">';
1074 $tmptitle = $langs->trans(
'IncludingProductWithTag');
1075 $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT,
null,
'parent',
null,
null, 1);
1076 $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);
1077 $moreforfilter .=
'</div>';
1080if (isModEnabled(
'category')) {
1081 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1082 $moreforfilter .=
'<div class="divsearchfield">';
1083 $tmptitle = $langs->trans(
'SuppliersCategoriesShort');
1084 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$formother->select_categories(
'supplier', $search_categ_sup,
'search_categ_sup', 1, $tmptitle);
1085 $moreforfilter .=
'</div>';
1087$parameters = array();
1088$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1089if (empty($reshook)) {
1090 $moreforfilter .= $hookmanager->resPrint;
1092 $moreforfilter = $hookmanager->resPrint;
1095if (!empty($moreforfilter)) {
1096 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1097 print $moreforfilter;
1101$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1102$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1103$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
1104$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1106print
'<div class="div-table-responsive">';
1107print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1111print
'<tr class="liste_titre_filter">';
1114 print
'<td class="liste_titre center maxwidthsearch">';
1115 $searchpicto = $form->showFilterButtons(
'left');
1120if (!empty($arrayfields[
'f.ref'][
'checked'])) {
1121 print
'<td class="liste_titre left">';
1122 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
1126if (!empty($arrayfields[
'f.ref_supplier'][
'checked'])) {
1127 print
'<td class="liste_titre">';
1128 print
'<input class="flat maxwidth75" type="text" name="search_refsupplier" value="'.dol_escape_htmltag($search_refsupplier).
'">';
1132if (!empty($arrayfields[
'f.type'][
'checked'])) {
1133 print
'<td class="liste_titre maxwidthonsmartphone">';
1140 print $form->selectarray(
'search_type', $typearray, $search_type, 1, 0, 0,
'', 0, 0, 0,
'ASC',
'maxwidth100');
1144if (!empty($arrayfields[
'f.subtype'][
'checked'])) {
1145 print
'<td class="liste_titre maxwidthonsmartphone" align="center">';
1146 print $form->selectarray(
'search_subtype', $subtypearray, $search_subtype, 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth100');
1150if (!empty($arrayfields[
'f.label'][
'checked'])) {
1151 print
'<td class="liste_titre">';
1152 print
'<input class="flat maxwidth75" type="text" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
1156if (!empty($arrayfields[
'f.datef'][
'checked'])) {
1157 print
'<td class="liste_titre center">';
1158 print
'<div class="nowrapfordate">';
1159 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1161 print
'<div class="nowrapfordate">';
1162 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1167if (!empty($arrayfields[
'f.date_lim_reglement'][
'checked'])) {
1168 print
'<td class="liste_titre center">';
1169 print
'<div class="">';
1176 print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1,
'search_datelimit_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"Before"));
1178 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>';
1183if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1184 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_project" value="'.dol_escape_htmltag($search_project).
'"></td>';
1187if (!empty($arrayfields[
's.nom'][
'checked'])) {
1188 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).
'"'.($socid > 0 ?
" disabled" :
"").
'></td>';
1191if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1192 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_company_alias" value="'.dol_escape_htmltag($search_company_alias).
'"></td>';
1195if (!empty($arrayfields[
's.town'][
'checked'])) {
1196 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).
'"></td>';
1199if (!empty($arrayfields[
's.zip'][
'checked'])) {
1200 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'"></td>';
1203if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1204 print
'<td class="liste_titre">';
1205 print
'<input class="flat maxwidth50imp" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1209if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1210 print
'<td class="liste_titre center">';
1211 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth150imp maxwidth150',
'code2', 1, 0, 1,
null, 1);
1215if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1216 print
'<td class="liste_titre maxwidthonsmartphone center">';
1217 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);
1221if (!empty($arrayfields[
'f.fk_cond_reglement'][
'checked'])) {
1222 print
'<td class="liste_titre left">';
1223 print $form->getSelectConditionsPaiements($search_paymentcond,
'search_paymentcond', -1, 1, 1,
'maxwidth100');
1227if (!empty($arrayfields[
'f.fk_mode_reglement'][
'checked'])) {
1228 print
'<td class="liste_titre">';
1229 print $form->select_types_paiements($search_paymentmode,
'search_paymentmode',
'', 0, 1, 1, 20, 1,
'maxwidth100', 1);
1232if (!empty($arrayfields[
'f.total_ht'][
'checked'])) {
1234 print
'<td class="liste_titre right">';
1235 print
'<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).
'">';
1238if (!empty($arrayfields[
'f.total_vat'][
'checked'])) {
1240 print
'<td class="liste_titre right">';
1241 print
'<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).
'">';
1244if (!empty($arrayfields[
'f.total_localtax1'][
'checked'])) {
1246 print
'<td class="liste_titre right">';
1247 print
'<input class="flat" type="text" size="5" name="search_montant_localtax1" value="'.dol_escape_htmltag($search_montant_localtax1).
'">';
1250if (!empty($arrayfields[
'f.total_localtax2'][
'checked'])) {
1252 print
'<td class="liste_titre right">';
1253 print
'<input class="flat" type="text" size="5" name="search_montant_localtax2" value="'.dol_escape_htmltag($search_montant_localtax2).
'">';
1256if (!empty($arrayfields[
'f.total_ttc'][
'checked'])) {
1258 print
'<td class="liste_titre right">';
1259 print
'<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).
'">';
1262if (!empty($arrayfields[
'f.nb_docs'][
'checked'])) {
1264 print
'<td class="liste_titre" align="center">';
1267if (!empty($arrayfields[
'u.login'][
'checked'])) {
1269 print
'<td class="liste_titre" align="center">';
1270 print
'<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1273if (!empty($arrayfields[
'dynamount_payed'][
'checked'])) {
1274 print
'<td class="liste_titre right">';
1277if (!empty($arrayfields[
'rtp'][
'checked'])) {
1278 print
'<td class="liste_titre">';
1281if (!empty($arrayfields[
'f.multicurrency_code'][
'checked'])) {
1283 print
'<td class="liste_titre">';
1284 print $form->selectMultiCurrency($search_multicurrency_code,
'search_multicurrency_code', 1);
1287if (!empty($arrayfields[
'f.multicurrency_tx'][
'checked'])) {
1289 print
'<td class="liste_titre">';
1290 print
'<input class="flat" type="text" size="4" name="search_multicurrency_tx" value="'.dol_escape_htmltag($search_multicurrency_tx).
'">';
1293if (!empty($arrayfields[
'f.multicurrency_total_ht'][
'checked'])) {
1295 print
'<td class="liste_titre right">';
1296 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ht" value="'.dol_escape_htmltag($search_multicurrency_montant_ht).
'">';
1299if (!empty($arrayfields[
'f.multicurrency_total_vat'][
'checked'])) {
1301 print
'<td class="liste_titre right">';
1302 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_vat" value="'.dol_escape_htmltag($search_multicurrency_montant_vat).
'">';
1305if (!empty($arrayfields[
'f.multicurrency_total_ttc'][
'checked'])) {
1307 print
'<td class="liste_titre right">';
1308 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ttc" value="'.dol_escape_htmltag($search_multicurrency_montant_ttc).
'">';
1311if (!empty($arrayfields[
'multicurrency_dynamount_payed'][
'checked'])) {
1312 print
'<td class="liste_titre">';
1315if (!empty($arrayfields[
'multicurrency_rtp'][
'checked'])) {
1316 print
'<td class="liste_titre right">';
1320include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1323$parameters = array(
'arrayfields' => $arrayfields);
1324$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1325print $hookmanager->resPrint;
1327if (!empty($arrayfields[
'f.datec'][
'checked'])) {
1328 print
'<td class="liste_titre">';
1332if (!empty($arrayfields[
'f.tms'][
'checked'])) {
1333 print
'<td class="liste_titre">';
1337if (!empty($arrayfields[
'f.fk_statut'][
'checked'])) {
1338 print
'<td class="liste_titre center parentonrightofpage">';
1339 $liststatus = array(
'0' => $langs->trans(
"Draft"),
'1' => $langs->trans(
"Unpaid"),
'2' => $langs->trans(
"Paid"));
1341 print $form->selectarray(
'search_status', $liststatus, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'center search_status width100 onrightofpage', 1);
1346 print
'<td class="liste_titre center maxwidthsearch">';
1347 $searchpicto = $form->showFilterButtons();
1354$totalarray = array();
1355$totalarray[
'nbfield'] = 0;
1359print
'<tr class="liste_titre">';
1362 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1363 $totalarray[
'nbfield']++;
1365if (!empty($arrayfields[
'f.ref'][
'checked'])) {
1366 print_liste_field_titre($arrayfields[
'f.ref'][
'label'], $_SERVER[
'PHP_SELF'],
'f.ref,f.rowid',
'', $param,
'', $sortfield, $sortorder);
1367 $totalarray[
'nbfield']++;
1369if (!empty($arrayfields[
'f.ref_supplier'][
'checked'])) {
1370 print_liste_field_titre($arrayfields[
'f.ref_supplier'][
'label'], $_SERVER[
"PHP_SELF"],
'f.ref_supplier',
'', $param,
'', $sortfield, $sortorder);
1371 $totalarray[
'nbfield']++;
1373if (!empty($arrayfields[
'f.type'][
'checked'])) {
1374 print_liste_field_titre($arrayfields[
'f.type'][
'label'], $_SERVER[
"PHP_SELF"],
'f.type',
'', $param,
'', $sortfield, $sortorder);
1375 $totalarray[
'nbfield']++;
1377if (!empty($arrayfields[
'f.subtype'][
'checked'])) {
1378 print_liste_field_titre($arrayfields[
'f.subtype'][
'label'], $_SERVER[
"PHP_SELF"],
'f.subtype',
'', $param,
'', $sortfield, $sortorder);
1380if (!empty($arrayfields[
'f.label'][
'checked'])) {
1381 print_liste_field_titre($arrayfields[
'f.label'][
'label'], $_SERVER[
'PHP_SELF'],
"f.libelle,f.rowid",
'', $param,
'', $sortfield, $sortorder);
1382 $totalarray[
'nbfield']++;
1384if (!empty($arrayfields[
'f.datef'][
'checked'])) {
1385 print_liste_field_titre($arrayfields[
'f.datef'][
'label'], $_SERVER[
'PHP_SELF'],
'f.datef,f.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1386 $totalarray[
'nbfield']++;
1388if (!empty($arrayfields[
'f.date_lim_reglement'][
'checked'])) {
1389 print_liste_field_titre($arrayfields[
'f.date_lim_reglement'][
'label'], $_SERVER[
'PHP_SELF'],
"f.date_lim_reglement",
'', $param,
'', $sortfield, $sortorder,
'center ');
1390 $totalarray[
'nbfield']++;
1392if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1393 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
'PHP_SELF'],
"p.ref",
'', $param,
'', $sortfield, $sortorder);
1394 $totalarray[
'nbfield']++;
1396if (!empty($arrayfields[
's.nom'][
'checked'])) {
1397 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
'PHP_SELF'],
's.nom',
'', $param,
'', $sortfield, $sortorder);
1398 $totalarray[
'nbfield']++;
1400if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1402 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
'PHP_SELF'],
's.name_alias',
'', $param,
'', $sortfield, $sortorder);
1403 $totalarray[
'nbfield']++;
1405if (!empty($arrayfields[
's.town'][
'checked'])) {
1406 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1407 $totalarray[
'nbfield']++;
1409if (!empty($arrayfields[
's.zip'][
'checked'])) {
1410 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1411 $totalarray[
'nbfield']++;
1413if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1414 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.name_alias",
"", $param,
'', $sortfield, $sortorder);
1415 $totalarray[
'nbfield']++;
1417if (!empty($arrayfields[
'state.name_alias'][
'checked'])) {
1418 print_liste_field_titre($arrayfields[
'state.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1419 $totalarray[
'nbfield']++;
1421if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1422 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1423 $totalarray[
'nbfield']++;
1425if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1426 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1427 $totalarray[
'nbfield']++;
1429if (!empty($arrayfields[
'f.fk_cond_reglement'][
'checked'])) {
1430 print_liste_field_titre($arrayfields[
'f.fk_cond_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"f.fk_cond_reglement",
"", $param,
"", $sortfield, $sortorder);
1431 $totalarray[
'nbfield']++;
1433if (!empty($arrayfields[
'f.fk_mode_reglement'][
'checked'])) {
1434 print_liste_field_titre($arrayfields[
'f.fk_mode_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"f.fk_mode_reglement",
"", $param,
"", $sortfield, $sortorder);
1435 $totalarray[
'nbfield']++;
1437if (!empty($arrayfields[
'f.total_ht'][
'checked'])) {
1438 print_liste_field_titre($arrayfields[
'f.total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'f.total_ht',
'', $param,
'', $sortfield, $sortorder,
'right ');
1439 $totalarray[
'nbfield']++;
1441if (!empty($arrayfields[
'f.total_vat'][
'checked'])) {
1442 print_liste_field_titre($arrayfields[
'f.total_vat'][
'label'], $_SERVER[
'PHP_SELF'],
'f.total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1443 $totalarray[
'nbfield']++;
1445if (!empty($arrayfields[
'f.total_localtax1'][
'checked'])) {
1446 print_liste_field_titre($arrayfields[
'f.total_localtax1'][
'label'], $_SERVER[
'PHP_SELF'],
'f.localtax1',
'', $param,
'', $sortfield, $sortorder,
'right ');
1447 $totalarray[
'nbfield']++;
1449if (!empty($arrayfields[
'f.total_localtax2'][
'checked'])) {
1450 print_liste_field_titre($arrayfields[
'f.total_localtax2'][
'label'], $_SERVER[
'PHP_SELF'],
'f.localtax2',
'', $param,
'', $sortfield, $sortorder,
'right ');
1451 $totalarray[
'nbfield']++;
1453if (!empty($arrayfields[
'f.total_ttc'][
'checked'])) {
1454 print_liste_field_titre($arrayfields[
'f.total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'f.total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1455 $totalarray[
'nbfield']++;
1457if (!empty($arrayfields[
'f.nb_docs'][
'checked'])) {
1458 print_liste_field_titre($arrayfields[
'f.nb_docs'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1459 $totalarray[
'nbfield']++;
1461if (!empty($arrayfields[
'u.login'][
'checked'])) {
1462 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'', $sortfield, $sortorder);
1463 $totalarray[
'nbfield']++;
1465if (!empty($arrayfields[
'dynamount_payed'][
'checked'])) {
1466 print_liste_field_titre($arrayfields[
'dynamount_payed'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1467 $totalarray[
'nbfield']++;
1469if (!empty($arrayfields[
'rtp'][
'checked'])) {
1470 print_liste_field_titre($arrayfields[
'rtp'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder);
1471 $totalarray[
'nbfield']++;
1473if (!empty($arrayfields[
'f.multicurrency_code'][
'checked'])) {
1474 print_liste_field_titre($arrayfields[
'f.multicurrency_code'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_code',
'', $param,
'', $sortfield, $sortorder);
1475 $totalarray[
'nbfield']++;
1477if (!empty($arrayfields[
'f.multicurrency_tx'][
'checked'])) {
1478 print_liste_field_titre($arrayfields[
'f.multicurrency_tx'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_tx',
'', $param,
'', $sortfield, $sortorder);
1479 $totalarray[
'nbfield']++;
1481if (!empty($arrayfields[
'f.multicurrency_total_ht'][
'checked'])) {
1482 print_liste_field_titre($arrayfields[
'f.multicurrency_total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_total_ht',
'', $param,
'"', $sortfield, $sortorder,
'right ');
1483 $totalarray[
'nbfield']++;
1485if (!empty($arrayfields[
'f.multicurrency_total_vat'][
'checked'])) {
1486 print_liste_field_titre($arrayfields[
'f.multicurrency_total_vat'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1487 $totalarray[
'nbfield']++;
1489if (!empty($arrayfields[
'f.multicurrency_total_ttc'][
'checked'])) {
1490 print_liste_field_titre($arrayfields[
'f.multicurrency_total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1491 $totalarray[
'nbfield']++;
1493if (!empty($arrayfields[
'multicurrency_dynamount_payed'][
'checked'])) {
1494 print_liste_field_titre($arrayfields[
'multicurrency_dynamount_payed'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1495 $totalarray[
'nbfield']++;
1497if (!empty($arrayfields[
'multicurrency_rtp'][
'checked'])) {
1498 print_liste_field_titre($arrayfields[
'multicurrency_rtp'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1499 $totalarray[
'nbfield']++;
1502include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1504$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1505$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1506print $hookmanager->resPrint;
1507if (!empty($arrayfields[
'f.datec'][
'checked'])) {
1508 print_liste_field_titre($arrayfields[
'f.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"f.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1509 $totalarray[
'nbfield']++;
1511if (!empty($arrayfields[
'f.tms'][
'checked'])) {
1512 print_liste_field_titre($arrayfields[
'f.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"f.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1513 $totalarray[
'nbfield']++;
1515if (!empty($arrayfields[
'f.fk_statut'][
'checked'])) {
1516 print_liste_field_titre($arrayfields[
'f.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"fk_statut,paye,type",
"", $param,
'', $sortfield, $sortorder,
'center ');
1517 $totalarray[
'nbfield']++;
1521 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1522 $totalarray[
'nbfield']++;
1528$projectstatic =
new Project($db);
1529$userstatic =
new User($db);
1535$savnbfield = $totalarray[
'nbfield'];
1536$totalarray = array();
1537$totalarray[
'nbfield'] = 0;
1538$totalarray[
'val'] = array();
1539$totalarray[
'val'][
'f.total_ht'] = 0;
1540$totalarray[
'val'][
'f.total_vat'] = 0;
1541$totalarray[
'val'][
'f.total_localtax1'] = 0;
1542$totalarray[
'val'][
'f.total_localtax1'] = 0;
1543$totalarray[
'val'][
'f.total_ttc'] = 0;
1544$totalarray[
'val'][
'totalam'] = 0;
1545$totalarray[
'val'][
'rtp'] = 0;
1547$imaxinloop = ($limit ? min($num, $limit) : $num);
1548while ($i < $imaxinloop) {
1549 $obj = $db->fetch_object($resql);
1554 $datelimit = $db->jdate($obj->datelimite);
1556 $userstatic->id = $obj->fk_user_author;
1557 $userstatic->login = $obj->login;
1558 $userstatic->lastname = $obj->lastname;
1559 $userstatic->firstname = $obj->firstname;
1560 $userstatic->email = $obj->user_email;
1561 $userstatic->statut = $obj->user_statut;
1562 $userstatic->status = $obj->user_statut;
1563 $userstatic->entity = $obj->entity;
1564 $userstatic->photo = $obj->photo;
1565 $userstatic->office_phone = $obj->office_phone;
1566 $userstatic->office_fax = $obj->office_fax;
1567 $userstatic->user_mobile = $obj->user_mobile;
1568 $userstatic->job = $obj->job;
1569 $userstatic->gender = $obj->gender;
1570 $facturestatic->id = $obj->facid;
1571 $facturestatic->ref = $obj->ref;
1572 $facturestatic->type = $obj->type;
1573 $facturestatic->subtype = $obj->subtype;
1574 $facturestatic->total_ht = $obj->total_ht;
1575 $facturestatic->total_tva = $obj->total_vat;
1576 $facturestatic->total_ttc = $obj->total_ttc;
1577 $facturestatic->close_code = $obj->close_code;
1578 $facturestatic->ref_supplier = $obj->ref_supplier;
1579 $facturestatic->date_echeance = $db->jdate($obj->datelimite);
1580 $facturestatic->statut = $obj->fk_statut;
1581 $facturestatic->status = $obj->fk_statut;
1582 $facturestatic->note_public = $obj->note_public;
1583 $facturestatic->note_private = $obj->note_private;
1584 $facturestatic->multicurrency_code = $obj->multicurrency_code;
1585 $facturestatic->multicurrency_tx = $obj->multicurrency_tx;
1586 $facturestatic->multicurrency_total_ht = $obj->multicurrency_total_ht;
1587 $facturestatic->multicurrency_total_tva = $obj->multicurrency_total_vat;
1588 $facturestatic->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
1589 $thirdparty->id = $obj->socid;
1590 $thirdparty->name = $obj->name;
1591 $thirdparty->name_alias = $obj->alias;
1592 $thirdparty->client = $obj->client;
1593 $thirdparty->fournisseur = $obj->fournisseur;
1594 $thirdparty->code_client = $obj->code_client;
1595 $thirdparty->code_compta_client = $obj->code_compta_client;
1596 $thirdparty->code_fournisseur = $obj->code_fournisseur;
1597 $thirdparty->code_compta_fournisseur = $obj->code_compta_fournisseur;
1598 $thirdparty->email = $obj->email;
1599 $thirdparty->country_code = $obj->country_code;
1601 $paiement = $facturestatic->getSommePaiement();
1602 $totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
1603 $totaldeposits = $facturestatic->getSumDepositsUsed();
1604 $totalpay = $paiement + $totalcreditnotes + $totaldeposits;
1605 $remaintopay = $obj->total_ttc - $totalpay;
1607 $multicurrency_paiement = $facturestatic->getSommePaiement(1);
1608 $multicurrency_totalcreditnotes = $facturestatic->getSumCreditNotesUsed(1);
1609 $multicurrency_totaldeposits = $facturestatic->getSumDepositsUsed(1);
1611 $totalpay = $paiement + $totalcreditnotes + $totaldeposits;
1612 $remaintopay =
price2num($facturestatic->total_ttc - $totalpay);
1614 $multicurrency_totalpay = $multicurrency_paiement + $multicurrency_totalcreditnotes + $multicurrency_totaldeposits;
1615 $multicurrency_remaintopay =
price2num($facturestatic->multicurrency_total_ttc - $multicurrency_totalpay);
1619 $multicurrency_remaintopay = 0;
1622 $remaincreditnote = $discount->getAvailableDiscounts($thirdparty,
'',
'rc.fk_facture_source='.$facturestatic->id);
1623 $remaintopay = -$remaincreditnote;
1624 $totalpay =
price2num($facturestatic->total_ttc - $remaintopay);
1625 $multicurrency_remaincreditnote = $discount->getAvailableDiscounts($thirdparty,
'',
'rc.fk_facture_source='.$facturestatic->id, 0, 0, 1);
1626 $multicurrency_remaintopay = -$multicurrency_remaincreditnote;
1627 $multicurrency_totalpay =
price2num($facturestatic->multicurrency_total_ttc - $multicurrency_remaintopay);
1630 $facturestatic->alreadypaid = ($paiement ? $paiement : 0);
1632 $facturestatic->paye = $obj->paye;
1633 $facturestatic->paid = $obj->paye;
1635 $facturestatic->date = $db->jdate($obj->datef);
1641 if ($facturestatic->isCreditNoteUsed()) {
1642 $remaintopay = -$facturestatic->getSumFromThisCreditNotesNotUsed();
1646 if ($mode ==
'kanban') {
1648 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1649 print
'<div class="box-flex-container kanban">';
1652 if ($massactionbutton || $massaction) {
1654 if (in_array(
$object->id, $arrayofselected)) {
1659 $arraydata = array(
'alreadypaid' => $paiement,
'thirdparty' => $thirdparty->getNomUrl(1,
'', 12),
'selected' => in_array(
$object->id, $arrayofselected));
1660 print $facturestatic->getKanbanView(
'', $arraydata);
1661 if ($i == ($imaxinloop - 1)) {
1668 print
'<tr data-rowid="'.$object->id.
'" class="oddeven '.((
getDolGlobalInt(
'MAIN_FINISHED_LINES_OPACITY') == 1 && $obj->fk_statut > 1) ?
'opacitymedium' :
'').
'">';
1672 print
'<td class="nowrap center">';
1673 if ($massactionbutton || $massaction) {
1675 if (in_array($obj->facid, $arrayofselected)) {
1678 print
'<input id="cb'.$obj->facid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->facid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1682 $totalarray[
'nbfield']++;
1685 if (!empty($arrayfields[
'f.ref'][
'checked'])) {
1686 print
'<td class="nowraponall">';
1688 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1690 print
'<td class="nobordernopadding nowraponall">';
1691 print $facturestatic->getNomUrl(1,
'', 0, 0,
'', 0, -1, 1);
1694 $filedir =
$conf->fournisseur->facture->dir_output.
'/'.
get_exdir($obj->facid, 2, 0, 0, $facturestatic,
'invoice_supplier').dol_sanitizeFileName($obj->ref);
1695 $subdir =
get_exdir($obj->facid, 2, 0, 0, $facturestatic,
'invoice_supplier').dol_sanitizeFileName($obj->ref);
1696 print $formfile->getDocumentsLink(
'facture_fournisseur', $subdir, $filedir);
1697 print
'</td></tr></table>';
1701 $totalarray[
'nbfield']++;
1706 if (!empty($arrayfields[
'f.ref_supplier'][
'checked'])) {
1707 print
'<td class="nowrap tdoverflowmax150" title="'.dol_escape_htmltag($obj->ref_supplier).
'">';
1708 print $obj->ref_supplier;
1711 $totalarray[
'nbfield']++;
1716 if (!empty($arrayfields[
'f.type'][
'checked'])) {
1717 print
'<td class="nowrap">';
1718 print $facturestatic->getLibType();
1721 $totalarray[
'nbfield']++;
1726 if (!empty($arrayfields[
'f.subtype'][
'checked'])) {
1728 if ($facturestatic->subtype > 0) {
1729 $labeltoshow = $facturestatic->getSubtypeLabel(
'facture_fourn');
1731 print
'<td class="nowraponall tdoverflowmax300" title="'.$labeltoshow.
'">';
1735 $totalarray[
'nbfield']++;
1740 if (!empty($arrayfields[
'f.label'][
'checked'])) {
1741 print
'<td class="nowrap tdoverflowmax125" title="'.dol_escape_htmltag($obj->label).
'">';
1745 $totalarray[
'nbfield']++;
1750 if (!empty($arrayfields[
'f.datef'][
'checked'])) {
1751 print
'<td class="center nowrap">';
1755 $totalarray[
'nbfield']++;
1760 if (!empty($arrayfields[
'f.date_lim_reglement'][
'checked'])) {
1761 print
'<td class="center nowraponall">'.dol_print_date($datelimit,
'day');
1762 if ($facturestatic->hasDelay()) {
1763 print
img_warning($langs->trans(
'Alert').
' - '.$langs->trans(
'Late'));
1767 $totalarray[
'nbfield']++;
1772 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1773 print
'<td class="nowrap">';
1774 if ($obj->project_id > 0) {
1775 $projectstatic->id = $obj->project_id;
1776 $projectstatic->ref = $obj->project_ref;
1777 $projectstatic->title = $obj->project_label;
1778 print $projectstatic->getNomUrl(1);
1782 $totalarray[
'nbfield']++;
1787 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1788 print
'<td class="tdoverflowmax125">';
1789 print $thirdparty->getNomUrl(1,
'supplier', 0, 0, -1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
1792 $totalarray[
'nbfield']++;
1796 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1797 print
'<td class="tdoverflowmax150">';
1801 $totalarray[
'nbfield']++;
1805 if (!empty($arrayfields[
's.town'][
'checked'])) {
1806 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->town).
'">';
1810 $totalarray[
'nbfield']++;
1814 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1815 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->zip).
'">';
1819 $totalarray[
'nbfield']++;
1823 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1824 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->state_name).
'">';
1828 $totalarray[
'nbfield']++;
1832 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1833 print
'<td class="center">';
1834 $tmparray =
getCountry($obj->fk_pays,
'all');
1835 print $tmparray[
'label'];
1838 $totalarray[
'nbfield']++;
1842 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1843 print
'<td class="center">';
1844 if (empty($typenArray)) {
1845 $typenArray = $formcompany->typent_array(1);
1847 print $typenArray[$obj->typent_code];
1850 $totalarray[
'nbfield']++;
1855 if (!empty($arrayfields[
'f.fk_cond_reglement'][
'checked'])) {
1856 $s = $form->form_conditions_reglement($_SERVER[
'PHP_SELF'], $obj->fk_cond_reglement,
'none', 1,
'', -1, -1, 1);
1857 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).
'">';
1861 $totalarray[
'nbfield']++;
1865 if (!empty($arrayfields[
'f.fk_mode_reglement'][
'checked'])) {
1866 $s = $form->form_modes_reglement($_SERVER[
'PHP_SELF'], $obj->fk_mode_reglement,
'none',
'', -1, 0,
'', 1);
1867 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).
'">';
1871 $totalarray[
'nbfield']++;
1876 if (!empty($arrayfields[
'f.total_ht'][
'checked'])) {
1877 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_ht).
"</span></td>\n";
1879 $totalarray[
'nbfield']++;
1880 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_ht';
1882 $totalarray[
'val'][
'f.total_ht'] += $obj->total_ht;
1885 if (!empty($arrayfields[
'f.total_vat'][
'checked'])) {
1886 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_vat).
"</span></td>\n";
1888 $totalarray[
'nbfield']++;
1889 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_vat';
1891 $totalarray[
'val'][
'f.total_vat'] += $obj->total_vat;
1894 if (!empty($arrayfields[
'f.total_localtax1'][
'checked'])) {
1895 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_localtax1).
"</span></td>\n";
1897 $totalarray[
'nbfield']++;
1898 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_localtax1';
1900 $totalarray[
'val'][
'f.total_localtax1'] += $obj->total_localtax1;
1903 if (!empty($arrayfields[
'f.total_localtax2'][
'checked'])) {
1904 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_localtax2).
"</span></td>\n";
1906 $totalarray[
'nbfield']++;
1907 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_localtax2';
1909 $totalarray[
'val'][
'f.total_localtax2'] += $obj->total_localtax2;
1912 if (!empty($arrayfields[
'f.total_ttc'][
'checked'])) {
1913 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_ttc).
"</span></td>\n";
1915 $totalarray[
'nbfield']++;
1916 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_ttc';
1918 $totalarray[
'val'][
'f.total_ttc'] += $obj->total_ttc;
1922 if (!empty($arrayfields[
'f.nb_docs'][
'checked'])) {
1923 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
1924 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
1925 $upload_dir =
$conf->fournisseur->facture->dir_output.
'/'.
get_exdir($facturestatic->id, 2, 0, 0, $facturestatic,
'invoice_supplier').$facturestatic->ref;
1926 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
1927 $nbLinks =
Link::count($db, $facturestatic->element, $facturestatic->id);
1928 $nbTotal = $nbFiles + $nbLinks;
1929 echo
'<td class="center">'.(empty($nbTotal) ?
'' : $nbTotal).
'</td>';
1931 $totalarray[
'nbfield']++;
1936 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1937 print
'<td class="tdoverflowmax100">';
1938 if ($userstatic->id) {
1939 print $userstatic->getNomUrl(-1);
1945 $totalarray[
'nbfield']++;
1950 if (!empty($arrayfields[
'dynamount_payed'][
'checked'])) {
1951 print
'<td class="right nowrap"><span class="amount">'.(!empty($totalpay) ?
price($totalpay, 0, $langs) :
'').
'</span></td>';
1953 $totalarray[
'nbfield']++;
1954 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalam';
1956 if (empty($totalarray[
'val'][
'totalam'])) {
1957 $totalarray[
'val'][
'totalam'] = 0;
1959 $totalarray[
'val'][
'totalam'] += $totalpay;
1963 if (!empty($arrayfields[
'rtp'][
'checked'])) {
1964 print
'<td class="right nowrap">'.(!empty($remaintopay) ?
price($remaintopay, 0, $langs) :
' ').
'</td>';
1966 $totalarray[
'nbfield']++;
1967 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'rtp';
1969 $totalarray[
'val'][
'rtp'] += $remaintopay;
1973 if (!empty($arrayfields[
'f.multicurrency_code'][
'checked'])) {
1974 print
'<td class="nowrap">'.$obj->multicurrency_code.
' - '.$langs->trans(
'Currency'.$obj->multicurrency_code).
"</td>\n";
1976 $totalarray[
'nbfield']++;
1981 if (!empty($arrayfields[
'f.multicurrency_tx'][
'checked'])) {
1982 print
'<td class="nowrap">';
1983 $form->form_multicurrency_rate($_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid, $obj->multicurrency_tx,
'none', $obj->multicurrency_code);
1986 $totalarray[
'nbfield']++;
1990 if (!empty($arrayfields[
'f.multicurrency_total_ht'][
'checked'])) {
1991 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht).
"</span></td>\n";
1993 $totalarray[
'nbfield']++;
1997 if (!empty($arrayfields[
'f.multicurrency_total_vat'][
'checked'])) {
1998 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_vat).
"</span></td>\n";
2000 $totalarray[
'nbfield']++;
2004 if (!empty($arrayfields[
'f.multicurrency_total_ttc'][
'checked'])) {
2005 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc).
"</span></td>\n";
2007 $totalarray[
'nbfield']++;
2011 if (!empty($arrayfields[
'multicurrency_dynamount_payed'][
'checked'])) {
2012 print
'<td class="right nowrap"><span class="amount">'.(!empty($multicurrency_totalpay) ?
price($multicurrency_totalpay, 0, $langs) :
'').
'</span></td>';
2014 $totalarray[
'nbfield']++;
2019 if (!empty($arrayfields[
'multicurrency_rtp'][
'checked'])) {
2020 print
'<td class="right nowrap"><span class="amount">';
2021 print(!empty($multicurrency_remaintopay) ?
price($multicurrency_remaintopay, 0, $langs) :
'');
2022 print
'</span></td>';
2024 $totalarray[
'nbfield']++;
2030 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
2032 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
2033 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
2034 print $hookmanager->resPrint;
2037 if (!empty($arrayfields[
'f.datec'][
'checked'])) {
2038 print
'<td class="center nowraponall">';
2039 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
2042 $totalarray[
'nbfield']++;
2046 if (!empty($arrayfields[
'f.tms'][
'checked'])) {
2047 print
'<td class="center nowraponall">';
2048 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
2051 $totalarray[
'nbfield']++;
2055 if (!empty($arrayfields[
'f.fk_statut'][
'checked'])) {
2056 print
'<td class="center nowrap">';
2057 print $facturestatic->getLibStatut(5, $paiement);
2060 $totalarray[
'nbfield']++;
2066 print
'<td class="nowrap center">';
2067 if ($massactionbutton || $massaction) {
2069 if (in_array($obj->facid, $arrayofselected)) {
2072 print
'<input id="cb'.$obj->facid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->facid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2076 $totalarray[
'nbfield']++;
2087include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2092 foreach ($arrayfields as $key => $val) {
2093 if (!empty($val[
'checked'])) {
2097 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2102$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
2103$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2104print $hookmanager->resPrint;
2106print
'</table>'.
"\n";
2109print
'</form>'.
"\n";
2111if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
2112 $hidegeneratedfilelistifempty = 1;
2113 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2114 $hidegeneratedfilelistifempty = 0;
2117 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
2121 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2122 $urlsource .= str_replace(
'&',
'&', $param);
2124 $filedir = $diroutputmassaction;
2125 $genallowed = $permissiontoread;
2126 $delallowed = $permissiontoadd;
2129 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($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_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.
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.
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 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.