43require
'../../main.inc.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formpropal.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
48if (isModEnabled(
'margin')) {
49 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmargin.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
52require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
53require_once DOL_DOCUMENT_ROOT.
'/comm/propal/class/propal.class.php';
54require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
55if (isModEnabled(
'categorie')) {
56 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
57 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
61$langs->loadLangs(array(
'companies',
'propal',
'compta',
'bills',
'orders',
'products',
'deliveries',
'categories'));
62if (isModEnabled(
"expedition")) {
63 $langs->loadLangs(array(
'sendings'));
67$socid =
GETPOST(
'socid',
'int');
69$action =
GETPOST(
'action',
'aZ09');
70$massaction =
GETPOST(
'massaction',
'alpha');
71$show_files =
GETPOST(
'show_files',
'int');
72$confirm =
GETPOST(
'confirm',
'alpha');
73$cancel =
GETPOST(
'cancel',
'alpha');
74$toselect =
GETPOST(
'toselect',
'array');
75$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'proposallist';
76$mode =
GETPOST(
'mode',
'alpha');
79$search_user =
GETPOST(
'search_user',
'int');
80$search_sale =
GETPOST(
'search_sale',
'int');
82$search_refcustomer =
GETPOST(
'search_refcustomer',
'alpha');
83$search_refproject =
GETPOST(
'search_refproject',
'alpha');
84$search_project =
GETPOST(
'search_project',
'alpha');
86$search_societe =
GETPOST(
'search_societe',
'alpha');
87$search_societe_alias =
GETPOST(
'search_societe_alias',
'alpha');
88$search_montant_ht =
GETPOST(
'search_montant_ht',
'alpha');
89$search_montant_vat =
GETPOST(
'search_montant_vat',
'alpha');
90$search_montant_ttc =
GETPOST(
'search_montant_ttc',
'alpha');
91$search_warehouse =
GETPOST(
'search_warehouse',
'alpha');
92$search_multicurrency_code =
GETPOST(
'search_multicurrency_code',
'alpha');
93$search_multicurrency_tx =
GETPOST(
'search_multicurrency_tx',
'alpha');
94$search_multicurrency_montant_ht =
GETPOST(
'search_multicurrency_montant_ht',
'alpha');
95$search_multicurrency_montant_vat =
GETPOST(
'search_multicurrency_montant_vat',
'alpha');
96$search_multicurrency_montant_ttc =
GETPOST(
'search_multicurrency_montant_ttc',
'alpha');
97$search_login =
GETPOST(
'search_login',
'alpha');
98$search_product_category =
GETPOST(
'search_product_category',
'int');
99$search_town =
GETPOST(
'search_town',
'alpha');
100$search_zip =
GETPOST(
'search_zip',
'alpha');
101$search_state =
GETPOST(
"search_state");
102$search_country =
GETPOST(
"search_country",
'int');
103$search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'int');
104$search_date_startday =
GETPOST(
'search_date_startday',
'int');
105$search_date_startmonth =
GETPOST(
'search_date_startmonth',
'int');
106$search_date_startyear =
GETPOST(
'search_date_startyear',
'int');
107$search_date_endday =
GETPOST(
'search_date_endday',
'int');
108$search_date_endmonth =
GETPOST(
'search_date_endmonth',
'int');
109$search_date_endyear =
GETPOST(
'search_date_endyear',
'int');
110$search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
111$search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
112$search_date_end_startday =
GETPOST(
'search_date_end_startday',
'int');
113$search_date_end_startmonth =
GETPOST(
'search_date_end_startmonth',
'int');
114$search_date_end_startyear =
GETPOST(
'search_date_end_startyear',
'int');
115$search_date_end_endday =
GETPOST(
'search_date_end_endday',
'int');
116$search_date_end_endmonth =
GETPOST(
'search_date_end_endmonth',
'int');
117$search_date_end_endyear =
GETPOST(
'search_date_end_endyear',
'int');
118$search_date_end_start =
dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);
119$search_date_end_end =
dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
120$search_date_delivery_startday =
GETPOST(
'search_date_delivery_startday',
'int');
121$search_date_delivery_startmonth =
GETPOST(
'search_date_delivery_startmonth',
'int');
122$search_date_delivery_startyear =
GETPOST(
'search_date_delivery_startyear',
'int');
123$search_date_delivery_endday =
GETPOST(
'search_date_delivery_endday',
'int');
124$search_date_delivery_endmonth =
GETPOST(
'search_date_delivery_endmonth',
'int');
125$search_date_delivery_endyear =
GETPOST(
'search_date_delivery_endyear',
'int');
126$search_date_delivery_start =
dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear);
127$search_date_delivery_end =
dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear);
128$search_availability =
GETPOST(
'search_availability',
'int');
129$search_categ_cus =
GETPOST(
"search_categ_cus",
'int');
130$search_fk_cond_reglement =
GETPOST(
"search_fk_cond_reglement",
'int');
131$search_fk_shipping_method =
GETPOST(
"search_fk_shipping_method",
'int');
132$search_fk_input_reason =
GETPOST(
"search_fk_input_reason",
'int');
133$search_fk_mode_reglement =
GETPOST(
"search_fk_mode_reglement",
'int');
134$search_btn =
GETPOST(
'button_search',
'alpha');
135$search_remove_btn =
GETPOST(
'button_removefilter',
'alpha');
136$search_date_signature_startday =
GETPOST(
'search_date_signature_startday',
'int');
137$search_date_signature_startmonth =
GETPOST(
'search_date_signature_startmonth',
'int');
138$search_date_signature_startyear =
GETPOST(
'search_date_signature_startyear',
'int');
139$search_date_signature_endday =
GETPOST(
'search_date_signature_endday',
'int');
140$search_date_signature_endmonth =
GETPOST(
'search_date_signature_endmonth',
'int');
141$search_date_signature_endyear =
GETPOST(
'search_date_signature_endyear',
'int');
142$search_date_signature_start =
dol_mktime(0, 0, 0, $search_date_signature_startmonth, $search_date_signature_startday, $search_date_signature_startyear);
143$search_date_signature_end =
dol_mktime(23, 59, 59, $search_date_signature_endmonth, $search_date_signature_endday, $search_date_signature_endyear);
145$search_status =
GETPOST(
'search_status',
'alpha');
147$optioncss =
GETPOST(
'optioncss',
'alpha');
148$object_statut =
GETPOST(
'search_statut',
'alpha');
150$search_option =
GETPOST(
'search_option',
'alpha');
151if ($search_option ==
'late') {
152 $search_status =
'1';
153 $object_statut =
'1';
156$sall = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
160$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
161$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
162$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
163$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
164if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction ===
'0')) {
167$offset = $limit * $page;
168$pageprev = $page - 1;
169$pagenext = $page + 1;
171 $sortfield =
'p.ref';
181if (!empty($user->socid)) {
182 $socid = $user->socid;
187 $dbtable =
'&societe';
191$diroutputmassaction = $conf->propal->multidir_output[$conf->entity].
'/temp/massgeneration/'.$user->id;
195$hookmanager->initHooks(array(
'propallist'));
199$extrafields->fetch_name_optionals_label($object->table_element);
201$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
204$fieldstosearchall = array(
206 'p.ref_client'=>
'RefCustomer',
207 'pd.description'=>
'Description',
208 's.nom'=>
"ThirdParty",
209 's.name_alias'=>
"AliasNameShort",
212 'p.note_public'=>
'NotePublic',
214if (empty($user->socid)) {
215 $fieldstosearchall[
"p.note_private"] =
"NotePrivate";
219$checkedtypetiers = 0;
221 'p.ref'=>array(
'label'=>
"Ref",
'checked'=>1),
222 'p.ref_client'=>array(
'label'=>
"RefCustomer",
'checked'=>-1),
223 'pr.ref'=>array(
'label'=>
"ProjectRef",
'checked'=>1,
'enabled'=>(isModEnabled(
'project') ? 1 : 0)),
224 'pr.title'=>array(
'label'=>
"ProjectLabel",
'checked'=>0,
'enabled'=>(isModEnabled(
'project') ? 1 : 0)),
225 's.nom'=>array(
'label'=>
"ThirdParty",
'checked'=>1),
226 's.name_alias'=>array(
'label'=>
"AliasNameShort",
'checked'=>-1),
227 's.town'=>array(
'label'=>
"Town",
'checked'=>-1),
228 's.zip'=>array(
'label'=>
"Zip",
'checked'=>-1),
229 'state.nom'=>array(
'label'=>
"StateShort",
'checked'=>0),
230 'country.code_iso'=>array(
'label'=>
"Country",
'checked'=>0),
231 'typent.code'=>array(
'label'=>
"ThirdPartyType",
'checked'=>$checkedtypetiers),
232 'p.date'=>array(
'label'=>
"DatePropal",
'checked'=>1),
233 'p.fin_validite'=>array(
'label'=>
"DateEnd",
'checked'=>1),
234 'p.date_livraison'=>array(
'label'=>
"DeliveryDate",
'checked'=>0),
235 'p.date_signature'=>array(
'label'=>
"DateSigning",
'checked'=>0),
236 'ava.rowid'=>array(
'label'=>
"AvailabilityPeriod",
'checked'=>0),
237 'p.fk_shipping_method'=>array(
'label'=>
"SendingMethod",
'checked'=>0,
'enabled'=>isModEnabled(
"expedition")),
238 'p.fk_input_reason'=>array(
'label'=>
"Origin",
'checked'=>0,
'enabled'=>1),
239 'p.fk_cond_reglement'=>array(
'label'=>
"PaymentConditionsShort",
'checked'=>0),
240 'p.fk_mode_reglement'=>array(
'label'=>
"PaymentMode",
'checked'=>0),
241 'p.total_ht'=>array(
'label'=>
"AmountHT",
'checked'=>1),
242 'p.total_tva'=>array(
'label'=>
"AmountVAT",
'checked'=>0),
243 'p.total_ttc'=>array(
'label'=>
"AmountTTC",
'checked'=>0),
244 'p.total_ht_invoiced'=>array(
'label'=>
"AmountInvoicedHT",
'checked'=>0,
'enabled'=>!empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
245 'p.total_invoiced'=>array(
'label'=>
"AmountInvoicedTTC",
'checked'=>0,
'enabled'=>!empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
246 'p.multicurrency_code'=>array(
'label'=>
'Currency',
'checked'=>0,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
247 'p.multicurrency_tx'=>array(
'label'=>
'CurrencyRate',
'checked'=>0,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
248 'p.multicurrency_total_ht'=>array(
'label'=>
'MulticurrencyAmountHT',
'checked'=>0,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
249 'p.multicurrency_total_tva'=>array(
'label'=>
'MulticurrencyAmountVAT',
'checked'=>0,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
250 'p.multicurrency_total_ttc'=>array(
'label'=>
'MulticurrencyAmountTTC',
'checked'=>0,
'enabled'=>(!isModEnabled(
"multicurrency") ? 0 : 1)),
251 'p.multicurrency_total_ht_invoiced'=>array(
'label'=>
'MulticurrencyAmountInvoicedHT',
'checked'=>0,
'enabled'=>isModEnabled(
"multicurrency") && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
252 'p.multicurrency_total_invoiced'=>array(
'label'=>
'MulticurrencyAmountInvoicedTTC',
'checked'=>0,
'enabled'=>isModEnabled(
"multicurrency") && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
253 'u.login'=>array(
'label'=>
"Author",
'checked'=>1,
'position'=>10),
254 'sale_representative'=>array(
'label'=>
"SaleRepresentativesOfThirdParty",
'checked'=>-1),
255 'total_pa' => array(
'label' => (
getDolGlobalString(
'MARGIN_TYPE') ==
'1' ?
'BuyingPrice' :
'CostPrice'),
'checked' => 0,
'position' => 300,
'enabled' => (!isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') ? 0 : 1)),
256 'total_margin' => array(
'label' =>
'Margin',
'checked' => 0,
'position' => 301,
'enabled' => (!isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') ? 0 : 1)),
257 'total_margin_rate' => array(
'label' =>
'MarginRate',
'checked' => 0,
'position' => 302,
'enabled' => (!isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)),
258 'total_mark_rate' => array(
'label' =>
'MarkRate',
'checked' => 0,
'position' => 303,
'enabled' => (!isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)),
259 'p.datec'=>array(
'label'=>
"DateCreation",
'checked'=>0,
'position'=>500),
260 'p.tms'=>array(
'label'=>
"DateModificationShort",
'checked'=>0,
'position'=>500),
261 'p.date_cloture'=>array(
'label'=>
"DateClosing",
'checked'=>0,
'position'=>500),
262 'p.note_public'=>array(
'label'=>
'NotePublic',
'checked'=>0,
'position'=>510,
'enabled'=>(!
getDolGlobalInt(
'MAIN_LIST_HIDE_PUBLIC_NOTES'))),
263 'p.note_private'=>array(
'label'=>
'NotePrivate',
'checked'=>0,
'position'=>511,
'enabled'=>(!
getDolGlobalInt(
'MAIN_LIST_HIDE_PRIVATE_NOTES'))),
264 'p.fk_statut'=>array(
'label'=>
"Status",
'checked'=>1,
'position'=>1000),
292include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
295$permissiontoread = $user->hasRight(
'propal',
'lire');
296$permissiontoadd = $user->hasRight(
'propal',
'creer');
297$permissiontodelete = $user->hasRight(
'propal',
'supprimer');
298if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
299 $permissiontovalidate = $user->hasRight(
'propal',
'propal_advance',
'validate');
300 $permissiontoclose = $user->hasRight(
'propal',
'propal_advance',
'close');
301 $permissiontosendbymail = $user->hasRight(
'propal',
'propal_advance',
'send');
303 $permissiontovalidate = $user->hasRight(
'propal',
'creer');
304 $permissiontoclose = $user->hasRight(
'propal',
'creer');
305 $permissiontosendbymail = $user->hasRight(
'propal',
'lire');
313if (
GETPOST(
'cancel',
'alpha')) {
317if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
321$parameters = array(
'socid'=>$socid,
'arrayfields'=>&$arrayfields);
322$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
327include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
330if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
335 $search_refcustomer =
'';
336 $search_refproject =
'';
337 $search_project =
'';
338 $search_societe =
'';
339 $search_societe_alias =
'';
340 $search_montant_ht =
'';
341 $search_montant_vat =
'';
342 $search_montant_ttc =
'';
343 $search_warehouse =
'';
344 $search_multicurrency_code =
'';
345 $search_multicurrency_tx =
'';
346 $search_multicurrency_montant_ht =
'';
347 $search_multicurrency_montant_vat =
'';
348 $search_multicurrency_montant_ttc =
'';
350 $search_product_category =
'';
355 $search_country =
'';
356 $search_type_thirdparty =
'';
357 $search_date_startday =
'';
358 $search_date_startmonth =
'';
359 $search_date_startyear =
'';
360 $search_date_endday =
'';
361 $search_date_endmonth =
'';
362 $search_date_endyear =
'';
363 $search_date_start =
'';
364 $search_date_end =
'';
365 $search_date_end_startday =
'';
366 $search_date_end_startmonth =
'';
367 $search_date_end_startyear =
'';
368 $search_date_end_endday =
'';
369 $search_date_end_endmonth =
'';
370 $search_date_end_endyear =
'';
371 $search_date_end_start =
'';
372 $search_date_end_end =
'';
373 $search_date_delivery_startday =
'';
374 $search_date_delivery_startmonth =
'';
375 $search_date_delivery_startyear =
'';
376 $search_date_delivery_endday =
'';
377 $search_date_delivery_endmonth =
'';
378 $search_date_delivery_endyear =
'';
379 $search_date_delivery_start =
'';
380 $search_date_delivery_end =
'';
381 $search_availability =
'';
385 $search_array_options = array();
386 $search_categ_cus = 0;
387 $search_fk_cond_reglement =
'';
388 $search_fk_shipping_method =
'';
389 $search_fk_input_reason =
'';
390 $search_fk_mode_reglement =
'';
391 $search_date_signature_startday =
'';
392 $search_date_signature_startmonth =
'';
393 $search_date_signature_startyear =
'';
394 $search_date_signature_endday =
'';
395 $search_date_signature_endmonth =
'';
396 $search_date_signature_endyear =
'';
397 $search_date_signature_start =
'';
398 $search_date_signature_end =
'';
401if ($object_statut !=
'') {
402 $search_status = $object_statut;
406if (empty($reshook)) {
407 $objectclass =
'Propal';
408 $objectlabel =
'Proposals';
409 $uploaddir = $conf->propal->multidir_output[$conf->entity];
410 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
413if ($action ==
'validate' && $permissiontovalidate) {
414 if (
GETPOST(
'confirm') ==
'yes') {
415 $tmpproposal =
new Propal($db);
418 foreach ($toselect as $checked) {
419 if ($tmpproposal->fetch($checked) > 0) {
420 if ($tmpproposal->statut == $tmpproposal::STATUS_DRAFT) {
421 if ($tmpproposal->valid($user) > 0) {
422 setEventMessages($langs->trans(
'hasBeenValidated', $tmpproposal->ref),
null,
'mesgs');
428 $langs->load(
"errors");
429 setEventMessages($langs->trans(
'ErrorIsNotADraft', $tmpproposal->ref),
null,
'errors');
445if ($action ==
"sign" && $permissiontoclose) {
446 if (
GETPOST(
'confirm') ==
'yes') {
447 $tmpproposal =
new Propal($db);
450 foreach ($toselect as $checked) {
451 if ($tmpproposal->fetch($checked) > 0) {
452 if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) {
453 $tmpproposal->statut = $tmpproposal::STATUS_SIGNED;
454 if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_SIGNED) >= 0) {
455 setEventMessages($tmpproposal->ref.
" ".$langs->trans(
'Signed'),
null,
'mesgs');
461 setEventMessage($langs->trans(
'MustBeValidatedToBeSigned', $tmpproposal->ref),
'errors');
477if ($action ==
"nosign" && $permissiontoclose) {
478 if (
GETPOST(
'confirm') ==
'yes') {
479 $tmpproposal =
new Propal($db);
482 foreach ($toselect as $checked) {
483 if ($tmpproposal->fetch($checked) > 0) {
484 if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED || (!empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE) && $tmpproposal->statut == $tmpproposal::STATUS_DRAFT)) {
485 $tmpproposal->statut = $tmpproposal::STATUS_NOTSIGNED;
486 if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_NOTSIGNED) > 0) {
487 setEventMessage($tmpproposal->ref.
" ".$langs->trans(
'NoSigned'),
'mesgs');
493 setEventMessage($tmpproposal->ref.
" ".$langs->trans(
'CantBeNoSign'),
'errors');
510if (!$error && $massaction ===
'setbilled' && $permissiontoclose) {
513 $objecttmp =
new $objectclass($db);
515 foreach ($toselect as $toselectid) {
516 $result = $objecttmp->fetch($toselectid);
518 $result = $objecttmp->classifyBilled($user, 0);
553$form =
new Form($db);
558if (isModEnabled(
'margin')) {
561$companystatic =
new Societe($db);
562$projectstatic =
new Project($db);
565$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
566$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
569if ($sall || $search_user > 0) {
570 $sql =
'SELECT DISTINCT';
572$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, ';
573$sql .=
" typent.code as typent_code,";
574$sql .=
" ava.rowid as availability,";
575$sql .=
" country.code as country_code,";
576$sql .=
" state.code_departement as state_code, state.nom as state_name,";
577$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,';
578$sql .=
' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc,';
579$sql .=
' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,';
580$sql .=
' p.date_signature as dsignature,';
581$sql .=
' p.note_public, p.note_private,';
582$sql .=
' p.fk_cond_reglement,p.deposit_percent,p.fk_mode_reglement,p.fk_shipping_method,p.fk_input_reason,';
583$sql .=
" pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
584$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';
585if (empty($user->rights->societe->client->voir) && !$socid) {
586 $sql .=
", sc.fk_soc, sc.fk_user";
588if (!empty($search_categ_cus) && $search_categ_cus !=
'-1') {
589 $sql .=
", cc.fk_categorie, cc.fk_soc";
592if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
593 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
594 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
598$parameters = array();
599$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
600$sql .= $hookmanager->resPrint;
601$sql = preg_replace(
'/, $/',
'', $sql);
605$sql .=
' FROM '.MAIN_DB_PREFIX.
'societe as s';
606$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
607$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
608$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
609if (!empty($search_categ_cus) && $search_categ_cus !=
'-1') {
610 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
"categorie_societe as cc ON s.rowid = cc.fk_soc";
612$sql .=
', '.MAIN_DB_PREFIX.
'propal as p';
613if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
614 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
617 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'propaldet as pd ON p.rowid=pd.fk_propal';
619$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON p.fk_user_author = u.rowid';
620$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as pr ON pr.rowid = p.fk_projet";
621$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_availability as ava on (ava.rowid = p.fk_availability)";
623if ($search_sale == -2) {
624 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON (sc.fk_soc = p.fk_soc)";
625} elseif ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) {
626 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
628if ($search_user > 0) {
629 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as c";
630 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
634$parameters = array();
635$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
636$sql .= $hookmanager->resPrint;
638$sql .=
' WHERE p.fk_soc = s.rowid';
639$sql .=
' AND p.entity IN ('.getEntity(
'propal').
')';
640if (empty($user->rights->societe->client->voir) && !$socid) {
641 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
653if ($search_country) {
654 $sql .=
" AND s.fk_pays IN (".$db->sanitize($db->escape($search_country)).
')';
656if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
657 $sql .=
" AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).
')';
662if ($search_refcustomer) {
665if ($search_refproject) {
668if ($search_project) {
671if ($search_availability) {
672 $sql .=
" AND p.fk_availability IN (".$db->sanitize($db->escape($search_availability)).
')';
674if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
675 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_societe);
677 if ($search_societe) {
680 if ($search_societe_alias) {
685 $sql .=
natural_search(array(
"u.login",
"u.firstname",
"u.lastname"), $search_login);
687if ($search_montant_ht !=
'') {
690if ($search_montant_vat !=
'') {
693if ($search_montant_ttc !=
'') {
696if ($search_warehouse !=
'' && $search_warehouse > 0) {
699if ($search_multicurrency_code !=
'') {
700 $sql .=
" AND p.multicurrency_code = '".$db->escape($search_multicurrency_code).
"'";
702if ($search_multicurrency_tx !=
'') {
703 $sql .=
natural_search(
'p.multicurrency_tx', $search_multicurrency_tx, 1);
705if ($search_multicurrency_montant_ht !=
'') {
706 $sql .=
natural_search(
'p.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
708if ($search_multicurrency_montant_vat !=
'') {
709 $sql .=
natural_search(
'p.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
711if ($search_multicurrency_montant_ttc !=
'') {
712 $sql .=
natural_search(
'p.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
718if ($search_categ_cus > 0) {
719 $sql .=
" AND cc.fk_categorie = ".((int) $search_categ_cus);
721if ($search_categ_cus == -2) {
722 $sql .=
" AND cc.fk_categorie IS NULL";
725if ($search_fk_cond_reglement > 0) {
726 $sql .=
" AND p.fk_cond_reglement = ".((int) $search_fk_cond_reglement);
728if ($search_fk_shipping_method > 0) {
729 $sql .=
" AND p.fk_shipping_method = ".((int) $search_fk_shipping_method);
731if ($search_fk_input_reason > 0) {
732 $sql .=
" AND p.fk_input_reason = ".((int) $search_fk_input_reason);
734if ($search_fk_mode_reglement > 0) {
735 $sql .=
" AND p.fk_mode_reglement = ".((int) $search_fk_mode_reglement);
738 $sql .=
' AND s.rowid = '.((int) $socid);
740if ($search_status !=
'' && $search_status !=
'-1') {
741 $sql .=
' AND p.fk_statut IN ('.$db->sanitize($search_status).
')';
743if ($search_date_start) {
744 $sql .=
" AND p.datep >= '".$db->idate($search_date_start).
"'";
746if ($search_date_end) {
747 $sql .=
" AND p.datep <= '".$db->idate($search_date_end).
"'";
749if ($search_date_end_start) {
750 $sql .=
" AND p.fin_validite >= '".$db->idate($search_date_end_start).
"'";
752if ($search_date_end_end) {
753 $sql .=
" AND p.fin_validite <= '".$db->idate($search_date_end_end).
"'";
755if ($search_date_delivery_start) {
756 $sql .=
" AND p.date_livraison >= '".$db->idate($search_date_delivery_start).
"'";
758if ($search_date_delivery_end) {
759 $sql .=
" AND p.date_livraison <= '".$db->idate($search_date_delivery_end).
"'";
761if ($search_sale == -2) {
762 $sql .=
" AND sc.fk_user IS NULL";
763} elseif ($search_sale > 0) {
764 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
766if ($search_user > 0) {
767 $sql .=
" AND c.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".((int) $search_user);
769if ($search_date_signature_start) {
770 $sql .=
" AND p.date_signature >= '".$db->idate($search_date_signature_start).
"'";
772if ($search_date_signature_end) {
773 $sql .=
" AND p.date_signature <= '".$db->idate($search_date_signature_end).
"'";
775if ($search_option ==
'late') {
776 $sql .=
" AND p.fin_validite < '".$db->idate(
dol_now() - $conf->propal->cloture->warning_delay).
"'";
779$searchCategoryProductOperator = -1;
780$searchCategoryProductList = array($search_product_category);
781if (!empty($searchCategoryProductList)) {
782 $searchCategoryProductSqlList = array();
783 $listofcategoryid =
'';
784 foreach ($searchCategoryProductList as $searchCategoryProduct) {
785 if (intval($searchCategoryProduct) == -2) {
786 $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)";
787 } elseif (intval($searchCategoryProduct) > 0) {
788 if ($searchCategoryProductOperator == 0) {
789 $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).
")";
791 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
795 if ($listofcategoryid) {
796 $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).
"))";
798 if ($searchCategoryProductOperator == 1) {
799 if (!empty($searchCategoryProductSqlList)) {
800 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
803 if (!empty($searchCategoryProductSqlList)) {
804 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
809include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
812$parameters = array();
813$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
814$sql .= $hookmanager->resPrint;
817$parameters = array();
818$reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object, $action);
819$sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
822$nbtotalofrecords =
'';
825 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
826 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
827 $resql = $db->query($sqlforcount);
829 $objforcount = $db->fetch_object($resql);
830 $nbtotalofrecords = $objforcount->nbtotalofrecords;
835 if (($page * $limit) > $nbtotalofrecords) {
842$sql .= $db->order($sortfield, $sortorder);
843$sql .=
', p.ref DESC';
845 $sql .= $db->plimit($limit + 1, $offset);
848$resql = $db->query($sql);
851 $objectstatic =
new Propal($db);
852 $userstatic =
new User($db);
857 $title = $langs->trans(
'Proposals').
' - '.$soc->name;
858 if (empty($search_societe)) {
859 $search_societe = $soc->name;
862 $title = $langs->trans(
'Proposals');
865 $num = $db->num_rows($resql);
867 $arrayofselected = is_array($toselect) ? $toselect : array();
869 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) {
870 $obj = $db->fetch_object($resql);
874 header(
"Location: ".DOL_URL_ROOT.
'/comm/propal/card.php?id='.$id);
878 $help_url =
'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos';
881 $param =
'&search_status='.urlencode($search_status);
883 $param .=
'&mode='.urlencode($mode);
885 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
886 $param .=
'&contextpage='.urlencode($contextpage);
888 if ($limit > 0 && $limit != $conf->liste_limit) {
889 $param .=
'&limit='.((int) $limit);
892 $param .=
'&sall='.urlencode($sall);
894 if ($search_date_startday) {
895 $param .=
'&search_date_startday='.urlencode($search_date_startday);
897 if ($search_date_startmonth) {
898 $param .=
'&search_date_startmonth='.urlencode($search_date_startmonth);
900 if ($search_date_startyear) {
901 $param .=
'&search_date_startyear='.urlencode($search_date_startyear);
903 if ($search_date_endday) {
904 $param .=
'&search_date_endday='.urlencode($search_date_endday);
906 if ($search_date_endmonth) {
907 $param .=
'&search_date_endmonth='.urlencode($search_date_endmonth);
909 if ($search_date_endyear) {
910 $param .=
'&search_date_endyear='.urlencode($search_date_endyear);
912 if ($search_date_end_startday) {
913 $param .=
'&search_date_end_startday='.urlencode($search_date_end_startday);
915 if ($search_date_end_startmonth) {
916 $param .=
'&search_date_end_startmonth='.urlencode($search_date_end_startmonth);
918 if ($search_date_end_startyear) {
919 $param .=
'&search_date_end_startyear='.urlencode($search_date_end_startyear);
921 if ($search_date_end_endday) {
922 $param .=
'&search_date_end_endday='.urlencode($search_date_end_endday);
924 if ($search_date_end_endmonth) {
925 $param .=
'&search_date_end_endmonth='.urlencode($search_date_end_endmonth);
927 if ($search_date_end_endyear) {
928 $param .=
'&search_date_end_endyear='.urlencode($search_date_end_endyear);
930 if ($search_date_delivery_startday) {
931 $param .=
'&search_date_delivery_startday='.urlencode($search_date_delivery_startday);
933 if ($search_date_delivery_startmonth) {
934 $param .=
'&search_date_delivery_startmonth='.urlencode($search_date_delivery_startmonth);
936 if ($search_date_delivery_startyear) {
937 $param .=
'&search_date_delivery_startyear='.urlencode($search_date_delivery_startyear);
939 if ($search_date_delivery_endday) {
940 $param .=
'&search_date_delivery_endday='.urlencode($search_date_delivery_endday);
942 if ($search_date_delivery_endmonth) {
943 $param .=
'&search_date_delivery_endmonth='.urlencode($search_date_delivery_endmonth);
945 if ($search_date_delivery_endyear) {
946 $param .=
'&search_date_delivery_endyear='.urlencode($search_date_delivery_endyear);
949 $param .=
'&search_ref='.urlencode($search_ref);
951 if ($search_refcustomer) {
952 $param .=
'&search_refcustomer='.urlencode($search_refcustomer);
954 if ($search_refproject) {
955 $param .=
'&search_refproject='.urlencode($search_refproject);
957 if ($search_societe) {
958 $param .=
'&search_societe='.urlencode($search_societe);
960 if ($search_societe_alias) {
961 $param .=
'&search_societe_alias='.urlencode($search_societe_alias);
963 if ($search_user > 0) {
964 $param .=
'&search_user='.urlencode($search_user);
966 if ($search_sale > 0) {
967 $param .=
'&search_sale='.urlencode($search_sale);
969 if ($search_montant_ht) {
970 $param .=
'&search_montant_ht='.urlencode($search_montant_ht);
972 if ($search_multicurrency_code !=
'') {
973 $param .=
'&search_multicurrency_code='.urlencode($search_multicurrency_code);
975 if ($search_multicurrency_tx !=
'') {
976 $param .=
'&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
978 if ($search_multicurrency_montant_ht !=
'') {
979 $param .=
'&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
981 if ($search_multicurrency_montant_vat !=
'') {
982 $param .=
'&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
984 if ($search_multicurrency_montant_ttc !=
'') {
985 $param .=
'&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
988 $param .=
'&search_login='.urlencode($search_login);
991 $param .=
'&search_town='.urlencode($search_town);
994 $param .=
'&search_zip='.urlencode($search_zip);
997 $param .=
'&socid='.urlencode($socid);
999 if ($optioncss !=
'') {
1000 $param .=
'&optioncss='.urlencode($optioncss);
1002 if ($search_categ_cus > 0) {
1003 $param .=
'&search_categ_cus='.urlencode($search_categ_cus);
1005 if ($search_product_category !=
'') {
1006 $param .=
'&search_product_category='.urlencode($search_product_category);
1008 if ($search_fk_cond_reglement > 0) {
1009 $param .=
'&search_fk_cond_reglement='.urlencode($search_fk_cond_reglement);
1011 if ($search_fk_shipping_method > 0) {
1012 $param .=
'&search_fk_shipping_method='.urlencode($search_fk_shipping_method);
1014 if ($search_fk_input_reason > 0) {
1015 $param .=
'&search_fk_input_reason='.urlencode($search_fk_input_reason);
1017 if ($search_fk_mode_reglement > 0) {
1018 $param .=
'&search_fk_mode_reglement='.urlencode($search_fk_mode_reglement);
1020 if ($search_type_thirdparty > 0) {
1021 $param .=
'&search_type_thirdparty='.urlencode($search_type_thirdparty);
1024 $param .=
'&search_town='.urlencode($search_town);
1027 $param .=
'&search_zip='.urlencode($search_zip);
1029 if ($search_state) {
1030 $param .=
'&search_state='.urlencode($search_state);
1033 $param .=
'&search_town='.urlencode($search_town);
1035 if ($search_country) {
1036 $param .=
'&search_country='.urlencode($search_country);
1038 if ($search_date_signature_startday) {
1039 $param .=
'&search_date_signature_startday='.urlencode($search_date_signature_startday);
1041 if ($search_date_signature_startmonth) {
1042 $param .=
'&search_date_signature_startmonth='.urlencode($search_date_signature_startmonth);
1044 if ($search_date_signature_startyear) {
1045 $param .=
'&search_date_signature_startyear='.urlencode($search_date_signature_startyear);
1047 if ($search_date_signature_endday) {
1048 $param .=
'&search_date_signature_endday='.urlencode($search_date_signature_endday);
1050 if ($search_date_signature_endmonth) {
1051 $param .=
'&search_date_signature_endmonth='.urlencode($search_date_signature_endmonth);
1053 if ($search_date_signature_endyear) {
1054 $param .=
'&search_date_signature_endyear='.urlencode($search_date_signature_endyear);
1056 if ($search_option) {
1057 $param .=
"&search_option=".urlencode($search_option);
1061 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
1063 $parameters = array();
1064 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
1065 $param .= $hookmanager->resPrint;
1068 $arrayofmassactions = array(
1069 'generate_doc'=>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
1070 'builddoc'=>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
1072 if ($permissiontosendbymail) {
1073 $arrayofmassactions[
'presend']=
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail");
1075 if ($permissiontovalidate) {
1076 $arrayofmassactions[
'prevalidate']=
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate");
1078 if ($permissiontoclose) {
1079 $arrayofmassactions[
'presign']=
img_picto(
'',
'propal',
'class="pictofixedwidth"').$langs->trans(
"Sign");
1080 $arrayofmassactions[
'nopresign']=
img_picto(
'',
'propal',
'class="pictofixedwidth"').$langs->trans(
"NoSign");
1081 $arrayofmassactions[
'setbilled'] =
img_picto(
'',
'bill',
'class="pictofixedwidth"').$langs->trans(
"ClassifyBilled");
1083 if ($permissiontodelete) {
1084 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
1087 if (in_array($massaction, array(
'presend',
'predelete',
'closed'))) {
1088 $arrayofmassactions = array();
1090 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1092 $url = DOL_URL_ROOT.
'/comm/propal/card.php?action=create';
1093 if (!empty($socid)) {
1094 $url .=
'&socid='.$socid;
1096 $newcardbutton =
'';
1097 $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'));
1098 $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'));
1099 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewPropal'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'propal',
'creer'));
1102 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
1103 if ($optioncss !=
'') {
1104 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1106 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1107 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1108 print
'<input type="hidden" name="action" value="list">';
1109 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1110 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1111 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
1112 print
'<input type="hidden" name="mode"value="'.$mode.
'">';
1114 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'propal', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1116 $topicmail =
"SendPropalRef";
1117 $modelmail =
"propal_send";
1118 $objecttmp =
new Propal($db);
1119 $trackid =
'pro'.$object->id;
1120 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1122 if ($massaction ==
'prevalidate') {
1123 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassValidation"), $langs->trans(
"ConfirmMassValidationQuestion"),
"validate",
null,
'', 0, 200, 500, 1);
1126 if ($massaction ==
'presign') {
1127 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassSignature"), $langs->trans(
"ConfirmMassSignatureQuestion"),
"sign",
null,
'', 0, 200, 500, 1);
1130 if ($massaction ==
'nopresign') {
1131 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassNoSignature"), $langs->trans(
"ConfirmMassNoSignatureQuestion"),
"nosign",
null,
'', 0, 200, 500, 1);
1135 foreach ($fieldstosearchall as $key => $val) {
1136 $fieldstosearchall[$key] = $langs->trans($val);
1138 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $sall).join(
', ', $fieldstosearchall).
'</div>';
1143 $moreforfilter =
'';
1146 if ($user->rights->user->user->lire) {
1147 $langs->load(
"commercial");
1148 $moreforfilter .=
'<div class="divsearchfield">';
1149 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1150 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth250 widthcentpercentminusx', 1);
1151 $moreforfilter .=
'</div>';
1154 if ($user->rights->user->user->lire) {
1155 $moreforfilter .=
'<div class="divsearchfield">';
1156 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
1157 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$form->select_dolusers($search_user,
'search_user', $tmptitle,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth250 widthcentpercentminusx');
1158 $moreforfilter .=
'</div>';
1161 if (isModEnabled(
'categorie') && $user->hasRight(
'categorie',
'read') && ($user->hasRight(
'product',
'read') || $user->hasRight(
'service',
'read'))) {
1162 $searchCategoryProductOperator = -1;
1163 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1164 $tmptitle = $langs->trans(
'IncludingProductWithTag');
1166 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, array($search_product_category),
'maxwidth300', $searchCategoryProductOperator, 0, 0, $tmptitle);
1168 if (isModEnabled(
'categorie') && $user->hasRight(
'categorie',
'lire')) {
1169 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1170 $moreforfilter .=
'<div class="divsearchfield">';
1171 $tmptitle = $langs->trans(
'CustomersProspectsCategoriesShort');
1172 $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'));
1173 $moreforfilter .=
'</div>';
1175 if (isModEnabled(
'stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
1176 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
1178 $moreforfilter .=
'<div class="divsearchfield">';
1179 $tmptitle = $langs->trans(
'Warehouse');
1180 $moreforfilter .=
img_picto($tmptitle,
'stock',
'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse,
'search_warehouse',
'', $tmptitle, 0, 0, $tmptitle);
1181 $moreforfilter .=
'</div>';
1184 $parameters = array();
1185 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1186 if (empty($reshook)) {
1187 $moreforfilter .= $hookmanager->resPrint;
1189 $moreforfilter = $hookmanager->resPrint;
1192 if (!empty($moreforfilter)) {
1193 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1194 print $moreforfilter;
1198 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1199 $selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
1200 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1202 print
'<div class="div-table-responsive">';
1203 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1205 print
'<tr class="liste_titre_filter">';
1208 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1209 print
'<td class="liste_titre" align="middle">';
1210 $searchpicto = $form->showFilterButtons(
'left');
1215 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1216 print
'<td class="liste_titre">';
1217 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
1220 if (!empty($arrayfields[
'p.ref_client'][
'checked'])) {
1221 print
'<td class="liste_titre">';
1222 print
'<input class="flat maxwidth50" type="text" name="search_refcustomer" value="'.dol_escape_htmltag($search_refcustomer).
'">';
1225 if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1226 print
'<td class="liste_titre">';
1227 print
'<input class="flat maxwidth50" type="text" name="search_refproject" value="'.dol_escape_htmltag($search_refproject).
'">';
1230 if (!empty($arrayfields[
'pr.title'][
'checked'])) {
1231 print
'<td class="liste_titre">';
1232 print
'<input class="flat maxwidth50" type="text" name="search_project" value="'.dol_escape_htmltag($search_project).
'">';
1235 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1236 print
'<td class="liste_titre" align="left">';
1237 print
'<input class="flat maxwidth100" type="text" name="search_societe" value="'.dol_escape_htmltag($search_societe).
'">';
1240 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1241 print
'<td class="liste_titre" align="left">';
1242 print
'<input class="flat maxwidth100" type="text" name="search_societe_alias" value="'.dol_escape_htmltag($search_societe_alias).
'">';
1245 if (!empty($arrayfields[
's.town'][
'checked'])) {
1246 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_town" value="'.$search_town.
'"></td>';
1248 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1249 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_zip" value="'.$search_zip.
'"></td>';
1252 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1253 print
'<td class="liste_titre">';
1254 print
'<input class="flat maxwidth50" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1258 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1259 print
'<td class="liste_titre" align="center">';
1260 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1264 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1265 print
'<td class="liste_titre maxwidth100onsmartphone" align="center">';
1266 print $form->selectarray(
"search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0,
'', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ?
'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT),
'', 1);
1271 if (!empty($arrayfields[
'p.date'][
'checked'])) {
1272 print
'<td class="liste_titre center">';
1273 print
'<div class="nowrap">';
1274 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1276 print
'<div class="nowrap">';
1277 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1282 if (!empty($arrayfields[
'p.fin_validite'][
'checked'])) {
1283 print
'<td class="liste_titre center">';
1284 print
'<div class="nowrap">';
1285 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'));
1287 print
'<div class="nowrap">';
1288 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'));
1293 if (!empty($arrayfields[
'p.date_livraison'][
'checked'])) {
1294 print
'<td class="liste_titre center">';
1295 print
'<div class="nowrap">';
1296 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'));
1298 print
'<div class="nowrap">';
1299 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'));
1304 if (!empty($arrayfields[
'p.date_signature'][
'checked'])) {
1305 print
'<td class="liste_titre center">';
1306 print
'<div class="nowrap">';
1307 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'));
1309 print
'<div class="nowrap">';
1310 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'));
1315 if (!empty($arrayfields[
'ava.rowid'][
'checked'])) {
1316 print
'<td class="liste_titre maxwidth100onsmartphone center">';
1317 $form->selectAvailabilityDelay($search_availability,
'search_availability',
'', 1);
1322 if (!empty($arrayfields[
'p.fk_shipping_method'][
'checked'])) {
1323 print
'<td class="liste_titre">';
1324 $form->selectShippingMethod($search_fk_shipping_method,
'search_fk_shipping_method',
'', 1,
'', 1);
1328 if (!empty($arrayfields[
'p.fk_input_reason'][
'checked'])) {
1329 print
'<td class="liste_titre">';
1330 $form->selectInputReason($search_fk_input_reason,
'search_fk_input_reason',
'', 1,
'maxwidth125', 1);
1334 if (!empty($arrayfields[
'p.fk_cond_reglement'][
'checked'])) {
1335 print
'<td class="liste_titre">';
1336 print $form->getSelectConditionsPaiements($search_fk_cond_reglement,
'search_fk_cond_reglement', 1, 1, 1);
1340 if (!empty($arrayfields[
'p.fk_mode_reglement'][
'checked'])) {
1341 print
'<td class="liste_titre">';
1342 print $form->select_types_paiements($search_fk_mode_reglement,
'search_fk_mode_reglement',
'', 0, 1, 1, 0, -1,
'', 1);
1345 if (!empty($arrayfields[
'p.total_ht'][
'checked'])) {
1347 print
'<td class="liste_titre right">';
1348 print
'<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).
'">';
1351 if (!empty($arrayfields[
'p.total_tva'][
'checked'])) {
1353 print
'<td class="liste_titre right">';
1354 print
'<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).
'">';
1357 if (!empty($arrayfields[
'p.total_ttc'][
'checked'])) {
1359 print
'<td class="liste_titre right">';
1360 print
'<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).
'">';
1363 if (!empty($arrayfields[
'p.total_ht_invoiced'][
'checked'])) {
1365 print
'<td class="liste_titre right">';
1368 if (!empty($arrayfields[
'p.total_invoiced'][
'checked'])) {
1370 print
'<td class="liste_titre right">';
1373 if (!empty($arrayfields[
'p.multicurrency_code'][
'checked'])) {
1375 print
'<td class="liste_titre">';
1376 print $form->selectMultiCurrency($search_multicurrency_code,
'search_multicurrency_code', 1);
1379 if (!empty($arrayfields[
'p.multicurrency_tx'][
'checked'])) {
1381 print
'<td class="liste_titre">';
1382 print
'<input class="flat" type="text" size="4" name="search_multicurrency_tx" value="'.dol_escape_htmltag($search_multicurrency_tx).
'">';
1385 if (!empty($arrayfields[
'p.multicurrency_total_ht'][
'checked'])) {
1387 print
'<td class="liste_titre right">';
1388 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ht" value="'.dol_escape_htmltag($search_multicurrency_montant_ht).
'">';
1391 if (!empty($arrayfields[
'p.multicurrency_total_tva'][
'checked'])) {
1393 print
'<td class="liste_titre right">';
1394 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_vat" value="'.dol_escape_htmltag($search_multicurrency_montant_vat).
'">';
1397 if (!empty($arrayfields[
'p.multicurrency_total_ttc'][
'checked'])) {
1399 print
'<td class="liste_titre right">';
1400 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ttc" value="'.dol_escape_htmltag($search_multicurrency_montant_ttc).
'">';
1403 if (!empty($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'checked'])) {
1405 print
'<td class="liste_titre right">';
1408 if (!empty($arrayfields[
'p.multicurrency_total_invoiced'][
'checked'])) {
1410 print
'<td class="liste_titre right">';
1413 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1415 print
'<td class="liste_titre">';
1416 print
'<input class="flat maxwidth75" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1419 if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
1420 print
'<td class="liste_titre"></td>';
1422 if (!empty($arrayfields[
'total_pa'][
'checked'])) {
1423 print
'<td class="liste_titre right">';
1426 if (!empty($arrayfields[
'total_margin'][
'checked'])) {
1427 print
'<td class="liste_titre right">';
1430 if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
1431 print
'<td class="liste_titre right">';
1434 if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
1435 print
'<td class="liste_titre right">';
1439 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1442 $parameters = array(
'arrayfields'=>$arrayfields);
1443 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1444 print $hookmanager->resPrint;
1446 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1447 print
'<td class="liste_titre">';
1451 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1452 print
'<td class="liste_titre">';
1456 if (!empty($arrayfields[
'p.date_cloture'][
'checked'])) {
1457 print
'<td class="liste_titre">';
1460 if (!empty($arrayfields[
'p.note_public'][
'checked'])) {
1462 print
'<td class="liste_titre">';
1465 if (!empty($arrayfields[
'p.note_private'][
'checked'])) {
1467 print
'<td class="liste_titre">';
1471 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1472 print
'<td class="liste_titre right parentonrightofpage">';
1473 $formpropal->selectProposalStatus($search_status, 1, 0, 1,
'customer',
'search_statut',
'search_status width100 onrightofpage');
1477 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1478 print
'<td class="liste_titre" align="middle">';
1479 $searchpicto = $form->showFilterButtons();
1485 $totalarray = array(
1495 print
'<tr class="liste_titre">';
1496 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1497 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
1499 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1500 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'p.ref',
'', $param,
'', $sortfield, $sortorder);
1502 if (!empty($arrayfields[
'p.ref_client'][
'checked'])) {
1503 print_liste_field_titre($arrayfields[
'p.ref_client'][
'label'], $_SERVER[
"PHP_SELF"],
'p.ref_client',
'', $param,
'', $sortfield, $sortorder);
1505 if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1506 print_liste_field_titre($arrayfields[
'pr.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'pr.ref',
'', $param,
'', $sortfield, $sortorder);
1508 if (!empty($arrayfields[
'pr.title'][
'checked'])) {
1509 print_liste_field_titre($arrayfields[
'pr.title'][
'label'], $_SERVER[
"PHP_SELF"],
'pr.title',
'', $param,
'', $sortfield, $sortorder);
1511 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1512 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
's.nom',
'', $param,
'', $sortfield, $sortorder);
1514 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1515 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
's.name_alias',
'', $param,
'', $sortfield, $sortorder);
1517 if (!empty($arrayfields[
's.town'][
'checked'])) {
1518 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1520 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1521 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1523 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1524 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1526 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1527 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'class="center"', $sortfield, $sortorder);
1529 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1530 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'class="center"', $sortfield, $sortorder);
1532 if (!empty($arrayfields[
'p.date'][
'checked'])) {
1533 print_liste_field_titre($arrayfields[
'p.date'][
'label'], $_SERVER[
"PHP_SELF"],
'p.datep',
'', $param,
'class="center"', $sortfield, $sortorder);
1535 if (!empty($arrayfields[
'p.fin_validite'][
'checked'])) {
1536 print_liste_field_titre($arrayfields[
'p.fin_validite'][
'label'], $_SERVER[
"PHP_SELF"],
'dfv',
'', $param,
'class="center"', $sortfield, $sortorder);
1538 if (!empty($arrayfields[
'p.date_livraison'][
'checked'])) {
1539 print_liste_field_titre($arrayfields[
'p.date_livraison'][
'label'], $_SERVER[
"PHP_SELF"],
'p.date_livraison',
'', $param,
'class="center"', $sortfield, $sortorder);
1541 if (!empty($arrayfields[
'p.date_signature'][
'checked'])) {
1542 print_liste_field_titre($arrayfields[
'p.date_signature'][
'label'], $_SERVER[
"PHP_SELF"],
'p.date_signature',
'', $param,
'class="center"', $sortfield, $sortorder);
1544 if (!empty($arrayfields[
'ava.rowid'][
'checked'])) {
1545 print_liste_field_titre($arrayfields[
'ava.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
'availability',
'', $param,
'', $sortfield, $sortorder);
1547 if (!empty($arrayfields[
'p.fk_shipping_method'][
'checked'])) {
1548 print_liste_field_titre($arrayfields[
'p.fk_shipping_method'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_shipping_method",
"", $param,
'', $sortfield, $sortorder);
1550 if (!empty($arrayfields[
'p.fk_input_reason'][
'checked'])) {
1551 print_liste_field_titre($arrayfields[
'p.fk_input_reason'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_input_reason",
"", $param,
'', $sortfield, $sortorder);
1553 if (!empty($arrayfields[
'p.fk_cond_reglement'][
'checked'])) {
1554 print_liste_field_titre($arrayfields[
'p.fk_cond_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_cond_reglement",
"", $param,
'', $sortfield, $sortorder);
1556 if (!empty($arrayfields[
'p.fk_mode_reglement'][
'checked'])) {
1557 print_liste_field_titre($arrayfields[
'p.fk_mode_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_mode_reglement",
"", $param,
'', $sortfield, $sortorder);
1559 if (!empty($arrayfields[
'p.total_ht'][
'checked'])) {
1560 print_liste_field_titre($arrayfields[
'p.total_ht'][
'label'], $_SERVER[
"PHP_SELF"],
'p.total_ht',
'', $param,
'class="right"', $sortfield, $sortorder);
1562 if (!empty($arrayfields[
'p.total_tva'][
'checked'])) {
1563 print_liste_field_titre($arrayfields[
'p.total_tva'][
'label'], $_SERVER[
"PHP_SELF"],
'p.total_tva',
'', $param,
'class="right"', $sortfield, $sortorder);
1565 if (!empty($arrayfields[
'p.total_ttc'][
'checked'])) {
1566 print_liste_field_titre($arrayfields[
'p.total_ttc'][
'label'], $_SERVER[
"PHP_SELF"],
'p.total_ttc',
'', $param,
'class="right"', $sortfield, $sortorder);
1568 if (!empty($arrayfields[
'p.total_ht_invoiced'][
'checked'])) {
1569 print_liste_field_titre($arrayfields[
'p.total_ht_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1571 if (!empty($arrayfields[
'p.total_invoiced'][
'checked'])) {
1572 print_liste_field_titre($arrayfields[
'p.total_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1574 if (!empty($arrayfields[
'p.multicurrency_code'][
'checked'])) {
1575 print_liste_field_titre($arrayfields[
'p.multicurrency_code'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_code',
'', $param,
'', $sortfield, $sortorder);
1577 if (!empty($arrayfields[
'p.multicurrency_tx'][
'checked'])) {
1578 print_liste_field_titre($arrayfields[
'p.multicurrency_tx'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_tx',
'', $param,
'', $sortfield, $sortorder);
1580 if (!empty($arrayfields[
'p.multicurrency_total_ht'][
'checked'])) {
1581 print_liste_field_titre($arrayfields[
'p.multicurrency_total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_total_ht',
'', $param,
'class="right"', $sortfield, $sortorder);
1583 if (!empty($arrayfields[
'p.multicurrency_total_tva'][
'checked'])) {
1584 print_liste_field_titre($arrayfields[
'p.multicurrency_total_tva'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_total_tva',
'', $param,
'class="right"', $sortfield, $sortorder);
1586 if (!empty($arrayfields[
'p.multicurrency_total_ttc'][
'checked'])) {
1587 print_liste_field_titre($arrayfields[
'p.multicurrency_total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_total_ttc',
'', $param,
'class="right"', $sortfield, $sortorder);
1589 if (!empty($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'checked'])) {
1590 print_liste_field_titre($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1592 if (!empty($arrayfields[
'p.multicurrency_total_invoiced'][
'checked'])) {
1593 print_liste_field_titre($arrayfields[
'p.multicurrency_total_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1595 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1596 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'class="center"', $sortfield, $sortorder);
1598 if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
1599 print_liste_field_titre($arrayfields[
'sale_representative'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"",
"$param",
'', $sortfield, $sortorder);
1601 if (!empty($arrayfields[
'total_pa'][
'checked'])) {
1602 print_liste_field_titre($arrayfields[
'total_pa'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1604 if (!empty($arrayfields[
'total_margin'][
'checked'])) {
1605 print_liste_field_titre($arrayfields[
'total_margin'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1607 if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
1608 print_liste_field_titre($arrayfields[
'total_margin_rate'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1610 if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
1611 print_liste_field_titre($arrayfields[
'total_mark_rate'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1614 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1616 $parameters = array(
1617 'arrayfields' => $arrayfields,
1619 'sortfield' => $sortfield,
1620 'sortorder' => $sortorder,
1621 'totalarray' => &$totalarray,
1624 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1626 print $hookmanager->resPrint;
1627 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1628 print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datec",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
1630 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1631 print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"p.tms",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
1633 if (!empty($arrayfields[
'p.date_cloture'][
'checked'])) {
1634 print_liste_field_titre($arrayfields[
'p.date_cloture'][
'label'], $_SERVER[
"PHP_SELF"],
"p.date_cloture",
"", $param,
'align="center" class="nowrap"', $sortfield, $sortorder);
1636 if (!empty($arrayfields[
'p.note_public'][
'checked'])) {
1637 print_liste_field_titre($arrayfields[
'p.note_public'][
'label'], $_SERVER[
"PHP_SELF"],
"p.note_public",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1639 if (!empty($arrayfields[
'p.note_private'][
'checked'])) {
1640 print_liste_field_titre($arrayfields[
'p.note_private'][
'label'], $_SERVER[
"PHP_SELF"],
"p.note_private",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1642 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1643 print_liste_field_titre($arrayfields[
'p.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_statut",
"", $param,
'class="right"', $sortfield, $sortorder);
1645 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1646 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
1654 $with_margin_info =
false;
1655 if (isModEnabled(
'margin') && (
1656 !empty($arrayfields[
'total_pa'][
'checked'])
1657 || !empty($arrayfields[
'total_margin'][
'checked'])
1658 || !empty($arrayfields[
'total_margin_rate'][
'checked'])
1659 || !empty($arrayfields[
'total_mark_rate'][
'checked'])
1662 $with_margin_info =
true;
1667 $savnbfield = $totalarray[
'nbfield'];
1668 $totalarray = array();
1669 $totalarray[
'nbfield'] = 0;
1671 $imaxinloop = ($limit ? min($num, $limit) : $num);
1672 while ($i < $imaxinloop) {
1673 $obj = $db->fetch_object($resql);
1675 $objectstatic->id = $obj->rowid;
1676 $objectstatic->ref = $obj->ref;
1677 $objectstatic->ref_client = $obj->ref_client;
1678 $objectstatic->note_public = $obj->note_public;
1679 $objectstatic->note_private = $obj->note_private;
1680 $objectstatic->statut = $obj->status;
1681 $objectstatic->status = $obj->status;
1683 $companystatic->id = $obj->socid;
1684 $companystatic->name = $obj->name;
1685 $companystatic->name_alias = $obj->alias;
1686 $companystatic->client = $obj->client;
1687 $companystatic->fournisseur = $obj->fournisseur;
1688 $companystatic->code_client = $obj->code_client;
1689 $companystatic->email = $obj->email;
1690 $companystatic->phone = $obj->phone;
1691 $companystatic->address = $obj->address;
1692 $companystatic->zip = $obj->zip;
1693 $companystatic->town = $obj->town;
1694 $companystatic->country_code = $obj->country_code;
1696 $projectstatic->id = $obj->project_id;
1697 $projectstatic->ref = $obj->project_ref;
1698 $projectstatic->title = $obj->project_label;
1700 $totalInvoicedHT = 0;
1701 $totalInvoicedTTC = 0;
1702 $multicurrency_totalInvoicedHT = 0;
1703 $multicurrency_totalInvoicedTTC = 0;
1705 $TInvoiceData = $objectstatic->InvoiceArrayList($obj->rowid);
1707 if (!empty($TInvoiceData)) {
1708 foreach ($TInvoiceData as $invoiceData) {
1710 $invoice->fetch($invoiceData->facid);
1712 if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) && $invoice->type ==
Facture::TYPE_DEPOSIT) {
1716 $totalInvoicedHT += $invoice->total_ht;
1717 $totalInvoicedTTC += $invoice->total_ttc;
1718 $multicurrency_totalInvoicedHT += $invoice->multicurrency_total_ht;
1719 $multicurrency_totalInvoicedTTC += $invoice->multicurrency_total_ttc;
1723 $marginInfo = array();
1724 if ($with_margin_info ===
true) {
1725 $objectstatic->fetch_lines();
1726 $marginInfo = $formmargin->getMarginInfosArray($objectstatic);
1727 $total_ht += $obj->total_ht;
1728 $total_margin += $marginInfo[
'total_margin'];
1731 if ($mode ==
'kanban') {
1733 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1734 print
'<div class="box-flex-container kanban">';
1737 $userstatic->fetch($obj->fk_user_author);
1738 $objectstatic->author = $userstatic->getNomUrl(1);
1739 $objectstatic->fk_project = $projectstatic->getNomUrl(1);
1740 print $objectstatic->getKanbanView(
'', array(
'selected' => in_array($object->id, $arrayofselected)));
1741 if ($i == ($imaxinloop - 1)) {
1746 print
'<tr class="oddeven">';
1749 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1750 print
'<td class="nowrap" align="center">';
1751 if ($massactionbutton || $massaction) {
1753 if (in_array($obj->rowid, $arrayofselected)) {
1756 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1760 $totalarray[
'nbfield']++;
1764 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1765 print
'<td class="nowraponall">';
1767 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1769 print
'<td class="nobordernopadding nowraponall">';
1770 print $objectstatic->getNomUrl(1,
'',
'', 0, 1, (isset($conf->global->PROPAL_LIST_SHOW_NOTES) ? $conf->global->PROPAL_LIST_SHOW_NOTES : 1));
1774 if ($obj->status ==
Propal::STATUS_VALIDATED && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) {
1775 $warnornote .=
img_warning($langs->trans(
"Late"));
1778 print
'<td style="min-width: 20px" class="nobordernopadding nowrap">';
1783 print
'<td width="16" class="nobordernopadding right">';
1785 $filedir = $conf->propal->multidir_output[$obj->propal_entity].
'/'.
dol_sanitizeFileName($obj->ref);
1786 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
1787 print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
1788 print
'</td></tr></table>';
1792 $totalarray[
'nbfield']++;
1796 if (!empty($arrayfields[
'p.ref_client'][
'checked'])) {
1798 print
'<td class="nowrap tdoverflowmax200">';
1802 $totalarray[
'nbfield']++;
1806 if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1808 print
'<td class="nowraponall">';
1809 if ($obj->project_id > 0) {
1810 print $projectstatic->getNomUrl(1);
1814 $totalarray[
'nbfield']++;
1818 if (!empty($arrayfields[
'pr.title'][
'checked'])) {
1820 print
'<td class="nowrap">';
1821 if ($obj->project_id > 0) {
1826 $totalarray[
'nbfield']++;
1831 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1832 print
'<td class="tdoverflowmax150">';
1833 print $companystatic->getNomUrl(1,
'customer', 0, 0, 1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
1836 $totalarray[
'nbfield']++;
1841 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1842 print
'<td class="tdoverflowmax200">';
1846 $totalarray[
'nbfield']++;
1851 if (!empty($arrayfields[
's.town'][
'checked'])) {
1852 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->town).
'">';
1856 $totalarray[
'nbfield']++;
1860 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1861 print
'<td class="nocellnopadd">';
1865 $totalarray[
'nbfield']++;
1869 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1870 print
"<td>".$obj->state_name.
"</td>\n";
1872 $totalarray[
'nbfield']++;
1876 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1877 print
'<td class="center">';
1878 $tmparray =
getCountry($obj->fk_pays,
'all');
1879 print $tmparray[
'label'];
1882 $totalarray[
'nbfield']++;
1886 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1887 if (!is_array($typenArray) || empty($typenArray)) {
1888 $typenArray = $formcompany->typent_array(1);
1891 print
'<td class="center">';
1892 print $typenArray[$obj->typent_code];
1895 $totalarray[
'nbfield']++;
1900 if (!empty($arrayfields[
'p.date'][
'checked'])) {
1901 print
'<td class="center">';
1905 $totalarray[
'nbfield']++;
1910 if (!empty($arrayfields[
'p.fin_validite'][
'checked'])) {
1912 print
'<td class="center">'.dol_print_date($db->jdate($obj->dfv),
'day');
1915 print
'<td> </td>';
1918 $totalarray[
'nbfield']++;
1922 if (!empty($arrayfields[
'p.date_livraison'][
'checked'])) {
1923 if ($obj->ddelivery) {
1924 print
'<td class="center">'.dol_print_date($db->jdate($obj->ddelivery),
'day');
1927 print
'<td> </td>';
1930 $totalarray[
'nbfield']++;
1934 if (!empty($arrayfields[
'p.date_signature'][
'checked'])) {
1935 if ($obj->dsignature) {
1936 print
'<td class="center">'.dol_print_date($db->jdate($obj->dsignature),
'day');
1939 print
'<td> </td>';
1942 $totalarray[
'nbfield']++;
1946 if (!empty($arrayfields[
'ava.rowid'][
'checked'])) {
1947 print
'<td class="center">';
1948 $form->form_availability(
'', $obj->availability,
'none', 1);
1951 $totalarray[
'nbfield']++;
1955 if (!empty($arrayfields[
'p.fk_shipping_method'][
'checked'])) {
1957 $form->formSelectShippingMethod(
'', $obj->fk_shipping_method,
'none', 1);
1960 $totalarray[
'nbfield']++;
1964 if (!empty($arrayfields[
'p.fk_input_reason'][
'checked'])) {
1965 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($form->cache_demand_reason[$obj->fk_input_reason][
'label']).
'">';
1966 if ($obj->fk_input_reason > 0) {
1967 print $form->cache_demand_reason[$obj->fk_input_reason][
'label'];
1971 $totalarray[
'nbfield']++;
1975 if (!empty($arrayfields[
'p.fk_cond_reglement'][
'checked'])) {
1977 $form->form_conditions_reglement($_SERVER[
'PHP_SELF'], $obj->fk_cond_reglement,
'none', 0,
'', 1, $obj->deposit_percent);
1980 $totalarray[
'nbfield']++;
1984 if (!empty($arrayfields[
'p.fk_mode_reglement'][
'checked'])) {
1986 $form->form_modes_reglement($_SERVER[
'PHP_SELF'], $obj->fk_mode_reglement,
'none',
'', -1);
1989 $totalarray[
'nbfield']++;
1993 if (!empty($arrayfields[
'p.total_ht'][
'checked'])) {
1994 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ht).
"</span></td>\n";
1996 $totalarray[
'nbfield']++;
1999 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.total_ht';
2001 if (empty($totalarray[
'val'][
'p.total_ht'])) {
2002 $totalarray[
'val'][
'p.total_ht'] = $obj->total_ht;
2004 $totalarray[
'val'][
'p.total_ht'] += $obj->total_ht;
2008 if (!empty($arrayfields[
'p.total_tva'][
'checked'])) {
2009 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_tva).
"</span></td>\n";
2011 $totalarray[
'nbfield']++;
2014 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.total_tva';
2016 if (empty($totalarray[
'val'][
'p.total_tva'])) {
2017 $totalarray[
'val'][
'p.total_tva'] = $obj->total_tva;
2019 $totalarray[
'val'][
'p.total_tva'] += $obj->total_tva;
2023 if (!empty($arrayfields[
'p.total_ttc'][
'checked'])) {
2024 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
"</span></td>\n";
2026 $totalarray[
'nbfield']++;
2029 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.total_ttc';
2031 if (empty($totalarray[
'val'][
'p.total_ttc'])) {
2032 $totalarray[
'val'][
'p.total_ttc'] = $obj->total_ttc;
2034 $totalarray[
'val'][
'p.total_ttc'] += $obj->total_ttc;
2038 if (!empty($arrayfields[
'p.total_ht_invoiced'][
'checked'])) {
2039 print
'<td class="nowrap right"><span class="amount">'.price($totalInvoicedHT).
"</span></td>\n";
2041 $totalarray[
'nbfield']++;
2044 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.total_ht_invoiced';
2046 if (empty($totalarray[
'val'][
'p.total_ht_invoiced'])) {
2047 $totalarray[
'val'][
'p.total_ht_invoiced'] = $totalInvoicedHT;
2049 $totalarray[
'val'][
'p.total_ht_invoiced'] += $totalInvoicedHT;
2053 if (!empty($arrayfields[
'p.total_invoiced'][
'checked'])) {
2054 print
'<td class="nowrap right"><span class="amount">'.price($totalInvoicedTTC).
"</span></td>\n";
2056 $totalarray[
'nbfield']++;
2059 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.total_invoiced';
2061 if (empty($totalarray[
'val'][
'p.total_invoiced'])) {
2062 $totalarray[
'val'][
'p.total_invoiced'] = $totalInvoicedTTC;
2064 $totalarray[
'val'][
'p.total_invoiced'] += $totalInvoicedTTC;
2068 if (!empty($arrayfields[
'p.multicurrency_code'][
'checked'])) {
2069 print
'<td class="nowrap">'.$obj->multicurrency_code.
' - '.$langs->trans(
'Currency'.$obj->multicurrency_code).
"</td>\n";
2071 $totalarray[
'nbfield']++;
2076 if (!empty($arrayfields[
'p.multicurrency_tx'][
'checked'])) {
2077 print
'<td class="nowrap">';
2078 $form->form_multicurrency_rate($_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid, $obj->multicurrency_tx,
'none', $obj->multicurrency_code);
2081 $totalarray[
'nbfield']++;
2085 if (!empty($arrayfields[
'p.multicurrency_total_ht'][
'checked'])) {
2086 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht).
"</span></td>\n";
2088 $totalarray[
'nbfield']++;
2092 if (!empty($arrayfields[
'p.multicurrency_total_tva'][
'checked'])) {
2093 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_tva).
"</span></td>\n";
2095 $totalarray[
'nbfield']++;
2099 if (!empty($arrayfields[
'p.multicurrency_total_ttc'][
'checked'])) {
2100 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc).
"</span></td>\n";
2102 $totalarray[
'nbfield']++;
2106 if (!empty($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'checked'])) {
2107 print
'<td class="nowrap right"><span class="amount">'.price($multicurrency_totalInvoicedHT).
"</span></td>\n";
2109 $totalarray[
'nbfield']++;
2113 if (!empty($arrayfields[
'p.multicurrency_total_invoiced'][
'checked'])) {
2114 print
'<td class="nowrap right"><span class="amount">'.price($multicurrency_totalInvoicedTTC).
"</span></td>\n";
2116 $totalarray[
'nbfield']++;
2120 $userstatic->id = $obj->fk_user_author;
2121 $userstatic->login = $obj->login;
2122 $userstatic->lastname = $obj->lastname;
2123 $userstatic->firstname = $obj->firstname;
2124 $userstatic->email = $obj->user_email;
2125 $userstatic->statut = $obj->user_statut;
2126 $userstatic->entity = $obj->user_entity;
2127 $userstatic->photo = $obj->photo;
2128 $userstatic->office_phone = $obj->office_phone;
2129 $userstatic->office_fax = $obj->office_fax;
2130 $userstatic->user_mobile = $obj->user_mobile;
2131 $userstatic->job = $obj->job;
2132 $userstatic->gender = $obj->gender;
2135 if (!empty($arrayfields[
'u.login'][
'checked'])) {
2136 print
'<td class="tdoverflowmax150">';
2137 if ($userstatic->id) {
2138 print $userstatic->getNomUrl(-1);
2142 $totalarray[
'nbfield']++;
2146 if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
2148 print
'<td class="tdoverflowmax125">';
2149 if ($obj->socid > 0) {
2150 $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
2151 if ($listsalesrepresentatives < 0) {
2154 $nbofsalesrepresentative = count($listsalesrepresentatives);
2155 if ($nbofsalesrepresentative > 6) {
2157 print $nbofsalesrepresentative;
2158 } elseif ($nbofsalesrepresentative > 0) {
2159 $userstatic =
new User($db);
2161 foreach ($listsalesrepresentatives as $val) {
2162 $userstatic->id = $val[
'id'];
2163 $userstatic->lastname = $val[
'lastname'];
2164 $userstatic->firstname = $val[
'firstname'];
2165 $userstatic->email = $val[
'email'];
2166 $userstatic->statut = $val[
'statut'];
2167 $userstatic->entity = $val[
'entity'];
2168 $userstatic->photo = $val[
'photo'];
2169 $userstatic->login = $val[
'login'];
2170 $userstatic->office_phone = $val[
'office_phone'];
2171 $userstatic->office_fax = $val[
'office_fax'];
2172 $userstatic->user_mobile = $val[
'user_mobile'];
2173 $userstatic->job = $val[
'job'];
2174 $userstatic->gender = $val[
'gender'];
2176 print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1,
'', 0, 0, 12) : $userstatic->getNomUrl(-2);
2178 if ($j < $nbofsalesrepresentative) {
2190 $totalarray[
'nbfield']++;
2195 if (!empty($arrayfields[
'total_pa'][
'checked'])) {
2196 print
'<td class="right nowrap">'.price($marginInfo[
'pa_total']).
'</td>';
2198 $totalarray[
'nbfield']++;
2202 if (!empty($arrayfields[
'total_margin'][
'checked'])) {
2203 print
'<td class="right nowrap">'.price($marginInfo[
'total_margin']).
'</td>';
2205 $totalarray[
'nbfield']++;
2208 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_margin';
2210 $totalarray[
'val'][
'total_margin'] = $total_margin;
2213 if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
2214 print
'<td class="right nowrap">'.(($marginInfo[
'total_margin_rate'] ==
'') ?
'' :
price($marginInfo[
'total_margin_rate'], null, null, null, null, 2).
'%').
'</td>';
2216 $totalarray[
'nbfield']++;
2220 if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
2221 print
'<td class="right nowrap">'.(($marginInfo[
'total_mark_rate'] ==
'') ?
'' :
price($marginInfo[
'total_mark_rate'], null, null, null, null, 2).
'%').
'</td>';
2223 $totalarray[
'nbfield']++;
2226 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'total_mark_rate';
2228 if ($i >= $imaxinloop - 1) {
2229 if (!empty($total_ht)) {
2230 $totalarray[
'val'][
'total_mark_rate'] =
price2num($total_margin * 100 / $total_ht,
'MT');
2232 $totalarray[
'val'][
'total_mark_rate'] =
'';
2238 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
2240 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
2241 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
2242 print $hookmanager->resPrint;
2244 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
2245 print
'<td align="center" class="nowrap">';
2246 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
2249 $totalarray[
'nbfield']++;
2253 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
2254 print
'<td align="center" class="nowrap">';
2255 print
dol_print_date($db->jdate($obj->date_update),
'dayhour',
'tzuser');
2258 $totalarray[
'nbfield']++;
2262 if (!empty($arrayfields[
'p.date_cloture'][
'checked'])) {
2263 print
'<td align="center" class="nowrap">';
2264 print
dol_print_date($db->jdate($obj->date_cloture),
'dayhour',
'tzuser');
2267 $totalarray[
'nbfield']++;
2271 if (!empty($arrayfields[
'p.note_public'][
'checked'])) {
2272 print
'<td class="center">';
2276 $totalarray[
'nbfield']++;
2280 if (!empty($arrayfields[
'p.note_private'][
'checked'])) {
2281 print
'<td class="center">';
2285 $totalarray[
'nbfield']++;
2289 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
2290 print
'<td class="nowrap right">'.$objectstatic->getLibStatut(5).
'</td>';
2292 $totalarray[
'nbfield']++;
2296 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
2297 print
'<td class="nowrap" align="center">';
2298 if ($massactionbutton || $massaction) {
2300 if (in_array($obj->rowid, $arrayofselected)) {
2303 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2307 $totalarray[
'nbfield']++;
2319 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2324 foreach ($arrayfields as $key => $val) {
2325 if (!empty($val[
'checked'])) {
2329 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2334 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
2335 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2336 print $hookmanager->resPrint;
2338 print
'</table>'.
"\n";
2339 print
'</div>'.
"\n";
2341 print
'</form>'.
"\n";
2343 $hidegeneratedfilelistifempty = 1;
2344 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2345 $hidegeneratedfilelistifempty = 0;
2349 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2350 $urlsource .= str_replace(
'&',
'&', $param);
2352 $filedir = $diroutputmassaction;
2353 $genallowed = $user->hasRight(
'propal',
'lire');
2354 $delallowed = $user->hasRight(
'propal',
'creer');
2356 print $formfile->showdocuments(
'massfilesarea_proposals',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
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=0, $outputlangs='', $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 informations (by default a local PHP server timestamp) Re...
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
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_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
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.