44require
'../../main.inc.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formpropal.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
49if (isModEnabled(
'margin')) {
50 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmargin.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
53require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
54require_once DOL_DOCUMENT_ROOT.
'/comm/propal/class/propal.class.php';
55require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
56if (isModEnabled(
'category')) {
57 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
58 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
70$langs->loadLangs(array(
'companies',
'propal',
'compta',
'bills',
'orders',
'products',
'deliveries',
'categories'));
71if (isModEnabled(
"shipping")) {
72 $langs->loadLangs(array(
'sendings'));
78$action =
GETPOST(
'action',
'aZ09');
79$massaction =
GETPOST(
'massaction',
'alpha');
81$confirm =
GETPOST(
'confirm',
'alpha');
82$cancel =
GETPOST(
'cancel',
'alpha');
83$toselect =
GETPOST(
'toselect',
'array');
84$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'proposallist';
85$optioncss =
GETPOST(
'optioncss',
'alpha');
86$mode =
GETPOST(
'mode',
'alpha');
89$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
91if ($search_user == -1) {
96$search_refcustomer =
GETPOST(
'search_refcustomer',
'alpha');
97$search_refproject =
GETPOST(
'search_refproject',
'alpha');
98$search_project =
GETPOST(
'search_project',
'alpha');
99$search_societe =
GETPOST(
'search_societe',
'alpha');
100$search_societe_alias =
GETPOST(
'search_societe_alias',
'alpha');
101$search_montant_ht =
GETPOST(
'search_montant_ht',
'alpha');
102$search_montant_vat =
GETPOST(
'search_montant_vat',
'alpha');
103$search_montant_ttc =
GETPOST(
'search_montant_ttc',
'alpha');
104$search_warehouse =
GETPOST(
'search_warehouse',
'alpha');
105$search_multicurrency_code =
GETPOST(
'search_multicurrency_code',
'alpha');
106$search_multicurrency_tx =
GETPOST(
'search_multicurrency_tx',
'alpha');
107$search_multicurrency_montant_ht =
GETPOST(
'search_multicurrency_montant_ht',
'alpha');
108$search_multicurrency_montant_vat =
GETPOST(
'search_multicurrency_montant_vat',
'alpha');
109$search_multicurrency_montant_ttc =
GETPOST(
'search_multicurrency_montant_ttc',
'alpha');
110$search_login =
GETPOST(
'search_login',
'alpha');
111$search_product_category =
GETPOSTINT(
'search_product_category');
112$search_town =
GETPOST(
'search_town',
'alpha');
113$search_zip =
GETPOST(
'search_zip',
'alpha');
114$search_state =
GETPOST(
"search_state");
115$search_country =
GETPOST(
"search_country",
'aZ09');
116$search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'intcomma');
117$search_date_startday =
GETPOSTINT(
'search_date_startday');
118$search_date_startmonth =
GETPOSTINT(
'search_date_startmonth');
119$search_date_startyear =
GETPOSTINT(
'search_date_startyear');
120$search_date_endday =
GETPOSTINT(
'search_date_endday');
121$search_date_endmonth =
GETPOSTINT(
'search_date_endmonth');
122$search_date_endyear =
GETPOSTINT(
'search_date_endyear');
123$search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
124$search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
125$search_date_end_startday =
GETPOSTINT(
'search_date_end_startday');
126$search_date_end_startmonth =
GETPOSTINT(
'search_date_end_startmonth');
127$search_date_end_startyear =
GETPOSTINT(
'search_date_end_startyear');
128$search_date_end_endday =
GETPOSTINT(
'search_date_end_endday');
129$search_date_end_endmonth =
GETPOSTINT(
'search_date_end_endmonth');
130$search_date_end_endyear =
GETPOSTINT(
'search_date_end_endyear');
131$search_date_end_start =
dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);
132$search_date_end_end =
dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
133$search_date_delivery_startday =
GETPOSTINT(
'search_date_delivery_startday');
134$search_date_delivery_startmonth =
GETPOSTINT(
'search_date_delivery_startmonth');
135$search_date_delivery_startyear =
GETPOSTINT(
'search_date_delivery_startyear');
136$search_date_delivery_endday =
GETPOSTINT(
'search_date_delivery_endday');
137$search_date_delivery_endmonth =
GETPOSTINT(
'search_date_delivery_endmonth');
138$search_date_delivery_endyear =
GETPOSTINT(
'search_date_delivery_endyear');
139$search_date_delivery_start =
dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear);
140$search_date_delivery_end =
dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear);
141$search_availability =
GETPOST(
'search_availability',
'intcomma');
142$search_categ_cus =
GETPOSTINT(
"search_categ_cus");
143$search_fk_cond_reglement =
GETPOST(
"search_fk_cond_reglement",
'intcomma');
144$search_fk_shipping_method =
GETPOST(
"search_fk_shipping_method",
'intcomma');
145$search_fk_input_reason =
GETPOST(
"search_fk_input_reason",
'intcomma');
146$search_fk_mode_reglement =
GETPOST(
"search_fk_mode_reglement",
'intcomma');
147$search_date_signature_startday =
GETPOSTINT(
'search_date_signature_startday');
148$search_date_signature_startmonth =
GETPOSTINT(
'search_date_signature_startmonth');
149$search_date_signature_startyear =
GETPOSTINT(
'search_date_signature_startyear');
150$search_date_signature_endday =
GETPOSTINT(
'search_date_signature_endday');
151$search_date_signature_endmonth =
GETPOSTINT(
'search_date_signature_endmonth');
152$search_date_signature_endyear =
GETPOSTINT(
'search_date_signature_endyear');
153$search_date_signature_start =
dol_mktime(0, 0, 0, $search_date_signature_startmonth, $search_date_signature_startday, $search_date_signature_startyear);
154$search_date_signature_end =
dol_mktime(23, 59, 59, $search_date_signature_endmonth, $search_date_signature_endday, $search_date_signature_endyear);
155$search_status =
GETPOST(
'search_status',
'alpha');
156$search_note_public =
GETPOST(
'search_note_public',
'alpha');
157$search_import_key = trim(
GETPOST(
"search_import_key",
"alpha"));
159$search_option =
GETPOST(
'search_option',
'alpha');
160if ($search_option ==
'late') {
161 $search_status =
'1';
162 $object_statut =
'1';
167$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
168$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
170if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
174$offset = $limit * $page;
175$pageprev = $page - 1;
176$pagenext = $page + 1;
178 $sortfield =
'p.ref';
188if (!empty($user->socid)) {
189 $socid = $user->socid;
194 $dbtable =
'&societe';
196$hookmanager->initHooks(array(
'propallist'));
199$diroutputmassaction =
$conf->propal->multidir_output[
$conf->entity].
'/temp/massgeneration/'.$user->id;
206$extrafields->fetch_name_optionals_label(
$object->table_element);
208$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
211$fieldstosearchall = array(
213 'p.ref_client' =>
'RefCustomer',
214 'pd.description' =>
'Description',
215 's.nom' =>
"ThirdParty",
216 's.name_alias' =>
"AliasNameShort",
219 'p.note_public' =>
'NotePublic',
221if (empty($user->socid)) {
222 $fieldstosearchall[
"p.note_private"] =
"NotePrivate";
226$checkedtypetiers = 0;
228 'p.ref' => array(
'label' =>
"Ref",
'checked' =>
'1'),
229 'p.ref_client' => array(
'label' =>
"RefCustomer",
'checked' =>
'-1'),
230 'pr.ref' => array(
'label' =>
"ProjectRef",
'checked' =>
'1',
'enabled' => (isModEnabled(
'project') ?
'1' :
'0')),
231 'pr.title' => array(
'label' =>
"ProjectLabel",
'checked' =>
'0',
'enabled' => (isModEnabled(
'project') ?
'1' :
'0')),
232 's.nom' => array(
'label' =>
"ThirdParty",
'checked' =>
'1'),
233 's.name_alias' => array(
'label' =>
"AliasNameShort",
'checked' =>
'-1'),
234 's.town' => array(
'label' =>
"Town",
'checked' =>
'-1'),
235 's.zip' => array(
'label' =>
"Zip",
'checked' =>
'-1'),
236 'state.nom' => array(
'label' =>
"StateShort",
'checked' =>
'0'),
237 'country.code_iso' => array(
'label' =>
"Country",
'checked' =>
'0'),
238 'typent.code' => array(
'label' =>
"ThirdPartyType",
'checked' => (string) $checkedtypetiers),
239 'p.date' => array(
'label' =>
"DatePropal",
'checked' =>
'1'),
240 'p.fin_validite' => array(
'label' =>
"DateEnd",
'checked' =>
'1'),
241 'p.date_livraison' => array(
'label' =>
"DeliveryDate",
'checked' =>
'0'),
242 'p.date_signature' => array(
'label' =>
"DateSigning",
'checked' =>
'0'),
243 'ava.rowid' => array(
'label' =>
"AvailabilityPeriod",
'checked' =>
'0'),
244 'p.fk_shipping_method' => array(
'label' =>
"SendingMethod",
'checked' =>
'0',
'enabled' => (string) (int) isModEnabled(
"shipping")),
245 'p.fk_input_reason' => array(
'label' =>
"Origin",
'checked' =>
'0',
'enabled' =>
'1'),
246 'p.fk_cond_reglement' => array(
'label' =>
"PaymentConditionsShort",
'checked' =>
'0'),
247 'p.fk_mode_reglement' => array(
'label' =>
"PaymentMode",
'checked' =>
'0'),
248 'p.total_ht' => array(
'label' =>
"AmountHT",
'checked' =>
'1'),
249 'p.total_tva' => array(
'label' =>
"AmountVAT",
'checked' =>
'0'),
250 'p.total_ttc' => array(
'label' =>
"AmountTTC",
'checked' =>
'0'),
251 'p.total_ht_invoiced' => array(
'label' =>
"AmountInvoicedHT",
'checked' =>
'0',
'enabled' =>
getDolGlobalString(
'PROPOSAL_SHOW_INVOICED_AMOUNT')),
252 'p.total_invoiced' => array(
'label' =>
"AmountInvoicedTTC",
'checked' =>
'0',
'enabled' =>
getDolGlobalString(
'PROPOSAL_SHOW_INVOICED_AMOUNT')),
253 'p.multicurrency_code' => array(
'label' =>
'Currency',
'checked' =>
'0',
'enabled' => (!isModEnabled(
"multicurrency") ?
'0' :
'1')),
254 'p.multicurrency_tx' => array(
'label' =>
'CurrencyRate',
'checked' =>
'0',
'enabled' => (!isModEnabled(
"multicurrency") ?
'0' :
'1')),
255 'p.multicurrency_total_ht' => array(
'label' =>
'MulticurrencyAmountHT',
'checked' =>
'0',
'enabled' => (!isModEnabled(
"multicurrency") ?
'0' :
'1')),
256 'p.multicurrency_total_tva' => array(
'label' =>
'MulticurrencyAmountVAT',
'checked' =>
'0',
'enabled' => (!isModEnabled(
"multicurrency") ?
'0' :
'1')),
257 'p.multicurrency_total_ttc' => array(
'label' =>
'MulticurrencyAmountTTC',
'checked' =>
'0',
'enabled' => (!isModEnabled(
"multicurrency") ?
'0' :
'1')),
258 'p.multicurrency_total_ht_invoiced' => array(
'label' =>
'MulticurrencyAmountInvoicedHT',
'checked' =>
'0',
'enabled' => (string) (int) (isModEnabled(
"multicurrency") &&
getDolGlobalString(
'PROPOSAL_SHOW_INVOICED_AMOUNT'))),
259 'p.multicurrency_total_invoiced' => array(
'label' =>
'MulticurrencyAmountInvoicedTTC',
'checked' =>
'0',
'enabled' => (string) (int) (isModEnabled(
"multicurrency") &&
getDolGlobalString(
'PROPOSAL_SHOW_INVOICED_AMOUNT'))),
260 'u.login' => array(
'label' =>
"Author",
'checked' =>
'1',
'position' => 10),
261 'sale_representative' => array(
'label' =>
"SaleRepresentativesOfThirdParty",
'checked' =>
'-1'),
262 'total_pa' => array(
'label' => (
getDolGlobalString(
'MARGIN_TYPE') ==
'1' ?
'BuyingPrice' :
'CostPrice'),
'checked' =>
'0',
'position' => 300,
'enabled' => (!isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') ?
'0' :
'1')),
263 'total_margin' => array(
'label' =>
'Margin',
'checked' =>
'0',
'position' => 301,
'enabled' => (!isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') ?
'0' :
'1')),
264 'total_margin_rate' => array(
'label' =>
'MarginRate',
'checked' =>
'0',
'position' => 302,
'enabled' => (!isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') || !
getDolGlobalString(
'DISPLAY_MARGIN_RATES') ?
'0' :
'1')),
265 'total_mark_rate' => array(
'label' =>
'MarkRate',
'checked' =>
'0',
'position' => 303,
'enabled' => (!isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') || !
getDolGlobalString(
'DISPLAY_MARK_RATES') ?
'0' :
'1')),
266 'p.datec' => array(
'label' =>
"DateCreation",
'checked' =>
'0',
'position' => 500),
267 'p.tms' => array(
'label' =>
"DateModificationShort",
'checked' =>
'0',
'position' => 500),
268 'p.date_cloture' => array(
'label' =>
"DateClosing",
'checked' =>
'0',
'position' => 500),
269 'p.note_public' => array(
'label' =>
'NotePublic',
'checked' =>
'0',
'position' => 510,
'enabled' => (string) (!
getDolGlobalInt(
'MAIN_LIST_HIDE_PUBLIC_NOTES'))),
270 'p.note_private' => array(
'label' =>
'NotePrivate',
'checked' =>
'0',
'position' => 511,
'enabled' => (string) (!
getDolGlobalInt(
'MAIN_LIST_HIDE_PRIVATE_NOTES'))),
271 'p.import_key' => array(
'type' =>
'varchar(14)',
'label' =>
'ImportId',
'enabled' =>
'1',
'visible' => -2,
'position' => 999),
272 'p.fk_statut' => array(
'label' =>
"Status",
'checked' =>
'1',
'position' => 1000),
300if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
301 $search_sale = $user->id;
305include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
308$permissiontoread = $user->hasRight(
'propal',
'lire');
309$permissiontoadd = $user->hasRight(
'propal',
'creer');
310$permissiontodelete = $user->hasRight(
'propal',
'supprimer');
312 $permissiontovalidate = $user->hasRight(
'propal',
'propal_advance',
'validate');
313 $permissiontoclose = $user->hasRight(
'propal',
'propal_advance',
'close');
314 $permissiontosendbymail = $user->hasRight(
'propal',
'propal_advance',
'send');
316 $permissiontovalidate = $user->hasRight(
'propal',
'creer');
317 $permissiontoclose = $user->hasRight(
'propal',
'creer');
318 $permissiontosendbymail = $user->hasRight(
'propal',
'lire');
327if (
GETPOST(
'cancel',
'alpha')) {
331if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
336$search_code_client =
'';
338$parameters = array(
'socid' => $socid,
'arrayfields' => &$arrayfields);
339$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
344if (empty($reshook)) {
346 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
349 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
353 $search_refcustomer =
'';
354 $search_refproject =
'';
355 $search_project =
'';
356 $search_societe =
'';
357 $search_societe_alias =
'';
358 $search_montant_ht =
'';
359 $search_montant_vat =
'';
360 $search_montant_ttc =
'';
361 $search_warehouse =
'';
362 $search_multicurrency_code =
'';
363 $search_multicurrency_tx =
'';
364 $search_multicurrency_montant_ht =
'';
365 $search_multicurrency_montant_vat =
'';
366 $search_multicurrency_montant_ttc =
'';
368 $search_product_category = 0;
373 $search_country =
'';
374 $search_type_thirdparty =
'';
375 $search_date_startday =
'';
376 $search_date_startmonth =
'';
377 $search_date_startyear =
'';
378 $search_date_endday =
'';
379 $search_date_endmonth =
'';
380 $search_date_endyear =
'';
381 $search_date_start =
'';
382 $search_date_end =
'';
383 $search_date_end_startday =
'';
384 $search_date_end_startmonth =
'';
385 $search_date_end_startyear =
'';
386 $search_date_end_endday =
'';
387 $search_date_end_endmonth =
'';
388 $search_date_end_endyear =
'';
389 $search_date_end_start =
'';
390 $search_date_end_end =
'';
391 $search_date_delivery_startday =
'';
392 $search_date_delivery_startmonth =
'';
393 $search_date_delivery_startyear =
'';
394 $search_date_delivery_endday =
'';
395 $search_date_delivery_endmonth =
'';
396 $search_date_delivery_endyear =
'';
397 $search_date_delivery_start =
'';
398 $search_date_delivery_end =
'';
399 $search_availability =
'';
402 $search_fk_cond_reglement =
'';
403 $search_fk_shipping_method =
'';
404 $search_fk_input_reason =
'';
405 $search_fk_mode_reglement =
'';
406 $search_date_signature_startday =
'';
407 $search_date_signature_startmonth =
'';
408 $search_date_signature_startyear =
'';
409 $search_date_signature_endday =
'';
410 $search_date_signature_endmonth =
'';
411 $search_date_signature_endyear =
'';
412 $search_date_signature_start =
'';
413 $search_date_signature_end =
'';
414 $search_import_key =
'';
415 $search_categ_cus = 0;
419 $search_array_options = array();
425 $objectclass =
'Propal';
426 $objectlabel =
'Proposals';
427 $uploaddir =
$conf->propal->multidir_output[
$conf->entity];
428 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
431if ($action ==
'validate' && $permissiontovalidate) {
432 if (
GETPOST(
'confirm') ==
'yes') {
433 $tmpproposal =
new Propal($db);
435 foreach ($toselect as $checked) {
436 if ($tmpproposal->fetch($checked) > 0) {
437 if ($tmpproposal->status == $tmpproposal::STATUS_DRAFT) {
438 if ($tmpproposal->valid($user) > 0) {
439 setEventMessages($langs->trans(
'hasBeenValidated', $tmpproposal->ref),
null,
'mesgs');
445 $langs->load(
"errors");
446 setEventMessages($langs->trans(
'ErrorIsNotADraft', $tmpproposal->ref),
null,
'errors');
462if ($action ==
"sign" && $permissiontoclose) {
463 if (
GETPOST(
'confirm') ==
'yes') {
464 $tmpproposal =
new Propal($db);
466 foreach ($toselect as $checked) {
467 if ($tmpproposal->fetch($checked) > 0) {
468 if ($tmpproposal->status == $tmpproposal::STATUS_VALIDATED) {
469 $tmpproposal->status = $tmpproposal::STATUS_SIGNED;
470 if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_SIGNED) >= 0) {
471 setEventMessages($tmpproposal->ref.
" ".$langs->trans(
'Signed'),
null,
'mesgs');
477 setEventMessage($langs->trans(
'MustBeValidatedToBeSigned', $tmpproposal->ref),
'errors');
493if ($action ==
"nosign" && $permissiontoclose) {
494 if (
GETPOST(
'confirm') ==
'yes') {
495 $tmpproposal =
new Propal($db);
497 foreach ($toselect as $checked) {
498 if ($tmpproposal->fetch($checked) > 0) {
499 if ($tmpproposal->status == $tmpproposal::STATUS_VALIDATED || (
getDolGlobalString(
'PROPAL_SKIP_ACCEPT_REFUSE') && $tmpproposal->status == $tmpproposal::STATUS_DRAFT)) {
500 $tmpproposal->status = $tmpproposal::STATUS_NOTSIGNED;
501 if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_NOTSIGNED) > 0) {
502 setEventMessage($tmpproposal->ref.
" ".$langs->trans(
'NoSigned'),
'mesgs');
508 setEventMessage($tmpproposal->ref.
" ".$langs->trans(
'CantBeNoSign'),
'errors');
525if (!$error && $massaction ===
'setbilled' && $permissiontoclose && $objectclass !==
null) {
528 $objecttmp =
new $objectclass($db);
530 foreach ($toselect as $toselectid) {
531 $result = $objecttmp->fetch($toselectid);
533 $result = $objecttmp->classifyBilled($user, 0);
564$form =
new Form($db);
569if (isModEnabled(
'margin')) {
572$companystatic =
new Societe($db);
573$projectstatic =
new Project($db);
575$userstatic =
new User($db);
577$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
578$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
581if ($search_all !==
'') {
582 $sql =
'SELECT DISTINCT';
584$sql .=
' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.phone, s.fax , s.address, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client,';
585$sql .=
" typent.code as typent_code,";
586$sql .=
" ava.rowid as availability,";
587$sql .=
" country.code as country_code,";
588$sql .=
" state.code_departement as state_code, state.nom as state_name,";
589$sql .=
' p.rowid, p.entity, p.note_private, p.total_ht, p.total_tva, p.total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut as status, p.import_key, p.fk_user_author, p.datep as dp, p.fin_validite as dfv, p.date_livraison as ddelivery,';
590$sql .=
' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc,';
591$sql .=
' p.datec as date_creation, p.tms as date_modification, p.date_cloture as date_cloture,';
592$sql .=
' p.date_signature as dsignature,';
593$sql .=
' p.note_public, p.note_private,';
594$sql .=
' p.fk_cond_reglement,p.deposit_percent,p.fk_mode_reglement,p.fk_shipping_method,p.fk_input_reason,';
595$sql .=
" pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
596$sql .=
' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity as user_entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
598if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
599 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
600 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
604$parameters = array();
605$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
606$sql .= $hookmanager->resPrint;
607$sql = preg_replace(
'/, $/',
'', $sql);
611$sql .=
' FROM '.MAIN_DB_PREFIX.
'societe as s';
612$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
613$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
614$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
616$sql .=
' INNER JOIN '.MAIN_DB_PREFIX.
'propal as p ON p.fk_soc = s.rowid';
617if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
618 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
621 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'propaldet as pd ON p.rowid = pd.fk_propal';
623$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON p.fk_user_author = u.rowid';
624$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as pr ON pr.rowid = p.fk_projet";
625$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_availability as ava on (ava.rowid = p.fk_availability)";
627$parameters = array();
628$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
629$sql .= $hookmanager->resPrint;
632$sql .=
' p.entity IN ('.getEntity(
'propal').
')';
642if ($search_country) {
643 $sql .=
" AND s.fk_pays IN (".$db->sanitize($db->escape($search_country)).
')';
645if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
646 $sql .=
" AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).
')';
651if ($search_refcustomer) {
654if ($search_refproject) {
657if ($search_project) {
660if ($search_availability) {
661 $sql .=
" AND p.fk_availability IN (".$db->sanitize($db->escape($search_availability)).
')';
664if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
665 if ($societe_add_ref_in_list == 1) {
666 $sql .=
natural_search(array(
"s.nom",
"s.name_alias",
"s.code_client"), $search_societe);
668 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_societe);
671 if ($search_societe) {
672 if ($societe_add_ref_in_list == 1) {
673 $sql .=
natural_search(array(
's.nom',
's.code_client'), $search_societe);
678 if ($search_societe_alias) {
683if ($societe_add_ref_in_list == 1 && $search_code_client && !$search_societe) {
687 $sql .=
natural_search(array(
"u.login",
"u.firstname",
"u.lastname"), $search_login);
689if ($search_montant_ht !=
'') {
692if ($search_montant_vat !=
'') {
695if ($search_montant_ttc !=
'') {
698if ($search_warehouse !=
'' && $search_warehouse > 0) {
701if ($search_multicurrency_code !=
'') {
702 $sql .=
" AND p.multicurrency_code = '".$db->escape($search_multicurrency_code).
"'";
704if ($search_multicurrency_tx !=
'') {
705 $sql .=
natural_search(
'p.multicurrency_tx', $search_multicurrency_tx, 1);
707if ($search_multicurrency_montant_ht !=
'') {
708 $sql .=
natural_search(
'p.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
710if ($search_multicurrency_montant_vat !=
'') {
711 $sql .=
natural_search(
'p.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
713if ($search_multicurrency_montant_ttc !=
'') {
714 $sql .=
natural_search(
'p.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
717 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
719if ($search_fk_cond_reglement > 0) {
720 $sql .=
" AND p.fk_cond_reglement = ".((int) $search_fk_cond_reglement);
722if ($search_fk_shipping_method > 0) {
723 $sql .=
" AND p.fk_shipping_method = ".((int) $search_fk_shipping_method);
725if ($search_fk_input_reason > 0) {
726 $sql .=
" AND p.fk_input_reason = ".((int) $search_fk_input_reason);
728if ($search_fk_mode_reglement > 0) {
729 $sql .=
" AND p.fk_mode_reglement = ".((int) $search_fk_mode_reglement);
732 $sql .=
' AND s.rowid = '.((int) $socid);
734if ($search_status !=
'' && $search_status !=
'-1') {
735 $sql .=
' AND p.fk_statut IN ('.$db->sanitize($search_status).
')';
737if ($search_date_start) {
738 $sql .=
" AND p.datep >= '".$db->idate($search_date_start).
"'";
740if ($search_date_end) {
741 $sql .=
" AND p.datep <= '".$db->idate($search_date_end).
"'";
743if ($search_date_end_start) {
744 $sql .=
" AND p.fin_validite >= '".$db->idate($search_date_end_start).
"'";
746if ($search_date_end_end) {
747 $sql .=
" AND p.fin_validite <= '".$db->idate($search_date_end_end).
"'";
749if ($search_date_delivery_start) {
750 $sql .=
" AND p.date_livraison >= '".$db->idate($search_date_delivery_start).
"'";
752if ($search_date_delivery_end) {
753 $sql .=
" AND p.date_livraison <= '".$db->idate($search_date_delivery_end).
"'";
755if ($search_date_signature_start) {
756 $sql .=
" AND p.date_signature >= '".$db->idate($search_date_signature_start).
"'";
758if ($search_date_signature_end) {
759 $sql .=
" AND p.date_signature <= '".$db->idate($search_date_signature_end).
"'";
761if ($search_note_public) {
762 $sql .=
" AND p.note_public LIKE '%".$db->escape($db->escapeforlike($search_note_public)).
"%'";
764if ($search_import_key) {
768if ($search_user > 0) {
769 $sql .=
" AND EXISTS (";
770 $sql .=
" SELECT ec.fk_c_type_contact, ec.element_id, ec.fk_socpeople";
771 $sql .=
" FROM ".MAIN_DB_PREFIX.
"element_contact as ec";
772 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"c_type_contact as tc";
773 $sql .=
" ON ec.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal'";
774 $sql .=
" WHERE ec.element_id = p.rowid AND ec.fk_socpeople = ".((int) $search_user).
")";
777if ($search_sale && $search_sale !=
'-1') {
778 if ($search_sale == -2) {
779 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
780 } elseif ($search_sale > 0) {
781 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = ".((int) $search_sale).
")";
785$searchCategoryCustomerOperator =
GETPOSTINT(
'search_category_customer_operator');
786$searchCategoryCustomerList = ($search_categ_cus !==
'-1' ? explode(
',', (
string) $search_categ_cus) : array());
787if (!empty($searchCategoryCustomerList)) {
788 $searchCategoryCustomerSqlList = array();
789 $listofcategoryid =
'';
790 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
791 if (intval($searchCategoryCustomer) == -2) {
792 $searchCategoryCustomerSqlList[] =
"NOT EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc)";
793 } elseif (intval($searchCategoryCustomer) > 0) {
794 if ($searchCategoryCustomerOperator == 0) {
795 $searchCategoryCustomerSqlList[] =
" EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc AND cs.fk_categorie = ".((int) $searchCategoryCustomer).
")";
797 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryCustomer);
801 if ($listofcategoryid) {
802 $searchCategoryCustomerSqlList[] =
" EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc AND cs.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
804 if ($searchCategoryCustomerOperator == 1) {
805 if (!empty($searchCategoryCustomerSqlList)) {
806 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
809 if (!empty($searchCategoryCustomerSqlList)) {
810 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
815$searchCategoryProductOperator =
GETPOSTINT(
'search_category_product_operator');
816$searchCategoryProductList = array($search_product_category);
817if (!empty($searchCategoryProductList)) {
818 $searchCategoryProductSqlList = array();
819 $listofcategoryid =
'';
820 foreach ($searchCategoryProductList as $searchCategoryProduct) {
821 if (intval($searchCategoryProduct) == -2) {
822 $searchCategoryProductSqlList[] =
"NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product)";
823 } elseif (intval($searchCategoryProduct) > 0) {
824 if ($searchCategoryProductOperator == 0) {
825 $searchCategoryProductSqlList[] =
" EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).
")";
827 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
831 if ($listofcategoryid) {
832 $searchCategoryProductSqlList[] =
" EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
834 if ($searchCategoryProductOperator == 1) {
835 if (!empty($searchCategoryProductSqlList)) {
836 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
839 if (!empty($searchCategoryProductSqlList)) {
840 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
844if ($search_option ==
'late') {
845 $sql .=
" AND p.fin_validite < '".$db->idate(
dol_now() -
$conf->propal->cloture->warning_delay).
"'";
848include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
852$parameters = array();
853$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
854$sql .= $hookmanager->resPrint;
857$parameters = array();
858$reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object, $action);
859$sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
862$nbtotalofrecords =
'';
865 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
866 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
867 $resql = $db->query($sqlforcount);
869 $objforcount = $db->fetch_object($resql);
870 $nbtotalofrecords = $objforcount->nbtotalofrecords;
875 if (($page * $limit) > $nbtotalofrecords) {
883$sql .= $db->order($sortfield, $sortorder);
884$sql .=
', p.ref DESC';
886 $sql .= $db->plimit($limit + 1, $offset);
889$resql = $db->query($sql);
898 $title = $langs->trans(
'Proposals').
' - '.$soc->name;
899 if (empty($search_societe)) {
900 $search_societe = $soc->name;
903 $title = $langs->trans(
'Proposals');
906$num = $db->num_rows($resql);
908$arrayofselected = is_array($toselect) ? $toselect : array();
910if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all) {
911 $obj = $db->fetch_object($resql);
915 header(
"Location: ".DOL_URL_ROOT.
'/comm/propal/card.php?id='.
$id);
919$help_url =
'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos';
920llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist');
922$param =
'&search_status='.urlencode($search_status);
924 $param .=
'&mode='.urlencode($mode);
926if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
927 $param .=
'&contextpage='.urlencode($contextpage);
929if ($limit > 0 && $limit !=
$conf->liste_limit) {
930 $param .=
'&limit='.((int) $limit);
932if ($optioncss !=
'') {
933 $param .=
'&optioncss='.urlencode($optioncss);
936 $param .=
'&socid='.urlencode((
string) ($socid));
939 $param .=
'&search_all='.urlencode($search_all);
941if ($search_date_startday) {
942 $param .=
'&search_date_startday='.urlencode((
string) ($search_date_startday));
944if ($search_date_startmonth) {
945 $param .=
'&search_date_startmonth='.urlencode((
string) ($search_date_startmonth));
947if ($search_date_startyear) {
948 $param .=
'&search_date_startyear='.urlencode((
string) ($search_date_startyear));
950if ($search_date_endday) {
951 $param .=
'&search_date_endday='.urlencode((
string) ($search_date_endday));
953if ($search_date_endmonth) {
954 $param .=
'&search_date_endmonth='.urlencode((
string) ($search_date_endmonth));
956if ($search_date_endyear) {
957 $param .=
'&search_date_endyear='.urlencode((
string) ($search_date_endyear));
959if ($search_date_end_startday) {
960 $param .=
'&search_date_end_startday='.urlencode((
string) ($search_date_end_startday));
962if ($search_date_end_startmonth) {
963 $param .=
'&search_date_end_startmonth='.urlencode((
string) ($search_date_end_startmonth));
965if ($search_date_end_startyear) {
966 $param .=
'&search_date_end_startyear='.urlencode((
string) ($search_date_end_startyear));
968if ($search_date_end_endday) {
969 $param .=
'&search_date_end_endday='.urlencode((
string) ($search_date_end_endday));
971if ($search_date_end_endmonth) {
972 $param .=
'&search_date_end_endmonth='.urlencode((
string) ($search_date_end_endmonth));
974if ($search_date_end_endyear) {
975 $param .=
'&search_date_end_endyear='.urlencode((
string) ($search_date_end_endyear));
977if ($search_date_delivery_startday) {
978 $param .=
'&search_date_delivery_startday='.urlencode((
string) ($search_date_delivery_startday));
980if ($search_date_delivery_startmonth) {
981 $param .=
'&search_date_delivery_startmonth='.urlencode((
string) ($search_date_delivery_startmonth));
983if ($search_date_delivery_startyear) {
984 $param .=
'&search_date_delivery_startyear='.urlencode((
string) ($search_date_delivery_startyear));
986if ($search_date_delivery_endday) {
987 $param .=
'&search_date_delivery_endday='.urlencode((
string) ($search_date_delivery_endday));
989if ($search_date_delivery_endmonth) {
990 $param .=
'&search_date_delivery_endmonth='.urlencode((
string) ($search_date_delivery_endmonth));
992if ($search_date_delivery_endyear) {
993 $param .=
'&search_date_delivery_endyear='.urlencode((
string) ($search_date_delivery_endyear));
996 $param .=
'&search_ref='.urlencode($search_ref);
998if ($search_refcustomer) {
999 $param .=
'&search_refcustomer='.urlencode($search_refcustomer);
1001if ($search_refproject) {
1002 $param .=
'&search_refproject='.urlencode($search_refproject);
1004if ($search_societe) {
1005 $param .=
'&search_societe='.urlencode($search_societe);
1007if ($search_societe_alias) {
1008 $param .=
'&search_societe_alias='.urlencode($search_societe_alias);
1010if ($search_user > 0) {
1011 $param .=
'&search_user='.urlencode((
string) ($search_user));
1013if ($search_sale > 0) {
1014 $param .=
'&search_sale='.urlencode((
string) $search_sale);
1016if ($search_montant_ht) {
1017 $param .=
'&search_montant_ht='.urlencode($search_montant_ht);
1019if ($search_multicurrency_code !=
'') {
1020 $param .=
'&search_multicurrency_code='.urlencode($search_multicurrency_code);
1022if ($search_multicurrency_tx !=
'') {
1023 $param .=
'&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
1025if ($search_multicurrency_montant_ht !=
'') {
1026 $param .=
'&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
1028if ($search_multicurrency_montant_vat !=
'') {
1029 $param .=
'&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
1031if ($search_multicurrency_montant_ttc !=
'') {
1032 $param .=
'&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
1035 $param .=
'&search_login='.urlencode($search_login);
1038 $param .=
'&search_town='.urlencode($search_town);
1041 $param .=
'&search_zip='.urlencode($search_zip);
1043if ($search_categ_cus > 0) {
1044 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
1046if ($search_product_category !=
'') {
1047 $param .=
'&search_product_category='.urlencode((
string) ($search_product_category));
1049if ($search_fk_cond_reglement > 0) {
1050 $param .=
'&search_fk_cond_reglement='.urlencode((
string) ($search_fk_cond_reglement));
1052if ($search_fk_shipping_method > 0) {
1053 $param .=
'&search_fk_shipping_method='.urlencode((
string) ($search_fk_shipping_method));
1055if ($search_fk_input_reason > 0) {
1056 $param .=
'&search_fk_input_reason='.urlencode((
string) ($search_fk_input_reason));
1058if ($search_fk_mode_reglement > 0) {
1059 $param .=
'&search_fk_mode_reglement='.urlencode((
string) ($search_fk_mode_reglement));
1061if ($search_type_thirdparty > 0) {
1062 $param .=
'&search_type_thirdparty='.urlencode((
string) ($search_type_thirdparty));
1065 $param .=
'&search_town='.urlencode($search_town);
1068 $param .=
'&search_zip='.urlencode($search_zip);
1071 $param .=
'&search_state='.urlencode($search_state);
1074 $param .=
'&search_town='.urlencode($search_town);
1076if ($search_country) {
1077 $param .=
'&search_country='.urlencode((
string) ($search_country));
1079if ($search_date_signature_startday) {
1080 $param .=
'&search_date_signature_startday='.urlencode((
string) ($search_date_signature_startday));
1082if ($search_date_signature_startmonth) {
1083 $param .=
'&search_date_signature_startmonth='.urlencode((
string) ($search_date_signature_startmonth));
1085if ($search_date_signature_startyear) {
1086 $param .=
'&search_date_signature_startyear='.urlencode((
string) ($search_date_signature_startyear));
1088if ($search_date_signature_endday) {
1089 $param .=
'&search_date_signature_endday='.urlencode((
string) ($search_date_signature_endday));
1091if ($search_date_signature_endmonth) {
1092 $param .=
'&search_date_signature_endmonth='.urlencode((
string) ($search_date_signature_endmonth));
1094if ($search_date_signature_endyear) {
1095 $param .=
'&search_date_signature_endyear='.urlencode((
string) ($search_date_signature_endyear));
1097if ($search_import_key !=
'') {
1098 $param .=
'&search_import_key='.urlencode($search_import_key);
1102include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
1104$parameters = array(
'param' => &$param);
1105$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
1106$param .= $hookmanager->resPrint;
1109$arrayofmassactions = array(
1110 'generate_doc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
1111 'builddoc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
1113if ($permissiontosendbymail) {
1114 $arrayofmassactions[
'presend'] =
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail");
1116if ($permissiontovalidate) {
1117 $arrayofmassactions[
'prevalidate'] =
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate");
1119if ($permissiontoclose) {
1120 $arrayofmassactions[
'presign'] =
img_picto(
'',
'propal',
'class="pictofixedwidth"').$langs->trans(
"Sign");
1121 $arrayofmassactions[
'nopresign'] =
img_picto(
'',
'propal',
'class="pictofixedwidth"').$langs->trans(
"NoSign");
1122 $arrayofmassactions[
'setbilled'] =
img_picto(
'',
'bill',
'class="pictofixedwidth"').$langs->trans(
"ClassifyBilled");
1124if ($permissiontodelete) {
1125 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
1128if (in_array($massaction, array(
'presend',
'predelete',
'closed'))) {
1129 $arrayofmassactions = array();
1131$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1133$url = DOL_URL_ROOT.
'/comm/propal/card.php?action=create';
1134if (!empty($socid)) {
1135 $url .=
'&socid='.$socid;
1138$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'));
1139$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'));
1141$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewPropal'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'propal',
'creer'));
1144print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
1145if ($optioncss !=
'') {
1146 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1148print
'<input type="hidden" name="token" value="'.newToken().
'">';
1149print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1150print
'<input type="hidden" name="action" value="list">';
1151print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1152print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1153print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
1154print
'<input type="hidden" name="socid" value="'.$socid.
'">';
1155print
'<input type="hidden" name="mode"value="'.$mode.
'">';
1157print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'propal', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1159$topicmail =
"SendPropalRef";
1160$modelmail =
"propal_send";
1161$objecttmp =
new Propal($db);
1162$trackid =
'pro'.$object->id;
1163include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1165if ($massaction ==
'prevalidate') {
1166 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassValidation"), $langs->trans(
"ConfirmMassValidationQuestion"),
"validate",
null,
'', 0, 200, 500, 1);
1169if ($massaction ==
'presign') {
1170 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassSignature"), $langs->trans(
"ConfirmMassSignatureQuestion"),
"sign",
null,
'', 0, 200, 500, 1);
1173if ($massaction ==
'nopresign') {
1174 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassNoSignature"), $langs->trans(
"ConfirmMassNoSignatureQuestion"),
"nosign",
null,
'', 0, 200, 500, 1);
1178 foreach ($fieldstosearchall as $key => $val) {
1179 $fieldstosearchall[$key] = $langs->trans($val);
1181 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1189if ($user->hasRight(
'user',
'user',
'lire')) {
1190 $langs->load(
"commercial");
1191 $moreforfilter .=
'<div class="divsearchfield">';
1192 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1193 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth250 widthcentpercentminusx', 1);
1194 $moreforfilter .=
'</div>';
1197if ($user->hasRight(
'user',
'user',
'lire')) {
1198 $moreforfilter .=
'<div class="divsearchfield">';
1199 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
1200 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$form->select_dolusers((empty($search_user) ? -2 : 0),
'search_user', $tmptitle, null, 0,
'',
'',
'0', 0, 0,
'', 0,
'',
'maxwidth250 widthcentpercentminusx');
1201 $moreforfilter .=
'</div>';
1204if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'read') && ($user->hasRight(
'product',
'read') || $user->hasRight(
'service',
'read'))) {
1205 $searchCategoryProductOperator =
GETPOSTINT(
'search_category_product_operator');
1206 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1207 $tmptitle = $langs->trans(
'IncludingProductWithTag');
1209 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, array($search_product_category),
'maxwidth300', $searchCategoryProductOperator, 0, 0, $tmptitle);
1211if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1212 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1213 $moreforfilter .=
'<div class="divsearchfield">';
1214 $tmptitle = $langs->trans(
'CustomersProspectsCategoriesShort');
1215 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$formother->select_categories(
'customer', $search_categ_cus,
'search_categ_cus', 1, $tmptitle, (empty(
$conf->dol_optimize_smallscreen) ?
'maxwidth300 widthcentpercentminusx' :
'maxwidth250 widthcentpercentminusx'));
1216 $moreforfilter .=
'</div>';
1218if (isModEnabled(
'stock') &&
getDolGlobalString(
'WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) {
1219 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
1221 $moreforfilter .=
'<div class="divsearchfield">';
1222 $tmptitle = $langs->trans(
'Warehouse');
1223 $moreforfilter .=
img_picto($tmptitle,
'stock',
'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse,
'search_warehouse',
'', $tmptitle, 0, 0,
'', 0, 0, array(),
'maxwidth250 widthcentpercentminusx');
1224 $moreforfilter .=
'</div>';
1226$parameters = array();
1227$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1228if (empty($reshook)) {
1229 $moreforfilter .= $hookmanager->resPrint;
1231 $moreforfilter = $hookmanager->resPrint;
1234if (!empty($moreforfilter)) {
1235 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1236 print $moreforfilter;
1240$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1241$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1242$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1244print
'<div class="div-table-responsive">';
1245print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1247print
'<tr class="liste_titre_filter">';
1251 print
'<td class="liste_titre center">';
1252 $searchpicto = $form->showFilterButtons(
'left');
1257if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1258 print
'<td class="liste_titre">';
1259 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
1262if (!empty($arrayfields[
'p.ref_client'][
'checked'])) {
1263 print
'<td class="liste_titre">';
1264 print
'<input class="flat maxwidth50" type="text" name="search_refcustomer" value="'.dol_escape_htmltag($search_refcustomer).
'">';
1267if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1268 print
'<td class="liste_titre">';
1269 print
'<input class="flat maxwidth50" type="text" name="search_refproject" value="'.dol_escape_htmltag($search_refproject).
'">';
1272if (!empty($arrayfields[
'pr.title'][
'checked'])) {
1273 print
'<td class="liste_titre">';
1274 print
'<input class="flat maxwidth50" type="text" name="search_project" value="'.dol_escape_htmltag($search_project).
'">';
1277if (!empty($arrayfields[
's.nom'][
'checked'])) {
1278 print
'<td class="liste_titre" align="left">';
1279 print
'<input class="flat maxwidth100" type="text" name="search_societe" value="'.dol_escape_htmltag((
string) $search_societe).
'"'.($socid > 0 ?
" disabled" :
"").
'>';
1282if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1283 print
'<td class="liste_titre" align="left">';
1284 print
'<input class="flat maxwidth100" type="text" name="search_societe_alias" value="'.dol_escape_htmltag($search_societe_alias).
'">';
1287if (!empty($arrayfields[
's.town'][
'checked'])) {
1288 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_town" value="'.$search_town.
'"></td>';
1290if (!empty($arrayfields[
's.zip'][
'checked'])) {
1291 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_zip" value="'.$search_zip.
'"></td>';
1294if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1295 print
'<td class="liste_titre">';
1296 print
'<input class="flat maxwidth50" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1300if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1301 print
'<td class="liste_titre center">';
1302 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1306if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1307 print
'<td class="liste_titre maxwidth100onsmartphone center">';
1308 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'),
'maxwidth100', 1);
1313if (!empty($arrayfields[
'p.date'][
'checked'])) {
1314 print
'<td class="liste_titre center">';
1315 print
'<div class="nowrapfordate">';
1316 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1318 print
'<div class="nowrapfordate">';
1319 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1324if (!empty($arrayfields[
'p.fin_validite'][
'checked'])) {
1325 print
'<td class="liste_titre center">';
1326 print
'<div class="nowrapfordate">';
1327 print $form->selectDate($search_date_end_start ? $search_date_end_start : -1,
'search_date_end_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1329 print
'<div class="nowrapfordate">';
1330 print $form->selectDate($search_date_end_end ? $search_date_end_end : -1,
'search_date_end_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1335if (!empty($arrayfields[
'p.date_livraison'][
'checked'])) {
1336 print
'<td class="liste_titre center">';
1337 print
'<div class="nowrapfordate">';
1338 print $form->selectDate($search_date_delivery_start ? $search_date_delivery_start : -1,
'search_date_delivery_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1340 print
'<div class="nowrapfordate">';
1341 print $form->selectDate($search_date_delivery_end ? $search_date_delivery_end : -1,
'search_date_delivery_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1346if (!empty($arrayfields[
'p.date_signature'][
'checked'])) {
1347 print
'<td class="liste_titre center">';
1348 print
'<div class="nowrapfordate">';
1349 print $form->selectDate($search_date_signature_start ? $search_date_signature_start : -1,
'search_date_signature_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1351 print
'<div class="nowrapfordate">';
1352 print $form->selectDate($search_date_signature_end ? $search_date_signature_end : -1,
'search_date_signature_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1357if (!empty($arrayfields[
'ava.rowid'][
'checked'])) {
1358 print
'<td class="liste_titre maxwidth100onsmartphone center">';
1359 $form->selectAvailabilityDelay($search_availability,
'search_availability',
'', 1);
1364if (!empty($arrayfields[
'p.fk_shipping_method'][
'checked'])) {
1365 print
'<td class="liste_titre">';
1366 $form->selectShippingMethod($search_fk_shipping_method,
'search_fk_shipping_method',
'', 1,
'', 1);
1370if (!empty($arrayfields[
'p.fk_input_reason'][
'checked'])) {
1371 print
'<td class="liste_titre">';
1372 $form->selectInputReason($search_fk_input_reason,
'search_fk_input_reason',
'', 1,
'maxwidth125', 1);
1376if (!empty($arrayfields[
'p.fk_cond_reglement'][
'checked'])) {
1377 print
'<td class="liste_titre">';
1378 print $form->getSelectConditionsPaiements((
int) $search_fk_cond_reglement,
'search_fk_cond_reglement', 1, 1, 1);
1382if (!empty($arrayfields[
'p.fk_mode_reglement'][
'checked'])) {
1383 print
'<td class="liste_titre">';
1384 print $form->select_types_paiements($search_fk_mode_reglement,
'search_fk_mode_reglement',
'', 0, 1, 1, 0, -1,
'', 1);
1387if (!empty($arrayfields[
'p.total_ht'][
'checked'])) {
1389 print
'<td class="liste_titre right">';
1390 print
'<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).
'">';
1393if (!empty($arrayfields[
'p.total_tva'][
'checked'])) {
1395 print
'<td class="liste_titre right">';
1396 print
'<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).
'">';
1399if (!empty($arrayfields[
'p.total_ttc'][
'checked'])) {
1401 print
'<td class="liste_titre right">';
1402 print
'<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).
'">';
1405if (!empty($arrayfields[
'p.total_ht_invoiced'][
'checked'])) {
1407 print
'<td class="liste_titre right">';
1410if (!empty($arrayfields[
'p.total_invoiced'][
'checked'])) {
1412 print
'<td class="liste_titre right">';
1415if (!empty($arrayfields[
'p.multicurrency_code'][
'checked'])) {
1417 print
'<td class="liste_titre">';
1418 print $form->selectMultiCurrency($search_multicurrency_code,
'search_multicurrency_code', 1);
1421if (!empty($arrayfields[
'p.multicurrency_tx'][
'checked'])) {
1423 print
'<td class="liste_titre">';
1424 print
'<input class="flat" type="text" size="4" name="search_multicurrency_tx" value="'.dol_escape_htmltag($search_multicurrency_tx).
'">';
1427if (!empty($arrayfields[
'p.multicurrency_total_ht'][
'checked'])) {
1429 print
'<td class="liste_titre right">';
1430 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ht" value="'.dol_escape_htmltag($search_multicurrency_montant_ht).
'">';
1433if (!empty($arrayfields[
'p.multicurrency_total_tva'][
'checked'])) {
1435 print
'<td class="liste_titre right">';
1436 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_vat" value="'.dol_escape_htmltag($search_multicurrency_montant_vat).
'">';
1439if (!empty($arrayfields[
'p.multicurrency_total_ttc'][
'checked'])) {
1441 print
'<td class="liste_titre right">';
1442 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ttc" value="'.dol_escape_htmltag($search_multicurrency_montant_ttc).
'">';
1445if (!empty($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'checked'])) {
1447 print
'<td class="liste_titre right">';
1450if (!empty($arrayfields[
'p.multicurrency_total_invoiced'][
'checked'])) {
1452 print
'<td class="liste_titre right">';
1455if (!empty($arrayfields[
'u.login'][
'checked'])) {
1457 print
'<td class="liste_titre">';
1458 print
'<input class="flat maxwidth75" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1461if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
1462 print
'<td class="liste_titre"></td>';
1464if (!empty($arrayfields[
'total_pa'][
'checked'])) {
1465 print
'<td class="liste_titre right">';
1468if (!empty($arrayfields[
'total_margin'][
'checked'])) {
1469 print
'<td class="liste_titre right">';
1472if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
1473 print
'<td class="liste_titre right">';
1476if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
1477 print
'<td class="liste_titre right">';
1481include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1484$parameters = array(
'arrayfields' => $arrayfields);
1485$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1486print $hookmanager->resPrint;
1488if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1489 print
'<td class="liste_titre">';
1493if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1494 print
'<td class="liste_titre">';
1498if (!empty($arrayfields[
'p.date_cloture'][
'checked'])) {
1499 print
'<td class="liste_titre">';
1502if (!empty($arrayfields[
'p.note_public'][
'checked'])) {
1504 print
'<td class="liste_titre">';
1505 print
'<input class="flat maxwidth75" type="text" name="search_note_public" value="'.dol_escape_htmltag($search_note_public).
'">';
1508if (!empty($arrayfields[
'p.note_private'][
'checked'])) {
1510 print
'<td class="liste_titre">';
1514if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1515 print
'<td class="liste_titre maxwidthonsmartphone center">';
1516 print
'<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1520if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1521 print
'<td class="liste_titre center parentonrightofpage">';
1522 $formpropal->selectProposalStatus($search_status, 1, 0, 1,
'customer',
'search_status',
'search_status width100 onrightofpage');
1527 print
'<td class="liste_titre center">';
1528 $searchpicto = $form->showFilterButtons();
1544print
'<tr class="liste_titre">';
1546 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1549if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1550 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'p.ref',
'', $param,
'', $sortfield, $sortorder);
1553if (!empty($arrayfields[
'p.ref_client'][
'checked'])) {
1554 print_liste_field_titre($arrayfields[
'p.ref_client'][
'label'], $_SERVER[
"PHP_SELF"],
'p.ref_client',
'', $param,
'', $sortfield, $sortorder);
1557if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1558 print_liste_field_titre($arrayfields[
'pr.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'pr.ref',
'', $param,
'', $sortfield, $sortorder);
1561if (!empty($arrayfields[
'pr.title'][
'checked'])) {
1562 print_liste_field_titre($arrayfields[
'pr.title'][
'label'], $_SERVER[
"PHP_SELF"],
'pr.title',
'', $param,
'', $sortfield, $sortorder);
1565if (!empty($arrayfields[
's.nom'][
'checked'])) {
1566 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
's.nom',
'', $param,
'', $sortfield, $sortorder);
1569if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1570 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
's.name_alias',
'', $param,
'', $sortfield, $sortorder);
1573if (!empty($arrayfields[
's.town'][
'checked'])) {
1574 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1577if (!empty($arrayfields[
's.zip'][
'checked'])) {
1578 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1581if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1582 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1585if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1586 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1589if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1590 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1593if (!empty($arrayfields[
'p.date'][
'checked'])) {
1594 print_liste_field_titre($arrayfields[
'p.date'][
'label'], $_SERVER[
"PHP_SELF"],
'p.datep',
'', $param,
'', $sortfield, $sortorder,
'center ');
1597if (!empty($arrayfields[
'p.fin_validite'][
'checked'])) {
1598 print_liste_field_titre($arrayfields[
'p.fin_validite'][
'label'], $_SERVER[
"PHP_SELF"],
'dfv',
'', $param,
'', $sortfield, $sortorder,
'center ');
1601if (!empty($arrayfields[
'p.date_livraison'][
'checked'])) {
1602 print_liste_field_titre($arrayfields[
'p.date_livraison'][
'label'], $_SERVER[
"PHP_SELF"],
'p.date_livraison',
'', $param,
'', $sortfield, $sortorder,
'center ');
1605if (!empty($arrayfields[
'p.date_signature'][
'checked'])) {
1606 print_liste_field_titre($arrayfields[
'p.date_signature'][
'label'], $_SERVER[
"PHP_SELF"],
'p.date_signature',
'', $param,
'', $sortfield, $sortorder,
'center ');
1609if (!empty($arrayfields[
'ava.rowid'][
'checked'])) {
1610 print_liste_field_titre($arrayfields[
'ava.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
'availability',
'', $param,
'', $sortfield, $sortorder);
1613if (!empty($arrayfields[
'p.fk_shipping_method'][
'checked'])) {
1614 print_liste_field_titre($arrayfields[
'p.fk_shipping_method'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_shipping_method",
"", $param,
'', $sortfield, $sortorder);
1617if (!empty($arrayfields[
'p.fk_input_reason'][
'checked'])) {
1618 print_liste_field_titre($arrayfields[
'p.fk_input_reason'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_input_reason",
"", $param,
'', $sortfield, $sortorder);
1621if (!empty($arrayfields[
'p.fk_cond_reglement'][
'checked'])) {
1622 print_liste_field_titre($arrayfields[
'p.fk_cond_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_cond_reglement",
"", $param,
'', $sortfield, $sortorder);
1625if (!empty($arrayfields[
'p.fk_mode_reglement'][
'checked'])) {
1626 print_liste_field_titre($arrayfields[
'p.fk_mode_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_mode_reglement",
"", $param,
'', $sortfield, $sortorder);
1629if (!empty($arrayfields[
'p.total_ht'][
'checked'])) {
1630 print_liste_field_titre($arrayfields[
'p.total_ht'][
'label'], $_SERVER[
"PHP_SELF"],
'p.total_ht',
'', $param,
'', $sortfield, $sortorder,
'right ');
1633if (!empty($arrayfields[
'p.total_tva'][
'checked'])) {
1634 print_liste_field_titre($arrayfields[
'p.total_tva'][
'label'], $_SERVER[
"PHP_SELF"],
'p.total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1637if (!empty($arrayfields[
'p.total_ttc'][
'checked'])) {
1638 print_liste_field_titre($arrayfields[
'p.total_ttc'][
'label'], $_SERVER[
"PHP_SELF"],
'p.total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1641if (!empty($arrayfields[
'p.total_ht_invoiced'][
'checked'])) {
1642 print_liste_field_titre($arrayfields[
'p.total_ht_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1645if (!empty($arrayfields[
'p.total_invoiced'][
'checked'])) {
1646 print_liste_field_titre($arrayfields[
'p.total_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1649if (!empty($arrayfields[
'p.multicurrency_code'][
'checked'])) {
1650 print_liste_field_titre($arrayfields[
'p.multicurrency_code'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_code',
'', $param,
'', $sortfield, $sortorder);
1653if (!empty($arrayfields[
'p.multicurrency_tx'][
'checked'])) {
1654 print_liste_field_titre($arrayfields[
'p.multicurrency_tx'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_tx',
'', $param,
'', $sortfield, $sortorder);
1657if (!empty($arrayfields[
'p.multicurrency_total_ht'][
'checked'])) {
1658 print_liste_field_titre($arrayfields[
'p.multicurrency_total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_total_ht',
'', $param,
'', $sortfield, $sortorder,
'right ');
1661if (!empty($arrayfields[
'p.multicurrency_total_tva'][
'checked'])) {
1662 print_liste_field_titre($arrayfields[
'p.multicurrency_total_tva'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1665if (!empty($arrayfields[
'p.multicurrency_total_ttc'][
'checked'])) {
1666 print_liste_field_titre($arrayfields[
'p.multicurrency_total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1669if (!empty($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'checked'])) {
1670 print_liste_field_titre($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1673if (!empty($arrayfields[
'p.multicurrency_total_invoiced'][
'checked'])) {
1674 print_liste_field_titre($arrayfields[
'p.multicurrency_total_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1677if (!empty($arrayfields[
'u.login'][
'checked'])) {
1678 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'', $sortfield, $sortorder);
1681if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
1682 print_liste_field_titre($arrayfields[
'sale_representative'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"",
"$param",
'', $sortfield, $sortorder);
1685if (!empty($arrayfields[
'total_pa'][
'checked'])) {
1686 print_liste_field_titre($arrayfields[
'total_pa'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1689if (!empty($arrayfields[
'total_margin'][
'checked'])) {
1690 print_liste_field_titre($arrayfields[
'total_margin'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1693if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
1694 print_liste_field_titre($arrayfields[
'total_margin_rate'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1697if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
1698 print_liste_field_titre($arrayfields[
'total_mark_rate'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1702include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1705 'arrayfields' => $arrayfields,
1707 'sortfield' => $sortfield,
1708 'sortorder' => $sortorder,
1709 'totalarray' => &$totalarray,
1712$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1714print $hookmanager->resPrint;
1715if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1716 print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowraponall ');
1719if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1720 print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"p.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowraponall ');
1723if (!empty($arrayfields[
'p.date_cloture'][
'checked'])) {
1724 print_liste_field_titre($arrayfields[
'p.date_cloture'][
'label'], $_SERVER[
"PHP_SELF"],
"p.date_cloture",
"", $param,
'', $sortfield, $sortorder,
'center nowraponall ');
1727if (!empty($arrayfields[
'p.note_public'][
'checked'])) {
1728 print_liste_field_titre($arrayfields[
'p.note_public'][
'label'], $_SERVER[
"PHP_SELF"],
"p.note_public",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1731if (!empty($arrayfields[
'p.note_private'][
'checked'])) {
1732 print_liste_field_titre($arrayfields[
'p.note_private'][
'label'], $_SERVER[
"PHP_SELF"],
"p.note_private",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1736if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1737 print_liste_field_titre($arrayfields[
'p.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"p.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1740if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1741 print_liste_field_titre($arrayfields[
'p.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
1745 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1755$with_margin_info =
false;
1756if (isModEnabled(
'margin') && (
1757 !empty($arrayfields[
'total_pa'][
'checked'])
1758 || !empty($arrayfields[
'total_margin'][
'checked'])
1759 || !empty($arrayfields[
'total_margin_rate'][
'checked'])
1760 || !empty($arrayfields[
'total_mark_rate'][
'checked'])
1763 $with_margin_info =
true;
1773$imaxinloop = ($limit ? min($num, $limit) : $num);
1774while ($i < $imaxinloop) {
1775 $obj = $db->fetch_object($resql);
1779 if ($search_option) {
1780 $param .=
"&search_option=".urlencode($search_option);
1785 $object->ref_customer = $obj->ref_client;
1786 $object->note_public = $obj->note_public;
1787 $object->note_private = $obj->note_private;
1788 $object->statut = $obj->status;
1789 $object->status = $obj->status;
1791 $companystatic->id = $obj->socid;
1792 $companystatic->name = $obj->name;
1793 $companystatic->name_alias = $obj->alias;
1794 $companystatic->client = $obj->client;
1795 $companystatic->fournisseur = $obj->fournisseur;
1796 $companystatic->code_client = $obj->code_client;
1797 $companystatic->email = $obj->email;
1798 $companystatic->phone = $obj->phone;
1799 $companystatic->address = $obj->address;
1800 $companystatic->zip = $obj->zip;
1801 $companystatic->town = $obj->town;
1802 $companystatic->country_code = $obj->country_code;
1804 $projectstatic->id = $obj->project_id;
1805 $projectstatic->ref = $obj->project_ref;
1806 $projectstatic->title = $obj->project_label;
1808 $totalInvoicedHT = 0;
1809 $totalInvoicedTTC = 0;
1810 $multicurrency_totalInvoicedHT = 0;
1811 $multicurrency_totalInvoicedTTC = 0;
1815 if (!empty($TInvoiceData)) {
1816 foreach ($TInvoiceData as $invoiceData) {
1818 $invoice->fetch($invoiceData->facid);
1824 $totalInvoicedHT += $invoice->total_ht;
1825 $totalInvoicedTTC += $invoice->total_ttc;
1826 $multicurrency_totalInvoicedHT += $invoice->multicurrency_total_ht;
1827 $multicurrency_totalInvoicedTTC += $invoice->multicurrency_total_ttc;
1831 $marginInfo = array();
1832 if ($with_margin_info) {
1834 $marginInfo = $formmargin->getMarginInfosArray($object);
1835 $total_ht += $obj->total_ht;
1836 $total_margin += $marginInfo[
'total_margin'];
1839 if ($mode ==
'kanban') {
1841 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1842 print
'<div class="box-flex-container kanban">';
1845 $object->thirdparty = $companystatic;
1846 $userstatic->fetch($obj->fk_user_author);
1847 $arrayofparams = array(
'selected' => in_array(
$object->id, $arrayofselected),
'authorlink' => $userstatic->getNomUrl(-2),
'projectlink' => $projectstatic->getNomUrl(2));
1848 print
$object->getKanbanView(
'', $arrayofparams);
1849 if ($i == ($imaxinloop - 1)) {
1854 print
'<tr data-rowid="'.$object->id.
'" class="oddeven status'.
$object->status.((getDolGlobalInt(
'MAIN_FINISHED_LINES_OPACITY') == 1 && $obj->status > 1) ?
' opacitymedium' :
'').
'">';
1858 print
'<td class="nowrap center">';
1859 if ($massactionbutton || $massaction) {
1861 if (in_array($obj->rowid, $arrayofselected)) {
1864 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1872 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1873 print
'<td class="nowraponall">';
1875 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1877 print
'<td class="nobordernopadding nowraponall">';
1878 print
$object->getNomUrl(1,
'',
'', 0, 1, (isset(
$conf->global->PROPAL_LIST_SHOW_NOTES) ?
$conf->global->PROPAL_LIST_SHOW_NOTES : 1));
1883 $warnornote .=
img_warning($langs->trans(
"Late"));
1886 print
'<td style="min-width: 20px" class="nobordernopadding nowrap">';
1891 print
'<td width="16" class="nobordernopadding right">';
1894 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
1895 print $formfile->getDocumentsLink(
$object->element, $filename, $filedir);
1896 print
'</td></tr></table>';
1904 if (!empty($arrayfields[
'p.ref_client'][
'checked'])) {
1906 print
'<td class="nowrap tdoverflowmax200">';
1914 if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1916 print
'<td class="nowraponall">';
1917 if ($obj->project_id > 0) {
1918 print $projectstatic->getNomUrl(1);
1926 if (!empty($arrayfields[
'pr.title'][
'checked'])) {
1928 print
'<td class="nowrap">';
1929 if ($obj->project_id > 0) {
1939 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1940 print
'<td class="tdoverflowmax150">';
1941 print $companystatic->getNomUrl(1,
'customer', 0, 0, 1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
1949 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1950 print
'<td class="tdoverflowmax200">';
1959 if (!empty($arrayfields[
's.town'][
'checked'])) {
1960 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->town).
'">';
1968 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1969 print
'<td class="nocellnopadd">';
1977 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1978 print
"<td>".$obj->state_name.
"</td>\n";
1984 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1985 $tmparray =
getCountry($obj->fk_pays,
'all');
1986 print
'<td class="center tdoverflowmax100" title="'.dolPrintHTML($tmparray[
'label']).
'">';
1987 print $tmparray[
'label'];
1994 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1995 if (!is_array($typenArray) || empty($typenArray)) {
1996 $typenArray = $formcompany->typent_array(1);
1999 print
'<td class="center">';
2000 if (!empty($obj->typent_code)) {
2001 print $typenArray[$obj->typent_code];
2010 if (!empty($arrayfields[
'p.date'][
'checked'])) {
2011 print
'<td class="center">';
2020 if (!empty($arrayfields[
'p.fin_validite'][
'checked'])) {
2022 print
'<td class="center">'.dol_print_date($db->jdate($obj->dfv),
'day');
2025 print
'<td> </td>';
2032 if (!empty($arrayfields[
'p.date_livraison'][
'checked'])) {
2033 if ($obj->ddelivery) {
2034 print
'<td class="center">'.dol_print_date($db->jdate($obj->ddelivery),
'day');
2037 print
'<td> </td>';
2044 if (!empty($arrayfields[
'p.date_signature'][
'checked'])) {
2045 if ($obj->dsignature) {
2046 print
'<td class="center">'.dol_print_date($db->jdate($obj->dsignature),
'day');
2049 print
'<td> </td>';
2056 if (!empty($arrayfields[
'ava.rowid'][
'checked'])) {
2057 print
'<td class="center">';
2058 $form->form_availability(
'0', $obj->availability,
'none', 1);
2065 if (!empty($arrayfields[
'p.fk_shipping_method'][
'checked'])) {
2067 $form->formSelectShippingMethod(
'', $obj->fk_shipping_method,
'none', 1);
2074 if (!empty($arrayfields[
'p.fk_input_reason'][
'checked'])) {
2075 $labelInputReason =
'';
2076 if ($obj->fk_input_reason > 0) {
2077 $labelInputReason = $form->cache_demand_reason[$obj->fk_input_reason][
'label'];
2079 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($labelInputReason).
'">';
2087 if (!empty($arrayfields[
'p.fk_cond_reglement'][
'checked'])) {
2089 $form->form_conditions_reglement($_SERVER[
'PHP_SELF'], $obj->fk_cond_reglement,
'none', 0,
'', 1, $obj->deposit_percent);
2096 if (!empty($arrayfields[
'p.fk_mode_reglement'][
'checked'])) {
2098 $form->form_modes_reglement($_SERVER[
'PHP_SELF'], $obj->fk_mode_reglement,
'none',
'', -1);
2105 if (!empty($arrayfields[
'p.total_ht'][
'checked'])) {
2106 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ht).
"</span></td>\n";
2113 if (empty($totalarray[
'val'][
'p.total_ht'])) {
2114 $totalarray[
'val'][
'p.total_ht'] = $obj->total_ht;
2116 $totalarray[
'val'][
'p.total_ht'] += $obj->total_ht;
2120 if (!empty($arrayfields[
'p.total_tva'][
'checked'])) {
2121 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_tva).
"</span></td>\n";
2128 if (empty($totalarray[
'val'][
'p.total_tva'])) {
2129 $totalarray[
'val'][
'p.total_tva'] = $obj->total_tva;
2131 $totalarray[
'val'][
'p.total_tva'] += $obj->total_tva;
2135 if (!empty($arrayfields[
'p.total_ttc'][
'checked'])) {
2136 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
"</span></td>\n";
2143 if (empty($totalarray[
'val'][
'p.total_ttc'])) {
2144 $totalarray[
'val'][
'p.total_ttc'] = $obj->total_ttc;
2146 $totalarray[
'val'][
'p.total_ttc'] += $obj->total_ttc;
2150 if (!empty($arrayfields[
'p.total_ht_invoiced'][
'checked'])) {
2151 print
'<td class="nowrap right"><span class="amount">'.price($totalInvoicedHT).
"</span></td>\n";
2158 if (empty($totalarray[
'val'][
'p.total_ht_invoiced'])) {
2159 $totalarray[
'val'][
'p.total_ht_invoiced'] = $totalInvoicedHT;
2161 $totalarray[
'val'][
'p.total_ht_invoiced'] += $totalInvoicedHT;
2165 if (!empty($arrayfields[
'p.total_invoiced'][
'checked'])) {
2166 print
'<td class="nowrap right"><span class="amount">'.price($totalInvoicedTTC).
"</span></td>\n";
2173 if (empty($totalarray[
'val'][
'p.total_invoiced'])) {
2174 $totalarray[
'val'][
'p.total_invoiced'] = $totalInvoicedTTC;
2176 $totalarray[
'val'][
'p.total_invoiced'] += $totalInvoicedTTC;
2180 if (!empty($arrayfields[
'p.multicurrency_code'][
'checked'])) {
2181 print
'<td class="nowrap">'.$obj->multicurrency_code.
' - '.$langs->trans(
'Currency'.$obj->multicurrency_code).
"</td>\n";
2188 if (!empty($arrayfields[
'p.multicurrency_tx'][
'checked'])) {
2189 print
'<td class="nowrap">';
2190 $form->form_multicurrency_rate($_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid, $obj->multicurrency_tx,
'none', $obj->multicurrency_code);
2197 if (!empty($arrayfields[
'p.multicurrency_total_ht'][
'checked'])) {
2198 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht).
"</span></td>\n";
2204 if (!empty($arrayfields[
'p.multicurrency_total_tva'][
'checked'])) {
2205 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_tva).
"</span></td>\n";
2211 if (!empty($arrayfields[
'p.multicurrency_total_ttc'][
'checked'])) {
2212 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc).
"</span></td>\n";
2218 if (!empty($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'checked'])) {
2219 print
'<td class="nowrap right"><span class="amount">'.price($multicurrency_totalInvoicedHT).
"</span></td>\n";
2225 if (!empty($arrayfields[
'p.multicurrency_total_invoiced'][
'checked'])) {
2226 print
'<td class="nowrap right"><span class="amount">'.price($multicurrency_totalInvoicedTTC).
"</span></td>\n";
2232 $userstatic->id = $obj->fk_user_author;
2233 $userstatic->login = $obj->login;
2234 $userstatic->lastname = $obj->lastname;
2235 $userstatic->firstname = $obj->firstname;
2236 $userstatic->email = $obj->user_email;
2237 $userstatic->status = $obj->user_statut;
2238 $userstatic->entity = $obj->user_entity;
2239 $userstatic->photo = $obj->photo;
2240 $userstatic->office_phone = $obj->office_phone;
2241 $userstatic->office_fax = $obj->office_fax;
2242 $userstatic->user_mobile = $obj->user_mobile;
2243 $userstatic->job = $obj->job;
2244 $userstatic->gender = $obj->gender;
2247 if (!empty($arrayfields[
'u.login'][
'checked'])) {
2248 print
'<td class="tdoverflowmax150">';
2249 if ($userstatic->id) {
2250 print $userstatic->getNomUrl(-1);
2258 if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
2260 print
'<td class="tdoverflowmax125">';
2261 if ($obj->socid > 0) {
2262 $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
2263 if ($listsalesrepresentatives < 0) {
2266 $nbofsalesrepresentative = count($listsalesrepresentatives);
2267 if ($nbofsalesrepresentative > 6) {
2269 print $nbofsalesrepresentative;
2270 } elseif ($nbofsalesrepresentative > 0) {
2271 $userstatic =
new User($db);
2273 foreach ($listsalesrepresentatives as $val) {
2274 $userstatic->id = $val[
'id'];
2275 $userstatic->lastname = $val[
'lastname'];
2276 $userstatic->firstname = $val[
'firstname'];
2277 $userstatic->email = $val[
'email'];
2278 $userstatic->status = $val[
'statut'];
2279 $userstatic->entity = $val[
'entity'];
2280 $userstatic->photo = $val[
'photo'];
2281 $userstatic->login = $val[
'login'];
2282 $userstatic->office_phone = $val[
'office_phone'];
2283 $userstatic->office_fax = $val[
'office_fax'];
2284 $userstatic->user_mobile = $val[
'user_mobile'];
2285 $userstatic->job = $val[
'job'];
2286 $userstatic->gender = $val[
'gender'];
2288 print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1,
'', 0, 0, 12) : $userstatic->getNomUrl(-2);
2290 if ($j < $nbofsalesrepresentative) {
2307 if (!empty($arrayfields[
'total_pa'][
'checked'])) {
2308 print
'<td class="right nowrap">'.price($marginInfo[
'pa_total']).
'</td>';
2314 if (!empty($arrayfields[
'total_margin'][
'checked'])) {
2315 print
'<td class="right nowrap">'.price($marginInfo[
'total_margin']).
'</td>';
2322 $totalarray[
'val'][
'total_margin'] = $total_margin;
2325 if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
2326 print
'<td class="right nowrap">'.(($marginInfo[
'total_margin_rate'] ==
'') ?
'' :
price($marginInfo[
'total_margin_rate'], 0,
'', 0, 0, 2).
'%').
'</td>';
2332 if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
2333 print
'<td class="right nowrap">'.(($marginInfo[
'total_mark_rate'] ==
'') ?
'' :
price($marginInfo[
'total_mark_rate'], 0,
'', 0, 0, 2).
'%').
'</td>';
2340 if ($i >= $imaxinloop - 1) {
2341 if (!empty($total_ht)) {
2350 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
2352 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
2353 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
2354 print $hookmanager->resPrint;
2356 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
2357 print
'<td class="nowraponall center">';
2358 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
2365 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
2366 print
'<td class="nowraponall center">';
2367 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
2374 if (!empty($arrayfields[
'p.date_cloture'][
'checked'])) {
2375 print
'<td class="nowraponall center">';
2376 print
dol_print_date($db->jdate($obj->date_cloture),
'dayhour',
'tzuser');
2383 if (!empty($arrayfields[
'p.note_public'][
'checked'])) {
2384 print
'<td class="sensiblehtmlcontent center">';
2385 print
'<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(
dolGetFirstLineOfText($obj->note_public, 5)).
'</div>';
2392 if (!empty($arrayfields[
'p.note_private'][
'checked'])) {
2393 print
'<td class="sensiblehtmlcontent center">';
2394 print
'<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(
dolGetFirstLineOfText($obj->note_private, 5)).
'</div>';
2402 if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
2403 print
'<td class="nowrap center">'.dol_escape_htmltag($obj->import_key).
'</td>';
2410 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
2411 print
'<td class="nowrap center">'.$object->getLibStatut(5).
'</td>';
2418 print
'<td class="nowrap center">';
2419 if ($massactionbutton || $massaction) {
2421 if (in_array($obj->rowid, $arrayofselected)) {
2424 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2440include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2445 foreach ($arrayfields as $key => $val) {
2446 if (!empty($val[
'checked'])) {
2450 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2455$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
2456$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2457print $hookmanager->resPrint;
2459print
'</table>'.
"\n";
2462print
'</form>'.
"\n";
2464if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
2465 $hidegeneratedfilelistifempty = 1;
2466 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2467 $hidegeneratedfilelistifempty = 0;
2470 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
2474 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2475 $urlsource .= str_replace(
'&',
'&', $param);
2477 $filedir = $diroutputmassaction;
2478 $genallowed = $permissiontoread;
2479 $delallowed = $permissiontoadd;
2481 print $formfile->showdocuments(
'massfilesarea_proposals',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
$id
Support class for third parties, contacts, members, users or resources.
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage invoices.
const TYPE_DEPOSIT
Deposit invoice.
Class to manage projects.
Class to manage proposals.
const STATUS_VALIDATED
Validated status.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
getCountry($searchkey, $withcode='', $dbtouse=null, $outputlangs=null, $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=0)
Set event message in dol_events session object.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.