39require
'../../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
48require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/class/discount.class.php';
52$langs->loadLangs(array(
'products',
'bills',
'companies',
'projects'));
54$action =
GETPOST(
'action',
'aZ09');
55$massaction =
GETPOST(
'massaction',
'alpha');
56$show_files =
GETPOST(
'show_files',
'int');
57$confirm =
GETPOST(
'confirm',
'alpha');
58$toselect =
GETPOST(
'toselect',
'array');
59$optioncss =
GETPOST(
'optioncss',
'alpha');
60$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'supplierinvoicelist';
63$search_all = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
64$search_label =
GETPOST(
"search_label",
"alpha");
65$search_amount_no_tax =
GETPOST(
"search_amount_no_tax",
"alpha");
66$search_amount_all_tax =
GETPOST(
"search_amount_all_tax",
"alpha");
68$search_refsupplier =
GETPOST(
'search_refsupplier',
'alpha');
69$search_type =
GETPOST(
'search_type',
'int');
70$search_subtype =
GETPOST(
'search_subtype',
'int');
71$search_project =
GETPOST(
'search_project',
'alpha');
72$search_company =
GETPOST(
'search_company',
'alpha');
73$search_company_alias =
GETPOST(
'search_company_alias',
'alpha');
74$search_montant_ht =
GETPOST(
'search_montant_ht',
'alpha');
75$search_montant_vat =
GETPOST(
'search_montant_vat',
'alpha');
76$search_montant_localtax1 =
GETPOST(
'search_montant_localtax1',
'alpha');
77$search_montant_localtax2 =
GETPOST(
'search_montant_localtax2',
'alpha');
78$search_montant_ttc =
GETPOST(
'search_montant_ttc',
'alpha');
79$search_login =
GETPOST(
'search_login',
'alpha');
80$search_multicurrency_code =
GETPOST(
'search_multicurrency_code',
'alpha');
81$search_multicurrency_tx =
GETPOST(
'search_multicurrency_tx',
'alpha');
82$search_multicurrency_montant_ht =
GETPOST(
'search_multicurrency_montant_ht',
'alpha');
83$search_multicurrency_montant_vat =
GETPOST(
'search_multicurrency_montant_vat',
'alpha');
84$search_multicurrency_montant_ttc =
GETPOST(
'search_multicurrency_montant_ttc',
'alpha');
85$search_status =
GETPOST(
'search_status',
'int');
86$search_paymentmode =
GETPOST(
'search_paymentmode',
'int');
87$search_paymentcond =
GETPOST(
'search_paymentcond',
'int');
88$search_town =
GETPOST(
'search_town',
'alpha');
89$search_zip =
GETPOST(
'search_zip',
'alpha');
90$search_state =
GETPOST(
"search_state");
91$search_country =
GETPOST(
"search_country",
'int');
92$search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'int');
93$search_user =
GETPOST(
'search_user',
'int');
94$search_sale =
GETPOST(
'search_sale',
'int');
95$search_date_start =
GETPOSTDATE(
'search_date_start',
'',
'tzserver');
96$search_date_end =
GETPOSTDATE(
'search_date_end',
'23:59:59',
'tzserver');
97$search_datelimit_startday =
GETPOST(
'search_datelimit_startday',
'int');
98$search_datelimit_startmonth =
GETPOST(
'search_datelimit_startmonth',
'int');
99$search_datelimit_startyear =
GETPOST(
'search_datelimit_startyear',
'int');
100$search_datelimit_endday =
GETPOST(
'search_datelimit_endday',
'int');
101$search_datelimit_endmonth =
GETPOST(
'search_datelimit_endmonth',
'int');
102$search_datelimit_endyear =
GETPOST(
'search_datelimit_endyear',
'int');
103$search_datelimit_start =
dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear);
104$search_datelimit_end =
dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear);
105$search_btn =
GETPOST(
'button_search',
'alpha');
106$search_remove_btn =
GETPOST(
'button_removefilter',
'alpha');
107$search_categ_sup = trim(
GETPOST(
"search_categ_sup",
'int'));
108$search_product_category =
GETPOST(
'search_product_category',
'int');
110$option =
GETPOST(
'search_option');
111if ($option ==
'late') {
112 $search_status =
'1';
114$filter =
GETPOST(
'filtre',
'alpha');
117$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
118$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
119$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
120$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
121if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
125$offset = $limit * $page;
130 $sortfield =
"f.datef,f.rowid";
132$pageprev = $page - 1;
133$pagenext = $page + 1;
135$socid =
GETPOST(
'socid',
'int');
138if ($user->socid > 0) {
140 $_GET[
"action"] =
'';
141 $socid = $user->socid;
144$diroutputmassaction = $conf->fournisseur->facture->dir_output.
'/temp/massgeneration/'.$user->id;
150$hookmanager->initHooks(array(
'supplierinvoicelist'));
154$extrafields->fetch_name_optionals_label($object->table_element);
156$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
159$fieldstosearchall = array(
161 'f.ref_supplier'=>
'RefSupplier',
162 'f.note_public'=>
'NotePublic',
163 's.nom'=>
"ThirdParty",
164 's.code_fournisseur'=>
"SupplierCodeShort",
165 'pd.description'=>
'Description',
167if (empty($user->socid)) {
168 $fieldstosearchall[
"f.note_private"] =
"NotePrivate";
171$checkedtypetiers = 0;
173 'f.ref'=>array(
'label'=>
"Ref",
'checked'=>1),
174 'f.ref_supplier'=>array(
'label'=>
"RefSupplier",
'checked'=>1),
175 'f.type'=>array(
'label'=>
"Type",
'checked'=>0),
176 'f.subtype'=>array(
'label'=>
"InvoiceSubtype",
'checked'=>0,),
177 'f.label'=>array(
'label'=>
"Label",
'checked'=>0),
178 'f.datef'=>array(
'label'=>
"DateInvoice",
'checked'=>1),
179 'f.date_lim_reglement'=>array(
'label'=>
"DateDue",
'checked'=>1),
180 'p.ref'=>array(
'label'=>
"ProjectRef",
'checked'=>0),
181 's.nom'=>array(
'label'=>
"ThirdParty",
'checked'=>1,
'position'=>41),
182 's.name_alias'=>array(
'label'=>
"AliasNameShort",
'checked'=>0,
'position'=>42),
183 's.town'=>array(
'label'=>
"Town",
'checked'=>-1,
'position'=>43),
184 's.zip'=>array(
'label'=>
"Zip",
'checked'=>1,
'position'=>44),
185 'state.nom'=>array(
'label'=>
"StateShort",
'checked'=>0,
'position'=>45),
186 'country.code_iso'=>array(
'label'=>
"Country",
'checked'=>0,
'position'=>46),
187 'typent.code'=>array(
'label'=>
"ThirdPartyType",
'checked'=>$checkedtypetiers,
'position'=>49),
188 'f.fk_mode_reglement'=>array(
'label'=>
"PaymentMode",
'checked'=>1,
'position'=>52),
189 'f.fk_cond_reglement'=>array(
'label'=>
"PaymentConditionsShort",
'checked'=>1,
'position'=>50),
190 'f.total_ht'=>array(
'label'=>
"AmountHT",
'checked'=>1,
'position'=>105),
191 'f.total_vat'=>array(
'label'=>
"AmountVAT",
'checked'=>0,
'position'=>110),
192 'f.total_localtax1'=>array(
'label'=>$langs->transcountry(
"AmountLT1", $mysoc->country_code),
'checked'=>0,
'enabled'=>$mysoc->localtax1_assuj ==
"1",
'position'=>95),
193 'f.total_localtax2'=>array(
'label'=>$langs->transcountry(
"AmountLT2", $mysoc->country_code),
'checked'=>0,
'enabled'=>$mysoc->localtax2_assuj ==
"1",
'position'=>100),
194 'f.total_ttc'=>array(
'label'=>
"AmountTTC",
'checked'=>0,
'position'=>115),
195 'dynamount_payed'=>array(
'label'=>
"Paid",
'checked'=>0,
'position'=>116),
196 'rtp'=>array(
'label'=>
"Rest",
'checked'=>0,
'position'=>117),
197 'f.multicurrency_code'=>array(
'label'=>
'Currency',
'checked'=>0,
'position'=>205,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
198 'f.multicurrency_tx'=>array(
'label'=>
'CurrencyRate',
'checked'=>0,
'position'=>206,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
199 'f.multicurrency_total_ht'=>array(
'label'=>
'MulticurrencyAmountHT',
'position'=>207,
'checked'=>0,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
200 'f.multicurrency_total_vat'=>array(
'label'=>
'MulticurrencyAmountVAT',
'position'=>208,
'checked'=>0,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
201 'f.multicurrency_total_ttc'=>array(
'label'=>
'MulticurrencyAmountTTC',
'position'=>209,
'checked'=>0,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
202 'multicurrency_dynamount_payed'=>array(
'label'=>
'MulticurrencyAlreadyPaid',
'position'=>210,
'checked'=>0,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
203 'multicurrency_rtp'=>array(
'label'=>
'MulticurrencyRemainderToPay',
'checked'=>0,
'position'=>211,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
204 'u.login'=>array(
'label'=>
"Author",
'checked'=>1,
'position'=>500),
205 'f.datec'=>array(
'label'=>
"DateCreation",
'checked'=>0,
'position'=>501),
206 'f.tms'=>array(
'label'=>
"DateModificationShort",
'checked'=>0,
'position'=>502),
207 'f.fk_statut'=>array(
'label'=>
"Status",
'checked'=>1,
'position'=>1000),
208 'f.nb_docs'=>array(
'label'=>
"Documents",
'checked'=>1,
'position'=>510),
211include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
216if (!isModEnabled(
'supplier_invoice')) {
219if ((!$user->hasRight(
"fournisseur",
"facture",
"lire") && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD'))
220 || (!$user->hasRight(
"supplier_invoice",
"lire") &&
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD'))) {
224if (!$user->hasRight(
'societe',
'client',
'voir')) {
225 $search_sale = $user->id;
228$permissiontoread = ($user->hasRight(
"fournisseur",
"facture",
"lire") || $user->hasRight(
"supplier_invoice",
"lire"));
229$permissiontoadd = ($user->hasRight(
"fournisseur",
"facture",
"creer") || $user->hasRight(
"supplier_invoice",
"creer"));
230$permissiontodelete = ($user->hasRight(
"fournisseur",
"facture",
"supprimer") || $user->hasRight(
"supplier_invoice",
"supprimer"));
237if (
GETPOST(
'cancel',
'alpha')) {
241if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
245$parameters = array(
'socid'=>$socid,
'arrayfields'=>&$arrayfields);
246$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
251if (empty($reshook)) {
253 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
256 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha')) {
260 $search_product_category =
'';
262 $search_refsupplier =
"";
264 $search_subtype =
'';
266 $search_project =
'';
267 $search_company =
"";
268 $search_company_alias =
"";
269 $search_amount_no_tax =
"";
270 $search_amount_all_tax =
"";
271 $search_montant_ht =
'';
272 $search_montant_vat =
'';
273 $search_montant_localtax1 =
'';
274 $search_montant_localtax2 =
'';
275 $search_montant_ttc =
'';
277 $search_multicurrency_code =
'';
278 $search_multicurrency_tx =
'';
279 $search_multicurrency_montant_ht =
'';
280 $search_multicurrency_montant_vat =
'';
281 $search_multicurrency_montant_ttc =
'';
283 $search_paymentmode =
'';
284 $search_paymentcond =
'';
288 $search_country =
'';
289 $search_type_thirdparty =
'';
290 $search_date_start =
'';
291 $search_date_end =
'';
292 $search_datelimit_startday =
'';
293 $search_datelimit_startmonth =
'';
294 $search_datelimit_startyear =
'';
295 $search_datelimit_endday =
'';
296 $search_datelimit_endmonth =
'';
297 $search_datelimit_endyear =
'';
298 $search_datelimit_start =
'';
299 $search_datelimit_end =
'';
301 $search_array_options = array();
302 $search_categ_sup = 0;
309 $objectclass =
'FactureFournisseur';
310 $objectlabel =
'SupplierInvoices';
311 $uploaddir = $conf->fournisseur->facture->dir_output;
312 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
314 if ($massaction ==
'banktransfertrequest') {
315 $langs->load(
"withdrawals");
317 if (!$user->hasRight(
"paymentbybanktransfer",
"create")) {
324 $arrayofselected = is_array($toselect) ? $toselect : array();
325 $listofbills = array();
326 foreach ($arrayofselected as $toselectid) {
328 $result = $objecttmp->fetch($toselectid);
330 $totalpaid = $objecttmp->getSommePaiement();
331 $totalcreditnotes = $objecttmp->getSumCreditNotesUsed();
332 $totaldeposits = $objecttmp->getSumDepositsUsed();
333 $objecttmp->resteapayer =
price2num($objecttmp->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits,
'MT');
336 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"Draft"), $objecttmp->errors,
'errors');
337 } elseif ($objecttmp->paye || $objecttmp->resteapayer == 0) {
339 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"AlreadyPaid"), $objecttmp->errors,
'errors');
340 } elseif ($objecttmp->resteapayer < 0) {
342 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"AmountMustBePositive"), $objecttmp->errors,
'errors');
345 $rsql =
"SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande";
346 $rsql .=
" , pfd.date_traite as date_traite";
347 $rsql .=
" , pfd.amount";
348 $rsql .=
" , u.rowid as user_id, u.lastname, u.firstname, u.login";
349 $rsql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_demande as pfd";
350 $rsql .=
" , ".MAIN_DB_PREFIX.
"user as u";
351 $rsql .=
" WHERE fk_facture_fourn = ".((int) $objecttmp->id);
352 $rsql .=
" AND pfd.fk_user_demande = u.rowid";
353 $rsql .=
" AND pfd.traite = 0";
354 $rsql .=
" ORDER BY pfd.date_demande DESC";
356 $result_sql = $db->query($rsql);
358 $numprlv = $db->num_rows($result_sql);
363 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"RequestAlreadyDone"), $objecttmp->errors,
'warnings');
364 } elseif (!empty($objecttmp->mode_reglement_code) && $objecttmp->mode_reglement_code !=
'VIR') {
366 setEventMessages($objecttmp->ref.
' '.$langs->trans(
"BadPaymentMethod"), $objecttmp->errors,
'errors');
368 $listofbills[] = $objecttmp;
374 if (!empty($listofbills)) {
375 $nbwithdrawrequestok = 0;
376 foreach ($listofbills as $aBill) {
378 $result = $aBill->demande_prelevement($user, $aBill->resteapayer,
'bank-transfer',
'supplier_invoice');
381 $nbwithdrawrequestok++;
387 if ($nbwithdrawrequestok > 0) {
388 setEventMessages($langs->trans(
"WithdrawRequestsDone", $nbwithdrawrequestok),
null,
'mesgs');
400$form =
new Form($db);
403$bankaccountstatic =
new Account($db);
407$subtypearray = $object->getArrayOfInvoiceSubtypes(0);
413 if (empty($search_company)) {
414 $search_company = $soc->name;
418$title = $langs->trans(
"BillsSuppliers").($socid ?
' - '.$soc->name :
'');
419$help_url =
'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores';
425 $sql =
'SELECT DISTINCT';
427$sql .=
" f.rowid as facid, f.ref, f.ref_supplier, f.type, f.subtype, f.datef, f.date_lim_reglement as datelimite, f.fk_mode_reglement, f.fk_cond_reglement,";
428$sql .=
" f.total_ht, f.total_ttc, f.total_tva as total_vat, f.paye as paye, f.close_code, f.fk_statut as fk_statut, f.libelle as label, f.datec as date_creation, f.tms as date_update,";
429$sql .=
" f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,";
430$sql .=
' f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva as multicurrency_total_vat, f.multicurrency_total_ttc,';
431$sql .=
" f.note_public, f.note_private,";
432$sql .=
" f.fk_user_author,";
433$sql .=
" s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,";
434$sql .=
" typent.code as typent_code,";
435$sql .=
" state.code_departement as state_code, state.nom as state_name,";
436$sql .=
" country.code as country_code,";
437$sql .=
" p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
438$sql .=
' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
440if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
441 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
442 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
446$parameters = array();
447$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
448$sql .= $hookmanager->resPrint;
449$sql = preg_replace(
'/,\s*$/',
'', $sql);
454 $sql .=
', SUM(pf.amount) as dynamount_payed';
459$sql .=
' FROM '.MAIN_DB_PREFIX.
'societe as s';
460$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
461$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
462$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
463$sql .=
', '.MAIN_DB_PREFIX.
'facture_fourn as f';
464if (isset($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
465 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (f.rowid = ef.fk_object)";
468 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
471 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'facture_fourn_det as pd ON f.rowid=pd.fk_facture_fourn';
473$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user AS u ON f.fk_user_author = u.rowid';
474$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as p ON p.rowid = f.fk_projet";
475if ($search_user > 0) {
476 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ec";
477 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
480$parameters = array();
481$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
482$sql .= $hookmanager->resPrint;
483$sql .=
' WHERE f.fk_soc = s.rowid';
484$sql .=
' AND f.entity IN ('.getEntity(
'facture_fourn').
')';
486 $sql .=
' AND s.rowid = '.((int) $socid);
489 if (is_numeric($search_ref)) {
498if ($search_refsupplier) {
501if ($search_type !=
'' && $search_type >= 0) {
502 if ($search_type ==
'0') {
503 $sql .=
" AND f.type = 0";
505 if ($search_type ==
'1') {
506 $sql .=
" AND f.type = 1";
508 if ($search_type ==
'2') {
509 $sql .=
" AND f.type = 2";
511 if ($search_type ==
'3') {
512 $sql .=
" AND f.type = 3";
517if ($search_subtype !=
'' && $search_subtype !=
'-1') {
518 $sql .=
" AND f.subtype IN (".$db->sanitize($db->escape($search_subtype)).
")";
520if ($search_project) {
523if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_company) {
524 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_company);
526 if ($search_company) {
529 if ($search_company_alias) {
542if ($search_country) {
543 $sql .=
" AND s.fk_pays IN (".$db->sanitize($search_country).
')';
545if ($search_type_thirdparty !=
'' && $search_type_thirdparty >= 0) {
546 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
548if ($search_montant_ht !=
'') {
551if ($search_montant_vat !=
'') {
554if ($search_montant_localtax1 !=
'') {
555 $sql .=
natural_search(
'f.localtax1', $search_montant_localtax1, 1);
557if ($search_montant_localtax2 !=
'') {
558 $sql .=
natural_search(
'f.localtax2', $search_montant_localtax2, 1);
560if ($search_montant_ttc !=
'') {
563if ($search_multicurrency_code !=
'') {
564 $sql .=
" AND f.multicurrency_code = '".$db->escape($search_multicurrency_code).
"'";
566if ($search_multicurrency_tx !=
'') {
567 $sql .=
natural_search(
'f.multicurrency_tx', $search_multicurrency_tx, 1);
569if ($search_multicurrency_montant_ht !=
'') {
570 $sql .=
natural_search(
'f.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
572if ($search_multicurrency_montant_vat !=
'') {
573 $sql .=
natural_search(
'f.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
575if ($search_multicurrency_montant_ttc !=
'') {
576 $sql .=
natural_search(
'f.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
579 $sql .=
natural_search(array(
'u.login',
'u.lastname',
'u.firstname'), $search_login);
581if ($search_status !=
'' && $search_status >= 0) {
582 $sql .=
" AND f.fk_statut = ".((int) $search_status);
584if ($search_paymentmode > 0) {
585 $sql .=
" AND f.fk_mode_reglement = ".((int) $search_paymentmode);
587if ($search_paymentcond > 0) {
588 $sql .=
" AND f.fk_cond_reglement = ".((int) $search_paymentcond);
590if ($search_date_start) {
591 $sql .=
" AND f.datef >= '" . $db->idate($search_date_start) .
"'";
593if ($search_date_end) {
594 $sql .=
" AND f.datef <= '" . $db->idate($search_date_end) .
"'";
596if ($search_datelimit_start) {
597 $sql .=
" AND f.date_lim_reglement >= '" . $db->idate($search_datelimit_start) .
"'";
599if ($search_datelimit_end) {
600 $sql .=
" AND f.date_lim_reglement <= '" . $db->idate($search_datelimit_end) .
"'";
602if ($option ==
'late') {
603 $sql .=
" AND f.date_lim_reglement < '".$db->idate(
dol_now() - $conf->facture->fournisseur->warning_delay).
"'";
609if ($search_sale && $search_sale !=
'-1') {
610 if ($search_sale == -2) {
611 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc)";
612 } elseif ($search_sale > 0) {
613 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc AND sc.fk_user = ".((int) $search_sale).
")";
616$searchCategorySupplierList = $search_categ_sup ? array($search_categ_sup) : array();
617$searchCategorySupplierOperator = 0;
619if (!empty($searchCategorySupplierList)) {
620 $searchCategorySupplierSqlList = array();
621 $listofcategoryid =
'';
622 foreach ($searchCategorySupplierList as $searchCategorySupplier) {
623 if (intval($searchCategorySupplier) == -2) {
624 $searchCategorySupplierSqlList[] =
"NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)";
625 } elseif (intval($searchCategorySupplier) > 0) {
626 if ($searchCategorySupplierOperator == 0) {
627 $searchCategorySupplierSqlList[] =
" EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).
")";
629 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategorySupplier);
633 if ($listofcategoryid) {
634 $searchCategorySupplierSqlList[] =
" EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
636 if ($searchCategorySupplierOperator == 1) {
637 if (!empty($searchCategorySupplierSqlList)) {
638 $sql .=
" AND (".implode(
' OR ', $searchCategorySupplierSqlList).
")";
641 if (!empty($searchCategorySupplierSqlList)) {
642 $sql .=
" AND (".implode(
' AND ', $searchCategorySupplierSqlList).
")";
647$searchCategoryProductList = $search_product_category ? array($search_product_category) : array();
648$searchCategoryProductOperator = 0;
649if (!empty($searchCategoryProductList)) {
650 $searchCategoryProductSqlList = array();
651 $listofcategoryid =
'';
652 foreach ($searchCategoryProductList as $searchCategoryProduct) {
653 if (intval($searchCategoryProduct) == -2) {
654 $searchCategoryProductSqlList[] =
"NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND fd.fk_product = ck.fk_product)";
655 } elseif (intval($searchCategoryProduct) > 0) {
656 if ($searchCategoryProductOperator == 0) {
657 $searchCategoryProductSqlList[] =
" EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND fd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).
")";
659 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
663 if ($listofcategoryid) {
664 $searchCategoryProductSqlList[] =
" EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND fd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
666 if ($searchCategoryProductOperator == 1) {
667 if (!empty($searchCategoryProductSqlList)) {
668 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
671 if (!empty($searchCategoryProductSqlList)) {
672 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
676if ($filter && $filter != -1) {
677 $aFilter = explode(
',', $filter);
678 foreach ($aFilter as $fil) {
679 $filt = explode(
':', $fil);
680 $sql .=
" AND ".$db->escape(trim($filt[0])).
" = '".$db->escape(trim($filt[1])).
"'";
687if ($search_user > 0) {
688 $sql .=
" AND ec.fk_c_type_contact = tc.rowid AND tc.element='invoice_supplier' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".((int) $search_user);
691include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
693$parameters = array();
694$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
695$sql .= $hookmanager->resPrint;
698 $sql .=
" GROUP BY f.rowid, f.ref, f.ref_supplier, f.type, f.subtype, f.datef, f.date_lim_reglement, f.fk_mode_reglement, f.fk_cond_reglement,";
699 $sql .=
" f.total_ht, f.total_ttc, f.total_tva, f.paye, f.close_code, f.fk_statut, f.libelle, f.datec, f.tms,";
700 $sql .=
" f.localtax1, f.localtax2,";
701 $sql .=
' f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc,';
702 $sql .=
" f.note_public, f.note_private,";
703 $sql .=
" f.fk_user_author,";
704 $sql .=
' s.rowid, s.nom, s.name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,';
705 $sql .=
" typent.code,";
706 $sql .=
" state.code_departement, state.nom,";
707 $sql .=
' country.code,';
708 $sql .=
" p.rowid, p.ref, p.title,";
709 $sql .=
" u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender";
710 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
711 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
713 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
",ef.".$key :
'');
717 $parameters = array(
'all' => $search_all,
'fieldstosearchall' => $fieldstosearchall);
718 $reshook = $hookmanager->executeHooks(
'printFieldListGroupBy', $parameters, $object, $action);
719 $sql .= $hookmanager->resPrint;
721 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
725$parameters = array();
726$reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object, $action);
727$sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
730$nbtotalofrecords =
'';
733 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(DISTINCT f.rowid) as nbtotalofrecords', $sql);
735 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
736 $sqlforcount = preg_replace(
'/LEFT JOIN '.MAIN_DB_PREFIX.
'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid/',
'', $sqlforcount);
738 $resql = $db->query($sqlforcount);
740 $objforcount = $db->fetch_object($resql);
741 $nbtotalofrecords = $objforcount->nbtotalofrecords;
746 if (($page * $limit) > $nbtotalofrecords) {
754$sql .= $db->order($sortfield, $sortorder);
756 $sql .= $db->plimit($limit + 1, $offset);
760$resql = $db->query($sql);
766$num = $db->num_rows($resql);
769if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
770 $obj = $db->fetch_object($resql);
772 header(
"Location: ".DOL_URL_ROOT.
'/fourn/facture/card.php?facid='.$id);
784 if (empty($search_company)) {
785 $search_company = $soc->name;
786 $search_company_alias = $soc->name_alias;
790$arrayofselected = is_array($toselect) ? $toselect : array();
792$param =
'&socid='.$socid;
794 $param .=
'&mode='.urlencode($mode);
796if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
797 $param .=
'&contextpage='.urlencode($contextpage);
799if ($limit > 0 && $limit != $conf->liste_limit) {
800 $param .=
'&limit='.((int) $limit);
802if ($optioncss !=
'') {
803 $param .=
'&optioncss='.urlencode($optioncss);
806 $param .=
'&search_all='.urlencode($search_all);
808if ($search_date_start) {
809 $param .=
buildParamDate(
'search_date_start',
null,
'',
'tzserver');
811if ($search_date_end) {
812 $param .=
buildParamDate(
'search_date_end',
null,
'',
'tzserver');
814if ($search_datelimit_startday) {
815 $param .=
'&search_datelimit_startday='.urlencode($search_datelimit_startday);
817if ($search_datelimit_startmonth) {
818 $param .=
'&search_datelimit_startmonth='.urlencode($search_datelimit_startmonth);
820if ($search_datelimit_startyear) {
821 $param .=
'&search_datelimit_startyear='.urlencode($search_datelimit_startyear);
823if ($search_datelimit_endday) {
824 $param .=
'&search_datelimit_endday='.urlencode($search_datelimit_endday);
826if ($search_datelimit_endmonth) {
827 $param .=
'&search_datelimit_endmonth='.urlencode($search_datelimit_endmonth);
829if ($search_datelimit_endyear) {
830 $param .=
'&search_datelimit_endyear='.urlencode($search_datelimit_endyear);
833 $param .=
'&search_ref='.urlencode($search_ref);
835if ($search_refsupplier) {
836 $param .=
'&search_refsupplier='.urlencode($search_refsupplier);
838if ($search_type !=
'') {
839 $param .=
'&search_type='.urlencode($search_type);
841if ($search_subtype !=
'') {
842 $param .=
'&search_subtype='.urlencode($search_subtype);
845 $param .=
'&search_label='.urlencode($search_label);
847if ($search_company) {
848 $param .=
'&search_company='.urlencode($search_company);
850if ($search_company_alias) {
851 $param .=
'&search_company_alias='.urlencode($search_company_alias);
854 $param .=
'&search_login='.urlencode($search_login);
856if ($search_montant_ht !=
'') {
857 $param .=
'&search_montant_ht='.urlencode($search_montant_ht);
859if ($search_montant_vat !=
'') {
860 $param .=
'&search_montant_vat='.urlencode($search_montant_vat);
862if ($search_montant_localtax1 !=
'') {
863 $param .=
'&search_montant_localtax1='.urlencode($search_montant_localtax1);
865if ($search_montant_localtax2 !=
'') {
866 $param .=
'&search_montant_localtax2='.urlencode($search_montant_localtax2);
868if ($search_montant_ttc !=
'') {
869 $param .=
'&search_montant_ttc='.urlencode($search_montant_ttc);
871if ($search_multicurrency_code !=
'') {
872 $param .=
'&search_multicurrency_code='.urlencode($search_multicurrency_code);
874if ($search_multicurrency_tx !=
'') {
875 $param .=
'&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
877if ($search_multicurrency_montant_ht !=
'') {
878 $param .=
'&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
880if ($search_multicurrency_montant_vat !=
'') {
881 $param .=
'&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
883if ($search_multicurrency_montant_ttc !=
'') {
884 $param .=
'&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
886if ($search_amount_no_tax) {
887 $param .=
'&search_amount_no_tax='.urlencode($search_amount_no_tax);
889if ($search_amount_all_tax) {
890 $param .=
'&search_amount_all_tax='.urlencode($search_amount_all_tax);
892if ($search_status >= 0) {
893 $param .=
"&search_status=".urlencode($search_status);
895if ($search_paymentmode) {
896 $param .=
'&search_paymentmode='.urlencode($search_paymentmode);
898if ($search_paymentcond) {
899 $param .=
'&search_paymentcond='.urlencode($search_paymentcond);
902 $param .=
'&show_files='.urlencode($show_files);
905 $param .=
"&search_option=".urlencode($option);
907if ($search_categ_sup > 0) {
908 $param .=
'&search_categ_sup='.urlencode($search_categ_sup);
910if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
911 $param .=
'&search_type_thirdparty='.urlencode($search_type_thirdparty);
915include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
917$parameters = array(
'param' => &$param);
918$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
919$param .= $hookmanager->resPrint;
922$arrayofmassactions = array(
923 'validate'=>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate"),
924 'generate_doc'=>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
929if (isModEnabled(
'paymentbybanktransfer') && $user->hasRight(
"paymentbybanktransfer",
"create")) {
930 $langs->load(
'withdrawals');
931 $arrayofmassactions[
'banktransfertrequest'] =
img_picto(
'',
'payment',
'class="pictofixedwidth"').$langs->trans(
"MakeBankTransferOrder");
933if (!empty($permissiontodelete)) {
934 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
936if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
937 $arrayofmassactions = array();
939$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
941$url = DOL_URL_ROOT.
'/fourn/facture/card.php?action=create';
943 $url .=
'&socid='.urlencode($socid);
947print
'<form method="POST" id="searchFormList" name="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
948if ($optioncss !=
'') {
949 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
951print
'<input type="hidden" name="token" value="'.newToken().
'">';
952print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
953print
'<input type="hidden" name="action" value="list">';
954print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
955print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
956print
'<input type="hidden" name="socid" value="'.$socid.
'">';
957print
'<input type="hidden" name="page" value="'.$page.
'">';
958print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
959print
'<input type="hidden" name="page_y" value="">';
960print
'<input type="hidden" name="mode" value="'.$mode.
'">';
963$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'));
964$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'));
966$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewBill'),
'',
'fa fa-plus-circle', $url,
'', ($user->hasRight(
"fournisseur",
"facture",
"creer") || $user->hasRight(
"supplier_invoice",
"creer")));
968print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_invoice', 0, $newcardbutton,
'', $limit, 0, 0, 1);
971$topicmail =
"SendBillRef";
972$modelmail =
"invoice_supplier_send";
974$trackid =
'sinv'.$object->id;
975include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
979 foreach ($fieldstosearchall as $key => $val) {
980 $fieldstosearchall[$key] = $langs->trans($val);
981 $setupstring .= $key.
"=".$val.
";";
983 print
'<!-- Search done like if SUPPLIER_INVOICE_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
984 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>'.
"\n";
989if ($user->hasRight(
"user",
"user",
"lire")) {
990 $langs->load(
"commercial");
991 $moreforfilter .=
'<div class="divsearchfield">';
992 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
993 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth200');
994 $moreforfilter .=
'</div>';
997if ($user->hasRight(
"user",
"user",
"lire")) {
998 $moreforfilter .=
'<div class="divsearchfield">';
999 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
1000 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$form->select_dolusers($search_user,
'search_user', $tmptitle,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth200');
1001 $moreforfilter .=
'</div>';
1004if (isModEnabled(
'categorie') && $user->hasRight(
'categorie',
'lire') && ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire'))) {
1005 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1006 $moreforfilter .=
'<div class="divsearchfield">';
1007 $tmptitle = $langs->trans(
'IncludingProductWithTag');
1008 $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT,
null,
'parent',
null,
null, 1);
1009 $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);
1010 $moreforfilter .=
'</div>';
1013if (isModEnabled(
'categorie')) {
1014 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1015 $moreforfilter .=
'<div class="divsearchfield">';
1016 $tmptitle = $langs->trans(
'SuppliersCategoriesShort');
1017 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$formother->select_categories(
'supplier', $search_categ_sup,
'search_categ_sup', 1, $tmptitle);
1018 $moreforfilter .=
'</div>';
1020$parameters = array();
1021$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1022if (empty($reshook)) {
1023 $moreforfilter .= $hookmanager->resPrint;
1025 $moreforfilter = $hookmanager->resPrint;
1028if (!empty($moreforfilter)) {
1029 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1030 print $moreforfilter;
1031 $parameters = array();
1032 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1033 print $hookmanager->resPrint;
1037$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1038$selectedfields = ($mode !=
'kanban' ? $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
'')) :
'');
1039$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1041print
'<div class="div-table-responsive">';
1042print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1046print
'<tr class="liste_titre_filter">';
1049 print
'<td class="liste_titre center maxwidthsearch">';
1050 $searchpicto = $form->showFilterButtons(
'left');
1055if (!empty($arrayfields[
'f.ref'][
'checked'])) {
1056 print
'<td class="liste_titre left">';
1057 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
1061if (!empty($arrayfields[
'f.ref_supplier'][
'checked'])) {
1062 print
'<td class="liste_titre">';
1063 print
'<input class="flat maxwidth75" type="text" name="search_refsupplier" value="'.dol_escape_htmltag($search_refsupplier).
'">';
1067if (!empty($arrayfields[
'f.type'][
'checked'])) {
1068 print
'<td class="liste_titre maxwidthonsmartphone">';
1082 print $form->selectarray(
'search_type', $listtype, $search_type, 1, 0, 0,
'', 0, 0, 0,
'ASC',
'maxwidth100');
1086if (!empty($arrayfields[
'f.subtype'][
'checked'])) {
1087 print
'<td class="liste_titre maxwidthonsmartphone" align="center">';
1088 print $form->selectarray(
'search_subtype', $subtypearray, $search_subtype, 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth100');
1092if (!empty($arrayfields[
'f.label'][
'checked'])) {
1093 print
'<td class="liste_titre">';
1094 print
'<input class="flat maxwidth75" type="text" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
1098if (!empty($arrayfields[
'f.datef'][
'checked'])) {
1099 print
'<td class="liste_titre center">';
1100 print
'<div class="nowrapfordate">';
1101 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1103 print
'<div class="nowrapfordate">';
1104 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1109if (!empty($arrayfields[
'f.date_lim_reglement'][
'checked'])) {
1110 print
'<td class="liste_titre center">';
1111 print
'<div class="">';
1118 print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1,
'search_datelimit_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"Before"));
1120 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>';
1125if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1126 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_project" value="'.dol_escape_htmltag($search_project).
'"></td>';
1129if (!empty($arrayfields[
's.nom'][
'checked'])) {
1130 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).
'"'.($socid > 0 ?
" disabled" :
"").
'></td>';
1133if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1134 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_company_alias" value="'.dol_escape_htmltag($search_company_alias).
'"></td>';
1137if (!empty($arrayfields[
's.town'][
'checked'])) {
1138 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).
'"></td>';
1141if (!empty($arrayfields[
's.zip'][
'checked'])) {
1142 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'"></td>';
1145if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1146 print
'<td class="liste_titre">';
1147 print
'<input class="flat maxwidth50imp" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1151if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1152 print
'<td class="liste_titre center">';
1153 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1157if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1158 print
'<td class="liste_titre maxwidthonsmartphone center">';
1159 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);
1163if (!empty($arrayfields[
'f.fk_cond_reglement'][
'checked'])) {
1164 print
'<td class="liste_titre left">';
1165 print $form->getSelectConditionsPaiements($search_paymentcond,
'search_paymentcond', -1, 1, 1,
'maxwidth100');
1169if (!empty($arrayfields[
'f.fk_mode_reglement'][
'checked'])) {
1170 print
'<td class="liste_titre">';
1171 print $form->select_types_paiements($search_paymentmode,
'search_paymentmode',
'', 0, 1, 1, 20, 1,
'maxwidth100', 1);
1174if (!empty($arrayfields[
'f.total_ht'][
'checked'])) {
1176 print
'<td class="liste_titre right">';
1177 print
'<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).
'">';
1180if (!empty($arrayfields[
'f.total_vat'][
'checked'])) {
1182 print
'<td class="liste_titre right">';
1183 print
'<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).
'">';
1186if (!empty($arrayfields[
'f.total_localtax1'][
'checked'])) {
1188 print
'<td class="liste_titre right">';
1189 print
'<input class="flat" type="text" size="5" name="search_montant_localtax1" value="'.dol_escape_htmltag($search_montant_localtax1).
'">';
1192if (!empty($arrayfields[
'f.total_localtax2'][
'checked'])) {
1194 print
'<td class="liste_titre right">';
1195 print
'<input class="flat" type="text" size="5" name="search_montant_localtax2" value="'.dol_escape_htmltag($search_montant_localtax2).
'">';
1198if (!empty($arrayfields[
'f.total_ttc'][
'checked'])) {
1200 print
'<td class="liste_titre right">';
1201 print
'<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).
'">';
1204if (!empty($arrayfields[
'f.nb_docs'][
'checked'])) {
1206 print
'<td class="liste_titre" align="center">';
1209if (!empty($arrayfields[
'u.login'][
'checked'])) {
1211 print
'<td class="liste_titre" align="center">';
1212 print
'<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1215if (!empty($arrayfields[
'dynamount_payed'][
'checked'])) {
1216 print
'<td class="liste_titre right">';
1219if (!empty($arrayfields[
'rtp'][
'checked'])) {
1220 print
'<td class="liste_titre">';
1223if (!empty($arrayfields[
'f.multicurrency_code'][
'checked'])) {
1225 print
'<td class="liste_titre">';
1226 print $form->selectMultiCurrency($search_multicurrency_code,
'search_multicurrency_code', 1);
1229if (!empty($arrayfields[
'f.multicurrency_tx'][
'checked'])) {
1231 print
'<td class="liste_titre">';
1232 print
'<input class="flat" type="text" size="4" name="search_multicurrency_tx" value="'.dol_escape_htmltag($search_multicurrency_tx).
'">';
1235if (!empty($arrayfields[
'f.multicurrency_total_ht'][
'checked'])) {
1237 print
'<td class="liste_titre right">';
1238 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ht" value="'.dol_escape_htmltag($search_multicurrency_montant_ht).
'">';
1241if (!empty($arrayfields[
'f.multicurrency_total_vat'][
'checked'])) {
1243 print
'<td class="liste_titre right">';
1244 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_vat" value="'.dol_escape_htmltag($search_multicurrency_montant_vat).
'">';
1247if (!empty($arrayfields[
'f.multicurrency_total_ttc'][
'checked'])) {
1249 print
'<td class="liste_titre right">';
1250 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ttc" value="'.dol_escape_htmltag($search_multicurrency_montant_ttc).
'">';
1253if (!empty($arrayfields[
'multicurrency_dynamount_payed'][
'checked'])) {
1254 print
'<td class="liste_titre">';
1257if (!empty($arrayfields[
'multicurrency_rtp'][
'checked'])) {
1258 print
'<td class="liste_titre right">';
1262include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1265$parameters = array(
'arrayfields'=>$arrayfields);
1266$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1267print $hookmanager->resPrint;
1269if (!empty($arrayfields[
'f.datec'][
'checked'])) {
1270 print
'<td class="liste_titre">';
1274if (!empty($arrayfields[
'f.tms'][
'checked'])) {
1275 print
'<td class="liste_titre">';
1279if (!empty($arrayfields[
'f.fk_statut'][
'checked'])) {
1280 print
'<td class="liste_titre center parentonrightofpage">';
1281 $liststatus = array(
'0'=>$langs->trans(
"Draft"),
'1'=>$langs->trans(
"Unpaid"),
'2'=>$langs->trans(
"Paid"));
1282 print $form->selectarray(
'search_status', $liststatus, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'center search_status width100 onrightofpage', 1);
1287 print
'<td class="liste_titre center maxwidthsearch">';
1288 $searchpicto = $form->showFilterButtons();
1295$totalarray = array();
1296$totalarray[
'nbfield'] = 0;
1300print
'<tr class="liste_titre">';
1303 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1304 $totalarray[
'nbfield']++;
1306if (!empty($arrayfields[
'f.ref'][
'checked'])) {
1307 print_liste_field_titre($arrayfields[
'f.ref'][
'label'], $_SERVER[
'PHP_SELF'],
'f.ref,f.rowid',
'', $param,
'', $sortfield, $sortorder);
1308 $totalarray[
'nbfield']++;
1310if (!empty($arrayfields[
'f.ref_supplier'][
'checked'])) {
1311 print_liste_field_titre($arrayfields[
'f.ref_supplier'][
'label'], $_SERVER[
"PHP_SELF"],
'f.ref_supplier',
'', $param,
'', $sortfield, $sortorder);
1312 $totalarray[
'nbfield']++;
1314if (!empty($arrayfields[
'f.type'][
'checked'])) {
1315 print_liste_field_titre($arrayfields[
'f.type'][
'label'], $_SERVER[
"PHP_SELF"],
'f.type',
'', $param,
'', $sortfield, $sortorder);
1316 $totalarray[
'nbfield']++;
1318if (!empty($arrayfields[
'f.subtype'][
'checked'])) {
1319 print_liste_field_titre($arrayfields[
'f.subtype'][
'label'], $_SERVER[
"PHP_SELF"],
'f.subtype',
'', $param,
'', $sortfield, $sortorder);
1321if (!empty($arrayfields[
'f.label'][
'checked'])) {
1322 print_liste_field_titre($arrayfields[
'f.label'][
'label'], $_SERVER[
'PHP_SELF'],
"f.libelle,f.rowid",
'', $param,
'', $sortfield, $sortorder);
1323 $totalarray[
'nbfield']++;
1325if (!empty($arrayfields[
'f.datef'][
'checked'])) {
1326 print_liste_field_titre($arrayfields[
'f.datef'][
'label'], $_SERVER[
'PHP_SELF'],
'f.datef,f.rowid',
'', $param,
'', $sortfield, $sortorder,
'center ');
1327 $totalarray[
'nbfield']++;
1329if (!empty($arrayfields[
'f.date_lim_reglement'][
'checked'])) {
1330 print_liste_field_titre($arrayfields[
'f.date_lim_reglement'][
'label'], $_SERVER[
'PHP_SELF'],
"f.date_lim_reglement",
'', $param,
'', $sortfield, $sortorder,
'center ');
1331 $totalarray[
'nbfield']++;
1333if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1334 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
'PHP_SELF'],
"p.ref",
'', $param,
'', $sortfield, $sortorder);
1335 $totalarray[
'nbfield']++;
1337if (!empty($arrayfields[
's.nom'][
'checked'])) {
1338 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
'PHP_SELF'],
's.nom',
'', $param,
'', $sortfield, $sortorder);
1339 $totalarray[
'nbfield']++;
1341if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1342 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
'PHP_SELF'],
's.name_alias',
'', $param,
'', $sortfield, $sortorder);
1343 $totalarray[
'nbfield']++;
1345if (!empty($arrayfields[
's.town'][
'checked'])) {
1346 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1347 $totalarray[
'nbfield']++;
1349if (!empty($arrayfields[
's.zip'][
'checked'])) {
1350 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder,
'center ');
1351 $totalarray[
'nbfield']++;
1353if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1354 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.name_alias",
"", $param,
'', $sortfield, $sortorder);
1355 $totalarray[
'nbfield']++;
1357if (!empty($arrayfields[
'state.name_alias'][
'checked'])) {
1358 print_liste_field_titre($arrayfields[
'state.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1359 $totalarray[
'nbfield']++;
1361if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1362 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1363 $totalarray[
'nbfield']++;
1365if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1366 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1367 $totalarray[
'nbfield']++;
1369if (!empty($arrayfields[
'f.fk_cond_reglement'][
'checked'])) {
1370 print_liste_field_titre($arrayfields[
'f.fk_cond_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"f.fk_cond_reglement",
"", $param,
"", $sortfield, $sortorder);
1371 $totalarray[
'nbfield']++;
1373if (!empty($arrayfields[
'f.fk_mode_reglement'][
'checked'])) {
1374 print_liste_field_titre($arrayfields[
'f.fk_mode_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"f.fk_mode_reglement",
"", $param,
"", $sortfield, $sortorder);
1375 $totalarray[
'nbfield']++;
1377if (!empty($arrayfields[
'f.total_ht'][
'checked'])) {
1378 print_liste_field_titre($arrayfields[
'f.total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'f.total_ht',
'', $param,
'', $sortfield, $sortorder,
'right ');
1379 $totalarray[
'nbfield']++;
1381if (!empty($arrayfields[
'f.total_vat'][
'checked'])) {
1382 print_liste_field_titre($arrayfields[
'f.total_vat'][
'label'], $_SERVER[
'PHP_SELF'],
'f.total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1383 $totalarray[
'nbfield']++;
1385if (!empty($arrayfields[
'f.total_localtax1'][
'checked'])) {
1386 print_liste_field_titre($arrayfields[
'f.total_localtax1'][
'label'], $_SERVER[
'PHP_SELF'],
'f.localtax1',
'', $param,
'', $sortfield, $sortorder,
'right ');
1387 $totalarray[
'nbfield']++;
1389if (!empty($arrayfields[
'f.total_localtax2'][
'checked'])) {
1390 print_liste_field_titre($arrayfields[
'f.total_localtax2'][
'label'], $_SERVER[
'PHP_SELF'],
'f.localtax2',
'', $param,
'', $sortfield, $sortorder,
'right ');
1391 $totalarray[
'nbfield']++;
1393if (!empty($arrayfields[
'f.total_ttc'][
'checked'])) {
1394 print_liste_field_titre($arrayfields[
'f.total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'f.total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1395 $totalarray[
'nbfield']++;
1397if (!empty($arrayfields[
'f.nb_docs'][
'checked'])) {
1398 print_liste_field_titre($arrayfields[
'f.nb_docs'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1399 $totalarray[
'nbfield']++;
1401if (!empty($arrayfields[
'u.login'][
'checked'])) {
1402 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'', $sortfield, $sortorder);
1403 $totalarray[
'nbfield']++;
1405if (!empty($arrayfields[
'dynamount_payed'][
'checked'])) {
1406 print_liste_field_titre($arrayfields[
'dynamount_payed'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1407 $totalarray[
'nbfield']++;
1409if (!empty($arrayfields[
'rtp'][
'checked'])) {
1410 print_liste_field_titre($arrayfields[
'rtp'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder);
1411 $totalarray[
'nbfield']++;
1413if (!empty($arrayfields[
'f.multicurrency_code'][
'checked'])) {
1414 print_liste_field_titre($arrayfields[
'f.multicurrency_code'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_code',
'', $param,
'', $sortfield, $sortorder);
1415 $totalarray[
'nbfield']++;
1417if (!empty($arrayfields[
'f.multicurrency_tx'][
'checked'])) {
1418 print_liste_field_titre($arrayfields[
'f.multicurrency_tx'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_tx',
'', $param,
'', $sortfield, $sortorder);
1419 $totalarray[
'nbfield']++;
1421if (!empty($arrayfields[
'f.multicurrency_total_ht'][
'checked'])) {
1422 print_liste_field_titre($arrayfields[
'f.multicurrency_total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_total_ht',
'', $param,
'"', $sortfield, $sortorder,
'right ');
1423 $totalarray[
'nbfield']++;
1425if (!empty($arrayfields[
'f.multicurrency_total_vat'][
'checked'])) {
1426 print_liste_field_titre($arrayfields[
'f.multicurrency_total_vat'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1427 $totalarray[
'nbfield']++;
1429if (!empty($arrayfields[
'f.multicurrency_total_ttc'][
'checked'])) {
1430 print_liste_field_titre($arrayfields[
'f.multicurrency_total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'f.multicurrency_total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1431 $totalarray[
'nbfield']++;
1433if (!empty($arrayfields[
'multicurrency_dynamount_payed'][
'checked'])) {
1434 print_liste_field_titre($arrayfields[
'multicurrency_dynamount_payed'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1435 $totalarray[
'nbfield']++;
1437if (!empty($arrayfields[
'multicurrency_rtp'][
'checked'])) {
1438 print_liste_field_titre($arrayfields[
'multicurrency_rtp'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1439 $totalarray[
'nbfield']++;
1442include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1444$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
1445$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1446print $hookmanager->resPrint;
1447if (!empty($arrayfields[
'f.datec'][
'checked'])) {
1448 print_liste_field_titre($arrayfields[
'f.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"f.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1449 $totalarray[
'nbfield']++;
1451if (!empty($arrayfields[
'f.tms'][
'checked'])) {
1452 print_liste_field_titre($arrayfields[
'f.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"f.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1453 $totalarray[
'nbfield']++;
1455if (!empty($arrayfields[
'f.fk_statut'][
'checked'])) {
1456 print_liste_field_titre($arrayfields[
'f.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"fk_statut,paye,type",
"", $param,
'', $sortfield, $sortorder,
'center ');
1457 $totalarray[
'nbfield']++;
1461 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1462 $totalarray[
'nbfield']++;
1468$projectstatic =
new Project($db);
1469$userstatic =
new User($db);
1475$savnbfield = $totalarray[
'nbfield'];
1476$totalarray = array();
1477$totalarray[
'nbfield'] = 0;
1478$totalarray[
'val'] = array();
1479$totalarray[
'val'][
'f.total_ht']=0;
1480$totalarray[
'val'][
'f.total_vat']=0;
1481$totalarray[
'val'][
'f.total_localtax1']=0;
1482$totalarray[
'val'][
'f.total_localtax1']=0;
1483$totalarray[
'val'][
'f.total_ttc']=0;
1484$totalarray[
'val'][
'totalam']=0;
1485$totalarray[
'val'][
'rtp']=0;
1486$imaxinloop = ($limit ? min($num, $limit) : $num);
1487while ($i < $imaxinloop) {
1488 $obj = $db->fetch_object($resql);
1493 $datelimit = $db->jdate($obj->datelimite);
1495 $userstatic->id = $obj->fk_user_author;
1496 $userstatic->login = $obj->login;
1497 $userstatic->lastname = $obj->lastname;
1498 $userstatic->firstname = $obj->firstname;
1499 $userstatic->email = $obj->user_email;
1500 $userstatic->statut = $obj->user_statut;
1501 $userstatic->status = $obj->user_statut;
1502 $userstatic->entity = $obj->entity;
1503 $userstatic->photo = $obj->photo;
1504 $userstatic->office_phone = $obj->office_phone;
1505 $userstatic->office_fax = $obj->office_fax;
1506 $userstatic->user_mobile = $obj->user_mobile;
1507 $userstatic->job = $obj->job;
1508 $userstatic->gender = $obj->gender;
1509 $facturestatic->id = $obj->facid;
1510 $facturestatic->ref = $obj->ref;
1511 $facturestatic->type = $obj->type;
1512 $facturestatic->subtype = $obj->subtype;
1513 $facturestatic->total_ht = $obj->total_ht;
1514 $facturestatic->total_tva = $obj->total_vat;
1515 $facturestatic->total_ttc = $obj->total_ttc;
1516 $facturestatic->close_code = $obj->close_code;
1517 $facturestatic->ref_supplier = $obj->ref_supplier;
1518 $facturestatic->date_echeance = $db->jdate($obj->datelimite);
1519 $facturestatic->statut = $obj->fk_statut;
1520 $facturestatic->status = $obj->fk_statut;
1521 $facturestatic->note_public = $obj->note_public;
1522 $facturestatic->note_private = $obj->note_private;
1523 $facturestatic->multicurrency_code = $obj->multicurrency_code;
1524 $facturestatic->multicurrency_tx = $obj->multicurrency_tx;
1525 $facturestatic->multicurrency_total_ht = $obj->multicurrency_total_ht;
1526 $facturestatic->multicurrency_total_tva = $obj->multicurrency_total_vat;
1527 $facturestatic->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
1528 $thirdparty->id = $obj->socid;
1529 $thirdparty->name = $obj->name;
1530 $thirdparty->name_alias = $obj->alias;
1531 $thirdparty->client = $obj->client;
1532 $thirdparty->fournisseur = $obj->fournisseur;
1533 $thirdparty->code_client = $obj->code_client;
1534 $thirdparty->code_compta_client = $obj->code_compta_client;
1535 $thirdparty->code_fournisseur = $obj->code_fournisseur;
1536 $thirdparty->code_compta_fournisseur = $obj->code_compta_fournisseur;
1537 $thirdparty->email = $obj->email;
1538 $thirdparty->country_code = $obj->country_code;
1540 $paiement = $facturestatic->getSommePaiement();
1541 $totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
1542 $totaldeposits = $facturestatic->getSumDepositsUsed();
1543 $totalpay = $paiement + $totalcreditnotes + $totaldeposits;
1544 $remaintopay = $obj->total_ttc - $totalpay;
1546 $multicurrency_paiement = $facturestatic->getSommePaiement(1);
1547 $multicurrency_totalcreditnotes = $facturestatic->getSumCreditNotesUsed(1);
1548 $multicurrency_totaldeposits = $facturestatic->getSumDepositsUsed(1);
1550 $totalpay = $paiement + $totalcreditnotes + $totaldeposits;
1551 $remaintopay =
price2num($facturestatic->total_ttc - $totalpay);
1553 $multicurrency_totalpay = $multicurrency_paiement + $multicurrency_totalcreditnotes + $multicurrency_totaldeposits;
1554 $multicurrency_remaintopay =
price2num($facturestatic->multicurrency_total_ttc - $multicurrency_totalpay);
1558 $multicurrency_remaintopay = 0;
1561 $remaincreditnote = $discount->getAvailableDiscounts($thirdparty,
'',
'rc.fk_facture_source='.$facturestatic->id);
1562 $remaintopay = -$remaincreditnote;
1563 $totalpay =
price2num($facturestatic->total_ttc - $remaintopay);
1564 $multicurrency_remaincreditnote = $discount->getAvailableDiscounts($thirdparty,
'',
'rc.fk_facture_source='.$facturestatic->id, 0, 0, 1);
1565 $multicurrency_remaintopay = -$multicurrency_remaincreditnote;
1566 $multicurrency_totalpay =
price2num($facturestatic->multicurrency_total_ttc - $multicurrency_remaintopay);
1569 $facturestatic->alreadypaid = ($paiement ? $paiement : 0);
1571 $facturestatic->paye = $obj->paye;
1572 $facturestatic->socid = $thirdparty->getNomUrl(1,
'supplier', 3);
1574 $facturestatic->date = $db->jdate($obj->datef);
1576 $object = $facturestatic;
1580 if ($facturestatic->isCreditNoteUsed()) {
1581 $remaintopay = -$facturestatic->getSumFromThisCreditNotesNotUsed();
1585 if ($mode ==
'kanban') {
1587 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1588 print
'<div class="box-flex-container kanban">';
1591 if ($massactionbutton || $massaction) {
1593 if (in_array($object->id, $arrayofselected)) {
1598 $arraydata = array(
'alreadypaid' => $paiement,
'thirdparty' => $thirdparty->getNomUrl(1,
'', 12),
'selected' => in_array($object->id, $arrayofselected));
1599 print $facturestatic->getKanbanView(
'', $arraydata);
1600 if ($i == ($imaxinloop - 1)) {
1607 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
1611 print
'<td class="nowrap center">';
1612 if ($massactionbutton || $massaction) {
1614 if (in_array($obj->facid, $arrayofselected)) {
1617 print
'<input id="cb'.$obj->facid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->facid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1621 $totalarray[
'nbfield']++;
1624 if (!empty($arrayfields[
'f.ref'][
'checked'])) {
1625 print
'<td class="nowraponall">';
1627 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1629 print
'<td class="nobordernopadding nowraponall">';
1630 print $facturestatic->getNomUrl(1,
'', 0, 0,
'', 0, -1, 1);
1633 $filedir = $conf->fournisseur->facture->dir_output.
'/'.
get_exdir($obj->facid, 2, 0, 0, $facturestatic,
'invoice_supplier').dol_sanitizeFileName($obj->ref);
1634 $subdir =
get_exdir($obj->facid, 2, 0, 0, $facturestatic,
'invoice_supplier').dol_sanitizeFileName($obj->ref);
1635 print $formfile->getDocumentsLink(
'facture_fournisseur', $subdir, $filedir);
1636 print
'</td></tr></table>';
1640 $totalarray[
'nbfield']++;
1645 if (!empty($arrayfields[
'f.ref_supplier'][
'checked'])) {
1646 print
'<td class="nowrap tdoverflowmax150" title="'.dol_escape_htmltag($obj->ref_supplier).
'">';
1647 print $obj->ref_supplier;
1650 $totalarray[
'nbfield']++;
1655 if (!empty($arrayfields[
'f.type'][
'checked'])) {
1656 print
'<td class="nowrap">';
1657 print $facturestatic->getLibType();
1660 $totalarray[
'nbfield']++;
1665 if (!empty($arrayfields[
'f.subtype'][
'checked'])) {
1667 if ($facturestatic->subtype > 0) {
1668 $labeltoshow = $facturestatic->getSubtypeLabel(
'facture_fourn');
1670 print
'<td class="nowraponall tdoverflowmax300" title="'.$labeltoshow.
'">';
1674 $totalarray[
'nbfield']++;
1679 if (!empty($arrayfields[
'f.label'][
'checked'])) {
1680 print
'<td class="nowrap">';
1684 $totalarray[
'nbfield']++;
1689 if (!empty($arrayfields[
'f.datef'][
'checked'])) {
1690 print
'<td class="center nowrap">';
1694 $totalarray[
'nbfield']++;
1699 if (!empty($arrayfields[
'f.date_lim_reglement'][
'checked'])) {
1700 print
'<td class="center nowraponall">'.dol_print_date($datelimit,
'day');
1701 if ($facturestatic->hasDelay()) {
1702 print
img_warning($langs->trans(
'Alert').
' - '.$langs->trans(
'Late'));
1706 $totalarray[
'nbfield']++;
1711 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1712 print
'<td class="nowrap">';
1713 if ($obj->project_id > 0) {
1714 $projectstatic->id = $obj->project_id;
1715 $projectstatic->ref = $obj->project_ref;
1716 $projectstatic->title = $obj->project_label;
1717 print $projectstatic->getNomUrl(1);
1721 $totalarray[
'nbfield']++;
1726 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1727 print
'<td class="tdoverflowmax150">';
1728 print $thirdparty->getNomUrl(1,
'supplier', 0, 0, -1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
1731 $totalarray[
'nbfield']++;
1735 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1736 print
'<td class="tdoverflowmax150">';
1740 $totalarray[
'nbfield']++;
1744 if (!empty($arrayfields[
's.town'][
'checked'])) {
1745 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->town).
'">';
1749 $totalarray[
'nbfield']++;
1753 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1754 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->zip).
'">';
1758 $totalarray[
'nbfield']++;
1762 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1763 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->state_name).
'">';
1767 $totalarray[
'nbfield']++;
1771 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1772 print
'<td class="center">';
1773 $tmparray =
getCountry($obj->fk_pays,
'all');
1774 print $tmparray[
'label'];
1777 $totalarray[
'nbfield']++;
1781 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1782 print
'<td class="center">';
1783 if (empty($typenArray)) {
1784 $typenArray = $formcompany->typent_array(1);
1786 print $typenArray[$obj->typent_code];
1789 $totalarray[
'nbfield']++;
1794 if (!empty($arrayfields[
'f.fk_cond_reglement'][
'checked'])) {
1795 $s = $form->form_conditions_reglement($_SERVER[
'PHP_SELF'], $obj->fk_cond_reglement,
'none', 1,
'', -1, -1, 1);
1796 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).
'">';
1800 $totalarray[
'nbfield']++;
1804 if (!empty($arrayfields[
'f.fk_mode_reglement'][
'checked'])) {
1805 $s = $form->form_modes_reglement($_SERVER[
'PHP_SELF'], $obj->fk_mode_reglement,
'none',
'', -1, 0,
'', 1);
1806 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).
'">';
1810 $totalarray[
'nbfield']++;
1815 if (!empty($arrayfields[
'f.total_ht'][
'checked'])) {
1816 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_ht).
"</span></td>\n";
1818 $totalarray[
'nbfield']++;
1819 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_ht';
1821 $totalarray[
'val'][
'f.total_ht'] += $obj->total_ht;
1824 if (!empty($arrayfields[
'f.total_vat'][
'checked'])) {
1825 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_vat).
"</span></td>\n";
1827 $totalarray[
'nbfield']++;
1828 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_vat';
1830 $totalarray[
'val'][
'f.total_vat'] += $obj->total_vat;
1833 if (!empty($arrayfields[
'f.total_localtax1'][
'checked'])) {
1834 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_localtax1).
"</span></td>\n";
1836 $totalarray[
'nbfield']++;
1837 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_localtax1';
1839 $totalarray[
'val'][
'f.total_localtax1'] += $obj->total_localtax1;
1842 if (!empty($arrayfields[
'f.total_localtax2'][
'checked'])) {
1843 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_localtax2).
"</span></td>\n";
1845 $totalarray[
'nbfield']++;
1846 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_localtax2';
1848 $totalarray[
'val'][
'f.total_localtax2'] += $obj->total_localtax2;
1851 if (!empty($arrayfields[
'f.total_ttc'][
'checked'])) {
1852 print
'<td class="right nowrap"><span class="amount">'.price($obj->total_ttc).
"</span></td>\n";
1854 $totalarray[
'nbfield']++;
1855 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'f.total_ttc';
1857 $totalarray[
'val'][
'f.total_ttc'] += $obj->total_ttc;
1861 if (!empty($arrayfields[
'f.nb_docs'][
'checked'])) {
1862 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
1863 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
1864 $upload_dir = $conf->fournisseur->facture->dir_output.
'/'.
get_exdir($facturestatic->id, 2, 0, 0, $facturestatic,
'invoice_supplier').$facturestatic->ref;
1865 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
1866 $nbLinks =
Link::count($db, $facturestatic->element, $facturestatic->id);
1867 $nbTotal = $nbFiles + $nbLinks;
1868 echo
'<td class="center">'.(empty($nbTotal) ?
'' : $nbTotal).
'</td>';
1870 $totalarray[
'nbfield']++;
1875 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1876 print
'<td class="tdoverflowmax125">';
1877 if ($userstatic->id) {
1878 print $userstatic->getNomUrl(-1);
1884 $totalarray[
'nbfield']++;
1888 if (!empty($arrayfields[
'dynamount_payed'][
'checked'])) {
1889 print
'<td class="right nowrap"><span class="amount">'.(!empty($totalpay) ?
price($totalpay, 0, $langs) :
'').
'</span></td>';
1891 $totalarray[
'nbfield']++;
1892 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalam';
1894 if (empty($totalarray[
'val'][
'totalam'])) {
1895 $totalarray[
'val'][
'totalam'] = 0;
1897 $totalarray[
'val'][
'totalam'] += $totalpay;
1900 if (!empty($arrayfields[
'rtp'][
'checked'])) {
1901 print
'<td class="right nowrap">'.(!empty($remaintopay) ?
price($remaintopay, 0, $langs) :
' ').
'</td>';
1903 $totalarray[
'nbfield']++;
1904 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'rtp';
1906 $totalarray[
'val'][
'rtp'] += $remaintopay;
1910 if (!empty($arrayfields[
'f.multicurrency_code'][
'checked'])) {
1911 print
'<td class="nowrap">'.$obj->multicurrency_code.
' - '.$langs->trans(
'Currency'.$obj->multicurrency_code).
"</td>\n";
1913 $totalarray[
'nbfield']++;
1918 if (!empty($arrayfields[
'f.multicurrency_tx'][
'checked'])) {
1919 print
'<td class="nowrap">';
1920 $form->form_multicurrency_rate($_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid, $obj->multicurrency_tx,
'none', $obj->multicurrency_code);
1923 $totalarray[
'nbfield']++;
1927 if (!empty($arrayfields[
'f.multicurrency_total_ht'][
'checked'])) {
1928 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht).
"</span></td>\n";
1930 $totalarray[
'nbfield']++;
1934 if (!empty($arrayfields[
'f.multicurrency_total_vat'][
'checked'])) {
1935 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_vat).
"</span></td>\n";
1937 $totalarray[
'nbfield']++;
1941 if (!empty($arrayfields[
'f.multicurrency_total_ttc'][
'checked'])) {
1942 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc).
"</span></td>\n";
1944 $totalarray[
'nbfield']++;
1947 if (!empty($arrayfields[
'multicurrency_dynamount_payed'][
'checked'])) {
1948 print
'<td class="right nowrap"><span class="amount">'.(!empty($multicurrency_totalpay) ?
price($multicurrency_totalpay, 0, $langs) :
'').
'</span></td>';
1950 $totalarray[
'nbfield']++;
1955 if (!empty($arrayfields[
'multicurrency_rtp'][
'checked'])) {
1956 print
'<td class="right nowrap"><span class="amount">';
1957 print(!empty($multicurrency_remaintopay) ?
price($multicurrency_remaintopay, 0, $langs) :
'');
1958 print
'</span></td>';
1960 $totalarray[
'nbfield']++;
1966 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1968 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1969 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1970 print $hookmanager->resPrint;
1973 if (!empty($arrayfields[
'f.datec'][
'checked'])) {
1974 print
'<td class="center nowraponll">';
1975 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
1978 $totalarray[
'nbfield']++;
1982 if (!empty($arrayfields[
'f.tms'][
'checked'])) {
1983 print
'<td class="center nowraponall">';
1984 print
dol_print_date($db->jdate($obj->date_update),
'dayhour',
'tzuser');
1987 $totalarray[
'nbfield']++;
1991 if (!empty($arrayfields[
'f.fk_statut'][
'checked'])) {
1992 print
'<td class="center nowrap">';
1993 print $facturestatic->getLibStatut(5, $paiement);
1996 $totalarray[
'nbfield']++;
2002 print
'<td class="nowrap center">';
2003 if ($massactionbutton || $massaction) {
2005 if (in_array($obj->facid, $arrayofselected)) {
2008 print
'<input id="cb'.$obj->facid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->facid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2012 $totalarray[
'nbfield']++;
2023include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2028 foreach ($arrayfields as $key => $val) {
2029 if (!empty($val[
'checked'])) {
2033 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2038$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
2039$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2040print $hookmanager->resPrint;
2042print
'</table>'.
"\n";
2045print
'</form>'.
"\n";
2047if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
2048 $hidegeneratedfilelistifempty = 1;
2049 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2050 $hidegeneratedfilelistifempty = 0;
2053 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
2057 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2058 $urlsource .= str_replace(
'&',
'&', $param);
2060 $filedir = $diroutputmassaction;
2061 $genallowed = $permissiontoread;
2062 $delallowed = $permissiontoadd;
2065 print $formfile->showdocuments(
'massfilesarea_supplier_invoice',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage bank accounts.
Class to manage absolute discounts.
Class to manage suppliers invoices.
const TYPE_DEPOSIT
Deposit invoice.
const TYPE_CREDIT_NOTE
Credit note invoice.
const TYPE_REPLACEMENT
Replacement invoice.
const TYPE_STANDARD
Standard invoice.
const STATUS_CLOSED
Classified paid.
Class to manage suppliers.
static count($dbs, $objecttype, $objectid)
Return nb of links.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
getCountry($searchkey, $withcode='', $dbtouse=0, $outputlangs='', $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
GETPOSTDATE($prefix, $hourTime='', $gm='auto')
Helper function that combines values of a dolibarr DatePicker (such as Form\selectDate) for year,...
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
buildParamDate($prefix, $timestamp=null, $hourTime='', $gm='auto')
Helper function that combines values of a dolibarr DatePicker (such as Form\selectDate) for year,...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.