36 require_once
'../main.inc.php';
37 include_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
40 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
41 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/societe/class/client.class.php';
44 $langs->loadLangs(array(
"companies",
"commercial",
"customers",
"suppliers",
"bills",
"compta",
"categories",
"cashdesk"));
46 $action =
GETPOST(
'action',
'aZ09');
47 $massaction =
GETPOST(
'massaction',
'alpha');
48 $show_files =
GETPOST(
'show_files',
'int');
49 $confirm =
GETPOST(
'confirm',
'alpha');
50 $toselect =
GETPOST(
'toselect',
'array');
51 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'thirdpartylist';
53 if ($contextpage ==
'poslist')
55 $_GET[
'optioncss'] =
'print';
59 $socid =
GETPOST(
'socid',
'int');
60 if ($user->socid) $socid = $user->socid;
63 $search_all = trim(
GETPOST(
'search_all',
'alphanohtml') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
64 $search_cti = preg_replace(
'/^0+/',
'', preg_replace(
'/[^0-9]/',
'',
GETPOST(
'search_cti',
'alphanohtml')));
66 $search_id = trim(
GETPOST(
"search_id",
"int"));
67 $search_nom = trim(
GETPOST(
"search_nom",
'restricthtml'));
68 $search_alias = trim(
GETPOST(
"search_alias",
'restricthtml'));
69 $search_nom_only = trim(
GETPOST(
"search_nom_only",
'restricthtml'));
70 $search_barcode = trim(
GETPOST(
"search_barcode",
'alpha'));
71 $search_customer_code = trim(
GETPOST(
'search_customer_code',
'alpha'));
72 $search_supplier_code = trim(
GETPOST(
'search_supplier_code',
'alpha'));
73 $search_account_customer_code = trim(
GETPOST(
'search_account_customer_code',
'alpha'));
74 $search_account_supplier_code = trim(
GETPOST(
'search_account_supplier_code',
'alpha'));
75 $search_address = trim(
GETPOST(
'search_address',
'alpha'));
76 $search_town = trim(
GETPOST(
"search_town",
'alpha'));
77 $search_zip = trim(
GETPOST(
"search_zip",
'alpha'));
78 $search_state = trim(
GETPOST(
"search_state",
'alpha'));
79 $search_region = trim(
GETPOST(
"search_region",
'alpha'));
80 $search_email = trim(
GETPOST(
'search_email',
'alpha'));
81 $search_phone = trim(
GETPOST(
'search_phone',
'alpha'));
82 $search_fax = trim(
GETPOST(
'search_fax',
'alpha'));
83 $search_url = trim(
GETPOST(
'search_url',
'alpha'));
84 $search_idprof1 = trim(
GETPOST(
'search_idprof1',
'alpha'));
85 $search_idprof2 = trim(
GETPOST(
'search_idprof2',
'alpha'));
86 $search_idprof3 = trim(
GETPOST(
'search_idprof3',
'alpha'));
87 $search_idprof4 = trim(
GETPOST(
'search_idprof4',
'alpha'));
88 $search_idprof5 = trim(
GETPOST(
'search_idprof5',
'alpha'));
89 $search_idprof6 = trim(
GETPOST(
'search_idprof6',
'alpha'));
90 $search_vat = trim(
GETPOST(
'search_vat',
'alpha'));
91 $search_sale = trim(
GETPOST(
"search_sale",
'int'));
92 $search_categ_cus = trim(
GETPOST(
"search_categ_cus",
'int'));
93 $search_categ_sup = trim(
GETPOST(
"search_categ_sup",
'int'));
94 $search_country =
GETPOST(
"search_country",
'intcomma');
95 $search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'int');
96 $search_staff =
GETPOST(
"search_staff",
'int');
97 $search_status =
GETPOST(
"search_status",
'int');
98 $search_type =
GETPOST(
'search_type',
'alpha');
99 $search_level =
GETPOST(
"search_level",
"array");
100 $search_stcomm =
GETPOST(
'search_stcomm',
'int');
101 $search_import_key =
GETPOST(
"search_import_key",
"alpha");
102 $search_parent_name =
GETPOST(
'search_parent_name',
'alpha');
104 $type =
GETPOST(
'type',
'alpha');
105 $optioncss =
GETPOST(
'optioncss',
'alpha');
106 $mode =
GETPOST(
"mode",
'alpha');
107 $place =
GETPOST(
'place',
'aZ09') ?
GETPOST(
'place',
'aZ09') :
'0';
109 $diroutputmassaction = $conf->societe->dir_output.
'/temp/massgeneration/'.$user->id;
111 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
112 $sortfield =
GETPOST(
"sortfield",
'alpha');
113 $sortorder =
GETPOST(
"sortorder",
'alpha');
115 if (!$sortorder) $sortorder =
"ASC";
116 if (!$sortfield) $sortfield =
"s.nom";
117 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) { $page = 0; }
118 $offset = $limit * $page;
119 $pageprev = $page - 1;
120 $pagenext = $page + 1;
122 if ($type ==
'c') {
if (empty($contextpage) || $contextpage ==
'thirdpartylist') $contextpage =
'customerlist';
if ($search_type ==
'') $search_type =
'1,3'; }
123 if ($type ==
'p') {
if (empty($contextpage) || $contextpage ==
'thirdpartylist') $contextpage =
'prospectlist';
if ($search_type ==
'') $search_type =
'2,3'; }
124 if ($type ==
't') {
if (empty($contextpage) || $contextpage ==
'poslist') $contextpage =
'poslist';
if ($search_type ==
'') $search_type =
'1,2,3'; }
125 if ($type ==
'f') {
if (empty($contextpage) || $contextpage ==
'thirdpartylist') $contextpage =
'supplierlist';
if ($search_type ==
'') $search_type =
'4'; }
129 $hookmanager->initHooks(array(
'thirdpartylist'));
133 $extrafields->fetch_name_optionals_label($object->table_element);
135 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
138 $fieldstosearchall = array(
139 's.nom'=>
"ThirdPartyName",
140 's.name_alias'=>
"AliasNameShort",
141 's.code_client'=>
"CustomerCode",
142 's.code_fournisseur'=>
"SupplierCode",
143 's.code_compta'=>
"CustomerAccountancyCodeShort",
144 's.code_compta_fournisseur'=>
"SupplierAccountancyCodeShort",
149 's.tva_intra'=>
"VATIntra",
150 's.siren'=>
"ProfId1",
151 's.siret'=>
"ProfId2",
156 if (($tmp = $langs->transnoentities(
"ProfId4".$mysoc->country_code)) && $tmp !=
"ProfId4".$mysoc->country_code && $tmp !=
'-') $fieldstosearchall[
's.idprof4'] =
'ProfId4';
157 if (($tmp = $langs->transnoentities(
"ProfId5".$mysoc->country_code)) && $tmp !=
"ProfId5".$mysoc->country_code && $tmp !=
'-') $fieldstosearchall[
's.idprof5'] =
'ProfId5';
158 if (($tmp = $langs->transnoentities(
"ProfId6".$mysoc->country_code)) && $tmp !=
"ProfId6".$mysoc->country_code && $tmp !=
'-') $fieldstosearchall[
's.idprof6'] =
'ProfId6';
159 if (!empty($conf->barcode->enabled)) $fieldstosearchall[
's.barcode'] =
'Gencod';
161 if (!empty($conf->global->THIRDPARTY_QUICKSEARCH_ON_FIELDS)) $fieldstosearchall =
dolExplodeIntoArray($conf->global->THIRDPARTY_QUICKSEARCH_ON_FIELDS);
165 $checkedcustomercode = (in_array($contextpage, array(
'thirdpartylist',
'customerlist',
'prospectlist',
'poslist')) ? 1 : 0);
166 $checkedsuppliercode = (in_array($contextpage, array(
'supplierlist')) ? 1 : 0);
167 $checkedcustomeraccountcode = (in_array($contextpage, array(
'customerlist')) ? 1 : 0);
168 $checkedsupplieraccountcode = (in_array($contextpage, array(
'supplierlist')) ? 1 : 0);
169 $checkedtypetiers = 1;
179 $checkprospectlevel = (in_array($contextpage, array(
'prospectlist')) ? 1 : 0);
180 $checkstcomm = (in_array($contextpage, array(
'prospectlist')) ? 1 : 0);
181 $arrayfields = array(
182 's.rowid'=>array(
'label'=>
"TechnicalID",
'position'=>1,
'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0),
'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0)),
183 's.nom'=>array(
'label'=>
"ThirdPartyName",
'position'=>2,
'checked'=>1),
184 's.name_alias'=>array(
'label'=>
"AliasNameShort",
'position'=>3,
'checked'=>1),
185 's.barcode'=>array(
'label'=>
"Gencod",
'position'=>5,
'checked'=>1,
'enabled'=>(!empty($conf->barcode->enabled))),
186 's.code_client'=>array(
'label'=>
"CustomerCodeShort",
'position'=>10,
'checked'=>$checkedcustomercode),
187 's.code_fournisseur'=>array(
'label'=>
"SupplierCodeShort",
'position'=>11,
'checked'=>$checkedsuppliercode,
'enabled'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
188 's.code_compta'=>array(
'label'=>
"CustomerAccountancyCodeShort",
'position'=>13,
'checked'=>$checkedcustomeraccountcode),
189 's.code_compta_fournisseur'=>array(
'label'=>
"SupplierAccountancyCodeShort",
'position'=>14,
'checked'=>$checkedsupplieraccountcode,
'enabled'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
190 's.address'=>array(
'label'=>
"Address",
'position'=>19,
'checked'=>0),
191 's.town'=>array(
'label'=>
"Town",
'position'=>20,
'checked'=>0),
192 's.zip'=>array(
'label'=>
"Zip",
'position'=>21,
'checked'=>1),
193 'state.nom'=>array(
'label'=>
"State",
'position'=>22,
'checked'=>0),
194 'region.nom'=>array(
'label'=>
"Region",
'position'=>23,
'checked'=>0),
195 'country.code_iso'=>array(
'label'=>
"Country",
'position'=>24,
'checked'=>0),
196 's.email'=>array(
'label'=>
"Email",
'position'=>25,
'checked'=>0),
197 's.url'=>array(
'label'=>
"Url",
'position'=>26,
'checked'=>0),
198 's.phone'=>array(
'label'=>
"Phone",
'position'=>27,
'checked'=>1),
199 's.fax'=>array(
'label'=>
"Fax",
'position'=>28,
'checked'=>0),
200 'typent.code'=>array(
'label'=>
"ThirdPartyType",
'position'=>29,
'checked'=>$checkedtypetiers),
201 'staff.code'=>array(
'label'=>
"Staff",
'position'=>30,
'checked'=>0),
202 's.siren'=>array(
'label'=>
"ProfId1Short",
'position'=>40,
'checked'=>$checkedprofid1),
203 's.siret'=>array(
'label'=>
"ProfId2Short",
'position'=>41,
'checked'=>$checkedprofid2),
204 's.ape'=>array(
'label'=>
"ProfId3Short",
'position'=>42,
'checked'=>$checkedprofid3),
205 's.idprof4'=>array(
'label'=>
"ProfId4Short",
'position'=>43,
'checked'=>$checkedprofid4),
206 's.idprof5'=>array(
'label'=>
"ProfId5Short",
'position'=>44,
'checked'=>$checkedprofid5),
207 's.idprof6'=>array(
'label'=>
"ProfId6Short",
'position'=>45,
'checked'=>$checkedprofid6),
208 's.tva_intra'=>array(
'label'=>
"VATIntraShort",
'position'=>50,
'checked'=>0),
209 'customerorsupplier'=>array(
'label'=>
'NatureOfThirdParty',
'position'=>61,
'checked'=>1),
210 's.fk_prospectlevel'=>array(
'label'=>
"ProspectLevelShort",
'position'=>62,
'checked'=>$checkprospectlevel),
211 's.fk_stcomm'=>array(
'label'=>
"StatusProsp",
'position'=>63,
'checked'=>$checkstcomm),
212 's2.nom'=>array(
'label'=>
'ParentCompany',
'position'=>64,
'checked'=>0),
213 's.datec'=>array(
'label'=>
"DateCreation",
'checked'=>0,
'position'=>500),
214 's.tms'=>array(
'label'=>
"DateModificationShort",
'checked'=>0,
'position'=>500),
215 's.status'=>array(
'label'=>
"Status",
'checked'=>1,
'position'=>1000),
216 's.import_key'=>array(
'label'=>
"ImportId",
'checked'=>0,
'position'=>1100),
219 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
229 if ($action ==
"change")
231 $idcustomer =
GETPOST(
'idcustomer',
'int');
234 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"facture where ref='(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")' AND entity IN (".
getEntity(
'invoice').
")";
235 $result = $db->query($sql);
236 $num_lines = $db->num_rows($result);
239 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
241 $constforthirdpartyid =
'CASHDESK_ID_THIRDPARTY'.$_SESSION[
"takeposterminal"];
242 $invoice->socid = $conf->global->$constforthirdpartyid;
244 $invoice->module_source =
'takepos';
245 $invoice->pos_source = $_SESSION[
"takeposterminal"];
246 $placeid = $invoice->create($user);
247 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"facture set ref='(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")' where rowid=".$placeid;
251 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"facture set fk_soc=".$idcustomer.
" where ref='(PROV-POS".$_SESSION[
"takeposterminal"].
"-".$place.
")'";
252 $resql = $db->query($sql);
255 console.log(
"Reload page invoice.php with place=<?php print $place; ?>");
256 parent.$(
"#poslines").load(
"invoice.php?place=<?php print $place; ?>",
function() {
259 alert(
'Error failed to update customer on draft invoice.');
261 parent.$.colorbox.close();
268 if (
GETPOST(
'cancel',
'alpha')) { $action =
'list'; $massaction =
''; }
269 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') { $massaction =
''; }
271 $parameters = array();
272 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
273 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
278 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
281 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha'))
286 $search_categ_cus = 0;
287 $search_categ_sup = 0;
289 $search_barcode =
"";
290 $search_customer_code =
'';
291 $search_supplier_code =
'';
292 $search_account_customer_code =
'';
293 $search_account_supplier_code =
'';
294 $search_address =
'';
298 $search_country =
'';
303 $search_idprof1 =
'';
304 $search_idprof2 =
'';
305 $search_idprof3 =
'';
306 $search_idprof4 =
'';
307 $search_idprof5 =
'';
308 $search_idprof6 =
'';
311 $search_type_thirdparty =
'';
316 $search_parent_name =
'';
317 $search_import_key =
'';
319 $search_array_options = array();
323 $objectclass =
'Societe';
324 $objectlabel =
'ThirdParty';
325 $permissiontoread = $user->rights->societe->lire;
326 $permissiontodelete = $user->rights->societe->supprimer;
327 $uploaddir = $conf->societe->dir_output;
328 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
330 if ($action ==
'setstcomm')
332 $object =
new Client($db);
333 $result = $object->fetch(
GETPOST(
'stcommsocid'));
335 $result = $object->update($object->id, $user);
336 if ($result < 0)
setEventMessages($object->error, $object->errors,
'errors');
342 if ($search_status ==
'') $search_status = 1;
359 $form =
new Form($db);
361 $companystatic =
new Societe($db);
362 $companyparent =
new Societe($db);
364 $prospectstatic =
new Client($db);
365 $prospectstatic->client = 2;
366 $prospectstatic->loadCacheOfProspStatus();
369 $title = $langs->trans(
"ListOfThirdParties");
370 if ($type ==
'c' && (empty($search_type) || ($search_type ==
'1,3'))) $title = $langs->trans(
"ListOfCustomers");
371 if ($type ==
'p' && (empty($search_type) || ($search_type ==
'2,3'))) $title = $langs->trans(
"ListOfProspects");
372 if ($type ==
'f' && (empty($search_type) || ($search_type ==
'4'))) $title = $langs->trans(
"ListOfSuppliers");
375 $tab_level = array();
376 $sql =
"SELECT code, label, sortorder";
377 $sql .=
" FROM ".MAIN_DB_PREFIX.
"c_prospectlevel";
378 $sql .=
" WHERE active > 0";
379 $sql .=
" ORDER BY sortorder";
380 $resql = $db->query($sql);
383 while ($obj = $db->fetch_object(
$resql))
386 $level = $langs->trans($obj->code);
387 if ($level == $obj->code) $level = $langs->trans($obj->label);
388 $tab_level[$obj->code] = $level;
392 $sql =
"SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.address, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, s.logo,";
393 $sql .=
" s.entity,";
394 $sql .=
" st.libelle as stcomm, st.picto as stcomm_picto, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,";
395 $sql .=
" s.email, s.phone, s.fax, s.url, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4 as idprof4, s.idprof5 as idprof5, s.idprof6 as idprof6, s.tva_intra, s.fk_pays,";
396 $sql .=
" s.tms as date_update, s.datec as date_creation,";
397 $sql .=
" s.code_compta, s.code_compta_fournisseur, s.parent as fk_parent,";
398 $sql .=
" s2.nom as name2,";
399 $sql .=
" typent.code as typent_code,";
400 $sql .=
" staff.code as staff_code,";
401 $sql .=
" country.code as country_code, country.label as country_label,";
402 $sql .=
" state.code_departement as state_code, state.nom as state_name,";
403 $sql .=
" region.code_region as region_code, region.nom as region_name";
405 if ($search_sale) $sql .=
", sc.fk_soc, sc.fk_user";
407 if ($search_categ_cus) $sql .=
", cc.fk_categorie, cc.fk_soc";
408 if ($search_categ_sup) $sql .=
", cs.fk_categorie, cs.fk_soc";
410 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
411 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
' as options_'.$key :
'');
414 $parameters = array();
415 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
416 $sql .= $hookmanager->resPrint;
417 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
418 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s2 ON s.parent = s2.rowid";
419 if (is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (s.rowid = ef.fk_object)";
420 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
421 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
422 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_effectif as staff on (staff.id = s.fk_effectif)";
423 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
424 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_regions as region on (region. code_region = state.fk_region)";
426 if (!empty($search_categ_cus)) $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
"categorie_societe as cc ON s.rowid = cc.fk_soc";
427 if (!empty($search_categ_sup)) $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
"categorie_fournisseur as cs ON s.rowid = cs.fk_soc";
428 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
"c_stcomm as st ON s.fk_stcomm = st.id";
430 if ($search_sale == -2) $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON sc.fk_soc = s.rowid";
431 elseif ($search_sale || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
432 $sql .= " WHERE s.entity IN (".
getEntity('societe').")";
433 if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.
rowid = sc.fk_soc AND sc.fk_user = ".$user->
id;
434 if ($search_sale && $search_sale != -2) $sql .= " AND s.
rowid = sc.fk_soc";
435 if (!$user->rights->fournisseur->lire) $sql .= " AND (s.fournisseur <> 1 OR s.client <> 0)";
436 if ($search_sale == -2) $sql .= " AND sc.fk_user IS NULL";
437 elseif ($search_sale) $sql .= " AND sc.fk_user = ".$db->escape($search_sale);
438 if ($search_categ_cus > 0) $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
439 if ($search_categ_sup > 0) $sql .= " AND cs.fk_categorie = ".$db->escape($search_categ_sup);
440 if ($search_categ_cus == -2) $sql .= " AND cc.fk_categorie IS NULL";
441 if ($search_categ_sup == -2) $sql .= " AND cs.fk_categorie IS NULL";
443 if ($search_all) $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
450 if ($search_customer_code) $sql .=
natural_search("s.code_client", $search_customer_code);
451 if ($search_supplier_code) $sql .=
natural_search("s.code_fournisseur", $search_supplier_code);
452 if ($search_account_customer_code) $sql .=
natural_search("s.code_compta", $search_account_customer_code);
453 if ($search_account_supplier_code) $sql .=
natural_search("s.code_compta_fournisseur", $search_account_supplier_code);
459 if ($search_country && $search_country != '-1') $sql .= " AND s.fk_pays IN (".$db->sanitize($db->escape($search_country)).')';
461 if (strlen($search_phone)) $sql .=
natural_search("s.phone", $search_phone);
464 if (strlen($search_idprof1)) $sql .=
natural_search("s.siren", $search_idprof1);
465 if (strlen($search_idprof2)) $sql .=
natural_search("s.siret", $search_idprof2);
466 if (strlen($search_idprof3)) $sql .=
natural_search("s.ape", $search_idprof3);
467 if (strlen($search_idprof4)) $sql .=
natural_search("s.idprof4", $search_idprof4);
468 if (strlen($search_idprof5)) $sql .=
natural_search("s.idprof5", $search_idprof5);
469 if (strlen($search_idprof6)) $sql .=
natural_search("s.idprof6", $search_idprof6);
470 if (strlen($search_vat)) $sql .=
natural_search("s.tva_intra", $search_vat);
472 if ($search_type > 0 && in_array($search_type, array('1,3', '1,2,3', '2,3'))) $sql .= " AND s.client IN (".$db->sanitize($db->escape($search_type)).")";
473 if ($search_type > 0 && in_array($search_type, array('4'))) $sql .= " AND s.fournisseur = 1";
474 if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0";
475 if ($search_status != '' && $search_status >= 0) $sql .=
natural_search("s.status", $search_status, 2);
476 if (!empty($conf->barcode->enabled) && $search_barcode) $sql .=
natural_search("s.barcode", $search_barcode);
477 if ($search_type_thirdparty && $search_type_thirdparty != '-1') $sql .=
natural_search("s.fk_typent", $search_type_thirdparty, 2);
478 if (!empty($search_staff) && $search_staff != '-1') $sql .=
natural_search("s.fk_effectif", $search_staff, 2);
479 if ($search_level) $sql .=
natural_search("s.fk_prospectlevel", join(',', $search_level), 3);
480 if ($search_parent_name) $sql .=
natural_search("s2.nom", $search_parent_name);
481 if ($search_stcomm != '' && $search_stcomm != -2) $sql .=
natural_search("s.fk_stcomm", $search_stcomm, 2);
482 if ($search_import_key) $sql .=
natural_search("s.import_key", $search_import_key);
484 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
486 $parameters = array('socid' => $socid);
487 $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters);
488 if (empty($reshook)) {
489 if ($socid) $sql .=
" AND s.rowid = ".$socid;
491 $sql .= $hookmanager->resPrint;
493 $sql .= $db->order($sortfield, $sortorder);
496 $nbtotalofrecords =
'';
497 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
499 $result = $db->query($sql);
500 $nbtotalofrecords = $db->num_rows($result);
501 if (($page * $limit) > $nbtotalofrecords)
508 $sql .= $db->plimit($limit + 1, $offset);
510 $resql = $db->query($sql);
517 $num = $db->num_rows(
$resql);
519 $arrayofselected = is_array($toselect) ? $toselect : array();
521 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($search_all !=
'' || $search_cti !=
'') && $action !=
'list') {
522 $obj = $db->fetch_object(
$resql);
524 if (!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD)) {
525 if ($obj->client > 0) {
526 header(
"Location: ".DOL_URL_ROOT.
'/comm/card.php?socid='.$id);
529 if ($obj->fournisseur > 0) {
530 header(
"Location: ".DOL_URL_ROOT.
'/fourn/card.php?socid='.$id);
535 header(
"Location: ".DOL_URL_ROOT.
'/societe/card.php?socid='.$id);
539 $help_url =
'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
540 llxHeader(
'', $langs->trans(
"ThirdParty"), $help_url);
543 if (!empty($contextpage) && $contextpage !=
$_SERVER[
"PHP_SELF"]) $param .=
'&contextpage='.urlencode($contextpage);
544 if ($limit > 0 && $limit != $conf->liste_limit) $param .=
'&limit='.urlencode($limit);
545 if ($search_all !=
'') $param =
"&sall=".urlencode($search_all);
546 if ($search_categ_cus > 0) $param .=
'&search_categ_cus='.urlencode($search_categ_cus);
547 if ($search_categ_sup > 0) $param .=
'&search_categ_sup='.urlencode($search_categ_sup);
548 if ($search_sale > 0) $param .=
'&search_sale='.urlencode($search_sale);
549 if ($search_id > 0) $param .=
"&search_id=".urlencode($search_id);
550 if ($search_nom !=
'') $param .=
"&search_nom=".urlencode($search_nom);
551 if ($search_alias !=
'') $param .=
"&search_alias=".urlencode($search_alias);
552 if ($search_address !=
'') $param .=
'&search_address=' . urlencode($search_address);
553 if ($search_town !=
'') $param .=
"&search_town=".urlencode($search_town);
554 if ($search_zip !=
'') $param .=
"&search_zip=".urlencode($search_zip);
555 if ($search_phone !=
'') $param .=
"&search_phone=".urlencode($search_phone);
556 if ($search_fax !=
'') $param .=
"&search_fax=".urlencode($search_fax);
557 if ($search_email !=
'') $param .=
"&search_email=".urlencode($search_email);
558 if ($search_url !=
'') $param .=
"&search_url=".urlencode($search_url);
559 if ($search_state !=
'') $param .=
"&search_state=".urlencode($search_state);
560 if ($search_country !=
'') $param .=
"&search_country=".urlencode($search_country);
561 if ($search_customer_code !=
'') $param .=
"&search_customer_code=".urlencode($search_customer_code);
562 if ($search_supplier_code !=
'') $param .=
"&search_supplier_code=".urlencode($search_supplier_code);
563 if ($search_account_customer_code !=
'') $param .=
"&search_account_customer_code=".urlencode($search_account_customer_code);
564 if ($search_account_supplier_code !=
'') $param .=
"&search_account_supplier_code=".urlencode($search_account_supplier_code);
565 if ($search_barcode !=
'') $param .=
"&search_barcode=".urlencode($search_barcode);
566 if ($search_idprof1 !=
'') $param .=
'&search_idprof1='.urlencode($search_idprof1);
567 if ($search_idprof2 !=
'') $param .=
'&search_idprof2='.urlencode($search_idprof2);
568 if ($search_idprof3 !=
'') $param .=
'&search_idprof3='.urlencode($search_idprof3);
569 if ($search_idprof4 !=
'') $param .=
'&search_idprof4='.urlencode($search_idprof4);
570 if ($search_idprof5 !=
'') $param .=
'&search_idprof5='.urlencode($search_idprof5);
571 if ($search_idprof6 !=
'') $param .=
'&search_idprof6='.urlencode($search_idprof6);
572 if ($search_vat !=
'') $param .=
'&search_vat='.urlencode($search_vat);
573 if ($search_type_thirdparty !=
'') $param .=
'&search_type_thirdparty='.urlencode($search_type_thirdparty);
574 if ($search_type !=
'') $param .=
'&search_type='.urlencode($search_type);
575 if (is_array($search_level) && count($search_level))
foreach ($search_level as $slevel) $param .=
'&search_level[]='.urlencode($slevel);
576 if ($search_status !=
'') $param .=
'&search_status='.urlencode($search_status);
577 if ($search_stcomm !=
'') $param .=
'&search_stcomm='.urlencode($search_stcomm);
578 if ($search_parent_name !=
'') $param .=
'&search_parent_name='.urlencode($search_parent_name);
579 if ($search_import_key !=
'') $param .=
'&search_import_key='.urlencode($search_import_key);
580 if ($type !=
'') $param .=
'&type='.urlencode($type);
581 if ($optioncss !=
'') $param .=
'&optioncss='.urlencode($optioncss);
583 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
592 $arrayofmassactions = array(
593 'presend'=>$langs->trans(
"SendByMail"),
597 if ($user->rights->societe->supprimer) $arrayofmassactions[
'predelete'] =
'<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans(
"Delete");
598 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) $arrayofmassactions = array();
599 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
602 $label =
'MenuNewThirdParty';
606 $typefilter =
'&type='.$type;
607 if ($type ==
'p') $label =
'MenuNewProspect';
608 if ($type ==
'c') $label =
'MenuNewCustomer';
609 if ($type ==
'f') $label =
'NewSupplier';
612 if ($contextpage ==
'poslist' && $type ==
't' && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) {
618 if ($contextpage !=
'poslist') {
619 $url = DOL_URL_ROOT.
'/societe/card.php?action=create'.$typefilter;
620 if (!empty($socid)) $url .=
'&socid='.$socid;
621 $newcardbutton =
dolGetButtonTitle($langs->trans($label),
'',
'fa fa-plus-circle', $url,
'', $user->rights->societe->creer);
622 } elseif ($user->rights->societe->creer) {
623 $url = DOL_URL_ROOT.
'/societe/card.php?action=create&type=t&contextpage=poslist&optioncss=print&backtopage='.urlencode(
$_SERVER[
"PHP_SELF"].
'?type=t&contextpage=poslist&nomassaction=1&optioncss=print&place='.$place);
624 $label =
'MenuNewCustomer';
625 $newcardbutton .=
dolGetButtonTitle($langs->trans($label),
'',
'fa fa-plus-circle', $url);
628 print '<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'" name="formfilter" autocomplete="off">';
629 if ($optioncss !=
'')
print '<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
630 print '<input type="hidden" name="token" value="'.newToken().
'">';
631 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
632 print '<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
633 print '<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
635 print '<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
637 print_barre_liste($title, $page,
$_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'building', 0, $newcardbutton,
'', $limit, 0, 0, 1);
639 $langs->load(
"other");
640 $textprofid = array();
641 foreach (array(1, 2, 3, 4, 5, 6) as $key)
643 $label = $langs->transnoentities(
"ProfId".$key.$mysoc->country_code);
644 $textprofid[$key] =
'';
645 if ($label !=
"ProfId".$key.$mysoc->country_code)
647 if (preg_match(
'/\((.*)\)/i', $label, $reg)) $label = $reg[1];
648 $textprofid[$key] = $langs->trans(
"ProfIdShortDesc", $key, $mysoc->country_code, $label);
652 $topicmail =
"Information";
653 $modelmail =
"thirdparty";
655 $trackid =
'thi'.$object->id;
656 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
660 foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
661 print '<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
666 if (empty($type) || $type ==
'c' || $type ==
'p')
668 if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire)
670 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
671 $moreforfilter .=
'<div class="divsearchfield">';
672 $moreforfilter .= $langs->trans(
'CustomersProspectsCategoriesShort').
': ';
673 $moreforfilter .= $formother->select_categories(
'customer', $search_categ_cus,
'search_categ_cus', 1, $langs->trans(
'CustomersProspectsCategoriesShort'));
674 $moreforfilter .=
'</div>';
677 if (empty($type) || $type ==
'f')
679 if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire)
681 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
682 $moreforfilter .=
'<div class="divsearchfield">';
683 $moreforfilter .= $langs->trans(
'SuppliersCategoriesShort').
': ';
684 $moreforfilter .= $formother->select_categories(
'supplier', $search_categ_sup,
'search_categ_sup', 1);
685 $moreforfilter .=
'</div>';
690 if ($user->rights->societe->client->voir || $socid)
692 $moreforfilter .=
'<div class="divsearchfield">';
693 $moreforfilter .= $langs->trans(
'SalesRepresentatives').
': ';
694 $moreforfilter .= $formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, 1,
'maxwidth300', 1);
695 $moreforfilter .=
'</div>';
699 print '<div class="liste_titre liste_titre_bydiv centpercent">';
700 print $moreforfilter;
701 $parameters = array(
'type'=>$type);
702 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
703 print $hookmanager->resPrint;
707 $varpage = empty($contextpage) ?
$_SERVER[
"PHP_SELF"] : $contextpage;
708 $selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
710 if ($massactionbutton && $contextpage !=
'poslist') $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
712 if (empty($arrayfields[
'customerorsupplier'][
'checked']))
print '<input type="hidden" name="type" value="'.$type.
'">';
714 print '<div class="div-table-responsive">';
715 print '<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
718 print '<tr class="liste_titre_filter">';
719 if (!empty($arrayfields[
's.rowid'][
'checked']))
721 print
'<td class="liste_titre">';
722 print
'<input class="flat searchstring" type="text" name="search_id" size="1" value="'.dol_escape_htmltag($search_id).
'">';
725 if (!empty($arrayfields[
's.nom'][
'checked']))
727 print
'<td class="liste_titre">';
728 if (!empty($search_nom_only) && empty($search_nom)) $search_nom = $search_nom_only;
729 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_nom" value="'.dol_escape_htmltag($search_nom).
'">';
732 if (!empty($arrayfields[
's.name_alias'][
'checked']))
734 print
'<td class="liste_titre">';
735 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_alias" value="'.dol_escape_htmltag($search_alias).
'">';
739 if (!empty($arrayfields[
's.barcode'][
'checked']))
741 print
'<td class="liste_titre">';
742 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_barcode" value="'.dol_escape_htmltag($search_barcode).
'">';
746 if (!empty($arrayfields[
's.code_client'][
'checked']))
748 print
'<td class="liste_titre">';
749 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_customer_code" value="'.dol_escape_htmltag($search_customer_code).
'">';
753 if (!empty($arrayfields[
's.code_fournisseur'][
'checked']))
755 print
'<td class="liste_titre">';
756 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_supplier_code" value="'.dol_escape_htmltag($search_supplier_code).
'">';
760 if (!empty($arrayfields[
's.code_compta'][
'checked']))
762 print
'<td class="liste_titre">';
763 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_account_customer_code" value="'.dol_escape_htmltag($search_account_customer_code).
'">';
767 if (!empty($arrayfields[
's.code_compta_fournisseur'][
'checked']))
769 print
'<td class="liste_titre">';
770 print
'<input class="flat maxwidth75imp" type="text" name="search_account_supplier_code" value="'.dol_escape_htmltag($search_account_supplier_code).
'">';
774 if (!empty($arrayfields[
's.address'][
'checked']))
776 print
'<td class="liste_titre">';
777 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_address" value="'.dol_escape_htmltag($search_address).
'">';
781 if (!empty($arrayfields[
's.town'][
'checked']))
783 print
'<td class="liste_titre">';
784 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).
'">';
788 if (!empty($arrayfields[
's.zip'][
'checked']))
790 print
'<td class="liste_titre">';
791 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'">';
795 if (!empty($arrayfields[
'state.nom'][
'checked']))
797 print
'<td class="liste_titre">';
798 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
802 if (!empty($arrayfields[
'region.nom'][
'checked']))
804 print
'<td class="liste_titre">';
805 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_region" value="'.dol_escape_htmltag($search_region).
'">';
809 if (!empty($arrayfields[
'country.code_iso'][
'checked']))
811 print
'<td class="liste_titre center">';
812 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
816 if (!empty($arrayfields[
'typent.code'][
'checked']))
818 print
'<td class="liste_titre maxwidthonsmartphone center">';
819 print $form->selectarray(
"search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0,
'', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ?
'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT),
'maxwidth75', 1);
823 if (!empty($arrayfields[
'staff.code'][
'checked']))
825 print
'<td class="liste_titre maxwidthonsmartphone center">';
826 print $form->selectarray(
"search_staff", $formcompany->effectif_array(0), $search_staff, 0, 0, 0,
'', 0, 0, 0,
'ASC',
'maxwidth100', 1);
829 if (!empty($arrayfields[
's.email'][
'checked']))
832 print
'<td class="liste_titre">';
833 print
'<input class="flat searchemail maxwidth50imp" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).
'">';
836 if (!empty($arrayfields[
's.phone'][
'checked']))
839 print
'<td class="liste_titre">';
840 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_phone" value="'.dol_escape_htmltag($search_phone).
'">';
843 if (!empty($arrayfields[
's.fax'][
'checked']))
846 print
'<td class="liste_titre">';
847 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_fax" value="'.dol_escape_htmltag($search_fax).
'">';
850 if (!empty($arrayfields[
's.url'][
'checked']))
853 print
'<td class="liste_titre">';
854 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_url" value="'.dol_escape_htmltag($search_url).
'">';
857 if (!empty($arrayfields[
's.siren'][
'checked']))
860 print
'<td class="liste_titre">';
861 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_idprof1" value="'.dol_escape_htmltag($search_idprof1).
'">';
864 if (!empty($arrayfields[
's.siret'][
'checked']))
867 print
'<td class="liste_titre">';
868 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_idprof2" value="'.dol_escape_htmltag($search_idprof2).
'">';
871 if (!empty($arrayfields[
's.ape'][
'checked']))
874 print
'<td class="liste_titre">';
875 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_idprof3" value="'.dol_escape_htmltag($search_idprof3).
'">';
878 if (!empty($arrayfields[
's.idprof4'][
'checked']))
881 print
'<td class="liste_titre">';
882 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_idprof4" value="'.dol_escape_htmltag($search_idprof4).
'">';
885 if (!empty($arrayfields[
's.idprof5'][
'checked']))
888 print
'<td class="liste_titre">';
889 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_idprof5" value="'.dol_escape_htmltag($search_idprof5).
'">';
892 if (!empty($arrayfields[
's.idprof6'][
'checked']))
895 print
'<td class="liste_titre">';
896 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_idprof6" value="'.dol_escape_htmltag($search_idprof6).
'">';
899 if (!empty($arrayfields[
's.tva_intra'][
'checked']))
902 print
'<td class="liste_titre">';
903 print
'<input class="flat searchstring maxwidth50imp" type="text" name="search_vat" value="'.dol_escape_htmltag($search_vat).
'">';
908 if (!empty($arrayfields[
'customerorsupplier'][
'checked']))
910 print
'<td class="liste_titre maxwidthonsmartphone center">';
911 if ($type !=
'') print
'<input type="hidden" name="type" value="'.$type.
'">';
912 print $formcompany->selectProspectCustomerType($search_type,
'search_type',
'search_type',
'list');
913 print
'</select></td>';
916 if (!empty($arrayfields[
's.fk_prospectlevel'][
'checked']))
918 print
'<td class="liste_titre center">';
919 print $form->multiselectarray(
'search_level', $tab_level, $search_level, 0, 0,
'width75', 0, 0,
'',
'',
'', 2);
923 if (!empty($arrayfields[
's.fk_stcomm'][
'checked']))
925 print
'<td class="liste_titre maxwidthonsmartphone center">';
926 $arraystcomm = array();
927 foreach ($prospectstatic->cacheprospectstatus as $key => $val)
929 $arraystcomm[$val[
'id']] = ($langs->trans(
"StatusProspect".$val[
'id']) !=
"StatusProspect".$val[
'id'] ? $langs->trans(
"StatusProspect".$val[
'id']) : $val[
'label']);
931 print $form->selectarray(
'search_stcomm', $arraystcomm, $search_stcomm, -2, 0, 0,
'', 0, 0, 0,
'',
'', 1);
934 if (!empty($arrayfields[
's2.nom'][
'checked']))
936 print
'<td class="liste_titre center">';
937 print
'<input class="flat searchstring maxwidth75imp" type="text" name="search_parent_name" value="'.dol_escape_htmltag($search_parent_name).
'">';
941 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
944 $parameters = array(
'arrayfields'=>$arrayfields);
945 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
946 print $hookmanager->resPrint;
948 if (!empty($arrayfields[
's.datec'][
'checked']))
950 print
'<td class="liste_titre">';
954 if (!empty($arrayfields[
's.tms'][
'checked']))
956 print
'<td class="liste_titre">';
960 if (!empty($arrayfields[
's.status'][
'checked']))
962 print
'<td class="liste_titre center minwidth75imp">';
963 print $form->selectarray(
'search_status', array(
'0'=>$langs->trans(
'ActivityCeased'),
'1'=>$langs->trans(
'InActivity')), $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
966 if (!empty($arrayfields[
's.import_key'][
'checked']))
968 print
'<td class="liste_titre center">';
969 print
'<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
973 print
'<td class="liste_titre center">';
974 $searchpicto = $form->showFilterButtons();
980 print
'<tr class="liste_titre">';
981 if (!empty($arrayfields[
's.rowid'][
'checked']))
print_liste_field_titre($arrayfields[
's.rowid'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.rowid",
"", $param,
"", $sortfield, $sortorder);
982 if (!empty($arrayfields[
's.nom'][
'checked']))
print_liste_field_titre($arrayfields[
's.nom'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
"", $sortfield, $sortorder);
983 if (!empty($arrayfields[
's.name_alias'][
'checked']))
print_liste_field_titre($arrayfields[
's.name_alias'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.name_alias",
"", $param,
"", $sortfield, $sortorder);
984 if (!empty($arrayfields[
's.barcode'][
'checked']))
print_liste_field_titre($arrayfields[
's.barcode'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.barcode", $param,
'',
'', $sortfield, $sortorder);
985 if (!empty($arrayfields[
's.code_client'][
'checked']))
print_liste_field_titre($arrayfields[
's.code_client'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.code_client",
"", $param,
'', $sortfield, $sortorder);
986 if (!empty($arrayfields[
's.code_fournisseur'][
'checked']))
print_liste_field_titre($arrayfields[
's.code_fournisseur'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.code_fournisseur",
"", $param,
'', $sortfield, $sortorder);
987 if (!empty($arrayfields[
's.code_compta'][
'checked']))
print_liste_field_titre($arrayfields[
's.code_compta'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.code_compta",
"", $param,
'', $sortfield, $sortorder);
988 if (!empty($arrayfields[
's.code_compta_fournisseur'][
'checked']))
print_liste_field_titre($arrayfields[
's.code_compta_fournisseur'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.code_compta_fournisseur",
"", $param,
'', $sortfield, $sortorder);
989 if (!empty($arrayfields[
's.address'][
'checked']))
print_liste_field_titre($arrayfields[
's.address'][
'label'],
$_SERVER[
'PHP_SELF'],
's.address',
'', $param,
'', $sortfield, $sortorder);
990 if (!empty($arrayfields[
's.town'][
'checked']))
print_liste_field_titre($arrayfields[
's.town'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.town",
"", $param,
'', $sortfield, $sortorder);
991 if (!empty($arrayfields[
's.zip'][
'checked']))
print_liste_field_titre($arrayfields[
's.zip'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.zip",
"", $param,
'', $sortfield, $sortorder);
992 if (!empty($arrayfields[
'state.nom'][
'checked']))
print_liste_field_titre($arrayfields[
'state.nom'][
'label'],
$_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
993 if (!empty($arrayfields[
'region.nom'][
'checked']))
print_liste_field_titre($arrayfields[
'region.nom'][
'label'],
$_SERVER[
"PHP_SELF"],
"region.nom",
"", $param,
'', $sortfield, $sortorder);
994 if (!empty($arrayfields[
'country.code_iso'][
'checked']))
print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'],
$_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
995 if (!empty($arrayfields[
'typent.code'][
'checked']))
print_liste_field_titre($arrayfields[
'typent.code'][
'label'],
$_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
996 if (!empty($arrayfields[
'staff.code'][
'checked']))
print_liste_field_titre($arrayfields[
'staff.code'][
'label'],
$_SERVER[
"PHP_SELF"],
"staff.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
997 if (!empty($arrayfields[
's.email'][
'checked']))
print_liste_field_titre($arrayfields[
's.email'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.email",
"", $param,
'', $sortfield, $sortorder);
998 if (!empty($arrayfields[
's.phone'][
'checked']))
print_liste_field_titre($arrayfields[
's.phone'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.phone",
"", $param,
'', $sortfield, $sortorder);
999 if (!empty($arrayfields[
's.fax'][
'checked']))
print_liste_field_titre($arrayfields[
's.fax'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.fax",
"", $param,
'', $sortfield, $sortorder);
1000 if (!empty($arrayfields[
's.url'][
'checked']))
print_liste_field_titre($arrayfields[
's.url'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.url",
"", $param,
'', $sortfield, $sortorder);
1001 if (!empty($arrayfields[
's.siren'][
'checked']))
print_liste_field_titre($form->textwithpicto($langs->trans(
"ProfId1Short"), $textprofid[1], 1, 0),
$_SERVER[
"PHP_SELF"],
"s.siren",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
1002 if (!empty($arrayfields[
's.siret'][
'checked']))
print_liste_field_titre($form->textwithpicto($langs->trans(
"ProfId2Short"), $textprofid[2], 1, 0),
$_SERVER[
"PHP_SELF"],
"s.siret",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
1003 if (!empty($arrayfields[
's.ape'][
'checked']))
print_liste_field_titre($form->textwithpicto($langs->trans(
"ProfId3Short"), $textprofid[3], 1, 0),
$_SERVER[
"PHP_SELF"],
"s.ape",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
1004 if (!empty($arrayfields[
's.idprof4'][
'checked']))
print_liste_field_titre($form->textwithpicto($langs->trans(
"ProfId4Short"), $textprofid[4], 1, 0),
$_SERVER[
"PHP_SELF"],
"s.idprof4",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
1005 if (!empty($arrayfields[
's.idprof5'][
'checked']))
print_liste_field_titre($form->textwithpicto($langs->trans(
"ProfId5Short"), $textprofid[4], 1, 0),
$_SERVER[
"PHP_SELF"],
"s.idprof5",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
1006 if (!empty($arrayfields[
's.idprof6'][
'checked']))
print_liste_field_titre($form->textwithpicto($langs->trans(
"ProfId6Short"), $textprofid[4], 1, 0),
$_SERVER[
"PHP_SELF"],
"s.idprof6",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
1007 if (!empty($arrayfields[
's.tva_intra'][
'checked']))
print_liste_field_titre($arrayfields[
's.tva_intra'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.tva_intra",
"", $param,
'', $sortfield, $sortorder,
'nowrap ');
1009 if (!empty($arrayfields[
's.fk_prospectlevel'][
'checked']))
print_liste_field_titre($arrayfields[
's.fk_prospectlevel'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.fk_prospectlevel",
"", $param,
'', $sortfield, $sortorder,
'center ');
1010 if (!empty($arrayfields[
's.fk_stcomm'][
'checked']))
print_liste_field_titre($arrayfields[
's.fk_stcomm'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.fk_stcomm",
"", $param,
'', $sortfield, $sortorder,
'center ');
1011 if (!empty($arrayfields[
's2.nom'][
'checked']))
print_liste_field_titre($arrayfields[
's2.nom'][
'label'],
$_SERVER[
"PHP_SELF"],
"s2.nom",
"", $param,
'', $sortfield, $sortorder,
'center ');
1013 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1015 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
1016 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1017 print $hookmanager->resPrint;
1018 if (!empty($arrayfields[
's.datec'][
'checked']))
print_liste_field_titre($arrayfields[
's.datec'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1019 if (!empty($arrayfields[
's.tms'][
'checked']))
print_liste_field_titre($arrayfields[
's.tms'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1020 if (!empty($arrayfields[
's.status'][
'checked']))
print_liste_field_titre($arrayfields[
's.status'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.status",
"", $param,
'', $sortfield, $sortorder,
'center ');
1021 if (!empty($arrayfields[
's.import_key'][
'checked']))
print_liste_field_titre($arrayfields[
's.import_key'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1027 $totalarray = array();
1028 while ($i < min($num, $limit))
1030 $obj = $db->fetch_object(
$resql);
1032 $companystatic->id = $obj->rowid;
1033 $companystatic->name = $obj->name;
1034 $companystatic->name_alias = $obj->name_alias;
1035 $companystatic->logo = $obj->logo;
1036 $companystatic->canvas = $obj->canvas;
1037 $companystatic->client = $obj->client;
1038 $companystatic->status = $obj->status;
1039 $companystatic->email = $obj->email;
1040 $companystatic->fournisseur = $obj->fournisseur;
1041 $companystatic->code_client = $obj->code_client;
1042 $companystatic->code_fournisseur = $obj->code_fournisseur;
1043 $companystatic->tva_intra = $obj->tva_intra;
1044 $companystatic->country_code = $obj->country_code;
1046 $companystatic->code_compta_client = $obj->code_compta;
1047 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1049 $companystatic->fk_prospectlevel = $obj->fk_prospectlevel;
1050 $companystatic->fk_parent = $obj->fk_parent;
1051 $companystatic->entity = $obj->entity;
1053 print
'<tr class="oddeven"';
1054 if ($contextpage ==
'poslist')
1056 print
' onclick="location.href=\'list.php?action=change&contextpage=poslist&idcustomer='.$obj->rowid.
'&place='.urlencode($place).
'\'"';
1059 if (!empty($arrayfields['s.rowid']['checked']))
1061 print '<td class="tdoverflowmax50
">';
1064 if (!$i) $totalarray['nbfield']++;
1066 if (!empty($arrayfields['s.nom']['checked']))
1068 $savalias = $obj->name_alias;
1069 if (!empty($arrayfields['s.name_alias']['checked'])) $companystatic->name_alias = '';
1070 print '<td'.(empty($conf->global->MAIN_SOCIETE_SHOW_COMPLETE_NAME) ? ' class="tdoverflowmax200
"' : '').'>';
1071 if ($contextpage == 'poslist')
1075 print $companystatic->getNomUrl(1, '', 100, 0, 1);
1078 $companystatic->name_alias = $savalias;
1079 if (!$i) $totalarray['nbfield']++;
1081 if (!empty($arrayfields['s.name_alias']['checked']))
1083 print '<td class="tdoverflowmax200
">';
1084 print $companystatic->name_alias;
1086 if (!$i) $totalarray['nbfield']++;
1089 if (!empty($arrayfields['s.barcode']['checked']))
1091 print '<td>'.$obj->barcode.'</td>';
1092 if (!$i) $totalarray['nbfield']++;
1095 if (!empty($arrayfields['s.code_client']['checked']))
1097 print '<td class="nowraponall
">'.$obj->code_client.'</td>';
1098 if (!$i) $totalarray['nbfield']++;
1101 if (!empty($arrayfields['s.code_fournisseur']['checked']))
1103 print '<td class="nowraponall
">'.$obj->code_fournisseur.'</td>';
1104 if (!$i) $totalarray['nbfield']++;
1106 // Account customer code
1107 if (!empty($arrayfields['s.code_compta']['checked']))
1109 print '<td>'.$obj->code_compta.'</td>';
1110 if (!$i) $totalarray['nbfield']++;
1112 // Account supplier code
1113 if (!empty($arrayfields['s.code_compta_fournisseur']['checked']))
1115 print '<td>'.$obj->code_compta_fournisseur.'</td>';
1116 if (!$i) $totalarray['nbfield']++;
1119 if (!empty($arrayfields['s.address']['checked']))
1121 print '<td>'.$obj->address.'</td>';
1122 if (!$i) $totalarray['nbfield']++;
1125 if (!empty($arrayfields['s.town']['checked']))
1127 print "<td>
".$obj->town."</td>
\n";
1128 if (!$i) $totalarray['nbfield']++;
1131 if (!empty($arrayfields['s.zip']['checked']))
1133 print "<td>
".$obj->zip."</td>
\n";
1134 if (!$i) $totalarray['nbfield']++;
1137 if (!empty($arrayfields['state.nom']['checked']))
1139 print "<td>
".$obj->state_name."</td>
\n";
1140 if (!$i) $totalarray['nbfield']++;
1143 if (!empty($arrayfields['region.nom']['checked']))
1145 print "<td>
".$obj->region_name."</td>
\n";
1146 if (!$i) $totalarray['nbfield']++;
1149 if (!empty($arrayfields['country.code_iso']['checked']))
1151 print '<td class="center tdoverflowmax100
">';
1152 $labelcountry = ($obj->country_code && ($langs->trans("Country
".$obj->country_code) != "Country
".$obj->country_code)) ? $langs->trans("Country
".$obj->country_code) : $obj->country_label;
1153 print $labelcountry;
1155 if (!$i) $totalarray['nbfield']++;
1158 if (!empty($arrayfields['typent.code']['checked']))
1160 print '<td class="center
">';
1161 if (!is_array($typenArray) || count($typenArray) == 0) $typenArray = $formcompany->typent_array(1);
1162 print $typenArray[$obj->typent_code];
1164 if (!$i) $totalarray['nbfield']++;
1167 if (!empty($arrayfields['staff.code']['checked']))
1169 print '<td class="center
">';
1170 if (!is_array($staffArray) || count($staffArray) == 0) $staffArray = $formcompany->effectif_array(1);
1171 print $staffArray[$obj->staff_code];
1173 if (!$i) $totalarray['nbfield']++;
1175 if (!empty($arrayfields['s.email']['checked']))
1177 print '<td class="tdoverflowmax150
">'.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 0, 0, 1)."</td>
\n";
1178 if (!$i) $totalarray['nbfield']++;
1180 if (!empty($arrayfields['s.phone']['checked']))
1182 print "<td>
".dol_print_phone($obj->phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL')."</td>
\n";
1183 if (!$i) $totalarray['nbfield']++;
1185 if (!empty($arrayfields['s.fax']['checked']))
1187 print "<td>
".dol_print_phone($obj->fax, $obj->country_code, 0, $obj->rowid, 'AC_TEL')."</td>
\n";
1188 if (!$i) $totalarray['nbfield']++;
1190 if (!empty($arrayfields['s.url']['checked']))
1192 print "<td>
".$obj->url."</td>
\n";
1193 if (!$i) $totalarray['nbfield']++;
1195 if (!empty($arrayfields['s.siren']['checked']))
1197 print "<td>
".$obj->idprof1."</td>
\n";
1198 if (!$i) $totalarray['nbfield']++;
1200 if (!empty($arrayfields['s.siret']['checked']))
1202 print "<td>
".$obj->idprof2."</td>
\n";
1203 if (!$i) $totalarray['nbfield']++;
1205 if (!empty($arrayfields['s.ape']['checked']))
1207 print "<td>
".$obj->idprof3."</td>
\n";
1208 if (!$i) $totalarray['nbfield']++;
1210 if (!empty($arrayfields['s.idprof4']['checked']))
1212 print "<td>
".$obj->idprof4."</td>
\n";
1213 if (!$i) $totalarray['nbfield']++;
1215 if (!empty($arrayfields['s.idprof5']['checked']))
1217 print "<td>
".$obj->idprof5."</td>
\n";
1218 if (!$i) $totalarray['nbfield']++;
1220 if (!empty($arrayfields['s.idprof6']['checked']))
1222 print "<td>
".$obj->idprof6."</td>
\n";
1223 if (!$i) $totalarray['nbfield']++;
1226 if (!empty($arrayfields['s.tva_intra']['checked']))
1229 print $obj->tva_intra;
1230 if ($obj->tva_intra && !isValidVATID($companystatic))
1232 print img_warning("BadVATNumber
", '', '');
1235 if (!$i) $totalarray['nbfield']++;
1238 if (!empty($arrayfields['customerorsupplier']['checked']))
1240 print '<td class="center
">';
1242 if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
1244 $s .= '<a class="customer-back opacitymedium
" title="'.$langs->trans("Prospect").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid=
'.$companystatic->id.'">'.dol_substr($langs->trans("Prospect
"), 0, 1).'</a>';
1246 if (($obj->client == 1 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
1248 $s .= '<a class="customer-back
" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid=
'.$companystatic->id.'">'.dol_substr($langs->trans("Customer
"), 0, 1).'</a>';
1250 if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur)
1252 $s .= '<a class="vendor-back
" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid=
'.$companystatic->id.'">'.dol_substr($langs->trans("Supplier
"), 0, 1).'</a>';
1256 if (!$i) $totalarray['nbfield']++;
1259 if (!empty($arrayfields['s.fk_prospectlevel']['checked']))
1262 print '<td class="center
">';
1263 print $companystatic->getLibProspLevel();
1265 if (!$i) $totalarray['nbfield']++;
1268 if (!empty($arrayfields['s.fk_stcomm']['checked']))
1271 print '<td class="center nowrap
"><div class="nowrap
">';
1272 print '<div class="inline-block
">'.$companystatic->LibProspCommStatut($obj->stcomm_id, 2, $prospectstatic->cacheprospectstatus[$obj->stcomm_id]['label'], $obj->stcomm_picto);
1273 print '</div> - <div class="inline-block
">';
1274 foreach ($prospectstatic->cacheprospectstatus as $key => $val)
1276 $titlealt = 'default';
1277 if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt = $val['label'];
1278 if ($obj->stcomm_id != $val['id']) print '<a class="pictosubstatus
" href="'.$_SERVER["PHP_SELF"].'?stcommsocid=
'.$obj->rowid.'&stcomm=
'.$val['code'].'&action=setstcomm&token=
'.newToken().$param.($page ? '&page=
'.urlencode($page) : '').'">'.img_action($titlealt, $val['code'], $val['picto']).'</a>';
1280 print '</div></div></td>';
1281 if (!$i) $totalarray['nbfield']++;
1284 if (!empty($arrayfields['s2.nom']['checked']))
1286 print '<td class="center tdoverflowmax100
">';
1287 if ($companystatic->fk_parent > 0)
1289 $companyparent->fetch($companystatic->fk_parent);
1290 print $companyparent->getNomUrl(1);
1293 if (!$i) $totalarray['nbfield']++;
1296 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
1298 $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
1299 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
1300 print $hookmanager->resPrint;
1302 if (!empty($arrayfields['s.datec']['checked']))
1304 print '<td class="center nowrap
">';
1305 print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
1307 if (!$i) $totalarray['nbfield']++;
1309 // Date modification
1310 if (!empty($arrayfields['s.tms']['checked']))
1312 print '<td class="center nowrap
">';
1313 print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
1315 if (!$i) $totalarray['nbfield']++;
1318 if (!empty($arrayfields['s.status']['checked']))
1320 print '<td class="center nowrap
">'.$companystatic->getLibStatut(5).'</td>';
1321 if (!$i) $totalarray['nbfield']++;
1323 if (!empty($arrayfields['s.import_key']['checked']))
1325 print '<td class="tdoverflowmax100
">';
1326 print $obj->import_key;
1328 if (!$i) $totalarray['nbfield']++;
1331 // Action column (Show the massaction button only when this page is not opend from the Extended POS)
1332 print '<td class="nowrap center
">';
1333 if (($massactionbutton || $massaction) && $contextpage != 'poslist') // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
1336 if (in_array($obj->rowid, $arrayofselected)) $selected = 1;
1337 print '<input id="cb
'.$obj->rowid.'" class="flat checkforselect
" type="checkbox
" name="toselect[]
" value="'.$obj->rowid.'"'.($selected ? ' checked="checked
"' : '').'>';
1340 if (!$i) $totalarray['nbfield']++;
1346 // If no record found
1350 foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; }
1351 print '<tr><td colspan="'.$colspan.'" class="opacitymedium
">'.$langs->trans("NoRecordFound
").'</td></tr>';
1356 $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
1357 $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
1358 print $hookmanager->resPrint;
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'] country if(!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'] typent code
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.
</td >< tdcolspan="3">< spanclass="opacitymedium"></span ></td ></tr >< trclass="liste_total"> CREANCES DETTES< tdcolspan="3"class="right"></td >< tdcolspan="3"class="right"></td ></tr > CREANCES DETTES RECETTES DEPENSES trips CREANCES DETTES Y m expensereport p date_valid Y m expensereport pe datep $db idate($date_start)."' AND $column < p rowid
dol_now($mode= 'auto')
Return date for now.
Class to manage customers or prospects.
img_warning($titlealt= 'default', $moreatt= '', $morecss= 'pictowarning')
Show warning logo.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage third parties objects (customers, suppliers, prospects...)
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
get_htmloutput_mesg($mesgstring= '', $mesgarray= '', $style= 'ok', $keepembedded=0)
Get formated messages to output (Used to show messages on html output).
if(!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'] s nom
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
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...
print $_SERVER["PHP_SELF"]
Edit parameters.
dolExplodeIntoArray($string, $delimiter= ';', $kv= '=')
Split a string with 2 keys into key array.
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...
dol_getIdFromCode($db, $key, $tablename, $fieldkey= 'code', $fieldid= 'id', $entityfilter=0)
Return an id or code from a code or id.
print
Draft customers invoices.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
print $_SERVER["PHP_SELF"] n
Edit parameters.
Class to manage invoices.
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.