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';
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';
57 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
58 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
70$langs->loadLangs(array(
'companies',
'propal',
'compta',
'bills',
'orders',
'products',
'sendings',
'categories'));
72 $langs->loadLangs(array(
'sendings'));
78$action =
GETPOST(
'action',
'aZ09');
79$massaction =
GETPOST(
'massaction',
'alpha');
81$confirm =
GETPOST(
'confirm',
'alpha');
82$cancel =
GETPOST(
'cancel',
'alpha');
83$toselect =
GETPOST(
'toselect',
'array:int');
84$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'proposallist';
85$optioncss =
GETPOST(
'optioncss',
'alpha');
86$mode =
GETPOST(
'mode',
'alpha');
89$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
91if ($search_user == -1) {
96$search_refcustomer =
GETPOST(
'search_refcustomer',
'alpha');
97$search_refproject =
GETPOST(
'search_refproject',
'alpha');
98$search_project =
GETPOST(
'search_project',
'alpha');
99$search_societe =
GETPOST(
'search_societe',
'alpha');
100$search_societe_alias =
GETPOST(
'search_societe_alias',
'alpha');
101$search_montant_ht =
GETPOST(
'search_montant_ht',
'alpha');
102$search_montant_vat =
GETPOST(
'search_montant_vat',
'alpha');
103$search_montant_ttc =
GETPOST(
'search_montant_ttc',
'alpha');
104$search_warehouse =
GETPOST(
'search_warehouse',
'alpha');
105$search_multicurrency_code =
GETPOST(
'search_multicurrency_code',
'alpha');
106$search_multicurrency_tx =
GETPOST(
'search_multicurrency_tx',
'alpha');
107$search_multicurrency_montant_ht =
GETPOST(
'search_multicurrency_montant_ht',
'alpha');
108$search_multicurrency_montant_vat =
GETPOST(
'search_multicurrency_montant_vat',
'alpha');
109$search_multicurrency_montant_ttc =
GETPOST(
'search_multicurrency_montant_ttc',
'alpha');
110$search_login =
GETPOST(
'search_login',
'alpha');
111$searchCategoryPropalList =
GETPOST(
'search_category_propal_list',
'array:int');
112$searchCategoryPropalOperator = 0;
113if (GETPOSTISSET(
'formfilteraction')) {
114 $searchCategoryPropalOperator =
GETPOSTINT(
'search_category_propal_operator');
118$search_product_category =
GETPOSTINT(
'search_product_category');
119$search_town =
GETPOST(
'search_town',
'alpha');
120$search_zip =
GETPOST(
'search_zip',
'alpha');
121$search_state =
GETPOST(
"search_state");
122$search_country =
GETPOST(
"search_country",
'aZ09');
123$search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'intcomma');
124$search_date_startday =
GETPOSTINT(
'search_date_startday');
125$search_date_startmonth =
GETPOSTINT(
'search_date_startmonth');
126$search_date_startyear =
GETPOSTINT(
'search_date_startyear');
127$search_date_endday =
GETPOSTINT(
'search_date_endday');
128$search_date_endmonth =
GETPOSTINT(
'search_date_endmonth');
129$search_date_endyear =
GETPOSTINT(
'search_date_endyear');
130$search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
131$search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
132$search_date_end_startday =
GETPOSTINT(
'search_date_end_startday');
133$search_date_end_startmonth =
GETPOSTINT(
'search_date_end_startmonth');
134$search_date_end_startyear =
GETPOSTINT(
'search_date_end_startyear');
135$search_date_end_endday =
GETPOSTINT(
'search_date_end_endday');
136$search_date_end_endmonth =
GETPOSTINT(
'search_date_end_endmonth');
137$search_date_end_endyear =
GETPOSTINT(
'search_date_end_endyear');
138$search_date_end_start =
dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);
139$search_date_end_end =
dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
140$search_date_delivery_startday =
GETPOSTINT(
'search_date_delivery_startday');
141$search_date_delivery_startmonth =
GETPOSTINT(
'search_date_delivery_startmonth');
142$search_date_delivery_startyear =
GETPOSTINT(
'search_date_delivery_startyear');
143$search_date_delivery_endday =
GETPOSTINT(
'search_date_delivery_endday');
144$search_date_delivery_endmonth =
GETPOSTINT(
'search_date_delivery_endmonth');
145$search_date_delivery_endyear =
GETPOSTINT(
'search_date_delivery_endyear');
146$search_date_delivery_start =
dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear);
147$search_date_delivery_end =
dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear);
148$search_availability =
GETPOST(
'search_availability',
'intcomma');
149$search_categ_cus =
GETPOSTINT(
"search_categ_cus");
150$search_fk_cond_reglement =
GETPOST(
"search_fk_cond_reglement",
'intcomma');
151$search_fk_shipping_method =
GETPOST(
"search_fk_shipping_method",
'intcomma');
152$search_fk_input_reason =
GETPOST(
"search_fk_input_reason",
'intcomma');
153$search_fk_mode_reglement =
GETPOST(
"search_fk_mode_reglement",
'intcomma');
154$search_date_signature_startday =
GETPOSTINT(
'search_date_signature_startday');
155$search_date_signature_startmonth =
GETPOSTINT(
'search_date_signature_startmonth');
156$search_date_signature_startyear =
GETPOSTINT(
'search_date_signature_startyear');
157$search_date_signature_endday =
GETPOSTINT(
'search_date_signature_endday');
158$search_date_signature_endmonth =
GETPOSTINT(
'search_date_signature_endmonth');
159$search_date_signature_endyear =
GETPOSTINT(
'search_date_signature_endyear');
160$search_date_signature_start =
dol_mktime(0, 0, 0, $search_date_signature_startmonth, $search_date_signature_startday, $search_date_signature_startyear);
161$search_date_signature_end =
dol_mktime(23, 59, 59, $search_date_signature_endmonth, $search_date_signature_endday, $search_date_signature_endyear);
162$search_status =
GETPOST(
'search_status',
'alpha');
163$search_note_public =
GETPOST(
'search_note_public',
'alpha');
164$search_import_key = trim(
GETPOST(
"search_import_key",
"alpha"));
166$search_option =
GETPOST(
'search_option',
'alpha');
167if ($search_option ==
'late') {
168 $search_status =
'1';
169 $object_statut =
'1';
174$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
175$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
177if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
181$offset = $limit * $page;
182$pageprev = $page - 1;
183$pagenext = $page + 1;
185 $sortfield =
'p.ref';
195if (!empty($user->socid)) {
196 $socid = $user->socid;
201 $dbtable =
'&societe';
203$hookmanager->initHooks(array(
'propallist'));
206$diroutputmassaction = $conf->propal->multidir_output[$conf->entity].
'/temp/massgeneration/'.$user->id;
213$extrafields->fetch_name_optionals_label(
$object->table_element);
215$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
218$fieldstosearchall = array(
220 'p.ref_client' =>
'RefCustomer',
221 'pd.description' =>
'ProductDescription',
222 's.nom' =>
"ThirdParty",
223 's.name_alias' =>
"AliasNameShort",
226 'p.note_public' =>
'NotePublic',
228if (empty($user->socid)) {
229 $fieldstosearchall[
"p.note_private"] =
"NotePrivate";
233$checkedtypetiers = 0;
235 'p.ref' => array(
'label' =>
"Ref",
'checked' =>
'1'),
236 'p.ref_client' => array(
'label' =>
"RefCustomer",
'checked' =>
'-1'),
237 'pr.ref' => array(
'label' =>
"ProjectRef",
'checked' =>
'1',
'enabled' => (
isModEnabled(
'project') ?
'1' :
'0')),
238 'pr.title' => array(
'label' =>
"ProjectLabel",
'checked' =>
'0',
'enabled' => (
isModEnabled(
'project') ?
'1' :
'0')),
239 's.nom' => array(
'label' =>
"ThirdParty",
'checked' =>
'1'),
240 's.name_alias' => array(
'label' =>
"AliasNameShort",
'checked' =>
'-1'),
241 's.town' => array(
'label' =>
"Town",
'checked' =>
'-1'),
242 's.zip' => array(
'label' =>
"Zip",
'checked' =>
'-1'),
243 'state.nom' => array(
'label' =>
"StateShort",
'checked' =>
'0'),
244 'country.code_iso' => array(
'label' =>
"Country",
'checked' =>
'0'),
245 'typent.code' => array(
'label' =>
"ThirdPartyType",
'checked' => (string) $checkedtypetiers),
246 'p.date' => array(
'label' =>
"DatePropal",
'checked' =>
'1'),
247 'p.fin_validite' => array(
'label' =>
"DateEnd",
'checked' =>
'1'),
248 'p.date_livraison' => array(
'label' =>
"DeliveryDate",
'checked' =>
'0'),
249 'p.date_signature' => array(
'label' =>
"DateSigning",
'checked' =>
'0'),
250 'ava.rowid' => array(
'label' =>
"AvailabilityPeriod",
'checked' =>
'0'),
251 'p.fk_shipping_method' => array(
'label' =>
"SendingMethod",
'checked' =>
'0',
'enabled' => (string) (int)
isModEnabled(
"shipping")),
252 'p.fk_input_reason' => array(
'label' =>
"Origin",
'checked' =>
'0',
'enabled' =>
'1'),
253 'p.fk_cond_reglement' => array(
'label' =>
"PaymentConditionsShort",
'checked' =>
'0'),
254 'p.fk_mode_reglement' => array(
'label' =>
"PaymentMode",
'checked' =>
'0'),
255 'p.total_ht' => array(
'label' =>
"AmountHT",
'checked' =>
'1'),
256 'p.total_tva' => array(
'label' =>
"AmountVAT",
'checked' =>
'0'),
257 'p.total_ttc' => array(
'label' =>
"AmountTTC",
'checked' =>
'0'),
258 'p.total_ht_invoiced' => array(
'label' =>
"AmountInvoicedHT",
'checked' =>
'0',
'enabled' =>
getDolGlobalString(
'PROPOSAL_SHOW_INVOICED_AMOUNT')),
259 'p.total_invoiced' => array(
'label' =>
"AmountInvoicedTTC",
'checked' =>
'0',
'enabled' =>
getDolGlobalString(
'PROPOSAL_SHOW_INVOICED_AMOUNT')),
260 'p.multicurrency_code' => array(
'label' =>
'Currency',
'checked' =>
'0',
'enabled' => (!
isModEnabled(
"multicurrency") ?
'0' :
'1')),
261 'p.multicurrency_tx' => array(
'label' =>
'CurrencyRate',
'checked' =>
'0',
'enabled' => (!
isModEnabled(
"multicurrency") ?
'0' :
'1')),
262 'p.multicurrency_total_ht' => array(
'label' =>
'MulticurrencyAmountHT',
'checked' =>
'0',
'enabled' => (!
isModEnabled(
"multicurrency") ?
'0' :
'1')),
263 'p.multicurrency_total_tva' => array(
'label' =>
'MulticurrencyAmountVAT',
'checked' =>
'0',
'enabled' => (!
isModEnabled(
"multicurrency") ?
'0' :
'1')),
264 'p.multicurrency_total_ttc' => array(
'label' =>
'MulticurrencyAmountTTC',
'checked' =>
'0',
'enabled' => (!
isModEnabled(
"multicurrency") ?
'0' :
'1')),
265 'p.multicurrency_total_ht_invoiced' => array(
'label' =>
'MulticurrencyAmountInvoicedHT',
'checked' =>
'0',
'enabled' => (string) (int) (
isModEnabled(
"multicurrency") &&
getDolGlobalString(
'PROPOSAL_SHOW_INVOICED_AMOUNT'))),
266 'p.multicurrency_total_invoiced' => array(
'label' =>
'MulticurrencyAmountInvoicedTTC',
'checked' =>
'0',
'enabled' => (string) (int) (
isModEnabled(
"multicurrency") &&
getDolGlobalString(
'PROPOSAL_SHOW_INVOICED_AMOUNT'))),
267 'u.login' => array(
'label' =>
"Author",
'checked' =>
'1',
'position' => 10),
268 'sale_representative' => array(
'label' =>
"SaleRepresentativesOfThirdParty",
'checked' =>
'-1'),
269 'total_pa' => array(
'label' => (
getDolGlobalString(
'MARGIN_TYPE') ==
'1' ?
'BuyingPrice' :
'CostPrice'),
'checked' =>
'0',
'position' => 300,
'enabled' => (!
isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') ?
'0' :
'1')),
270 'total_margin' => array(
'label' =>
'Margin',
'checked' =>
'0',
'position' => 301,
'enabled' => (!
isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') ?
'0' :
'1')),
271 'total_margin_rate' => array(
'label' =>
'MarginRate',
'checked' =>
'0',
'position' => 302,
'enabled' => (!
isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') || !
getDolGlobalString(
'DISPLAY_MARGIN_RATES') ?
'0' :
'1')),
272 'total_mark_rate' => array(
'label' =>
'MarkRate',
'checked' =>
'0',
'position' => 303,
'enabled' => (!
isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') || !
getDolGlobalString(
'DISPLAY_MARK_RATES') ?
'0' :
'1')),
273 'p.datec' => array(
'label' =>
"DateCreation",
'checked' =>
'0',
'position' => 500),
274 'p.tms' => array(
'label' =>
"DateModificationShort",
'checked' =>
'0',
'position' => 500),
275 'p.date_cloture' => array(
'label' =>
"DateClosing",
'checked' =>
'0',
'position' => 500),
276 'p.note_public' => array(
'label' =>
'NotePublic',
'checked' =>
'0',
'position' => 510,
'enabled' => (string) (!
getDolGlobalInt(
'MAIN_LIST_HIDE_PUBLIC_NOTES'))),
277 'p.note_private' => array(
'label' =>
'NotePrivate',
'checked' =>
'0',
'position' => 511,
'enabled' => (string) (!
getDolGlobalInt(
'MAIN_LIST_HIDE_PRIVATE_NOTES'))),
278 'p.import_key' => array(
'type' =>
'varchar(14)',
'label' =>
'ImportId',
'enabled' =>
'1',
'visible' => -2,
'position' => 999),
279 'p.fk_statut' => array(
'label' =>
"Status",
'checked' =>
'1',
'position' => 1000),
307if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
308 $search_sale = $user->id;
312include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
315$permissiontoread = $user->hasRight(
'propal',
'lire');
316$permissiontoadd = $user->hasRight(
'propal',
'creer');
317$permissiontodelete = $user->hasRight(
'propal',
'supprimer');
319 $permissiontovalidate = $user->hasRight(
'propal',
'propal_advance',
'validate');
320 $permissiontoclose = $user->hasRight(
'propal',
'propal_advance',
'close');
321 $permissiontosendbymail = $user->hasRight(
'propal',
'propal_advance',
'send');
323 $permissiontovalidate = $user->hasRight(
'propal',
'creer');
324 $permissiontoclose = $user->hasRight(
'propal',
'creer');
325 $permissiontosendbymail = $user->hasRight(
'propal',
'lire');
334if (
GETPOST(
'cancel',
'alpha')) {
338if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
343$search_code_client =
'';
345$parameters = array(
'socid' => $socid,
'arrayfields' => &$arrayfields);
346$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
351if (empty($reshook)) {
353 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
356 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
360 $search_refcustomer =
'';
361 $search_refproject =
'';
362 $search_project =
'';
363 $search_societe =
'';
364 $search_societe_alias =
'';
365 $search_montant_ht =
'';
366 $search_montant_vat =
'';
367 $search_montant_ttc =
'';
368 $search_warehouse =
'';
369 $search_multicurrency_code =
'';
370 $search_multicurrency_tx =
'';
371 $search_multicurrency_montant_ht =
'';
372 $search_multicurrency_montant_vat =
'';
373 $search_multicurrency_montant_ttc =
'';
375 $search_product_category = 0;
376 $searchCategoryPropalList = array();
381 $search_country =
'';
382 $search_type_thirdparty =
'';
383 $search_date_startday =
'';
384 $search_date_startmonth =
'';
385 $search_date_startyear =
'';
386 $search_date_endday =
'';
387 $search_date_endmonth =
'';
388 $search_date_endyear =
'';
389 $search_date_start =
'';
390 $search_date_end =
'';
391 $search_date_end_startday =
'';
392 $search_date_end_startmonth =
'';
393 $search_date_end_startyear =
'';
394 $search_date_end_endday =
'';
395 $search_date_end_endmonth =
'';
396 $search_date_end_endyear =
'';
397 $search_date_end_start =
'';
398 $search_date_end_end =
'';
399 $search_date_delivery_startday =
'';
400 $search_date_delivery_startmonth =
'';
401 $search_date_delivery_startyear =
'';
402 $search_date_delivery_endday =
'';
403 $search_date_delivery_endmonth =
'';
404 $search_date_delivery_endyear =
'';
405 $search_date_delivery_start =
'';
406 $search_date_delivery_end =
'';
407 $search_availability =
'';
410 $search_fk_cond_reglement =
'';
411 $search_fk_shipping_method =
'';
412 $search_fk_input_reason =
'';
413 $search_fk_mode_reglement =
'';
414 $search_date_signature_startday =
'';
415 $search_date_signature_startmonth =
'';
416 $search_date_signature_startyear =
'';
417 $search_date_signature_endday =
'';
418 $search_date_signature_endmonth =
'';
419 $search_date_signature_endyear =
'';
420 $search_date_signature_start =
'';
421 $search_date_signature_end =
'';
422 $search_import_key =
'';
423 $search_categ_cus = 0;
427 $search_array_options = array();
433 $objectclass =
'Propal';
434 $objectlabel =
'Proposals';
435 $uploaddir = $conf->propal->multidir_output[$conf->entity];
436 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
439if ($action ==
'validate' && $permissiontovalidate) {
440 if (
GETPOST(
'confirm') ==
'yes') {
441 $tmpproposal =
new Propal($db);
443 foreach ($toselect as $checked) {
444 if ($tmpproposal->fetch($checked) > 0) {
445 if ($tmpproposal->status == $tmpproposal::STATUS_DRAFT) {
446 if ($tmpproposal->valid($user) > 0) {
447 setEventMessages($langs->trans(
'hasBeenValidated', $tmpproposal->ref),
null,
'mesgs');
453 $langs->load(
"errors");
454 setEventMessages($langs->trans(
'ErrorIsNotADraft', $tmpproposal->ref),
null,
'errors');
470if ($action ==
"sign" && $permissiontoclose) {
471 if (
GETPOST(
'confirm') ==
'yes') {
472 $tmpproposal =
new Propal($db);
474 foreach ($toselect as $checked) {
475 if ($tmpproposal->fetch($checked) > 0) {
476 if ($tmpproposal->status == $tmpproposal::STATUS_VALIDATED) {
477 $tmpproposal->status = $tmpproposal::STATUS_SIGNED;
478 if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_SIGNED) >= 0) {
479 setEventMessages($tmpproposal->ref.
" ".$langs->trans(
'Signed'),
null,
'mesgs');
485 setEventMessage($langs->trans(
'MustBeValidatedToBeSigned', $tmpproposal->ref),
'errors');
501if ($action ==
"nosign" && $permissiontoclose) {
502 if (
GETPOST(
'confirm') ==
'yes') {
503 $tmpproposal =
new Propal($db);
505 foreach ($toselect as $checked) {
506 if ($tmpproposal->fetch($checked) > 0) {
507 if ($tmpproposal->status == $tmpproposal::STATUS_VALIDATED || (
getDolGlobalString(
'PROPAL_SKIP_ACCEPT_REFUSE') && $tmpproposal->status == $tmpproposal::STATUS_DRAFT)) {
508 $tmpproposal->status = $tmpproposal::STATUS_NOTSIGNED;
509 if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_NOTSIGNED) > 0) {
510 setEventMessage($tmpproposal->ref.
" ".$langs->trans(
'NoSigned'),
'mesgs');
516 setEventMessage($tmpproposal->ref.
" ".$langs->trans(
'CantBeNoSign'),
'errors');
533if (!$error && $massaction ===
'setbilled' && $permissiontoclose && $objectclass !==
null) {
536 $objecttmp =
new $objectclass($db);
538 foreach ($toselect as $toselectid) {
539 $result = $objecttmp->fetch($toselectid);
541 $result = $objecttmp->classifyBilled($user, 0);
572$form =
new Form($db);
580$companystatic =
new Societe($db);
581$projectstatic =
new Project($db);
583$userstatic =
new User($db);
585$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
586$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
589$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,';
590$sql .=
" typent.code as typent_code,";
591$sql .=
" ava.rowid as availability,";
592$sql .=
" country.code as country_code,";
593$sql .=
" state.code_departement as state_code, state.nom as state_name,";
594$sql .=
' p.rowid, p.entity, p.note_private, p.total_ht, p.total_tva, p.total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut as status, p.import_key, p.fk_user_author, p.datep as dp, p.fin_validite as dfv, p.date_livraison as ddelivery,';
595$sql .=
' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc,';
596$sql .=
' p.datec as date_creation, p.tms as date_modification, p.date_cloture as date_cloture,';
597$sql .=
' p.date_signature as dsignature,';
598$sql .=
' p.note_public, p.note_private,';
599$sql .=
' p.fk_cond_reglement,p.deposit_percent,p.fk_mode_reglement,p.fk_shipping_method,p.fk_input_reason,';
600$sql .=
" pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
601$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';
603if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
604 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
605 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
609$parameters = array();
610$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
611$sql .= $hookmanager->resPrint;
612$sql = preg_replace(
'/, $/',
'', $sql);
616$sql .=
' FROM '.MAIN_DB_PREFIX.
'societe as s';
617$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
618$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
619$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
621$sql .=
' INNER JOIN '.MAIN_DB_PREFIX.
'propal as p ON p.fk_soc = s.rowid';
622if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
623 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
625$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON p.fk_user_author = u.rowid';
626$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as pr ON pr.rowid = p.fk_projet";
627$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_availability as ava on (ava.rowid = p.fk_availability)";
629$parameters = array();
630$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
631$sql .= $hookmanager->resPrint;
634$sql .=
' p.entity IN ('.getEntity(
'propal').
')';
644if ($search_country) {
645 $sql .=
" AND s.fk_pays IN (".$db->sanitize($db->escape($search_country)).
')';
647if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
648 $sql .=
" AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).
')';
653if ($search_refcustomer) {
656if ($search_refproject) {
659if ($search_project) {
662if ($search_availability) {
663 $sql .=
" AND p.fk_availability IN (".$db->sanitize($db->escape($search_availability)).
')';
666if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
667 if ($societe_add_ref_in_list == 1) {
668 $sql .=
natural_search(array(
"s.nom",
"s.name_alias",
"s.code_client"), $search_societe);
670 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_societe);
673 if ($search_societe) {
674 if ($societe_add_ref_in_list == 1) {
675 $sql .=
natural_search(array(
's.nom',
's.code_client'), $search_societe);
680 if ($search_societe_alias) {
685if ($societe_add_ref_in_list == 1 && $search_code_client && !$search_societe) {
689 $sql .=
natural_search(array(
"u.login",
"u.firstname",
"u.lastname"), $search_login);
691if ($search_montant_ht !=
'') {
694if ($search_montant_vat !=
'') {
697if ($search_montant_ttc !=
'') {
700if ($search_warehouse !=
'' && $search_warehouse > 0) {
703if ($search_multicurrency_code !=
'') {
704 $sql .=
" AND p.multicurrency_code = '".$db->escape($search_multicurrency_code).
"'";
706if ($search_multicurrency_tx !=
'') {
707 $sql .=
natural_search(
'p.multicurrency_tx', $search_multicurrency_tx, 1);
709if ($search_multicurrency_montant_ht !=
'') {
710 $sql .=
natural_search(
'p.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
712if ($search_multicurrency_montant_vat !=
'') {
713 $sql .=
natural_search(
'p.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
715if ($search_multicurrency_montant_ttc !=
'') {
716 $sql .=
natural_search(
'p.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
721 $fieldstosearchallwithoutpd = array();
722 $fieldstosearchallwithpd = array();
723 foreach ($fieldstosearchall as $key => $val) {
724 if (!preg_match(
'/^pd\./', $key)) {
725 $fieldstosearchallwithoutpd[$key] = $val;
727 $fieldstosearchallwithpd[$key] = $val;
731 if (count($fieldstosearchallwithpd) > 0) {
732 $sqltoadd .=
' OR EXISTS (SELECT pd.rowid FROM '.MAIN_DB_PREFIX.
'propaldet as pd WHERE pd.fk_propal = p.rowid';
733 $sqltoadd .=
natural_search(array_keys($fieldstosearchallwithpd),
'__KEYTOSEARCH__');
737 $sql .=
natural_search(array_keys($fieldstosearchallwithoutpd), $search_all, 0, 0, $sqltoadd);
739if ($search_fk_cond_reglement > 0) {
740 $sql .=
" AND p.fk_cond_reglement = ".((int) $search_fk_cond_reglement);
742if ($search_fk_shipping_method > 0) {
743 $sql .=
" AND p.fk_shipping_method = ".((int) $search_fk_shipping_method);
745if ($search_fk_input_reason > 0) {
746 $sql .=
" AND p.fk_input_reason = ".((int) $search_fk_input_reason);
748if ($search_fk_mode_reglement > 0) {
749 $sql .=
" AND p.fk_mode_reglement = ".((int) $search_fk_mode_reglement);
752 $sql .=
' AND s.rowid = '.((int) $socid);
754if ($search_status !=
'' && $search_status !=
'-1') {
755 $sql .=
' AND p.fk_statut IN ('.$db->sanitize($search_status).
')';
757if ($search_date_start) {
758 $sql .=
" AND p.datep >= '".$db->idate($search_date_start).
"'";
760if ($search_date_end) {
761 $sql .=
" AND p.datep <= '".$db->idate($search_date_end).
"'";
763if ($search_date_end_start) {
764 $sql .=
" AND p.fin_validite >= '".$db->idate($search_date_end_start).
"'";
766if ($search_date_end_end) {
767 $sql .=
" AND p.fin_validite <= '".$db->idate($search_date_end_end).
"'";
769if ($search_date_delivery_start) {
770 $sql .=
" AND p.date_livraison >= '".$db->idate($search_date_delivery_start).
"'";
772if ($search_date_delivery_end) {
773 $sql .=
" AND p.date_livraison <= '".$db->idate($search_date_delivery_end).
"'";
775if ($search_date_signature_start) {
776 $sql .=
" AND p.date_signature >= '".$db->idate($search_date_signature_start).
"'";
778if ($search_date_signature_end) {
779 $sql .=
" AND p.date_signature <= '".$db->idate($search_date_signature_end).
"'";
781if ($search_note_public) {
782 $sql .=
" AND p.note_public LIKE '%".$db->escape($db->escapeforlike($search_note_public)).
"%'";
784if ($search_import_key) {
789if ($search_user > 0) {
790 $sql .=
" AND EXISTS (";
791 $sql .=
" SELECT ec.fk_c_type_contact, ec.element_id, ec.fk_socpeople";
792 $sql .=
" FROM ".MAIN_DB_PREFIX.
"element_contact as ec";
793 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"c_type_contact as tc";
794 $sql .=
" ON ec.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal'";
795 $sql .=
" WHERE ec.element_id = p.rowid AND ec.fk_socpeople = ".((int) $search_user).
")";
797if ($searchCategoryPropalOperator == 1) {
798 $param .=
"&search_category_propal_operator=".urlencode((
string) ($searchCategoryPropalOperator));
800foreach ($searchCategoryPropalList as $searchCategoryPropal) {
801 $param .=
"&search_category_propal_list[]=".urlencode($searchCategoryPropal);
804if ($search_sale && $search_sale !=
'-1') {
805 if ($search_sale == -2) {
806 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
807 } elseif ($search_sale > 0) {
808 $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).
")";
812if (!empty($searchCategoryPropalList)) {
813 $searchCategoryPropalSqlList = array();
814 $listofcategoryid =
'';
815 foreach ($searchCategoryPropalList as $searchCategoryPropal) {
816 if (intval($searchCategoryPropal) == -2) {
817 $searchCategoryPropalSqlList[] =
"NOT EXISTS (SELECT ck.fk_propal FROM ".MAIN_DB_PREFIX.
"categorie_propal as ck WHERE p.rowid = ck.fk_propal)";
818 } elseif (intval($searchCategoryPropal) > 0) {
819 if ($searchCategoryPropalOperator == 0) {
820 $searchCategoryPropalSqlList[] =
" EXISTS (SELECT ck.fk_propal FROM ".MAIN_DB_PREFIX.
"categorie_propal as ck WHERE p.rowid = ck.fk_propal AND ck.fk_categorie = ".((int) $searchCategoryPropal).
")";
822 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryPropal);
826 if ($listofcategoryid) {
827 $searchCategoryPropalSqlList[] =
" EXISTS (SELECT ck.fk_propal FROM ".MAIN_DB_PREFIX.
"categorie_propal as ck WHERE p.rowid = ck.fk_propal AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
829 if ($searchCategoryPropalOperator == 1) {
830 if (!empty($searchCategoryPropalSqlList)) {
831 $sql .=
" AND (".implode(
' OR ', $searchCategoryPropalSqlList).
")";
834 if (!empty($searchCategoryPropalSqlList)) {
835 $sql .=
" AND (".implode(
' AND ', $searchCategoryPropalSqlList).
")";
840$searchCategoryCustomerOperator =
GETPOSTINT(
'search_category_customer_operator');
841$searchCategoryCustomerList = ($search_categ_cus !==
'-1' ? explode(
',', (
string) $search_categ_cus) : array());
842if (!empty($searchCategoryCustomerList)) {
843 $searchCategoryCustomerSqlList = array();
844 $listofcategoryid =
'';
845 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
846 if (intval($searchCategoryCustomer) == -2) {
847 $searchCategoryCustomerSqlList[] =
"NOT EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc)";
848 } elseif (intval($searchCategoryCustomer) > 0) {
849 if ($searchCategoryCustomerOperator == 0) {
850 $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).
")";
852 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryCustomer);
856 if ($listofcategoryid) {
857 $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).
"))";
859 if ($searchCategoryCustomerOperator == 1) {
860 if (!empty($searchCategoryCustomerSqlList)) {
861 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
864 if (!empty($searchCategoryCustomerSqlList)) {
865 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
870$searchCategoryProductOperator =
GETPOSTINT(
'search_category_product_operator');
871$searchCategoryProductList = array($search_product_category);
872if (!empty($searchCategoryProductList)) {
873 $searchCategoryProductSqlList = array();
874 $listofcategoryid =
'';
875 foreach ($searchCategoryProductList as $searchCategoryProduct) {
876 if (intval($searchCategoryProduct) == -2) {
877 $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)";
878 } elseif (intval($searchCategoryProduct) > 0) {
879 if ($searchCategoryProductOperator == 0) {
880 $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).
")";
882 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
886 if ($listofcategoryid) {
887 $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).
"))";
889 if ($searchCategoryProductOperator == 1) {
890 if (!empty($searchCategoryProductSqlList)) {
891 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
894 if (!empty($searchCategoryProductSqlList)) {
895 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
899if ($search_option ==
'late') {
903include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
907$parameters = array();
908$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
909$sql .= $hookmanager->resPrint;
912$parameters = array();
913$reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object, $action);
914if (empty($reshook)) {
915 $sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
917 $sql = $hookmanager->resPrint;
921$nbtotalofrecords =
'';
924 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
925 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
926 $resql = $db->query($sqlforcount);
928 $objforcount = $db->fetch_object($resql);
929 $nbtotalofrecords = (int) $objforcount->nbtotalofrecords;
934 if (($page * $limit) > (
int) $nbtotalofrecords) {
942$sql .= $db->order($sortfield, $sortorder);
943$sql .=
', p.ref DESC';
945 $sql .= $db->plimit($limit + 1, $offset);
948$resql = $db->query($sql);
957 $title = $langs->trans(
'Proposals').
' - '.$soc->name;
958 if (empty($search_societe)) {
959 $search_societe = $soc->name;
962 $title = $langs->trans(
'Proposals');
965$num = $db->num_rows($resql);
967$arrayofselected = is_array($toselect) ? $toselect : array();
969if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all) {
970 $obj = $db->fetch_object($resql);
974 header(
"Location: ".DOL_URL_ROOT.
'/comm/propal/card.php?id='.
$id);
978$help_url =
'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos';
979llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist');
981$param =
'&search_status='.urlencode($search_status);
983 $param .=
'&mode='.urlencode($mode);
985if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
986 $param .=
'&contextpage='.urlencode($contextpage);
988if ($limit > 0 && $limit != $conf->liste_limit) {
989 $param .=
'&limit='.((int) $limit);
991if ($optioncss !=
'') {
992 $param .=
'&optioncss='.urlencode($optioncss);
995 $param .=
'&socid='.urlencode((
string) ($socid));
998 $param .=
'&search_all='.urlencode($search_all);
1000if ($search_date_startday) {
1001 $param .=
'&search_date_startday='.urlencode((
string) ($search_date_startday));
1003if ($search_date_startmonth) {
1004 $param .=
'&search_date_startmonth='.urlencode((
string) ($search_date_startmonth));
1006if ($search_date_startyear) {
1007 $param .=
'&search_date_startyear='.urlencode((
string) ($search_date_startyear));
1009if ($search_date_endday) {
1010 $param .=
'&search_date_endday='.urlencode((
string) ($search_date_endday));
1012if ($search_date_endmonth) {
1013 $param .=
'&search_date_endmonth='.urlencode((
string) ($search_date_endmonth));
1015if ($search_date_endyear) {
1016 $param .=
'&search_date_endyear='.urlencode((
string) ($search_date_endyear));
1018if ($search_date_end_startday) {
1019 $param .=
'&search_date_end_startday='.urlencode((
string) ($search_date_end_startday));
1021if ($search_date_end_startmonth) {
1022 $param .=
'&search_date_end_startmonth='.urlencode((
string) ($search_date_end_startmonth));
1024if ($search_date_end_startyear) {
1025 $param .=
'&search_date_end_startyear='.urlencode((
string) ($search_date_end_startyear));
1027if ($search_date_end_endday) {
1028 $param .=
'&search_date_end_endday='.urlencode((
string) ($search_date_end_endday));
1030if ($search_date_end_endmonth) {
1031 $param .=
'&search_date_end_endmonth='.urlencode((
string) ($search_date_end_endmonth));
1033if ($search_date_end_endyear) {
1034 $param .=
'&search_date_end_endyear='.urlencode((
string) ($search_date_end_endyear));
1036if ($search_date_delivery_startday) {
1037 $param .=
'&search_date_delivery_startday='.urlencode((
string) ($search_date_delivery_startday));
1039if ($search_date_delivery_startmonth) {
1040 $param .=
'&search_date_delivery_startmonth='.urlencode((
string) ($search_date_delivery_startmonth));
1042if ($search_date_delivery_startyear) {
1043 $param .=
'&search_date_delivery_startyear='.urlencode((
string) ($search_date_delivery_startyear));
1045if ($search_date_delivery_endday) {
1046 $param .=
'&search_date_delivery_endday='.urlencode((
string) ($search_date_delivery_endday));
1048if ($search_date_delivery_endmonth) {
1049 $param .=
'&search_date_delivery_endmonth='.urlencode((
string) ($search_date_delivery_endmonth));
1051if ($search_date_delivery_endyear) {
1052 $param .=
'&search_date_delivery_endyear='.urlencode((
string) ($search_date_delivery_endyear));
1055 $param .=
'&search_ref='.urlencode($search_ref);
1057if ($search_refcustomer) {
1058 $param .=
'&search_refcustomer='.urlencode($search_refcustomer);
1060if ($search_refproject) {
1061 $param .=
'&search_refproject='.urlencode($search_refproject);
1063if ($search_societe) {
1064 $param .=
'&search_societe='.urlencode($search_societe);
1066if ($search_societe_alias) {
1067 $param .=
'&search_societe_alias='.urlencode($search_societe_alias);
1069if ($search_user > 0) {
1070 $param .=
'&search_user='.urlencode((
string) ($search_user));
1072if ($search_sale > 0) {
1073 $param .=
'&search_sale='.urlencode((
string) $search_sale);
1075if ($search_montant_ht) {
1076 $param .=
'&search_montant_ht='.urlencode($search_montant_ht);
1078if ($search_multicurrency_code !=
'') {
1079 $param .=
'&search_multicurrency_code='.urlencode($search_multicurrency_code);
1081if ($search_multicurrency_tx !=
'') {
1082 $param .=
'&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
1084if ($search_multicurrency_montant_ht !=
'') {
1085 $param .=
'&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
1087if ($search_multicurrency_montant_vat !=
'') {
1088 $param .=
'&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
1090if ($search_multicurrency_montant_ttc !=
'') {
1091 $param .=
'&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
1094 $param .=
'&search_login='.urlencode($search_login);
1097 $param .=
'&search_town='.urlencode($search_town);
1100 $param .=
'&search_zip='.urlencode($search_zip);
1102if ($search_categ_cus > 0) {
1103 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
1105if ($search_product_category !=
'') {
1106 $param .=
'&search_product_category='.urlencode((
string) ($search_product_category));
1108if ($search_fk_cond_reglement > 0) {
1109 $param .=
'&search_fk_cond_reglement='.urlencode((
string) ($search_fk_cond_reglement));
1111if ($search_fk_shipping_method > 0) {
1112 $param .=
'&search_fk_shipping_method='.urlencode((
string) ($search_fk_shipping_method));
1114if ($search_fk_input_reason > 0) {
1115 $param .=
'&search_fk_input_reason='.urlencode((
string) ($search_fk_input_reason));
1117if ($search_fk_mode_reglement > 0) {
1118 $param .=
'&search_fk_mode_reglement='.urlencode((
string) ($search_fk_mode_reglement));
1120if ($search_type_thirdparty > 0) {
1121 $param .=
'&search_type_thirdparty='.urlencode((
string) ($search_type_thirdparty));
1124 $param .=
'&search_town='.urlencode($search_town);
1127 $param .=
'&search_zip='.urlencode($search_zip);
1130 $param .=
'&search_state='.urlencode($search_state);
1133 $param .=
'&search_town='.urlencode($search_town);
1135if ($search_country) {
1136 $param .=
'&search_country='.urlencode((
string) ($search_country));
1138if ($search_date_signature_startday) {
1139 $param .=
'&search_date_signature_startday='.urlencode((
string) ($search_date_signature_startday));
1141if ($search_date_signature_startmonth) {
1142 $param .=
'&search_date_signature_startmonth='.urlencode((
string) ($search_date_signature_startmonth));
1144if ($search_date_signature_startyear) {
1145 $param .=
'&search_date_signature_startyear='.urlencode((
string) ($search_date_signature_startyear));
1147if ($search_date_signature_endday) {
1148 $param .=
'&search_date_signature_endday='.urlencode((
string) ($search_date_signature_endday));
1150if ($search_date_signature_endmonth) {
1151 $param .=
'&search_date_signature_endmonth='.urlencode((
string) ($search_date_signature_endmonth));
1153if ($search_date_signature_endyear) {
1154 $param .=
'&search_date_signature_endyear='.urlencode((
string) ($search_date_signature_endyear));
1156if ($search_import_key !=
'') {
1157 $param .=
'&search_import_key='.urlencode($search_import_key);
1161include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
1163$parameters = array(
'param' => &$param);
1164$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
1165$param .= $hookmanager->resPrint;
1168$arrayofmassactions = array(
1169 'generate_doc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
1170 'builddoc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
1172if ($permissiontosendbymail) {
1173 $arrayofmassactions[
'presend'] =
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail");
1175if (
isModEnabled(
'category') && $user->hasRight(
'propal',
'lire')) {
1176 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
1178if ($permissiontovalidate) {
1179 $arrayofmassactions[
'prevalidate'] =
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate");
1181if ($permissiontoclose) {
1182 $arrayofmassactions[
'presign'] =
img_picto(
'',
'propal',
'class="pictofixedwidth"').$langs->trans(
"Sign");
1183 $arrayofmassactions[
'nopresign'] =
img_picto(
'',
'propal',
'class="pictofixedwidth"').$langs->trans(
"NoSign");
1184 $arrayofmassactions[
'setbilled'] =
img_picto(
'',
'bill',
'class="pictofixedwidth"').$langs->trans(
"ClassifyBilled");
1186if ($permissiontodelete) {
1187 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
1190if (in_array($massaction, array(
'presend',
'predelete',
'closed'))) {
1191 $arrayofmassactions = array();
1193$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1195$url = DOL_URL_ROOT.
'/comm/propal/card.php?action=create';
1196if (!empty($socid)) {
1197 $url .=
'&socid='.$socid;
1200$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'));
1201$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'));
1203$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewPropal'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'propal',
'creer'));
1206print
'<form method="POST" id="searchFormList" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1207if ($optioncss !=
'') {
1208 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1210print
'<input type="hidden" name="token" value="'.newToken().
'">';
1211print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1212print
'<input type="hidden" name="action" value="list">';
1213print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1214print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1215print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
1216print
'<input type="hidden" name="socid" value="'.$socid.
'">';
1217print
'<input type="hidden" name="mode"value="'.$mode.
'">';
1219print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'propal', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1221$topicmail =
"SendPropalRef";
1222$modelmail =
"propal_send";
1223$objecttmp =
new Propal($db);
1224$trackid =
'pro'.$object->id;
1225include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1227if ($massaction ==
'prevalidate') {
1228 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassValidation"), $langs->trans(
"ConfirmMassValidationQuestion"),
"validate",
null,
'', 0, 200, 500, 1);
1231if ($massaction ==
'presign') {
1232 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassSignature"), $langs->trans(
"ConfirmMassSignatureQuestion"),
"sign",
null,
'', 0, 200, 500, 1);
1235if ($massaction ==
'nopresign') {
1236 print $form->formconfirm($_SERVER[
"PHP_SELF"], $langs->trans(
"ConfirmMassNoSignature"), $langs->trans(
"ConfirmMassNoSignatureQuestion"),
"nosign",
null,
'', 0, 200, 500, 1);
1240 foreach ($fieldstosearchall as $key => $val) {
1241 $fieldstosearchall[$key] = $langs->trans($val);
1243 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1249if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'read')) {
1250 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
1252 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROPOSAL, $searchCategoryPropalList,
'minwidth300', $searchCategoryPropalOperator ? $searchCategoryPropalOperator : 0);
1255if ($user->hasRight(
'user',
'user',
'lire')) {
1256 $langs->load(
"commercial");
1257 $moreforfilter .=
'<div class="divsearchfield">';
1258 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1259 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth250 widthcentpercentminusx', 1);
1260 $moreforfilter .=
'</div>';
1263if ($user->hasRight(
'user',
'user',
'lire')) {
1264 $moreforfilter .=
'<div class="divsearchfield">';
1265 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
1266 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$form->select_dolusers((empty($search_user) ? -2 : 0),
'search_user', $tmptitle, null, 0,
'',
'',
'0', 0, 0,
'', 0,
'',
'maxwidth250 widthcentpercentminusx');
1267 $moreforfilter .=
'</div>';
1270if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'read') && ($user->hasRight(
'product',
'read') || $user->hasRight(
'service',
'read'))) {
1271 $searchCategoryProductOperator =
GETPOSTINT(
'search_category_product_operator');
1272 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1273 $tmptitle = $langs->trans(
'IncludingProductWithTag');
1275 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, array($search_product_category),
'maxwidth300', $searchCategoryProductOperator, 0, 0, $tmptitle);
1277if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1278 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1279 $moreforfilter .=
'<div class="divsearchfield">';
1280 $tmptitle = $langs->trans(
'CustomersProspectsCategoriesShort');
1281 $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'));
1282 $moreforfilter .=
'</div>';
1285 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
1287 $moreforfilter .=
'<div class="divsearchfield">';
1288 $tmptitle = $langs->trans(
'Warehouse');
1289 $moreforfilter .=
img_picto($tmptitle,
'stock',
'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse,
'search_warehouse',
'', $tmptitle, 0, 0,
'', 0, 0, array(),
'maxwidth250 widthcentpercentminusx');
1290 $moreforfilter .=
'</div>';
1292$parameters = array();
1293$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1294if (empty($reshook)) {
1295 $moreforfilter .= $hookmanager->resPrint;
1297 $moreforfilter = $hookmanager->resPrint;
1300if (!empty($moreforfilter)) {
1301 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1302 print $moreforfilter;
1306$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1307$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1308$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1310print
'<div class="div-table-responsive">';
1311print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1313print
'<tr class="liste_titre_filter">';
1317 print
'<td class="liste_titre center">';
1318 $searchpicto = $form->showFilterButtons(
'left');
1323if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1324 print
'<td class="liste_titre">';
1325 print
'<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
1328if (!empty($arrayfields[
'p.ref_client'][
'checked'])) {
1329 print
'<td class="liste_titre">';
1330 print
'<input class="flat maxwidth50" type="text" name="search_refcustomer" value="'.dol_escape_htmltag($search_refcustomer).
'">';
1333if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1334 print
'<td class="liste_titre">';
1335 print
'<input class="flat maxwidth50" type="text" name="search_refproject" value="'.dol_escape_htmltag($search_refproject).
'">';
1338if (!empty($arrayfields[
'pr.title'][
'checked'])) {
1339 print
'<td class="liste_titre">';
1340 print
'<input class="flat maxwidth50" type="text" name="search_project" value="'.dol_escape_htmltag($search_project).
'">';
1343if (!empty($arrayfields[
's.nom'][
'checked'])) {
1344 print
'<td class="liste_titre" align="left">';
1345 print
'<input class="flat maxwidth100" type="text" name="search_societe" value="'.dol_escape_htmltag((
string) $search_societe).
'"'.($socid > 0 ?
" disabled" :
"").
'>';
1348if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1349 print
'<td class="liste_titre" align="left">';
1350 print
'<input class="flat maxwidth100" type="text" name="search_societe_alias" value="'.dol_escape_htmltag($search_societe_alias).
'">';
1353if (!empty($arrayfields[
's.town'][
'checked'])) {
1354 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_town" value="'.$search_town.
'"></td>';
1356if (!empty($arrayfields[
's.zip'][
'checked'])) {
1357 print
'<td class="liste_titre"><input class="flat maxwidth50" type="text" name="search_zip" value="'.$search_zip.
'"></td>';
1360if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1361 print
'<td class="liste_titre">';
1362 print
'<input class="flat maxwidth50" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1366if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1367 print
'<td class="liste_titre center">';
1368 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1372if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1373 print
'<td class="liste_titre maxwidth100onsmartphone center">';
1374 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);
1379if (!empty($arrayfields[
'p.date'][
'checked'])) {
1380 print
'<td class="liste_titre center">';
1381 print
'<div class="nowrapfordate">';
1382 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1384 print
'<div class="nowrapfordate">';
1385 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1390if (!empty($arrayfields[
'p.fin_validite'][
'checked'])) {
1391 print
'<td class="liste_titre center">';
1392 print
'<div class="nowrapfordate">';
1393 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'));
1395 print
'<div class="nowrapfordate">';
1396 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'));
1401if (!empty($arrayfields[
'p.date_livraison'][
'checked'])) {
1402 print
'<td class="liste_titre center">';
1403 print
'<div class="nowrapfordate">';
1404 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'));
1406 print
'<div class="nowrapfordate">';
1407 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'));
1412if (!empty($arrayfields[
'p.date_signature'][
'checked'])) {
1413 print
'<td class="liste_titre center">';
1414 print
'<div class="nowrapfordate">';
1415 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'));
1417 print
'<div class="nowrapfordate">';
1418 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'));
1423if (!empty($arrayfields[
'ava.rowid'][
'checked'])) {
1424 print
'<td class="liste_titre maxwidth100onsmartphone center">';
1425 $form->selectAvailabilityDelay($search_availability,
'search_availability',
'', 1);
1430if (!empty($arrayfields[
'p.fk_shipping_method'][
'checked'])) {
1431 print
'<td class="liste_titre">';
1432 $form->selectShippingMethod($search_fk_shipping_method,
'search_fk_shipping_method',
'', 1,
'', 1);
1436if (!empty($arrayfields[
'p.fk_input_reason'][
'checked'])) {
1437 print
'<td class="liste_titre">';
1438 $form->selectInputReason($search_fk_input_reason,
'search_fk_input_reason',
'', 1,
'maxwidth125', 1);
1442if (!empty($arrayfields[
'p.fk_cond_reglement'][
'checked'])) {
1443 print
'<td class="liste_titre">';
1444 print $form->getSelectConditionsPaiements((
int) $search_fk_cond_reglement,
'search_fk_cond_reglement', 1, 1, 1);
1448if (!empty($arrayfields[
'p.fk_mode_reglement'][
'checked'])) {
1449 print
'<td class="liste_titre">';
1450 print $form->select_types_paiements($search_fk_mode_reglement,
'search_fk_mode_reglement',
'', 0, 1, 1, 0, -1,
'', 1);
1453if (!empty($arrayfields[
'p.total_ht'][
'checked'])) {
1455 print
'<td class="liste_titre right">';
1456 print
'<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).
'">';
1459if (!empty($arrayfields[
'p.total_tva'][
'checked'])) {
1461 print
'<td class="liste_titre right">';
1462 print
'<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).
'">';
1465if (!empty($arrayfields[
'p.total_ttc'][
'checked'])) {
1467 print
'<td class="liste_titre right">';
1468 print
'<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).
'">';
1471if (!empty($arrayfields[
'p.total_ht_invoiced'][
'checked'])) {
1473 print
'<td class="liste_titre right">';
1476if (!empty($arrayfields[
'p.total_invoiced'][
'checked'])) {
1478 print
'<td class="liste_titre right">';
1481if (!empty($arrayfields[
'p.multicurrency_code'][
'checked'])) {
1483 print
'<td class="liste_titre">';
1484 print $form->selectMultiCurrency($search_multicurrency_code,
'search_multicurrency_code', 1);
1487if (!empty($arrayfields[
'p.multicurrency_tx'][
'checked'])) {
1489 print
'<td class="liste_titre">';
1490 print
'<input class="flat" type="text" size="4" name="search_multicurrency_tx" value="'.dol_escape_htmltag($search_multicurrency_tx).
'">';
1493if (!empty($arrayfields[
'p.multicurrency_total_ht'][
'checked'])) {
1495 print
'<td class="liste_titre right">';
1496 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ht" value="'.dol_escape_htmltag($search_multicurrency_montant_ht).
'">';
1499if (!empty($arrayfields[
'p.multicurrency_total_tva'][
'checked'])) {
1501 print
'<td class="liste_titre right">';
1502 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_vat" value="'.dol_escape_htmltag($search_multicurrency_montant_vat).
'">';
1505if (!empty($arrayfields[
'p.multicurrency_total_ttc'][
'checked'])) {
1507 print
'<td class="liste_titre right">';
1508 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ttc" value="'.dol_escape_htmltag($search_multicurrency_montant_ttc).
'">';
1511if (!empty($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'checked'])) {
1513 print
'<td class="liste_titre right">';
1516if (!empty($arrayfields[
'p.multicurrency_total_invoiced'][
'checked'])) {
1518 print
'<td class="liste_titre right">';
1521if (!empty($arrayfields[
'u.login'][
'checked'])) {
1523 print
'<td class="liste_titre">';
1524 print
'<input class="flat maxwidth75" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1527if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
1528 print
'<td class="liste_titre"></td>';
1530if (!empty($arrayfields[
'total_pa'][
'checked'])) {
1531 print
'<td class="liste_titre right">';
1534if (!empty($arrayfields[
'total_margin'][
'checked'])) {
1535 print
'<td class="liste_titre right">';
1538if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
1539 print
'<td class="liste_titre right">';
1542if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
1543 print
'<td class="liste_titre right">';
1547include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1550$parameters = array(
'arrayfields' => $arrayfields);
1551$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1552print $hookmanager->resPrint;
1554if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1555 print
'<td class="liste_titre">';
1559if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1560 print
'<td class="liste_titre">';
1564if (!empty($arrayfields[
'p.date_cloture'][
'checked'])) {
1565 print
'<td class="liste_titre">';
1568if (!empty($arrayfields[
'p.note_public'][
'checked'])) {
1570 print
'<td class="liste_titre">';
1571 print
'<input class="flat maxwidth75" type="text" name="search_note_public" value="'.dol_escape_htmltag($search_note_public).
'">';
1574if (!empty($arrayfields[
'p.note_private'][
'checked'])) {
1576 print
'<td class="liste_titre">';
1580if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1581 print
'<td class="liste_titre maxwidthonsmartphone center">';
1582 print
'<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1586if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1587 print
'<td class="liste_titre center parentonrightofpage">';
1588 $formpropal->selectProposalStatus($search_status, 1, 0, 1,
'customer',
'search_status',
'search_status width100 onrightofpage');
1593 print
'<td class="liste_titre center">';
1594 $searchpicto = $form->showFilterButtons();
1610print
'<tr class="liste_titre">';
1612 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1615if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1616 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'p.ref',
'', $param,
'', $sortfield, $sortorder);
1619if (!empty($arrayfields[
'p.ref_client'][
'checked'])) {
1620 print_liste_field_titre($arrayfields[
'p.ref_client'][
'label'], $_SERVER[
"PHP_SELF"],
'p.ref_client',
'', $param,
'', $sortfield, $sortorder);
1623if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1624 print_liste_field_titre($arrayfields[
'pr.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'pr.ref',
'', $param,
'', $sortfield, $sortorder);
1627if (!empty($arrayfields[
'pr.title'][
'checked'])) {
1628 print_liste_field_titre($arrayfields[
'pr.title'][
'label'], $_SERVER[
"PHP_SELF"],
'pr.title',
'', $param,
'', $sortfield, $sortorder);
1631if (!empty($arrayfields[
's.nom'][
'checked'])) {
1632 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
's.nom',
'', $param,
'', $sortfield, $sortorder);
1635if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1636 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
's.name_alias',
'', $param,
'', $sortfield, $sortorder);
1639if (!empty($arrayfields[
's.town'][
'checked'])) {
1640 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1643if (!empty($arrayfields[
's.zip'][
'checked'])) {
1644 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1647if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1648 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1651if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1652 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1655if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1656 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1659if (!empty($arrayfields[
'p.date'][
'checked'])) {
1660 print_liste_field_titre($arrayfields[
'p.date'][
'label'], $_SERVER[
"PHP_SELF"],
'p.datep',
'', $param,
'', $sortfield, $sortorder,
'center ');
1663if (!empty($arrayfields[
'p.fin_validite'][
'checked'])) {
1664 print_liste_field_titre($arrayfields[
'p.fin_validite'][
'label'], $_SERVER[
"PHP_SELF"],
'dfv',
'', $param,
'', $sortfield, $sortorder,
'center ');
1667if (!empty($arrayfields[
'p.date_livraison'][
'checked'])) {
1668 print_liste_field_titre($arrayfields[
'p.date_livraison'][
'label'], $_SERVER[
"PHP_SELF"],
'p.date_livraison',
'', $param,
'', $sortfield, $sortorder,
'center ');
1671if (!empty($arrayfields[
'p.date_signature'][
'checked'])) {
1672 print_liste_field_titre($arrayfields[
'p.date_signature'][
'label'], $_SERVER[
"PHP_SELF"],
'p.date_signature',
'', $param,
'', $sortfield, $sortorder,
'center ');
1675if (!empty($arrayfields[
'ava.rowid'][
'checked'])) {
1676 print_liste_field_titre($arrayfields[
'ava.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
'availability',
'', $param,
'', $sortfield, $sortorder);
1679if (!empty($arrayfields[
'p.fk_shipping_method'][
'checked'])) {
1680 print_liste_field_titre($arrayfields[
'p.fk_shipping_method'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_shipping_method",
"", $param,
'', $sortfield, $sortorder);
1683if (!empty($arrayfields[
'p.fk_input_reason'][
'checked'])) {
1684 print_liste_field_titre($arrayfields[
'p.fk_input_reason'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_input_reason",
"", $param,
'', $sortfield, $sortorder);
1687if (!empty($arrayfields[
'p.fk_cond_reglement'][
'checked'])) {
1688 print_liste_field_titre($arrayfields[
'p.fk_cond_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_cond_reglement",
"", $param,
'', $sortfield, $sortorder);
1691if (!empty($arrayfields[
'p.fk_mode_reglement'][
'checked'])) {
1692 print_liste_field_titre($arrayfields[
'p.fk_mode_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_mode_reglement",
"", $param,
'', $sortfield, $sortorder);
1695if (!empty($arrayfields[
'p.total_ht'][
'checked'])) {
1696 print_liste_field_titre($arrayfields[
'p.total_ht'][
'label'], $_SERVER[
"PHP_SELF"],
'p.total_ht',
'', $param,
'', $sortfield, $sortorder,
'right ');
1699if (!empty($arrayfields[
'p.total_tva'][
'checked'])) {
1700 print_liste_field_titre($arrayfields[
'p.total_tva'][
'label'], $_SERVER[
"PHP_SELF"],
'p.total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1703if (!empty($arrayfields[
'p.total_ttc'][
'checked'])) {
1704 print_liste_field_titre($arrayfields[
'p.total_ttc'][
'label'], $_SERVER[
"PHP_SELF"],
'p.total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1707if (!empty($arrayfields[
'p.total_ht_invoiced'][
'checked'])) {
1708 print_liste_field_titre($arrayfields[
'p.total_ht_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1711if (!empty($arrayfields[
'p.total_invoiced'][
'checked'])) {
1712 print_liste_field_titre($arrayfields[
'p.total_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1715if (!empty($arrayfields[
'p.multicurrency_code'][
'checked'])) {
1716 print_liste_field_titre($arrayfields[
'p.multicurrency_code'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_code',
'', $param,
'', $sortfield, $sortorder);
1719if (!empty($arrayfields[
'p.multicurrency_tx'][
'checked'])) {
1720 print_liste_field_titre($arrayfields[
'p.multicurrency_tx'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_tx',
'', $param,
'', $sortfield, $sortorder);
1723if (!empty($arrayfields[
'p.multicurrency_total_ht'][
'checked'])) {
1724 print_liste_field_titre($arrayfields[
'p.multicurrency_total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_total_ht',
'', $param,
'', $sortfield, $sortorder,
'right ');
1727if (!empty($arrayfields[
'p.multicurrency_total_tva'][
'checked'])) {
1728 print_liste_field_titre($arrayfields[
'p.multicurrency_total_tva'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1731if (!empty($arrayfields[
'p.multicurrency_total_ttc'][
'checked'])) {
1732 print_liste_field_titre($arrayfields[
'p.multicurrency_total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'p.multicurrency_total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1735if (!empty($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'checked'])) {
1736 print_liste_field_titre($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1739if (!empty($arrayfields[
'p.multicurrency_total_invoiced'][
'checked'])) {
1740 print_liste_field_titre($arrayfields[
'p.multicurrency_total_invoiced'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1743if (!empty($arrayfields[
'u.login'][
'checked'])) {
1744 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'', $sortfield, $sortorder);
1747if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
1748 print_liste_field_titre($arrayfields[
'sale_representative'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"",
"$param",
'', $sortfield, $sortorder);
1751if (!empty($arrayfields[
'total_pa'][
'checked'])) {
1752 print_liste_field_titre($arrayfields[
'total_pa'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1755if (!empty($arrayfields[
'total_margin'][
'checked'])) {
1756 print_liste_field_titre($arrayfields[
'total_margin'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1759if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
1760 print_liste_field_titre($arrayfields[
'total_margin_rate'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1763if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
1764 print_liste_field_titre($arrayfields[
'total_mark_rate'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1768include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1771 'arrayfields' => $arrayfields,
1773 'sortfield' => $sortfield,
1774 'sortorder' => $sortorder,
1775 'totalarray' => &$totalarray,
1778$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1780print $hookmanager->resPrint;
1781if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1782 print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowraponall ');
1785if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1786 print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"p.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowraponall ');
1789if (!empty($arrayfields[
'p.date_cloture'][
'checked'])) {
1790 print_liste_field_titre($arrayfields[
'p.date_cloture'][
'label'], $_SERVER[
"PHP_SELF"],
"p.date_cloture",
"", $param,
'', $sortfield, $sortorder,
'center nowraponall ');
1793if (!empty($arrayfields[
'p.note_public'][
'checked'])) {
1794 print_liste_field_titre($arrayfields[
'p.note_public'][
'label'], $_SERVER[
"PHP_SELF"],
"p.note_public",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1797if (!empty($arrayfields[
'p.note_private'][
'checked'])) {
1798 print_liste_field_titre($arrayfields[
'p.note_private'][
'label'], $_SERVER[
"PHP_SELF"],
"p.note_private",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1802if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1803 print_liste_field_titre($arrayfields[
'p.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"p.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1806if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1807 print_liste_field_titre($arrayfields[
'p.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
1811 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1821$with_margin_info =
false;
1823 !empty($arrayfields[
'total_pa'][
'checked'])
1824 || !empty($arrayfields[
'total_margin'][
'checked'])
1825 || !empty($arrayfields[
'total_margin_rate'][
'checked'])
1826 || !empty($arrayfields[
'total_mark_rate'][
'checked'])
1829 $with_margin_info =
true;
1839$imaxinloop = ($limit ? min($num, $limit) : $num);
1840while ($i < $imaxinloop) {
1841 $obj = $db->fetch_object($resql);
1845 if ($search_option) {
1846 $param .=
"&search_option=".urlencode($search_option);
1851 $object->ref_customer = $obj->ref_client;
1852 $object->note_public = $obj->note_public;
1853 $object->note_private = $obj->note_private;
1854 $object->statut = $obj->status;
1855 $object->status = $obj->status;
1857 $companystatic->id = $obj->socid;
1858 $companystatic->name = $obj->name;
1859 $companystatic->name_alias = $obj->alias;
1860 $companystatic->client = $obj->client;
1861 $companystatic->fournisseur = $obj->fournisseur;
1862 $companystatic->code_client = $obj->code_client;
1863 $companystatic->email = $obj->email;
1864 $companystatic->phone = $obj->phone;
1865 $companystatic->address = $obj->address;
1866 $companystatic->zip = $obj->zip;
1867 $companystatic->town = $obj->town;
1868 $companystatic->country_code = $obj->country_code;
1870 $projectstatic->id = $obj->project_id;
1871 $projectstatic->ref = $obj->project_ref;
1872 $projectstatic->title = $obj->project_label;
1874 $totalInvoicedHT = 0;
1875 $totalInvoicedTTC = 0;
1876 $multicurrency_totalInvoicedHT = 0;
1877 $multicurrency_totalInvoicedTTC = 0;
1881 if (!empty($TInvoiceData)) {
1882 foreach ($TInvoiceData as $invoiceData) {
1884 $invoice->fetch($invoiceData->facid);
1890 $totalInvoicedHT += $invoice->total_ht;
1891 $totalInvoicedTTC += $invoice->total_ttc;
1892 $multicurrency_totalInvoicedHT += $invoice->multicurrency_total_ht;
1893 $multicurrency_totalInvoicedTTC += $invoice->multicurrency_total_ttc;
1897 $marginInfo = array();
1898 if ($with_margin_info) {
1900 $marginInfo = $formmargin->getMarginInfosArray($object);
1901 $total_ht += $obj->total_ht;
1902 $total_margin += $marginInfo[
'total_margin'];
1905 if ($mode ==
'kanban') {
1907 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1908 print
'<div class="box-flex-container kanban">';
1911 $object->thirdparty = $companystatic;
1912 $userstatic->fetch($obj->fk_user_author);
1913 $arrayofparams = array(
'selected' => in_array(
$object->id, $arrayofselected),
'authorlink' => $userstatic->getNomUrl(-2),
'projectlink' => $projectstatic->getNomUrl(2));
1914 print
$object->getKanbanView(
'', $arrayofparams);
1915 if ($i == ($imaxinloop - 1)) {
1920 print
'<tr data-rowid="'.$object->id.
'" class="oddeven row-with-select status'.
$object->status.((getDolGlobalInt(
'MAIN_FINISHED_LINES_OPACITY') == 1 && $obj->status > 1) ?
' opacitymedium' :
'').
'">';
1924 print
'<td class="nowrap center">';
1925 if ($massactionbutton || $massaction) {
1927 if (in_array($obj->rowid, $arrayofselected)) {
1930 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1938 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1939 print
'<td class="nowraponall">';
1941 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1943 print
'<td class="nobordernopadding nowraponall">';
1948 if ($obj->status ==
Propal::STATUS_VALIDATED && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) {
1949 $warnornote .=
img_warning($langs->trans(
"Late"));
1952 print
'<td style="min-width: 20px" class="nobordernopadding nowrap">';
1957 print
'<td width="16" class="nobordernopadding right">';
1960 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
1961 print $formfile->getDocumentsLink(
$object->element, $filename, $filedir);
1962 print
'</td></tr></table>';
1970 if (!empty($arrayfields[
'p.ref_client'][
'checked'])) {
1972 print
'<td class="nowrap tdoverflowmax200">';
1980 if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1982 print
'<td class="nowraponall">';
1983 if ($obj->project_id > 0) {
1984 print $projectstatic->getNomUrl(1);
1992 if (!empty($arrayfields[
'pr.title'][
'checked'])) {
1994 print
'<td class="nowrap">';
1995 if ($obj->project_id > 0) {
2005 if (!empty($arrayfields[
's.nom'][
'checked'])) {
2006 print
'<td class="tdoverflowmax150">';
2007 print $companystatic->getNomUrl(1,
'customer', 0, 0, 1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
2015 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
2016 print
'<td class="tdoverflowmax200">';
2025 if (!empty($arrayfields[
's.town'][
'checked'])) {
2026 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->town).
'">';
2034 if (!empty($arrayfields[
's.zip'][
'checked'])) {
2035 print
'<td class="nocellnopadd">';
2043 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
2044 print
"<td>".$obj->state_name.
"</td>\n";
2050 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
2051 $tmparray =
getCountry($obj->fk_pays,
'all');
2052 print
'<td class="center tdoverflowmax100" title="'.dolPrintHTML($tmparray[
'label']).
'">';
2053 print $tmparray[
'label'];
2060 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
2061 if (!is_array($typenArray) || empty($typenArray)) {
2062 $typenArray = $formcompany->typent_array(1);
2065 print
'<td class="center">';
2066 if (!empty($obj->typent_code)) {
2067 print $typenArray[$obj->typent_code];
2076 if (!empty($arrayfields[
'p.date'][
'checked'])) {
2077 print
'<td class="center">';
2086 if (!empty($arrayfields[
'p.fin_validite'][
'checked'])) {
2088 print
'<td class="center">'.dol_print_date($db->jdate($obj->dfv),
'day');
2091 print
'<td> </td>';
2098 if (!empty($arrayfields[
'p.date_livraison'][
'checked'])) {
2099 if ($obj->ddelivery) {
2100 print
'<td class="center">'.dol_print_date($db->jdate($obj->ddelivery),
'day');
2103 print
'<td> </td>';
2110 if (!empty($arrayfields[
'p.date_signature'][
'checked'])) {
2111 if ($obj->dsignature) {
2112 print
'<td class="center">'.dol_print_date($db->jdate($obj->dsignature),
'day');
2115 print
'<td> </td>';
2122 if (!empty($arrayfields[
'ava.rowid'][
'checked'])) {
2123 print
'<td class="center">';
2124 $form->form_availability(
'0', $obj->availability,
'none', 1);
2131 if (!empty($arrayfields[
'p.fk_shipping_method'][
'checked'])) {
2133 $form->formSelectShippingMethod(
'', $obj->fk_shipping_method,
'none', 1);
2140 if (!empty($arrayfields[
'p.fk_input_reason'][
'checked'])) {
2141 $labelInputReason =
'';
2142 if ($obj->fk_input_reason > 0) {
2143 $labelInputReason = $form->cache_demand_reason[$obj->fk_input_reason][
'label'];
2145 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($labelInputReason).
'">';
2153 if (!empty($arrayfields[
'p.fk_cond_reglement'][
'checked'])) {
2155 $form->form_conditions_reglement($_SERVER[
'PHP_SELF'], $obj->fk_cond_reglement,
'none', 0,
'', 1, $obj->deposit_percent);
2162 if (!empty($arrayfields[
'p.fk_mode_reglement'][
'checked'])) {
2164 $form->form_modes_reglement($_SERVER[
'PHP_SELF'], $obj->fk_mode_reglement,
'none',
'', -1);
2171 if (!empty($arrayfields[
'p.total_ht'][
'checked'])) {
2172 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ht).
"</span></td>\n";
2179 if (empty($totalarray[
'val'][
'p.total_ht'])) {
2180 $totalarray[
'val'][
'p.total_ht'] = $obj->total_ht;
2182 $totalarray[
'val'][
'p.total_ht'] += $obj->total_ht;
2186 if (!empty($arrayfields[
'p.total_tva'][
'checked'])) {
2187 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_tva).
"</span></td>\n";
2194 if (empty($totalarray[
'val'][
'p.total_tva'])) {
2195 $totalarray[
'val'][
'p.total_tva'] = $obj->total_tva;
2197 $totalarray[
'val'][
'p.total_tva'] += $obj->total_tva;
2201 if (!empty($arrayfields[
'p.total_ttc'][
'checked'])) {
2202 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
"</span></td>\n";
2209 if (empty($totalarray[
'val'][
'p.total_ttc'])) {
2210 $totalarray[
'val'][
'p.total_ttc'] = $obj->total_ttc;
2212 $totalarray[
'val'][
'p.total_ttc'] += $obj->total_ttc;
2216 if (!empty($arrayfields[
'p.total_ht_invoiced'][
'checked'])) {
2217 print
'<td class="nowrap right"><span class="amount">'.price($totalInvoicedHT).
"</span></td>\n";
2224 if (empty($totalarray[
'val'][
'p.total_ht_invoiced'])) {
2225 $totalarray[
'val'][
'p.total_ht_invoiced'] = $totalInvoicedHT;
2227 $totalarray[
'val'][
'p.total_ht_invoiced'] += $totalInvoicedHT;
2231 if (!empty($arrayfields[
'p.total_invoiced'][
'checked'])) {
2232 print
'<td class="nowrap right"><span class="amount">'.price($totalInvoicedTTC).
"</span></td>\n";
2239 if (empty($totalarray[
'val'][
'p.total_invoiced'])) {
2240 $totalarray[
'val'][
'p.total_invoiced'] = $totalInvoicedTTC;
2242 $totalarray[
'val'][
'p.total_invoiced'] += $totalInvoicedTTC;
2246 if (!empty($arrayfields[
'p.multicurrency_code'][
'checked'])) {
2247 print
'<td class="nowrap">'.$obj->multicurrency_code.
' - '.$langs->trans(
'Currency'.$obj->multicurrency_code).
"</td>\n";
2254 if (!empty($arrayfields[
'p.multicurrency_tx'][
'checked'])) {
2255 print
'<td class="nowrap">';
2256 $form->form_multicurrency_rate($_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid, $obj->multicurrency_tx,
'none', $obj->multicurrency_code);
2263 if (!empty($arrayfields[
'p.multicurrency_total_ht'][
'checked'])) {
2264 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht).
"</span></td>\n";
2270 if (!empty($arrayfields[
'p.multicurrency_total_tva'][
'checked'])) {
2271 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_tva).
"</span></td>\n";
2277 if (!empty($arrayfields[
'p.multicurrency_total_ttc'][
'checked'])) {
2278 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc).
"</span></td>\n";
2284 if (!empty($arrayfields[
'p.multicurrency_total_ht_invoiced'][
'checked'])) {
2285 print
'<td class="nowrap right"><span class="amount">'.price($multicurrency_totalInvoicedHT).
"</span></td>\n";
2291 if (!empty($arrayfields[
'p.multicurrency_total_invoiced'][
'checked'])) {
2292 print
'<td class="nowrap right"><span class="amount">'.price($multicurrency_totalInvoicedTTC).
"</span></td>\n";
2298 $userstatic->id = $obj->fk_user_author;
2299 $userstatic->login = $obj->login;
2300 $userstatic->lastname = $obj->lastname;
2301 $userstatic->firstname = $obj->firstname;
2302 $userstatic->email = $obj->user_email;
2303 $userstatic->status = $obj->user_statut;
2304 $userstatic->entity = $obj->user_entity;
2305 $userstatic->photo = $obj->photo;
2306 $userstatic->office_phone = $obj->office_phone;
2307 $userstatic->office_fax = $obj->office_fax;
2308 $userstatic->user_mobile = $obj->user_mobile;
2309 $userstatic->job = $obj->job;
2310 $userstatic->gender = $obj->gender;
2313 if (!empty($arrayfields[
'u.login'][
'checked'])) {
2314 print
'<td class="tdoverflowmax150">';
2315 if ($userstatic->id) {
2316 print $userstatic->getNomUrl(-1);
2324 if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
2326 print
'<td class="tdoverflowmax125">';
2327 if ($obj->socid > 0) {
2328 $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
2329 if ($listsalesrepresentatives < 0) {
2332 $nbofsalesrepresentative = count($listsalesrepresentatives);
2333 if ($nbofsalesrepresentative > 6) {
2335 print $nbofsalesrepresentative;
2336 } elseif ($nbofsalesrepresentative > 0) {
2337 $userstatic =
new User($db);
2339 foreach ($listsalesrepresentatives as $val) {
2340 $userstatic->id = $val[
'id'];
2341 $userstatic->lastname = $val[
'lastname'];
2342 $userstatic->firstname = $val[
'firstname'];
2343 $userstatic->email = $val[
'email'];
2344 $userstatic->status = $val[
'statut'];
2345 $userstatic->entity = $val[
'entity'];
2346 $userstatic->photo = $val[
'photo'];
2347 $userstatic->login = $val[
'login'];
2348 $userstatic->office_phone = $val[
'office_phone'];
2349 $userstatic->office_fax = $val[
'office_fax'];
2350 $userstatic->user_mobile = $val[
'user_mobile'];
2351 $userstatic->job = $val[
'job'];
2352 $userstatic->gender = $val[
'gender'];
2354 print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1,
'', 0, 0, 12) : $userstatic->getNomUrl(-2);
2356 if ($j < $nbofsalesrepresentative) {
2373 if (!empty($arrayfields[
'total_pa'][
'checked'])) {
2374 print
'<td class="right nowrap">'.price($marginInfo[
'pa_total']).
'</td>';
2380 if (!empty($arrayfields[
'total_margin'][
'checked'])) {
2381 print
'<td class="right nowrap">'.price($marginInfo[
'total_margin']).
'</td>';
2388 $totalarray[
'val'][
'total_margin'] = $total_margin;
2391 if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
2392 print
'<td class="right nowrap">'.(($marginInfo[
'total_margin_rate'] ==
'') ?
'' :
price($marginInfo[
'total_margin_rate'], 0,
'', 0, 0, 2).
'%').
'</td>';
2398 if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
2399 print
'<td class="right nowrap">'.(($marginInfo[
'total_mark_rate'] ==
'') ?
'' :
price($marginInfo[
'total_mark_rate'], 0,
'', 0, 0, 2).
'%').
'</td>';
2406 if ($i >= $imaxinloop - 1) {
2407 if (!empty($total_ht)) {
2416 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
2418 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
2419 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
2420 print $hookmanager->resPrint;
2422 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
2423 print
'<td class="nowraponall center">';
2424 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
2431 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
2432 print
'<td class="nowraponall center">';
2433 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
2440 if (!empty($arrayfields[
'p.date_cloture'][
'checked'])) {
2441 print
'<td class="nowraponall center">';
2442 print
dol_print_date($db->jdate($obj->date_cloture),
'dayhour',
'tzuser');
2449 if (!empty($arrayfields[
'p.note_public'][
'checked'])) {
2450 print
'<td class="sensiblehtmlcontent center">';
2451 print
'<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(
dolGetFirstLineOfText($obj->note_public, 5)).
'</div>';
2458 if (!empty($arrayfields[
'p.note_private'][
'checked'])) {
2459 print
'<td class="sensiblehtmlcontent center">';
2460 print
'<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(
dolGetFirstLineOfText($obj->note_private, 5)).
'</div>';
2468 if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
2469 print
'<td class="nowrap center">'.dol_escape_htmltag($obj->import_key).
'</td>';
2476 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
2477 print
'<td class="nowrap center">'.$object->getLibStatut(5).
'</td>';
2484 print
'<td class="nowrap center">';
2485 if ($massactionbutton || $massaction) {
2487 if (in_array($obj->rowid, $arrayofselected)) {
2490 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2506include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2511 foreach ($arrayfields as $key => $val) {
2512 if (!empty($val[
'checked'])) {
2516 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2521$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
2522$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2523print $hookmanager->resPrint;
2525print
'</table>'.
"\n";
2528print
'</form>'.
"\n";
2530if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
2531 $hidegeneratedfilelistifempty = 1;
2532 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2533 $hidegeneratedfilelistifempty = 0;
2536 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
2540 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2541 $urlsource .= str_replace(
'&',
'&', $param);
2543 $filedir = $diroutputmassaction;
2544 $genallowed = $permissiontoread;
2545 $delallowed = $permissiontoadd;
2547 print $formfile->showdocuments(
'massfilesarea_proposals',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage invoices.
const TYPE_DEPOSIT
Deposit invoice.
Class to manage projects.
Class to manage proposals.
const STATUS_VALIDATED
Validated status.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
getCountry($searchkey, $withcode='', $dbtouse=null, $outputlangs=null, $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=0)
Set event message in dol_events session object.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
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.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
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 a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
getWarningDelay($module, $parmlevel1, $parmlevel2='')
Return a warning delay You can use it like this: if (getWarningDelay('module', 'paramlevel1')) It rep...
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.