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';
62$langs->loadLangs(array(
'companies',
'propal',
'compta',
'bills',
'orders',
'products',
'deliveries',
'categories'));
63if (isModEnabled(
"shipping")) {
64 $langs->loadLangs(array(
'sendings'));
70$action =
GETPOST(
'action',
'aZ09');
71$massaction =
GETPOST(
'massaction',
'alpha');
73$confirm =
GETPOST(
'confirm',
'alpha');
74$cancel =
GETPOST(
'cancel',
'alpha');
75$toselect =
GETPOST(
'toselect',
'array');
76$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'proposallist';
77$optioncss =
GETPOST(
'optioncss',
'alpha');
78$mode =
GETPOST(
'mode',
'alpha');
81$search_all = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
83if ($search_user == -1) {
88$search_refcustomer =
GETPOST(
'search_refcustomer',
'alpha');
89$search_refproject =
GETPOST(
'search_refproject',
'alpha');
90$search_project =
GETPOST(
'search_project',
'alpha');
91$search_societe =
GETPOST(
'search_societe',
'alpha');
92$search_societe_alias =
GETPOST(
'search_societe_alias',
'alpha');
93$search_montant_ht =
GETPOST(
'search_montant_ht',
'alpha');
94$search_montant_vat =
GETPOST(
'search_montant_vat',
'alpha');
95$search_montant_ttc =
GETPOST(
'search_montant_ttc',
'alpha');
96$search_warehouse =
GETPOST(
'search_warehouse',
'alpha');
97$search_multicurrency_code =
GETPOST(
'search_multicurrency_code',
'alpha');
98$search_multicurrency_tx =
GETPOST(
'search_multicurrency_tx',
'alpha');
99$search_multicurrency_montant_ht =
GETPOST(
'search_multicurrency_montant_ht',
'alpha');
100$search_multicurrency_montant_vat =
GETPOST(
'search_multicurrency_montant_vat',
'alpha');
101$search_multicurrency_montant_ttc =
GETPOST(
'search_multicurrency_montant_ttc',
'alpha');
102$search_login =
GETPOST(
'search_login',
'alpha');
103$search_product_category =
GETPOSTINT(
'search_product_category');
104$search_town =
GETPOST(
'search_town',
'alpha');
105$search_zip =
GETPOST(
'search_zip',
'alpha');
106$search_state =
GETPOST(
"search_state");
107$search_country =
GETPOST(
"search_country",
'aZ09');
108$search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'intcomma');
109$search_date_startday =
GETPOSTINT(
'search_date_startday');
110$search_date_startmonth =
GETPOSTINT(
'search_date_startmonth');
111$search_date_startyear =
GETPOSTINT(
'search_date_startyear');
112$search_date_endday =
GETPOSTINT(
'search_date_endday');
113$search_date_endmonth =
GETPOSTINT(
'search_date_endmonth');
114$search_date_endyear =
GETPOSTINT(
'search_date_endyear');
115$search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
116$search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
117$search_date_end_startday =
GETPOSTINT(
'search_date_end_startday');
118$search_date_end_startmonth =
GETPOSTINT(
'search_date_end_startmonth');
119$search_date_end_startyear =
GETPOSTINT(
'search_date_end_startyear');
120$search_date_end_endday =
GETPOSTINT(
'search_date_end_endday');
121$search_date_end_endmonth =
GETPOSTINT(
'search_date_end_endmonth');
122$search_date_end_endyear =
GETPOSTINT(
'search_date_end_endyear');
123$search_date_end_start =
dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);
124$search_date_end_end =
dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
125$search_date_delivery_startday =
GETPOSTINT(
'search_date_delivery_startday');
126$search_date_delivery_startmonth =
GETPOSTINT(
'search_date_delivery_startmonth');
127$search_date_delivery_startyear =
GETPOSTINT(
'search_date_delivery_startyear');
128$search_date_delivery_endday =
GETPOSTINT(
'search_date_delivery_endday');
129$search_date_delivery_endmonth =
GETPOSTINT(
'search_date_delivery_endmonth');
130$search_date_delivery_endyear =
GETPOSTINT(
'search_date_delivery_endyear');
131$search_date_delivery_start =
dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear);
132$search_date_delivery_end =
dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear);
133$search_availability =
GETPOST(
'search_availability',
'intcomma');
134$search_categ_cus =
GETPOST(
"search_categ_cus",
'intcomma');
135$search_fk_cond_reglement =
GETPOST(
"search_fk_cond_reglement",
'intcomma');
136$search_fk_shipping_method =
GETPOST(
"search_fk_shipping_method",
'intcomma');
137$search_fk_input_reason =
GETPOST(
"search_fk_input_reason",
'intcomma');
138$search_fk_mode_reglement =
GETPOST(
"search_fk_mode_reglement",
'intcomma');
139$search_date_signature_startday =
GETPOSTINT(
'search_date_signature_startday');
140$search_date_signature_startmonth =
GETPOSTINT(
'search_date_signature_startmonth');
141$search_date_signature_startyear =
GETPOSTINT(
'search_date_signature_startyear');
142$search_date_signature_endday =
GETPOSTINT(
'search_date_signature_endday');
143$search_date_signature_endmonth =
GETPOSTINT(
'search_date_signature_endmonth');
144$search_date_signature_endyear =
GETPOSTINT(
'search_date_signature_endyear');
145$search_date_signature_start =
dol_mktime(0, 0, 0, $search_date_signature_startmonth, $search_date_signature_startday, $search_date_signature_startyear);
146$search_date_signature_end =
dol_mktime(23, 59, 59, $search_date_signature_endmonth, $search_date_signature_endday, $search_date_signature_endyear);
147$search_status =
GETPOST(
'search_status',
'alpha');
148$search_note_public =
GETPOST(
'search_note_public',
'alpha');
150$search_option =
GETPOST(
'search_option',
'alpha');
151if ($search_option ==
'late') {
152 $search_status =
'1';
153 $object_statut =
'1';
158$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
159$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
161if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
165$offset = $limit * $page;
166$pageprev = $page - 1;
167$pagenext = $page + 1;
169 $sortfield =
'p.ref';
179if (!empty($user->socid)) {
180 $socid = $user->socid;
185 $dbtable =
'&societe';
189$diroutputmassaction = $conf->propal->multidir_output[$conf->entity].
'/temp/massgeneration/'.$user->id;
193$hookmanager->initHooks(array(
'propallist'));
197$extrafields->fetch_name_optionals_label(
$object->table_element);
199$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
202$fieldstosearchall = array(
204 'p.ref_client' =>
'RefCustomer',
205 'pd.description' =>
'Description',
206 's.nom' =>
"ThirdParty",
207 's.name_alias' =>
"AliasNameShort",
210 'p.note_public' =>
'NotePublic',
212if (empty($user->socid)) {
213 $fieldstosearchall[
"p.note_private"] =
"NotePrivate";
217$checkedtypetiers = 0;
219 'p.ref' => array(
'label' =>
"Ref",
'checked' => 1),
220 'p.ref_client' => array(
'label' =>
"RefCustomer",
'checked' => -1),
221 'pr.ref' => array(
'label' =>
"ProjectRef",
'checked' => 1,
'enabled' => (isModEnabled(
'project') ? 1 : 0)),
222 'pr.title' => array(
'label' =>
"ProjectLabel",
'checked' => 0,
'enabled' => (isModEnabled(
'project') ? 1 : 0)),
223 's.nom' => array(
'label' =>
"ThirdParty",
'checked' => 1),
224 's.name_alias' => array(
'label' =>
"AliasNameShort",
'checked' => -1),
225 's.town' => array(
'label' =>
"Town",
'checked' => -1),
226 's.zip' => array(
'label' =>
"Zip",
'checked' => -1),
227 'state.nom' => array(
'label' =>
"StateShort",
'checked' => 0),
228 'country.code_iso' => array(
'label' =>
"Country",
'checked' => 0),
229 'typent.code' => array(
'label' =>
"ThirdPartyType",
'checked' => $checkedtypetiers),
230 'p.date' => array(
'label' =>
"DatePropal",
'checked' => 1),
231 'p.fin_validite' => array(
'label' =>
"DateEnd",
'checked' => 1),
232 'p.date_livraison' => array(
'label' =>
"DeliveryDate",
'checked' => 0),
233 'p.date_signature' => array(
'label' =>
"DateSigning",
'checked' => 0),
234 'ava.rowid' => array(
'label' =>
"AvailabilityPeriod",
'checked' => 0),
235 'p.fk_shipping_method' => array(
'label' =>
"SendingMethod",
'checked' => 0,
'enabled' => isModEnabled(
"shipping")),
236 'p.fk_input_reason' => array(
'label' =>
"Origin",
'checked' => 0,
'enabled' => 1),
237 'p.fk_cond_reglement' => array(
'label' =>
"PaymentConditionsShort",
'checked' => 0),
238 'p.fk_mode_reglement' => array(
'label' =>
"PaymentMode",
'checked' => 0),
239 'p.total_ht' => array(
'label' =>
"AmountHT",
'checked' => 1),
240 'p.total_tva' => array(
'label' =>
"AmountVAT",
'checked' => 0),
241 'p.total_ttc' => array(
'label' =>
"AmountTTC",
'checked' => 0),
242 'p.total_ht_invoiced' => array(
'label' =>
"AmountInvoicedHT",
'checked' => 0,
'enabled' =>
getDolGlobalString(
'PROPOSAL_SHOW_INVOICED_AMOUNT')),
243 'p.total_invoiced' => array(
'label' =>
"AmountInvoicedTTC",
'checked' => 0,
'enabled' =>
getDolGlobalString(
'PROPOSAL_SHOW_INVOICED_AMOUNT')),
244 'p.multicurrency_code' => array(
'label' =>
'Currency',
'checked' => 0,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
245 'p.multicurrency_tx' => array(
'label' =>
'CurrencyRate',
'checked' => 0,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
246 'p.multicurrency_total_ht' => array(
'label' =>
'MulticurrencyAmountHT',
'checked' => 0,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
247 'p.multicurrency_total_tva' => array(
'label' =>
'MulticurrencyAmountVAT',
'checked' => 0,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
248 'p.multicurrency_total_ttc' => array(
'label' =>
'MulticurrencyAmountTTC',
'checked' => 0,
'enabled' => (!isModEnabled(
"multicurrency") ? 0 : 1)),
249 'p.multicurrency_total_ht_invoiced' => array(
'label' =>
'MulticurrencyAmountInvoicedHT',
'checked' => 0,
'enabled' => isModEnabled(
"multicurrency") &&
getDolGlobalString(
'PROPOSAL_SHOW_INVOICED_AMOUNT')),
250 'p.multicurrency_total_invoiced' => array(
'label' =>
'MulticurrencyAmountInvoicedTTC',
'checked' => 0,
'enabled' => isModEnabled(
"multicurrency") &&
getDolGlobalString(
'PROPOSAL_SHOW_INVOICED_AMOUNT')),
251 'u.login' => array(
'label' =>
"Author",
'checked' => 1,
'position' => 10),
252 'sale_representative' => array(
'label' =>
"SaleRepresentativesOfThirdParty",
'checked' => -1),
253 'total_pa' => array(
'label' => (
getDolGlobalString(
'MARGIN_TYPE') ==
'1' ?
'BuyingPrice' :
'CostPrice'),
'checked' => 0,
'position' => 300,
'enabled' => (!isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') ? 0 : 1)),
254 'total_margin' => array(
'label' =>
'Margin',
'checked' => 0,
'position' => 301,
'enabled' => (!isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') ? 0 : 1)),
255 'total_margin_rate' => array(
'label' =>
'MarginRate',
'checked' => 0,
'position' => 302,
'enabled' => (!isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') || !
getDolGlobalString(
'DISPLAY_MARGIN_RATES') ? 0 : 1)),
256 'total_mark_rate' => array(
'label' =>
'MarkRate',
'checked' => 0,
'position' => 303,
'enabled' => (!isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') || !
getDolGlobalString(
'DISPLAY_MARK_RATES') ? 0 : 1)),
257 'p.datec' => array(
'label' =>
"DateCreation",
'checked' => 0,
'position' => 500),
258 'p.tms' => array(
'label' =>
"DateModificationShort",
'checked' => 0,
'position' => 500),
259 'p.date_cloture' => array(
'label' =>
"DateClosing",
'checked' => 0,
'position' => 500),
260 'p.note_public' => array(
'label' =>
'NotePublic',
'checked' => 0,
'position' => 510,
'enabled' => (!
getDolGlobalInt(
'MAIN_LIST_HIDE_PUBLIC_NOTES'))),
261 'p.note_private' => array(
'label' =>
'NotePrivate',
'checked' => 0,
'position' => 511,
'enabled' => (!
getDolGlobalInt(
'MAIN_LIST_HIDE_PRIVATE_NOTES'))),
262 'p.fk_statut' => array(
'label' =>
"Status",
'checked' => 1,
'position' => 1000),
289if (!$user->hasRight(
'societe',
'client',
'voir')) {
290 $search_sale = $user->id;
294include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
297$permissiontoread = $user->hasRight(
'propal',
'lire');
298$permissiontoadd = $user->hasRight(
'propal',
'creer');
299$permissiontodelete = $user->hasRight(
'propal',
'supprimer');
301 $permissiontovalidate = $user->hasRight(
'propal',
'propal_advance',
'validate');
302 $permissiontoclose = $user->hasRight(
'propal',
'propal_advance',
'close');
303 $permissiontosendbymail = $user->hasRight(
'propal',
'propal_advance',
'send');
305 $permissiontovalidate = $user->hasRight(
'propal',
'creer');
306 $permissiontoclose = $user->hasRight(
'propal',
'creer');
307 $permissiontosendbymail = $user->hasRight(
'propal',
'lire');
315if (
GETPOST(
'cancel',
'alpha')) {
319if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
323$parameters = array(
'socid' => $socid,
'arrayfields' => &$arrayfields);
324$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
329if (empty($reshook)) {
331 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
334 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
338 $search_refcustomer =
'';
339 $search_refproject =
'';
340 $search_project =
'';
341 $search_societe =
'';
342 $search_societe_alias =
'';
343 $search_montant_ht =
'';
344 $search_montant_vat =
'';
345 $search_montant_ttc =
'';
346 $search_warehouse =
'';
347 $search_multicurrency_code =
'';
348 $search_multicurrency_tx =
'';
349 $search_multicurrency_montant_ht =
'';
350 $search_multicurrency_montant_vat =
'';
351 $search_multicurrency_montant_ttc =
'';
353 $search_product_category =
'';
358 $search_country =
'';
359 $search_type_thirdparty =
'';
360 $search_date_startday =
'';
361 $search_date_startmonth =
'';
362 $search_date_startyear =
'';
363 $search_date_endday =
'';
364 $search_date_endmonth =
'';
365 $search_date_endyear =
'';
366 $search_date_start =
'';
367 $search_date_end =
'';
368 $search_date_end_startday =
'';
369 $search_date_end_startmonth =
'';
370 $search_date_end_startyear =
'';
371 $search_date_end_endday =
'';
372 $search_date_end_endmonth =
'';
373 $search_date_end_endyear =
'';
374 $search_date_end_start =
'';
375 $search_date_end_end =
'';
376 $search_date_delivery_startday =
'';
377 $search_date_delivery_startmonth =
'';
378 $search_date_delivery_startyear =
'';
379 $search_date_delivery_endday =
'';
380 $search_date_delivery_endmonth =
'';
381 $search_date_delivery_endyear =
'';
382 $search_date_delivery_start =
'';
383 $search_date_delivery_end =
'';
384 $search_availability =
'';
387 $search_categ_cus = 0;
388 $search_fk_cond_reglement =
'';
389 $search_fk_shipping_method =
'';
390 $search_fk_input_reason =
'';
391 $search_fk_mode_reglement =
'';
392 $search_date_signature_startday =
'';
393 $search_date_signature_startmonth =
'';
394 $search_date_signature_startyear =
'';
395 $search_date_signature_endday =
'';
396 $search_date_signature_endmonth =
'';
397 $search_date_signature_endyear =
'';
398 $search_date_signature_start =
'';
399 $search_date_signature_end =
'';
401 $search_array_options = array();
406 $objectclass =
'Propal';
407 $objectlabel =
'Proposals';
408 $uploaddir = $conf->propal->multidir_output[$conf->entity];
409 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
412if ($action ==
'validate' && $permissiontovalidate) {
413 if (
GETPOST(
'confirm') ==
'yes') {
414 $tmpproposal =
new Propal($db);
417 foreach ($toselect as $checked) {
418 if ($tmpproposal->fetch($checked) > 0) {
419 if ($tmpproposal->statut == $tmpproposal::STATUS_DRAFT) {
420 if ($tmpproposal->valid($user) > 0) {
421 setEventMessages($langs->trans(
'hasBeenValidated', $tmpproposal->ref),
null,
'mesgs');
427 $langs->load(
"errors");
428 setEventMessages($langs->trans(
'ErrorIsNotADraft', $tmpproposal->ref),
null,
'errors');
444if ($action ==
"sign" && $permissiontoclose) {
445 if (
GETPOST(
'confirm') ==
'yes') {
446 $tmpproposal =
new Propal($db);
449 foreach ($toselect as $checked) {
450 if ($tmpproposal->fetch($checked) > 0) {
451 if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) {
452 $tmpproposal->statut = $tmpproposal::STATUS_SIGNED;
453 if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_SIGNED) >= 0) {
454 setEventMessages($tmpproposal->ref.
" ".$langs->trans(
'Signed'),
null,
'mesgs');
460 setEventMessage($langs->trans(
'MustBeValidatedToBeSigned', $tmpproposal->ref),
'errors');
476if ($action ==
"nosign" && $permissiontoclose) {
477 if (
GETPOST(
'confirm') ==
'yes') {
478 $tmpproposal =
new Propal($db);
481 foreach ($toselect as $checked) {
482 if ($tmpproposal->fetch($checked) > 0) {
483 if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED || (
getDolGlobalString(
'PROPAL_SKIP_ACCEPT_REFUSE') && $tmpproposal->statut == $tmpproposal::STATUS_DRAFT)) {
484 $tmpproposal->statut = $tmpproposal::STATUS_NOTSIGNED;
485 if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_NOTSIGNED) > 0) {
486 setEventMessage($tmpproposal->ref.
" ".$langs->trans(
'NoSigned'),
'mesgs');
492 setEventMessage($tmpproposal->ref.
" ".$langs->trans(
'CantBeNoSign'),
'errors');
509if (!$error && $massaction ===
'setbilled' && $permissiontoclose) {
512 $objecttmp =
new $objectclass($db);
514 foreach ($toselect as $toselectid) {
515 $result = $objecttmp->fetch($toselectid);
517 $result = $objecttmp->classifyBilled($user, 0);
548$form =
new Form($db);
553if (isModEnabled(
'margin')) {
556$companystatic =
new Societe($db);
557$projectstatic =
new Project($db);
560$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
561$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
564if ($search_all > 0) {
565 $sql =
'SELECT DISTINCT';
567$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,';
568$sql .=
" typent.code as typent_code,";
569$sql .=
" ava.rowid as availability,";
570$sql .=
" country.code as country_code,";
571$sql .=
" state.code_departement as state_code, state.nom as state_name,";
572$sql .=
' p.rowid, p.entity as propal_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.fk_user_author, p.datep as dp, p.fin_validite as dfv, p.date_livraison as ddelivery,';
573$sql .=
' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc,';
574$sql .=
' p.datec as date_creation, p.tms as date_modification, p.date_cloture as date_cloture,';
575$sql .=
' p.date_signature as dsignature,';
576$sql .=
' p.note_public, p.note_private,';
577$sql .=
' p.fk_cond_reglement,p.deposit_percent,p.fk_mode_reglement,p.fk_shipping_method,p.fk_input_reason,';
578$sql .=
" pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
579$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';
581if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
582 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
583 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
587$parameters = array();
588$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
589$sql .= $hookmanager->resPrint;
590$sql = preg_replace(
'/, $/',
'', $sql);
594$sql .=
' FROM '.MAIN_DB_PREFIX.
'societe as s';
595$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
596$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
597$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
599$sql .=
' INNER JOIN '.MAIN_DB_PREFIX.
'propal as p ON p.fk_soc = s.rowid';
600if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
601 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
604 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'propaldet as pd ON p.rowid = pd.fk_propal';
606$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON p.fk_user_author = u.rowid';
607$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as pr ON pr.rowid = p.fk_projet";
608$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_availability as ava on (ava.rowid = p.fk_availability)";
610$parameters = array();
611$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
612$sql .= $hookmanager->resPrint;
615$sql .=
' p.entity IN ('.getEntity(
'propal').
')';
625if ($search_country) {
626 $sql .=
" AND s.fk_pays IN (".$db->sanitize($db->escape($search_country)).
')';
628if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
629 $sql .=
" AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).
')';
634if ($search_refcustomer) {
637if ($search_refproject) {
640if ($search_project) {
643if ($search_availability) {
644 $sql .=
" AND p.fk_availability IN (".$db->sanitize($db->escape($search_availability)).
')';
646if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
647 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_societe);
649 if ($search_societe) {
652 if ($search_societe_alias) {
657 $sql .=
natural_search(array(
"u.login",
"u.firstname",
"u.lastname"), $search_login);
659if ($search_montant_ht !=
'') {
662if ($search_montant_vat !=
'') {
665if ($search_montant_ttc !=
'') {
668if ($search_warehouse !=
'' && $search_warehouse > 0) {
671if ($search_multicurrency_code !=
'') {
672 $sql .=
" AND p.multicurrency_code = '".$db->escape($search_multicurrency_code).
"'";
674if ($search_multicurrency_tx !=
'') {
675 $sql .=
natural_search(
'p.multicurrency_tx', $search_multicurrency_tx, 1);
677if ($search_multicurrency_montant_ht !=
'') {
678 $sql .=
natural_search(
'p.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
680if ($search_multicurrency_montant_vat !=
'') {
681 $sql .=
natural_search(
'p.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
683if ($search_multicurrency_montant_ttc !=
'') {
684 $sql .=
natural_search(
'p.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
687 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
689if ($search_fk_cond_reglement > 0) {
690 $sql .=
" AND p.fk_cond_reglement = ".((int) $search_fk_cond_reglement);
692if ($search_fk_shipping_method > 0) {
693 $sql .=
" AND p.fk_shipping_method = ".((int) $search_fk_shipping_method);
695if ($search_fk_input_reason > 0) {
696 $sql .=
" AND p.fk_input_reason = ".((int) $search_fk_input_reason);
698if ($search_fk_mode_reglement > 0) {
699 $sql .=
" AND p.fk_mode_reglement = ".((int) $search_fk_mode_reglement);
702 $sql .=
' AND s.rowid = '.((int) $socid);
704if ($search_status !=
'' && $search_status !=
'-1') {
705 $sql .=
' AND p.fk_statut IN ('.$db->sanitize($search_status).
')';
707if ($search_date_start) {
708 $sql .=
" AND p.datep >= '".$db->idate($search_date_start).
"'";
710if ($search_date_end) {
711 $sql .=
" AND p.datep <= '".$db->idate($search_date_end).
"'";
713if ($search_date_end_start) {
714 $sql .=
" AND p.fin_validite >= '".$db->idate($search_date_end_start).
"'";
716if ($search_date_end_end) {
717 $sql .=
" AND p.fin_validite <= '".$db->idate($search_date_end_end).
"'";
719if ($search_date_delivery_start) {
720 $sql .=
" AND p.date_livraison >= '".$db->idate($search_date_delivery_start).
"'";
722if ($search_date_delivery_end) {
723 $sql .=
" AND p.date_livraison <= '".$db->idate($search_date_delivery_end).
"'";
725if ($search_date_signature_start) {
726 $sql .=
" AND p.date_signature >= '".$db->idate($search_date_signature_start).
"'";
728if ($search_date_signature_end) {
729 $sql .=
" AND p.date_signature <= '".$db->idate($search_date_signature_end).
"'";
731if ($search_note_public) {
732 $sql .=
" AND p.note_public LIKE '%".$db->escape($db->escapeforlike($search_note_public)).
"%'";
735if ($search_user > 0) {
736 $sql .=
" AND EXISTS (";
737 $sql .=
" SELECT ec.fk_c_type_contact, ec.element_id, ec.fk_socpeople";
738 $sql .=
" FROM llx_element_contact as ec";
739 $sql .=
" INNER JOIN llx_c_type_contact as tc";
740 $sql .=
" ON ec.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal'";
741 $sql .=
" WHERE ec.element_id = p.rowid AND ec.fk_socpeople = ".((int) $search_user).
")";
744if ($search_sale && $search_sale !=
'-1') {
745 if ($search_sale == -2) {
746 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
747 } elseif ($search_sale > 0) {
748 $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).
")";
752$searchCategoryCustomerOperator = -1;
753$searchCategoryCustomerList = array($search_categ_cus);
754if (!empty($searchCategoryCustomerList)) {
755 $searchCategoryCustomerSqlList = array();
756 $listofcategoryid =
'';
757 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
758 if (intval($searchCategoryCustomer) == -2) {
759 $searchCategoryCustomerSqlList[] =
"NOT EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc)";
760 } elseif (intval($searchCategoryCustomer) > 0) {
761 if ($searchCategoryCustomerOperator == 0) {
762 $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).
")";
764 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryCustomer);
768 if ($listofcategoryid) {
769 $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).
"))";
771 if ($searchCategoryCustomerOperator == 1) {
772 if (!empty($searchCategoryCustomerSqlList)) {
773 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
776 if (!empty($searchCategoryCustomerSqlList)) {
777 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
782$searchCategoryProductOperator = -1;
783$searchCategoryProductList = array($search_product_category);
784if (!empty($searchCategoryProductList)) {
785 $searchCategoryProductSqlList = array();
786 $listofcategoryid =
'';
787 foreach ($searchCategoryProductList as $searchCategoryProduct) {
788 if (intval($searchCategoryProduct) == -2) {
789 $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)";
790 } elseif (intval($searchCategoryProduct) > 0) {
791 if ($searchCategoryProductOperator == 0) {
792 $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).
")";
794 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
798 if ($listofcategoryid) {
799 $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).
"))";
801 if ($searchCategoryProductOperator == 1) {
802 if (!empty($searchCategoryProductSqlList)) {
803 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
806 if (!empty($searchCategoryProductSqlList)) {
807 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
811if ($search_option ==
'late') {
812 $sql .=
" AND p.fin_validite < '".$db->idate(
dol_now() - $conf->propal->cloture->warning_delay).
"'";
815include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
819$parameters = array();
820$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
821$sql .= $hookmanager->resPrint;
824$parameters = array();
825$reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object, $action);
826$sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
829$nbtotalofrecords =
'';
832 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
833 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
834 $resql = $db->query($sqlforcount);
836 $objforcount = $db->fetch_object($resql);
837 $nbtotalofrecords = $objforcount->nbtotalofrecords;
842 if (($page * $limit) > $nbtotalofrecords) {
850$sql .= $db->order($sortfield, $sortorder);
851$sql .=
', p.ref DESC';
853 $sql .= $db->plimit($limit + 1, $offset);
856$resql = $db->query($sql);
862$objectstatic =
new Propal($db);
863$userstatic =
new User($db);
868 $title = $langs->trans(
'Proposals').
' - '.$soc->name;
869 if (empty($search_societe)) {
870 $search_societe = $soc->name;
873 $title = $langs->trans(
'Proposals');
876$num = $db->num_rows($resql);
878$arrayofselected = is_array($toselect) ? $toselect : array();
880if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all) {
881 $obj = $db->fetch_object($resql);
885 header(
"Location: ".DOL_URL_ROOT.
'/comm/propal/card.php?id='.$id);
889$help_url =
'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos';
890llxHeader(
'', $title, $help_url, 0, 0,
'',
'',
'',
'bodyforlist');
892$param =
'&search_status='.urlencode($search_status);
894 $param .=
'&mode='.urlencode($mode);
896if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
897 $param .=
'&contextpage='.urlencode($contextpage);
899if ($limit > 0 && $limit != $conf->liste_limit) {
900 $param .=
'&limit='.((int) $limit);
903 $param .=
'&search_all='.urlencode($search_all);
905if ($search_date_startday) {
906 $param .=
'&search_date_startday='.urlencode((
string) ($search_date_startday));
908if ($search_date_startmonth) {
909 $param .=
'&search_date_startmonth='.urlencode((
string) ($search_date_startmonth));
911if ($search_date_startyear) {
912 $param .=
'&search_date_startyear='.urlencode((
string) ($search_date_startyear));
914if ($search_date_endday) {
915 $param .=
'&search_date_endday='.urlencode((
string) ($search_date_endday));
917if ($search_date_endmonth) {
918 $param .=
'&search_date_endmonth='.urlencode((
string) ($search_date_endmonth));
920if ($search_date_endyear) {
921 $param .=
'&search_date_endyear='.urlencode((
string) ($search_date_endyear));
923if ($search_date_end_startday) {
924 $param .=
'&search_date_end_startday='.urlencode((
string) ($search_date_end_startday));
926if ($search_date_end_startmonth) {
927 $param .=
'&search_date_end_startmonth='.urlencode((
string) ($search_date_end_startmonth));
929if ($search_date_end_startyear) {
930 $param .=
'&search_date_end_startyear='.urlencode((
string) ($search_date_end_startyear));
932if ($search_date_end_endday) {
933 $param .=
'&search_date_end_endday='.urlencode((
string) ($search_date_end_endday));
935if ($search_date_end_endmonth) {
936 $param .=
'&search_date_end_endmonth='.urlencode((
string) ($search_date_end_endmonth));
938if ($search_date_end_endyear) {
939 $param .=
'&search_date_end_endyear='.urlencode((
string) ($search_date_end_endyear));
941if ($search_date_delivery_startday) {
942 $param .=
'&search_date_delivery_startday='.urlencode((
string) ($search_date_delivery_startday));
944if ($search_date_delivery_startmonth) {
945 $param .=
'&search_date_delivery_startmonth='.urlencode((
string) ($search_date_delivery_startmonth));
947if ($search_date_delivery_startyear) {
948 $param .=
'&search_date_delivery_startyear='.urlencode((
string) ($search_date_delivery_startyear));
950if ($search_date_delivery_endday) {
951 $param .=
'&search_date_delivery_endday='.urlencode((
string) ($search_date_delivery_endday));
953if ($search_date_delivery_endmonth) {
954 $param .=
'&search_date_delivery_endmonth='.urlencode((
string) ($search_date_delivery_endmonth));
956if ($search_date_delivery_endyear) {
957 $param .=
'&search_date_delivery_endyear='.urlencode((
string) ($search_date_delivery_endyear));
960 $param .=
'&search_ref='.urlencode($search_ref);
962if ($search_refcustomer) {
963 $param .=
'&search_refcustomer='.urlencode($search_refcustomer);
965if ($search_refproject) {
966 $param .=
'&search_refproject='.urlencode($search_refproject);
968if ($search_societe) {
969 $param .=
'&search_societe='.urlencode($search_societe);
971if ($search_societe_alias) {
972 $param .=
'&search_societe_alias='.urlencode($search_societe_alias);
974if ($search_user > 0) {
975 $param .=
'&search_user='.urlencode((
string) ($search_user));
977if ($search_sale > 0) {
978 $param .=
'&search_sale='.urlencode($search_sale);
980if ($search_montant_ht) {
981 $param .=
'&search_montant_ht='.urlencode($search_montant_ht);
983if ($search_multicurrency_code !=
'') {
984 $param .=
'&search_multicurrency_code='.urlencode($search_multicurrency_code);
986if ($search_multicurrency_tx !=
'') {
987 $param .=
'&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
989if ($search_multicurrency_montant_ht !=
'') {
990 $param .=
'&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
992if ($search_multicurrency_montant_vat !=
'') {
993 $param .=
'&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
995if ($search_multicurrency_montant_ttc !=
'') {
996 $param .=
'&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
999 $param .=
'&search_login='.urlencode($search_login);
1002 $param .=
'&search_town='.urlencode($search_town);
1005 $param .=
'&search_zip='.urlencode($search_zip);
1008 $param .=
'&socid='.urlencode((
string) ($socid));
1010if ($optioncss !=
'') {
1011 $param .=
'&optioncss='.urlencode($optioncss);
1013if ($search_categ_cus > 0) {
1014 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
1016if ($search_product_category !=
'') {
1017 $param .=
'&search_product_category='.urlencode((
string) ($search_product_category));
1019if ($search_fk_cond_reglement > 0) {
1020 $param .=
'&search_fk_cond_reglement='.urlencode((
string) ($search_fk_cond_reglement));
1022if ($search_fk_shipping_method > 0) {
1023 $param .=
'&search_fk_shipping_method='.urlencode((
string) ($search_fk_shipping_method));
1025if ($search_fk_input_reason > 0) {
1026 $param .=
'&search_fk_input_reason='.urlencode((
string) ($search_fk_input_reason));
1028if ($search_fk_mode_reglement > 0) {
1029 $param .=
'&search_fk_mode_reglement='.urlencode((
string) ($search_fk_mode_reglement));
1031if ($search_type_thirdparty > 0) {
1032 $param .=
'&search_type_thirdparty='.urlencode((
string) ($search_type_thirdparty));
1035 $param .=
'&search_town='.urlencode($search_town);
1038 $param .=
'&search_zip='.urlencode($search_zip);
1041 $param .=
'&search_state='.urlencode($search_state);
1044 $param .=
'&search_town='.urlencode($search_town);
1046if ($search_country) {
1047 $param .=
'&search_country='.urlencode((
string) ($search_country));
1049if ($search_date_signature_startday) {
1050 $param .=
'&search_date_signature_startday='.urlencode((
string) ($search_date_signature_startday));
1052if ($search_date_signature_startmonth) {
1053 $param .=
'&search_date_signature_startmonth='.urlencode((
string) ($search_date_signature_startmonth));
1055if ($search_date_signature_startyear) {
1056 $param .=
'&search_date_signature_startyear='.urlencode((
string) ($search_date_signature_startyear));
1058if ($search_date_signature_endday) {
1059 $param .=
'&search_date_signature_endday='.urlencode((
string) ($search_date_signature_endday));
1061if ($search_date_signature_endmonth) {
1062 $param .=
'&search_date_signature_endmonth='.urlencode((
string) ($search_date_signature_endmonth));
1064if ($search_date_signature_endyear) {
1065 $param .=
'&search_date_signature_endyear='.urlencode((
string) ($search_date_signature_endyear));
1069include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
1071$parameters = array(
'param' => &$param);
1072$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
1073$param .= $hookmanager->resPrint;
1076$arrayofmassactions = array(
1077 'generate_doc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
1078 'builddoc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
1080if ($permissiontosendbymail) {
1081 $arrayofmassactions[
'presend'] =
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail");
1083if ($permissiontovalidate) {
1084 $arrayofmassactions[
'prevalidate'] =
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate");
1086if ($permissiontoclose) {
1087 $arrayofmassactions[
'presign'] =
img_picto(
'',
'propal',
'class="pictofixedwidth"').$langs->trans(
"Sign");
1088 $arrayofmassactions[
'nopresign'] =
img_picto(
'',
'propal',
'class="pictofixedwidth"').$langs->trans(
"NoSign");
1089 $arrayofmassactions[
'setbilled'] =
img_picto(
'',
'bill',
'class="pictofixedwidth"').$langs->trans(
"ClassifyBilled");
1091if ($permissiontodelete) {
1092 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
1095if (in_array($massaction, array(
'presend',
'predelete',
'closed'))) {
1096 $arrayofmassactions = array();
1098$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1100$url = DOL_URL_ROOT.
'/comm/propal/card.php?action=create';
1101if (!empty($socid)) {
1102 $url .=
'&socid='.$socid;
1105$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'));
1106$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'));
1108$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewPropal'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'propal',
'creer'));
1111print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
1112if ($optioncss !=
'') {
1113 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1115print
'<input type="hidden" name="token" value="'.newToken().
'">';
1116print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1117print
'<input type="hidden" name="action" value="list">';
1118print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1119print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1120print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
1121print
'<input type="hidden" name="socid" value="'.$socid.
'">';
1122print
'<input type="hidden" name="mode"value="'.$mode.
'">';
1124print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'propal', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1126$topicmail =
"SendPropalRef";
1127$modelmail =
"propal_send";
1128$objecttmp =
new Propal($db);
1129$trackid =
'pro'.$object->id;
1130include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1132if ($massaction ==
'prevalidate') {
1133 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassValidation"), $langs->trans(
"ConfirmMassValidationQuestion"),
"validate",
null,
'', 0, 200, 500, 1);
1136if ($massaction ==
'presign') {
1137 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassSignature"), $langs->trans(
"ConfirmMassSignatureQuestion"),
"sign",
null,
'', 0, 200, 500, 1);
1140if ($massaction ==
'nopresign') {
1141 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassNoSignature"), $langs->trans(
"ConfirmMassNoSignatureQuestion"),
"nosign",
null,
'', 0, 200, 500, 1);
1145 foreach ($fieldstosearchall as $key => $val) {
1146 $fieldstosearchall[$key] = $langs->trans($val);
1148 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1156if ($user->hasRight(
'user',
'user',
'lire')) {
1157 $langs->load(
"commercial");
1158 $moreforfilter .=
'<div class="divsearchfield">';
1159 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1160 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth250 widthcentpercentminusx', 1);
1161 $moreforfilter .=
'</div>';
1164if ($user->hasRight(
'user',
'user',
'lire')) {
1165 $moreforfilter .=
'<div class="divsearchfield">';
1166 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
1167 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$form->select_dolusers((empty($search_user) ? -2 : 0),
'search_user', $tmptitle,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth250 widthcentpercentminusx');
1168 $moreforfilter .=
'</div>';
1171if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'read') && ($user->hasRight(
'product',
'read') || $user->hasRight(
'service',
'read'))) {
1172 $searchCategoryProductOperator = -1;
1173 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1174 $tmptitle = $langs->trans(
'IncludingProductWithTag');
1176 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, array($search_product_category),
'maxwidth300', $searchCategoryProductOperator, 0, 0, $tmptitle);
1178if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1179 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1180 $moreforfilter .=
'<div class="divsearchfield">';
1181 $tmptitle = $langs->trans(
'CustomersProspectsCategoriesShort');
1182 $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'));
1183 $moreforfilter .=
'</div>';
1185if (isModEnabled(
'stock') &&
getDolGlobalString(
'WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) {
1186 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
1188 $moreforfilter .=
'<div class="divsearchfield">';
1189 $tmptitle = $langs->trans(
'Warehouse');
1190 $moreforfilter .=
img_picto($tmptitle,
'stock',
'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse,
'search_warehouse',
'', $tmptitle, 0, 0, $tmptitle);
1191 $moreforfilter .=
'</div>';
1193$parameters = array();
1194$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1195if (empty($reshook)) {
1196 $moreforfilter .= $hookmanager->resPrint;
1198 $moreforfilter = $hookmanager->resPrint;
1201if (!empty($moreforfilter)) {
1202 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1203 print $moreforfilter;
1207$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1208$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1209$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1211print
'<div class="div-table-responsive">';
1212print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1214print
'<tr class="liste_titre_filter">';
1218 print
'<td class="liste_titre" align="middle">';
1219 $searchpicto = $form->showFilterButtons(
'left');
1224if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1225 print
'<td class="liste_titre">';
1226 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
1229if (!empty($arrayfields[
'p.ref_client'][
'checked'])) {
1230 print
'<td class="liste_titre">';
1231 print
'<input class="flat maxwidth50" type="text" name="search_refcustomer" value="'.dol_escape_htmltag($search_refcustomer).
'">';
1234if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1235 print
'<td class="liste_titre">';
1236 print
'<input class="flat maxwidth50" type="text" name="search_refproject" value="'.dol_escape_htmltag($search_refproject).
'">';
1239if (!empty($arrayfields[
'pr.title'][
'checked'])) {
1240 print
'<td class="liste_titre">';
1241 print
'<input class="flat maxwidth50" type="text" name="search_project" value="'.dol_escape_htmltag($search_project).
'">';
1244if (!empty($arrayfields[
's.nom'][
'checked'])) {
1245 print
'<td class="liste_titre" align="left">';
1246 print
'<input class="flat maxwidth100" type="text" name="search_societe" value="'.dol_escape_htmltag($search_societe).
'"'.($socid > 0 ?
" disabled" :
"").
'>';
1249if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1250 print
'<td class="liste_titre" align="left">';
1251 print
'<input class="flat maxwidth100" type="text" name="search_societe_alias" value="'.dol_escape_htmltag($search_societe_alias).
'">';
1254if (!empty($arrayfields[
's.town'][
'checked'])) {
1255 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_town" value="'.$search_town.
'"></td>';
1257if (!empty($arrayfields[
's.zip'][
'checked'])) {
1258 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_zip" value="'.$search_zip.
'"></td>';
1261if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1262 print
'<td class="liste_titre">';
1263 print
'<input class="flat maxwidth50" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1267if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1268 print
'<td class="liste_titre" align="center">';
1269 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1273if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1274 print
'<td class="liste_titre maxwidth100onsmartphone" align="center">';
1275 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);
1280if (!empty($arrayfields[
'p.date'][
'checked'])) {
1281 print
'<td class="liste_titre center">';
1282 print
'<div class="nowrapfordate">';
1283 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1285 print
'<div class="nowrapfordate">';
1286 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1291if (!empty($arrayfields[
'p.fin_validite'][
'checked'])) {
1292 print
'<td class="liste_titre center">';
1293 print
'<div class="nowrapfordate">';
1294 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'));
1296 print
'<div class="nowrapfordate">';
1297 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'));
1302if (!empty($arrayfields[
'p.date_livraison'][
'checked'])) {
1303 print
'<td class="liste_titre center">';
1304 print
'<div class="nowrapfordate">';
1305 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'));
1307 print
'<div class="nowrapfordate">';
1308 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'));
1313if (!empty($arrayfields[
'p.date_signature'][
'checked'])) {
1314 print
'<td class="liste_titre center">';
1315 print
'<div class="nowrapfordate">';
1316 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'));
1318 print
'<div class="nowrapfordate">';
1319 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'));
1324if (!empty($arrayfields[
'ava.rowid'][
'checked'])) {
1325 print
'<td class="liste_titre maxwidth100onsmartphone center">';
1326 $form->selectAvailabilityDelay($search_availability,
'search_availability',
'', 1);
1331if (!empty($arrayfields[
'p.fk_shipping_method'][
'checked'])) {
1332 print
'<td class="liste_titre">';
1333 $form->selectShippingMethod($search_fk_shipping_method,
'search_fk_shipping_method',
'', 1,
'', 1);
1337if (!empty($arrayfields[
'p.fk_input_reason'][
'checked'])) {
1338 print
'<td class="liste_titre">';
1339 $form->selectInputReason($search_fk_input_reason,
'search_fk_input_reason',
'', 1,
'maxwidth125', 1);
1343if (!empty($arrayfields[
'p.fk_cond_reglement'][
'checked'])) {
1344 print
'<td class="liste_titre">';
1345 print $form->getSelectConditionsPaiements($search_fk_cond_reglement,
'search_fk_cond_reglement', 1, 1, 1);
1349if (!empty($arrayfields[
'p.fk_mode_reglement'][
'checked'])) {
1350 print
'<td class="liste_titre">';
1351 print $form->select_types_paiements($search_fk_mode_reglement,
'search_fk_mode_reglement',
'', 0, 1, 1, 0, -1,
'', 1);
1354if (!empty($arrayfields[
'p.total_ht'][
'checked'])) {
1356 print
'<td class="liste_titre right">';
1357 print
'<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).
'">';
1360if (!empty($arrayfields[
'p.total_tva'][
'checked'])) {
1362 print
'<td class="liste_titre right">';
1363 print
'<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).
'">';
1366if (!empty($arrayfields[
'p.total_ttc'][
'checked'])) {
1368 print
'<td class="liste_titre right">';
1369 print
'<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).
'">';
1372if (!empty($arrayfields[
'p.total_ht_invoiced'][
'checked'])) {
1374 print
'<td class="liste_titre right">';
1377if (!empty($arrayfields[
'p.total_invoiced'][
'checked'])) {
1379 print
'<td class="liste_titre right">';
1382if (!empty($arrayfields[
'p.multicurrency_code'][
'checked'])) {
1384 print
'<td class="liste_titre">';
1385 print $form->selectMultiCurrency($search_multicurrency_code,
'search_multicurrency_code', 1);
1388if (!empty($arrayfields[
'p.multicurrency_tx'][
'checked'])) {
1390 print
'<td class="liste_titre">';
1391 print
'<input class="flat" type="text" size="4" name="search_multicurrency_tx" value="'.dol_escape_htmltag($search_multicurrency_tx).
'">';
1394if (!empty($arrayfields[
'p.multicurrency_total_ht'][
'checked'])) {
1396 print
'<td class="liste_titre right">';
1397 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ht" value="'.dol_escape_htmltag($search_multicurrency_montant_ht).
'">';
1400if (!empty($arrayfields[
'p.multicurrency_total_tva'][
'checked'])) {
1402 print
'<td class="liste_titre right">';
1403 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_vat" value="'.dol_escape_htmltag($search_multicurrency_montant_vat).
'">';
1406if (!empty($arrayfields[
'p.multicurrency_total_ttc'][
'checked'])) {
1408 print
'<td class="liste_titre right">';
1409 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ttc" value="'.dol_escape_htmltag($search_multicurrency_montant_ttc).
'">';
1412if (!empty($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'checked'])) {
1414 print
'<td class="liste_titre right">';
1417if (!empty($arrayfields[
'p.multicurrency_total_invoiced'][
'checked'])) {
1419 print
'<td class="liste_titre right">';
1422if (!empty($arrayfields[
'u.login'][
'checked'])) {
1424 print
'<td class="liste_titre">';
1425 print
'<input class="flat maxwidth75" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1428if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
1429 print
'<td class="liste_titre"></td>';
1431if (!empty($arrayfields[
'total_pa'][
'checked'])) {
1432 print
'<td class="liste_titre right">';
1435if (!empty($arrayfields[
'total_margin'][
'checked'])) {
1436 print
'<td class="liste_titre right">';
1439if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
1440 print
'<td class="liste_titre right">';
1443if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
1444 print
'<td class="liste_titre right">';
1448include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1451$parameters = array(
'arrayfields' => $arrayfields);
1452$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1453print $hookmanager->resPrint;
1455if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1456 print
'<td class="liste_titre">';
1460if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1461 print
'<td class="liste_titre">';
1465if (!empty($arrayfields[
'p.date_cloture'][
'checked'])) {
1466 print
'<td class="liste_titre">';
1469if (!empty($arrayfields[
'p.note_public'][
'checked'])) {
1471 print
'<td class="liste_titre">';
1472 print
'<input class="flat maxwidth75" type="text" name="search_note_public" value="'.dol_escape_htmltag($search_note_public).
'">';
1475if (!empty($arrayfields[
'p.note_private'][
'checked'])) {
1477 print
'<td class="liste_titre">';
1481if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1482 print
'<td class="liste_titre center parentonrightofpage">';
1483 $formpropal->selectProposalStatus($search_status, 1, 0, 1,
'customer',
'search_status',
'search_status width100 onrightofpage');
1488 print
'<td class="liste_titre" align="middle">';
1489 $searchpicto = $form->showFilterButtons();
1505print
'<tr class="liste_titre">';
1507 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
1508 $totalarray[
'nbfield']++;
1510if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1511 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'p.ref',
'', $param,
'', $sortfield, $sortorder);
1512 $totalarray[
'nbfield']++;
1514if (!empty($arrayfields[
'p.ref_client'][
'checked'])) {
1515 print_liste_field_titre($arrayfields[
'p.ref_client'][
'label'], $_SERVER[
"PHP_SELF"],
'p.ref_client',
'', $param,
'', $sortfield, $sortorder);
1516 $totalarray[
'nbfield']++;
1518if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1519 print_liste_field_titre($arrayfields[
'pr.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'pr.ref',
'', $param,
'', $sortfield, $sortorder);
1520 $totalarray[
'nbfield']++;
1522if (!empty($arrayfields[
'pr.title'][
'checked'])) {
1523 print_liste_field_titre($arrayfields[
'pr.title'][
'label'], $_SERVER[
"PHP_SELF"],
'pr.title',
'', $param,
'', $sortfield, $sortorder);
1524 $totalarray[
'nbfield']++;
1526if (!empty($arrayfields[
's.nom'][
'checked'])) {
1527 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
's.nom',
'', $param,
'', $sortfield, $sortorder);
1528 $totalarray[
'nbfield']++;
1530if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1531 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
's.name_alias',
'', $param,
'', $sortfield, $sortorder);
1532 $totalarray[
'nbfield']++;
1534if (!empty($arrayfields[
's.town'][
'checked'])) {
1535 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1536 $totalarray[
'nbfield']++;
1538if (!empty($arrayfields[
's.zip'][
'checked'])) {
1539 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1540 $totalarray[
'nbfield']++;
1542if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1543 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1544 $totalarray[
'nbfield']++;
1546if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1547 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1548 $totalarray[
'nbfield']++;
1550if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1551 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1552 $totalarray[
'nbfield']++;
1554if (!empty($arrayfields[
'p.date'][
'checked'])) {
1555 print_liste_field_titre($arrayfields[
'p.date'][
'label'], $_SERVER[
"PHP_SELF"],
'p.datep',
'', $param,
'', $sortfield, $sortorder,
'center ');
1556 $totalarray[
'nbfield']++;
1558if (!empty($arrayfields[
'p.fin_validite'][
'checked'])) {
1559 print_liste_field_titre($arrayfields[
'p.fin_validite'][
'label'], $_SERVER[
"PHP_SELF"],
'dfv',
'', $param,
'', $sortfield, $sortorder,
'center ');
1560 $totalarray[
'nbfield']++;
1562if (!empty($arrayfields[
'p.date_livraison'][
'checked'])) {
1563 print_liste_field_titre($arrayfields[
'p.date_livraison'][
'label'], $_SERVER[
"PHP_SELF"],
'p.date_livraison',
'', $param,
'', $sortfield, $sortorder,
'center ');
1564 $totalarray[
'nbfield']++;
1566if (!empty($arrayfields[
'p.date_signature'][
'checked'])) {
1567 print_liste_field_titre($arrayfields[
'p.date_signature'][
'label'], $_SERVER[
"PHP_SELF"],
'p.date_signature',
'', $param,
'', $sortfield, $sortorder,
'center ');
1568 $totalarray[
'nbfield']++;
1570if (!empty($arrayfields[
'ava.rowid'][
'checked'])) {
1571 print_liste_field_titre($arrayfields[
'ava.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
'availability',
'', $param,
'', $sortfield, $sortorder);
1572 $totalarray[
'nbfield']++;
1574if (!empty($arrayfields[
'p.fk_shipping_method'][
'checked'])) {
1575 print_liste_field_titre($arrayfields[
'p.fk_shipping_method'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_shipping_method",
"", $param,
'', $sortfield, $sortorder);
1576 $totalarray[
'nbfield']++;
1578if (!empty($arrayfields[
'p.fk_input_reason'][
'checked'])) {
1579 print_liste_field_titre($arrayfields[
'p.fk_input_reason'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_input_reason",
"", $param,
'', $sortfield, $sortorder);
1580 $totalarray[
'nbfield']++;
1582if (!empty($arrayfields[
'p.fk_cond_reglement'][
'checked'])) {
1583 print_liste_field_titre($arrayfields[
'p.fk_cond_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_cond_reglement",
"", $param,
'', $sortfield, $sortorder);
1584 $totalarray[
'nbfield']++;
1586if (!empty($arrayfields[
'p.fk_mode_reglement'][
'checked'])) {
1587 print_liste_field_titre($arrayfields[
'p.fk_mode_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_mode_reglement",
"", $param,
'', $sortfield, $sortorder);
1588 $totalarray[
'nbfield']++;
1590if (!empty($arrayfields[
'p.total_ht'][
'checked'])) {
1591 print_liste_field_titre($arrayfields[
'p.total_ht'][
'label'], $_SERVER[
"PHP_SELF"],
'p.total_ht',
'', $param,
'', $sortfield, $sortorder,
'right ');
1592 $totalarray[
'nbfield']++;
1594if (!empty($arrayfields[
'p.total_tva'][
'checked'])) {
1595 print_liste_field_titre($arrayfields[
'p.total_tva'][
'label'], $_SERVER[
"PHP_SELF"],
'p.total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1596 $totalarray[
'nbfield']++;
1598if (!empty($arrayfields[
'p.total_ttc'][
'checked'])) {
1599 print_liste_field_titre($arrayfields[
'p.total_ttc'][
'label'], $_SERVER[
"PHP_SELF"],
'p.total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1600 $totalarray[
'nbfield']++;
1602if (!empty($arrayfields[
'p.total_ht_invoiced'][
'checked'])) {
1603 print_liste_field_titre($arrayfields[
'p.total_ht_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1604 $totalarray[
'nbfield']++;
1606if (!empty($arrayfields[
'p.total_invoiced'][
'checked'])) {
1607 print_liste_field_titre($arrayfields[
'p.total_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1608 $totalarray[
'nbfield']++;
1610if (!empty($arrayfields[
'p.multicurrency_code'][
'checked'])) {
1611 print_liste_field_titre($arrayfields[
'p.multicurrency_code'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_code',
'', $param,
'', $sortfield, $sortorder);
1612 $totalarray[
'nbfield']++;
1614if (!empty($arrayfields[
'p.multicurrency_tx'][
'checked'])) {
1615 print_liste_field_titre($arrayfields[
'p.multicurrency_tx'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_tx',
'', $param,
'', $sortfield, $sortorder);
1616 $totalarray[
'nbfield']++;
1618if (!empty($arrayfields[
'p.multicurrency_total_ht'][
'checked'])) {
1619 print_liste_field_titre($arrayfields[
'p.multicurrency_total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_total_ht',
'', $param,
'', $sortfield, $sortorder,
'right ');
1620 $totalarray[
'nbfield']++;
1622if (!empty($arrayfields[
'p.multicurrency_total_tva'][
'checked'])) {
1623 print_liste_field_titre($arrayfields[
'p.multicurrency_total_tva'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1624 $totalarray[
'nbfield']++;
1626if (!empty($arrayfields[
'p.multicurrency_total_ttc'][
'checked'])) {
1627 print_liste_field_titre($arrayfields[
'p.multicurrency_total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1628 $totalarray[
'nbfield']++;
1630if (!empty($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'checked'])) {
1631 print_liste_field_titre($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1632 $totalarray[
'nbfield']++;
1634if (!empty($arrayfields[
'p.multicurrency_total_invoiced'][
'checked'])) {
1635 print_liste_field_titre($arrayfields[
'p.multicurrency_total_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1636 $totalarray[
'nbfield']++;
1638if (!empty($arrayfields[
'u.login'][
'checked'])) {
1639 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'', $sortfield, $sortorder);
1640 $totalarray[
'nbfield']++;
1642if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
1643 print_liste_field_titre($arrayfields[
'sale_representative'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"",
"$param",
'', $sortfield, $sortorder);
1644 $totalarray[
'nbfield']++;
1646if (!empty($arrayfields[
'total_pa'][
'checked'])) {
1647 print_liste_field_titre($arrayfields[
'total_pa'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1648 $totalarray[
'nbfield']++;
1650if (!empty($arrayfields[
'total_margin'][
'checked'])) {
1651 print_liste_field_titre($arrayfields[
'total_margin'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1652 $totalarray[
'nbfield']++;
1654if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
1655 print_liste_field_titre($arrayfields[
'total_margin_rate'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1656 $totalarray[
'nbfield']++;
1658if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
1659 print_liste_field_titre($arrayfields[
'total_mark_rate'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1660 $totalarray[
'nbfield']++;
1663include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1666 'arrayfields' => $arrayfields,
1668 'sortfield' => $sortfield,
1669 'sortorder' => $sortorder,
1670 'totalarray' => &$totalarray,
1673$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1675print $hookmanager->resPrint;
1676if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1677 print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowraponall ');
1678 $totalarray[
'nbfield']++;
1680if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1681 print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"p.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowraponall ');
1682 $totalarray[
'nbfield']++;
1684if (!empty($arrayfields[
'p.date_cloture'][
'checked'])) {
1685 print_liste_field_titre($arrayfields[
'p.date_cloture'][
'label'], $_SERVER[
"PHP_SELF"],
"p.date_cloture",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
1686 $totalarray[
'nbfield']++;
1688if (!empty($arrayfields[
'p.note_public'][
'checked'])) {
1689 print_liste_field_titre($arrayfields[
'p.note_public'][
'label'], $_SERVER[
"PHP_SELF"],
"p.note_public",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1690 $totalarray[
'nbfield']++;
1692if (!empty($arrayfields[
'p.note_private'][
'checked'])) {
1693 print_liste_field_titre($arrayfields[
'p.note_private'][
'label'], $_SERVER[
"PHP_SELF"],
"p.note_private",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1694 $totalarray[
'nbfield']++;
1696if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1697 print_liste_field_titre($arrayfields[
'p.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
1698 $totalarray[
'nbfield']++;
1701 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
1702 $totalarray[
'nbfield']++;
1711$with_margin_info =
false;
1712if (isModEnabled(
'margin') && (
1713 !empty($arrayfields[
'total_pa'][
'checked'])
1714 || !empty($arrayfields[
'total_margin'][
'checked'])
1715 || !empty($arrayfields[
'total_margin_rate'][
'checked'])
1716 || !empty($arrayfields[
'total_mark_rate'][
'checked'])
1719 $with_margin_info =
true;
1726$savnbfield = $totalarray[
'nbfield'];
1727$totalarray = array();
1728$totalarray[
'nbfield'] = 0;
1729$imaxinloop = ($limit ? min($num, $limit) : $num);
1730while ($i < $imaxinloop) {
1731 $obj = $db->fetch_object($resql);
1735 if ($search_option) {
1736 $param .=
"&search_option=".urlencode($search_option);
1739 $objectstatic->id = $obj->rowid;
1740 $objectstatic->ref = $obj->ref;
1741 $objectstatic->ref_customer = $obj->ref_client;
1742 $objectstatic->note_public = $obj->note_public;
1743 $objectstatic->note_private = $obj->note_private;
1744 $objectstatic->statut = $obj->status;
1745 $objectstatic->status = $obj->status;
1747 $companystatic->id = $obj->socid;
1748 $companystatic->name = $obj->name;
1749 $companystatic->name_alias = $obj->alias;
1750 $companystatic->client = $obj->client;
1751 $companystatic->fournisseur = $obj->fournisseur;
1752 $companystatic->code_client = $obj->code_client;
1753 $companystatic->email = $obj->email;
1754 $companystatic->phone = $obj->phone;
1755 $companystatic->address = $obj->address;
1756 $companystatic->zip = $obj->zip;
1757 $companystatic->town = $obj->town;
1758 $companystatic->country_code = $obj->country_code;
1760 $projectstatic->id = $obj->project_id;
1761 $projectstatic->ref = $obj->project_ref;
1762 $projectstatic->title = $obj->project_label;
1764 $totalInvoicedHT = 0;
1765 $totalInvoicedTTC = 0;
1766 $multicurrency_totalInvoicedHT = 0;
1767 $multicurrency_totalInvoicedTTC = 0;
1769 $TInvoiceData = $objectstatic->InvoiceArrayList($obj->rowid);
1771 if (!empty($TInvoiceData)) {
1772 foreach ($TInvoiceData as $invoiceData) {
1774 $invoice->fetch($invoiceData->facid);
1780 $totalInvoicedHT += $invoice->total_ht;
1781 $totalInvoicedTTC += $invoice->total_ttc;
1782 $multicurrency_totalInvoicedHT += $invoice->multicurrency_total_ht;
1783 $multicurrency_totalInvoicedTTC += $invoice->multicurrency_total_ttc;
1787 $marginInfo = array();
1788 if ($with_margin_info ===
true) {
1789 $objectstatic->fetch_lines();
1790 $marginInfo = $formmargin->getMarginInfosArray($objectstatic);
1791 $total_ht += $obj->total_ht;
1792 $total_margin += $marginInfo[
'total_margin'];
1795 if ($mode ==
'kanban') {
1797 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1798 print
'<div class="box-flex-container kanban">';
1801 $objectstatic->thirdparty = $companystatic;
1802 $userstatic->fetch($obj->fk_user_author);
1803 $arrayofparams = array(
'selected' => in_array(
$object->id, $arrayofselected),
'authorlink' => $userstatic->getNomUrl(-2),
'projectlink' => $projectstatic->getNomUrl(2));
1804 print $objectstatic->getKanbanView(
'', $arrayofparams);
1805 if ($i == ($imaxinloop - 1)) {
1810 print
'<tr class="oddeven">';
1814 print
'<td class="nowrap" align="center">';
1815 if ($massactionbutton || $massaction) {
1817 if (in_array($obj->rowid, $arrayofselected)) {
1820 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1824 $totalarray[
'nbfield']++;
1828 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1829 print
'<td class="nowraponall">';
1831 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1833 print
'<td class="nobordernopadding nowraponall">';
1834 print $objectstatic->getNomUrl(1,
'',
'', 0, 1, (isset($conf->global->PROPAL_LIST_SHOW_NOTES) ? $conf->global->PROPAL_LIST_SHOW_NOTES : 1));
1838 if ($obj->status ==
Propal::STATUS_VALIDATED && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) {
1839 $warnornote .=
img_warning($langs->trans(
"Late"));
1842 print
'<td style="min-width: 20px" class="nobordernopadding nowrap">';
1847 print
'<td width="16" class="nobordernopadding right">';
1849 $filedir = $conf->propal->multidir_output[$obj->propal_entity].
'/'.
dol_sanitizeFileName($obj->ref);
1850 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
1851 print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
1852 print
'</td></tr></table>';
1856 $totalarray[
'nbfield']++;
1860 if (!empty($arrayfields[
'p.ref_client'][
'checked'])) {
1862 print
'<td class="nowrap tdoverflowmax200">';
1866 $totalarray[
'nbfield']++;
1870 if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1872 print
'<td class="nowraponall">';
1873 if ($obj->project_id > 0) {
1874 print $projectstatic->getNomUrl(1);
1878 $totalarray[
'nbfield']++;
1882 if (!empty($arrayfields[
'pr.title'][
'checked'])) {
1884 print
'<td class="nowrap">';
1885 if ($obj->project_id > 0) {
1890 $totalarray[
'nbfield']++;
1895 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1896 print
'<td class="tdoverflowmax150">';
1897 print $companystatic->getNomUrl(1,
'customer', 0, 0, 1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
1900 $totalarray[
'nbfield']++;
1905 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1906 print
'<td class="tdoverflowmax200">';
1910 $totalarray[
'nbfield']++;
1915 if (!empty($arrayfields[
's.town'][
'checked'])) {
1916 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->town).
'">';
1920 $totalarray[
'nbfield']++;
1924 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1925 print
'<td class="nocellnopadd">';
1929 $totalarray[
'nbfield']++;
1933 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1934 print
"<td>".$obj->state_name.
"</td>\n";
1936 $totalarray[
'nbfield']++;
1940 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1941 print
'<td class="center">';
1942 $tmparray =
getCountry($obj->fk_pays,
'all');
1943 print $tmparray[
'label'];
1946 $totalarray[
'nbfield']++;
1950 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1951 if (!is_array($typenArray) || empty($typenArray)) {
1952 $typenArray = $formcompany->typent_array(1);
1955 print
'<td class="center">';
1956 if (!empty($obj->typent_code)) {
1957 print $typenArray[$obj->typent_code];
1961 $totalarray[
'nbfield']++;
1966 if (!empty($arrayfields[
'p.date'][
'checked'])) {
1967 print
'<td class="center">';
1971 $totalarray[
'nbfield']++;
1976 if (!empty($arrayfields[
'p.fin_validite'][
'checked'])) {
1978 print
'<td class="center">'.dol_print_date($db->jdate($obj->dfv),
'day');
1981 print
'<td> </td>';
1984 $totalarray[
'nbfield']++;
1988 if (!empty($arrayfields[
'p.date_livraison'][
'checked'])) {
1989 if ($obj->ddelivery) {
1990 print
'<td class="center">'.dol_print_date($db->jdate($obj->ddelivery),
'day');
1993 print
'<td> </td>';
1996 $totalarray[
'nbfield']++;
2000 if (!empty($arrayfields[
'p.date_signature'][
'checked'])) {
2001 if ($obj->dsignature) {
2002 print
'<td class="center">'.dol_print_date($db->jdate($obj->dsignature),
'day');
2005 print
'<td> </td>';
2008 $totalarray[
'nbfield']++;
2012 if (!empty($arrayfields[
'ava.rowid'][
'checked'])) {
2013 print
'<td class="center">';
2014 $form->form_availability(
'', $obj->availability,
'none', 1);
2017 $totalarray[
'nbfield']++;
2021 if (!empty($arrayfields[
'p.fk_shipping_method'][
'checked'])) {
2023 $form->formSelectShippingMethod(
'', $obj->fk_shipping_method,
'none', 1);
2026 $totalarray[
'nbfield']++;
2030 if (!empty($arrayfields[
'p.fk_input_reason'][
'checked'])) {
2031 $labelInputReason =
'';
2032 if ($obj->fk_input_reason > 0) {
2033 $labelInputReason = $form->cache_demand_reason[$obj->fk_input_reason][
'label'];
2035 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($labelInputReason).
'">';
2039 $totalarray[
'nbfield']++;
2043 if (!empty($arrayfields[
'p.fk_cond_reglement'][
'checked'])) {
2045 $form->form_conditions_reglement($_SERVER[
'PHP_SELF'], $obj->fk_cond_reglement,
'none', 0,
'', 1, $obj->deposit_percent);
2048 $totalarray[
'nbfield']++;
2052 if (!empty($arrayfields[
'p.fk_mode_reglement'][
'checked'])) {
2054 $form->form_modes_reglement($_SERVER[
'PHP_SELF'], $obj->fk_mode_reglement,
'none',
'', -1);
2057 $totalarray[
'nbfield']++;
2061 if (!empty($arrayfields[
'p.total_ht'][
'checked'])) {
2062 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ht).
"</span></td>\n";
2064 $totalarray[
'nbfield']++;
2067 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.total_ht';
2069 if (empty($totalarray[
'val'][
'p.total_ht'])) {
2070 $totalarray[
'val'][
'p.total_ht'] = $obj->total_ht;
2072 $totalarray[
'val'][
'p.total_ht'] += $obj->total_ht;
2076 if (!empty($arrayfields[
'p.total_tva'][
'checked'])) {
2077 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_tva).
"</span></td>\n";
2079 $totalarray[
'nbfield']++;
2082 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.total_tva';
2084 if (empty($totalarray[
'val'][
'p.total_tva'])) {
2085 $totalarray[
'val'][
'p.total_tva'] = $obj->total_tva;
2087 $totalarray[
'val'][
'p.total_tva'] += $obj->total_tva;
2091 if (!empty($arrayfields[
'p.total_ttc'][
'checked'])) {
2092 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
"</span></td>\n";
2094 $totalarray[
'nbfield']++;
2097 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.total_ttc';
2099 if (empty($totalarray[
'val'][
'p.total_ttc'])) {
2100 $totalarray[
'val'][
'p.total_ttc'] = $obj->total_ttc;
2102 $totalarray[
'val'][
'p.total_ttc'] += $obj->total_ttc;
2106 if (!empty($arrayfields[
'p.total_ht_invoiced'][
'checked'])) {
2107 print
'<td class="nowrap right"><span class="amount">'.price($totalInvoicedHT).
"</span></td>\n";
2109 $totalarray[
'nbfield']++;
2112 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.total_ht_invoiced';
2114 if (empty($totalarray[
'val'][
'p.total_ht_invoiced'])) {
2115 $totalarray[
'val'][
'p.total_ht_invoiced'] = $totalInvoicedHT;
2117 $totalarray[
'val'][
'p.total_ht_invoiced'] += $totalInvoicedHT;
2121 if (!empty($arrayfields[
'p.total_invoiced'][
'checked'])) {
2122 print
'<td class="nowrap right"><span class="amount">'.price($totalInvoicedTTC).
"</span></td>\n";
2124 $totalarray[
'nbfield']++;
2127 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.total_invoiced';
2129 if (empty($totalarray[
'val'][
'p.total_invoiced'])) {
2130 $totalarray[
'val'][
'p.total_invoiced'] = $totalInvoicedTTC;
2132 $totalarray[
'val'][
'p.total_invoiced'] += $totalInvoicedTTC;
2136 if (!empty($arrayfields[
'p.multicurrency_code'][
'checked'])) {
2137 print
'<td class="nowrap">'.$obj->multicurrency_code.
' - '.$langs->trans(
'Currency'.$obj->multicurrency_code).
"</td>\n";
2139 $totalarray[
'nbfield']++;
2144 if (!empty($arrayfields[
'p.multicurrency_tx'][
'checked'])) {
2145 print
'<td class="nowrap">';
2146 $form->form_multicurrency_rate($_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid, $obj->multicurrency_tx,
'none', $obj->multicurrency_code);
2149 $totalarray[
'nbfield']++;
2153 if (!empty($arrayfields[
'p.multicurrency_total_ht'][
'checked'])) {
2154 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht).
"</span></td>\n";
2156 $totalarray[
'nbfield']++;
2160 if (!empty($arrayfields[
'p.multicurrency_total_tva'][
'checked'])) {
2161 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_tva).
"</span></td>\n";
2163 $totalarray[
'nbfield']++;
2167 if (!empty($arrayfields[
'p.multicurrency_total_ttc'][
'checked'])) {
2168 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc).
"</span></td>\n";
2170 $totalarray[
'nbfield']++;
2174 if (!empty($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'checked'])) {
2175 print
'<td class="nowrap right"><span class="amount">'.price($multicurrency_totalInvoicedHT).
"</span></td>\n";
2177 $totalarray[
'nbfield']++;
2181 if (!empty($arrayfields[
'p.multicurrency_total_invoiced'][
'checked'])) {
2182 print
'<td class="nowrap right"><span class="amount">'.price($multicurrency_totalInvoicedTTC).
"</span></td>\n";
2184 $totalarray[
'nbfield']++;
2188 $userstatic->id = $obj->fk_user_author;
2189 $userstatic->login = $obj->login;
2190 $userstatic->lastname = $obj->lastname;
2191 $userstatic->firstname = $obj->firstname;
2192 $userstatic->email = $obj->user_email;
2193 $userstatic->status = $obj->user_statut;
2194 $userstatic->entity = $obj->user_entity;
2195 $userstatic->photo = $obj->photo;
2196 $userstatic->office_phone = $obj->office_phone;
2197 $userstatic->office_fax = $obj->office_fax;
2198 $userstatic->user_mobile = $obj->user_mobile;
2199 $userstatic->job = $obj->job;
2200 $userstatic->gender = $obj->gender;
2203 if (!empty($arrayfields[
'u.login'][
'checked'])) {
2204 print
'<td class="tdoverflowmax150">';
2205 if ($userstatic->id) {
2206 print $userstatic->getNomUrl(-1);
2210 $totalarray[
'nbfield']++;
2214 if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
2216 print
'<td class="tdoverflowmax125">';
2217 if ($obj->socid > 0) {
2218 $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
2219 if ($listsalesrepresentatives < 0) {
2222 $nbofsalesrepresentative = count($listsalesrepresentatives);
2223 if ($nbofsalesrepresentative > 6) {
2225 print $nbofsalesrepresentative;
2226 } elseif ($nbofsalesrepresentative > 0) {
2227 $userstatic =
new User($db);
2229 foreach ($listsalesrepresentatives as $val) {
2230 $userstatic->id = $val[
'id'];
2231 $userstatic->lastname = $val[
'lastname'];
2232 $userstatic->firstname = $val[
'firstname'];
2233 $userstatic->email = $val[
'email'];
2234 $userstatic->status = $val[
'statut'];
2235 $userstatic->entity = $val[
'entity'];
2236 $userstatic->photo = $val[
'photo'];
2237 $userstatic->login = $val[
'login'];
2238 $userstatic->office_phone = $val[
'office_phone'];
2239 $userstatic->office_fax = $val[
'office_fax'];
2240 $userstatic->user_mobile = $val[
'user_mobile'];
2241 $userstatic->job = $val[
'job'];
2242 $userstatic->gender = $val[
'gender'];
2244 print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1,
'', 0, 0, 12) : $userstatic->getNomUrl(-2);
2246 if ($j < $nbofsalesrepresentative) {
2258 $totalarray[
'nbfield']++;
2263 if (!empty($arrayfields[
'total_pa'][
'checked'])) {
2264 print
'<td class="right nowrap">'.price($marginInfo[
'pa_total']).
'</td>';
2266 $totalarray[
'nbfield']++;
2270 if (!empty($arrayfields[
'total_margin'][
'checked'])) {
2271 print
'<td class="right nowrap">'.price($marginInfo[
'total_margin']).
'</td>';
2273 $totalarray[
'nbfield']++;
2276 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_margin';
2278 $totalarray[
'val'][
'total_margin'] = $total_margin;
2281 if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
2282 print
'<td class="right nowrap">'.(($marginInfo[
'total_margin_rate'] ==
'') ?
'' :
price($marginInfo[
'total_margin_rate'], 0,
'', 0, 0, 2).
'%').
'</td>';
2284 $totalarray[
'nbfield']++;
2288 if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
2289 print
'<td class="right nowrap">'.(($marginInfo[
'total_mark_rate'] ==
'') ?
'' :
price($marginInfo[
'total_mark_rate'], 0,
'', 0, 0, 2).
'%').
'</td>';
2291 $totalarray[
'nbfield']++;
2294 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_mark_rate';
2296 if ($i >= $imaxinloop - 1) {
2297 if (!empty($total_ht)) {
2298 $totalarray[
'val'][
'total_mark_rate'] =
price2num($total_margin * 100 / $total_ht,
'MT');
2300 $totalarray[
'val'][
'total_mark_rate'] =
'';
2306 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
2308 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
2309 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
2310 print $hookmanager->resPrint;
2312 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
2313 print
'<td align="center" class="nowrap">';
2314 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
2317 $totalarray[
'nbfield']++;
2321 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
2322 print
'<td align="center" class="nowrap">';
2323 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
2326 $totalarray[
'nbfield']++;
2330 if (!empty($arrayfields[
'p.date_cloture'][
'checked'])) {
2331 print
'<td align="center" class="nowrap">';
2332 print
dol_print_date($db->jdate($obj->date_cloture),
'dayhour',
'tzuser');
2335 $totalarray[
'nbfield']++;
2339 if (!empty($arrayfields[
'p.note_public'][
'checked'])) {
2340 print
'<td class="sensiblehtmlcontent center">';
2344 $totalarray[
'nbfield']++;
2348 if (!empty($arrayfields[
'p.note_private'][
'checked'])) {
2349 print
'<td class="sensiblehtmlcontent center">';
2353 $totalarray[
'nbfield']++;
2357 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
2358 print
'<td class="nowrap center">'.$objectstatic->getLibStatut(5).
'</td>';
2360 $totalarray[
'nbfield']++;
2365 print
'<td class="nowrap" align="center">';
2366 if ($massactionbutton || $massaction) {
2368 if (in_array($obj->rowid, $arrayofselected)) {
2371 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2375 $totalarray[
'nbfield']++;
2387include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2392 foreach ($arrayfields as $key => $val) {
2393 if (!empty($val[
'checked'])) {
2397 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2402$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
2403$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2404print $hookmanager->resPrint;
2406print
'</table>'.
"\n";
2409print
'</form>'.
"\n";
2411if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
2412 $hidegeneratedfilelistifempty = 1;
2413 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2414 $hidegeneratedfilelistifempty = 0;
2417 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
2421 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2422 $urlsource .= str_replace(
'&',
'&', $param);
2424 $filedir = $diroutputmassaction;
2425 $genallowed = $permissiontoread;
2426 $delallowed = $permissiontoadd;
2428 print $formfile->showdocuments(
'massfilesarea_proposals',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
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.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
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...
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolPrintHTML($s, $allowiframe=0)
Return a string (that can be on several lines) ready to be output on a HTML page.
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.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0)
Set event message in dol_events session 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...
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).
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
print_barre_liste($title, $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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return 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...
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.