38require
'../main.inc.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/class/discount.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
54 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmargin.class.php';
56require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
57require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
58require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
59require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
60require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
63 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
64 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
68$langs->loadLangs(array(
"categories",
"orders",
'sendings',
'companies',
'compta',
'bills',
'stocks',
'products'));
70$action =
GETPOST(
'action',
'aZ09');
71$massaction =
GETPOST(
'massaction',
'alpha');
73$confirm =
GETPOST(
'confirm',
'alpha');
74$toselect =
GETPOST(
'toselect',
'array:int');
75$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'orderlistdet';
76$optioncss =
GETPOST(
'optioncss',
'alpha');
78$productobuy =
GETPOST(
'productobuy',
'alpha');
79$productonly =
GETPOST(
'productonly',
'alpha');
80$disablelinefree =
GETPOST(
'disablelinefree',
'alpha');
82$search_datecloture_start =
GETPOSTINT(
'search_datecloture_start');
83if (empty($search_datecloture_start)) {
86$search_datecloture_end =
GETPOSTINT(
'search_datecloture_end');
87if (empty($search_datecloture_end)) {
95$search_product_category_array = array();
96$searchCategoryProductOperator = 0;
98 $search_product_category_array =
GETPOST(
"search_category_".Categorie::TYPE_PRODUCT.
"_list",
"array");
99 if (GETPOSTISSET(
'formfilteraction')) {
100 $searchCategoryProductOperator =
GETPOSTINT(
'search_category_product_operator');
109$search_id =
GETPOST(
'search_id',
'alpha');
110$search_refProduct =
GETPOST(
'search_refProduct',
'alpha');
111$search_descProduct =
GETPOST(
'search_descProduct',
'alpha');
113$search_ref =
GETPOST(
'search_ref',
'alpha') !=
'' ?
GETPOST(
'search_ref',
'alpha') :
GETPOST(
'sref',
'alpha');
114$search_ref_customer =
GETPOST(
'search_ref_customer',
'alpha');
115$search_company =
GETPOST(
'search_company',
'alpha');
116$search_company_alias =
GETPOST(
'search_company_alias',
'alpha');
117$search_town =
GETPOST(
'search_town',
'alpha');
118$search_zip =
GETPOST(
'search_zip',
'alpha');
119$search_state =
GETPOST(
"search_state",
'alpha');
120$search_country =
GETPOST(
"search_country",
'aZ09');
121$search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'intcomma');
122$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
123$search_user =
GETPOST(
'search_user',
'intcomma');
124$search_sale =
GETPOST(
'search_sale',
'intcomma');
125$search_total_ht =
GETPOST(
'search_total_ht',
'alpha');
126$search_total_vat =
GETPOST(
'search_total_vat',
'alpha');
127$search_total_ttc =
GETPOST(
'search_total_ttc',
'alpha');
128$search_warehouse =
GETPOST(
'search_warehouse',
'intcomma');
129$search_multicurrency_code =
GETPOST(
'search_multicurrency_code',
'alpha');
130$search_multicurrency_tx =
GETPOST(
'search_multicurrency_tx',
'alpha');
131$search_multicurrency_montant_ht =
GETPOST(
'search_multicurrency_montant_ht',
'alpha');
132$search_multicurrency_montant_vat =
GETPOST(
'search_multicurrency_montant_vat',
'alpha');
133$search_multicurrency_montant_ttc =
GETPOST(
'search_multicurrency_montant_ttc',
'alpha');
134$search_login =
GETPOST(
'search_login',
'alpha');
135$search_categ_cus =
GETPOST(
"search_categ_cus",
'intcomma');
136$search_billed =
GETPOST(
'search_billed',
'intcomma');
137$search_status =
GETPOST(
'search_status',
'intcomma');
138$search_project_ref =
GETPOST(
'search_project_ref',
'alpha');
139$search_project =
GETPOST(
'search_project',
'alpha');
140$search_shippable =
GETPOST(
'search_shippable',
'aZ09');
141$search_fk_cond_reglement =
GETPOSTINT(
"search_fk_cond_reglement");
142$search_fk_shipping_method =
GETPOSTINT(
"search_fk_shipping_method");
143$search_fk_mode_reglement =
GETPOSTINT(
"search_fk_mode_reglement");
144$search_fk_input_reason =
GETPOSTINT(
"search_fk_input_reason");
146$diroutputmassaction =
$conf->commande->multidir_output[
$conf->entity].
'/temp/massgeneration/'.$user->id;
150$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
151$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
153if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
156$offset = $limit * $page;
157$pageprev = $page - 1;
158$pagenext = $page + 1;
160 $sortfield =
'c.ref';
166$show_shippable_command =
GETPOST(
'show_shippable_command',
'aZ09');
170$hookmanager->initHooks(array(
'orderlistdetail'));
173$extrafields->fetch_name_optionals_label(
$object->table_element);
174$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
177$fieldstosearchall = array(
179 'c.ref_client' =>
'RefCustomerOrder',
180 'cdet.description' =>
'Description',
181 's.nom' =>
"ThirdParty",
182 's.name_alias' =>
"AliasNameShort",
185 'c.note_public' =>
'NotePublic',
187if (empty($user->socid)) {
188 $fieldstosearchall[
"c.note_private"] =
"NotePrivate";
191$checkedtypetiers = 0;
194 'rowid' => array(
'label' =>
'LineID',
'checked' =>
'-1',
'position' => 1,
'enabled' =>
'1'),
195 'c.ref' => array(
'label' =>
"RefOrder",
'checked' =>
'1',
'position' => 5),
196 'pr.ref' => array(
'label' =>
'ProductRef',
'checked' =>
'1',
'position' => 6),
197 'pr.desc' => array(
'label' =>
'ProductDescription',
'checked' =>
'-1',
'position' => 7),
198 'cdet.qty' => array(
'label' =>
'QtyOrdered',
'checked' =>
'1',
'position' => 8),
199 'c.ref_client' => array(
'label' =>
"RefCustomerOrder",
'checked' =>
'-1',
'position' => 10),
200 'p.ref' => array(
'label' =>
"ProjectRef",
'checked' =>
'-1',
'enabled' => (
string) (
int)
isModEnabled(
'project'),
'position' => 20),
201 'p.title' => array(
'label' =>
"ProjectLabel",
'checked' =>
'0',
'enabled' => (
string) (
int)
isModEnabled(
'project'),
'position' => 25),
202 's.nom' => array(
'label' =>
"ThirdParty",
'checked' =>
'1',
'position' => 30),
203 's.name_alias' => array(
'label' =>
"AliasNameShort",
'checked' =>
'-1',
'position' => 31),
204 's.town' => array(
'label' =>
"Town",
'checked' =>
'-1',
'position' => 35),
205 's.zip' => array(
'label' =>
"Zip",
'checked' =>
'-1',
'position' => 40),
206 'state.nom' => array(
'label' =>
"StateShort",
'checked' =>
'0',
'position' => 45),
207 'country.code_iso' => array(
'label' =>
"Country",
'checked' =>
'0',
'position' => 50),
208 'typent.code' => array(
'label' =>
"ThirdPartyType",
'checked' => (
string) $checkedtypetiers,
'position' => 55),
209 'c.date_commande' => array(
'label' =>
"OrderDateShort",
'checked' =>
'1',
'position' => 60),
210 'c.delivery_date' => array(
'label' =>
"DateDeliveryPlanned",
'checked' =>
'1',
'enabled' => (
string) (
int) !
getDolGlobalString(
'ORDER_DISABLE_DELIVERY_DATE'),
'position' => 65),
211 'c.fk_shipping_method' => array(
'label' =>
"SendingMethod",
'checked' =>
'-1',
'position' => 66 ,
'enabled' => (
string) (
int)
isModEnabled(
'shipping')),
212 'c.fk_cond_reglement' => array(
'label' =>
"PaymentConditionsShort",
'checked' =>
'-1',
'position' => 67),
213 'c.fk_mode_reglement' => array(
'label' =>
"PaymentMode",
'checked' =>
'-1',
'position' => 68),
214 'c.fk_input_reason' => array(
'label' =>
"Channel",
'checked' =>
'-1',
'position' => 69),
215 'cdet.total_ht' => array(
'label' =>
"AmountHT",
'checked' =>
'1',
'position' => 75),
216 'c.total_vat' => array(
'label' =>
"AmountVAT",
'checked' =>
'0',
'position' => 80),
217 'cdet.total_ttc' => array(
'label' =>
"AmountTTC",
'checked' =>
'0',
'position' => 85),
218 'c.multicurrency_code' => array(
'label' =>
'Currency',
'checked' =>
'0',
'enabled' => (empty(
$conf->multicurrency->enabled) ?
'0' :
'1'),
'position' => 90),
219 'c.multicurrency_tx' => array(
'label' =>
'CurrencyRate',
'checked' =>
'0',
'enabled' => (empty(
$conf->multicurrency->enabled) ?
'0' :
'1'),
'position' => 95),
220 'c.multicurrency_total_ht' => array(
'label' =>
'MulticurrencyAmountHT',
'checked' =>
'0',
'enabled' => (empty(
$conf->multicurrency->enabled) ?
'0' :
'1'),
'position' => 100),
221 'c.multicurrency_total_vat' => array(
'label' =>
'MulticurrencyAmountVAT',
'checked' =>
'0',
'enabled' => (empty(
$conf->multicurrency->enabled) ?
'0' :
'1'),
'position' => 105),
222 'c.multicurrency_total_ttc' => array(
'label' =>
'MulticurrencyAmountTTC',
'checked' =>
'0',
'enabled' => (empty(
$conf->multicurrency->enabled) ?
'0' :
'1'),
'position' => 110),
223 'c.fk_warehouse' => array(
'label' =>
'Warehouse',
'checked' =>
'0',
'enabled' => (
string) (int) (!
isModEnabled(
'stock') && !
getDolGlobalString(
'WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') ?
'0' :
'1'),
'position' => 110),
224 'u.login' => array(
'label' =>
"Author",
'checked' =>
'1',
'position' => 115),
225 'sale_representative' => array(
'label' =>
"SaleRepresentativesOfThirdParty",
'checked' =>
'0',
'position' => 116),
226 'total_pa' => array(
'label' => (
getDolGlobalString(
'MARGIN_TYPE') ==
'1' ?
'BuyingPrice' :
'CostPrice'),
'checked' =>
'0',
'position' => 300,
'enabled' => (
string) (int) (!
isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') ?
'0' :
'1')),
227 'total_margin' => array(
'label' =>
'Margin',
'checked' =>
'0',
'position' => 301,
'enabled' => (
string) (int) (!
isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') ?
'0' :
'1')),
228 'total_margin_rate' => array(
'label' =>
'MarginRate',
'checked' =>
'0',
'position' => 302,
'enabled' => (
string) (int) (!
isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') || !
getDolGlobalString(
'DISPLAY_MARGIN_RATES') ?
'0' :
'1')),
229 'total_mark_rate' => array(
'label' =>
'MarkRate',
'checked' =>
'0',
'position' => 303,
'enabled' => (
string) (int) (!
isModEnabled(
'margin') || !$user->hasRight(
'margins',
'liretous') || !
getDolGlobalString(
'DISPLAY_MARK_RATES') ?
'0' :
'1')),
230 'c.datec' => array(
'label' =>
"DateCreation",
'checked' =>
'0',
'position' => 120),
231 'c.tms' => array(
'label' =>
"DateModificationShort",
'checked' =>
'0',
'position' => 125),
232 'c.date_cloture' => array(
'label' =>
"DateClosing",
'checked' =>
'0',
'position' => 130),
233 'c.note_public' => array(
'label' =>
'NotePublic',
'checked' =>
'0',
'enabled' => (
string) (int) (!
getDolGlobalString(
'MAIN_LIST_HIDE_PUBLIC_NOTES')),
'position' => 135),
234 'c.note_private' => array(
'label' =>
'NotePrivate',
'checked' =>
'0',
'enabled' => (
string) (int) (!
getDolGlobalString(
'MAIN_LIST_HIDE_PRIVATE_NOTES')),
'position' => 140),
235 'shippable' => array(
'label' =>
"Shippable",
'checked' =>
'1',
'enabled' => (
string) (int) (
isModEnabled(
'shipping')),
'position' => 990),
236 'c.facture' => array(
'label' =>
"Billed",
'checked' =>
'1',
'enabled' => (
string) (int) (!
getDolGlobalString(
'WORKFLOW_BILL_ON_SHIPMENT')),
'position' => 995),
237 'c.import_key' => array(
'type' =>
'varchar(14)',
'label' =>
'ImportId',
'enabled' =>
'1',
'visible' => -2,
'position' => 999),
238 'c.fk_statut' => array(
'label' =>
"Status",
'checked' =>
'1',
'position' => 1000)
242include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
247if (!$user->hasRight(
'societe',
'client',
'voir')) {
248 $search_sale = $user->id;
254 $socid = $user->socid;
258$permissiontoread = $user->hasRight(
"commande",
"lire");
259$permissiontoadd = $user->hasRight(
"commande",
"creer");
260$permissiontodelete = $user->hasRight(
"commande",
"supprimer");
261$permissiontoexport = $user->hasRight(
"commande",
"commande",
"export");
263 $permissiontovalidate = $user->hasRight(
"commande",
"order_advance",
"validate");
264 $permissiontoclose = $user->hasRight(
"commande",
"order_advance",
"close");
265 $permissiontocancel = $user->hasRight(
"commande",
"order_advance",
"annuler");
266 $permissiontosendbymail = $user->hasRight(
"commande",
"order_advance",
"send");
268 $permissiontovalidate = $user->hasRight(
"commande",
"creer");
269 $permissiontoclose = $user->hasRight(
"commande",
"creer");
270 $permissiontocancel = $user->hasRight(
"commande",
"creer");
271 $permissiontosendbymail = $user->hasRight(
"commande",
"creer");
279if (
GETPOST(
'cancel',
'alpha')) {
283if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend' && $massaction !=
'confirm_createbills') {
287$parameters = array(
'socid' => $socid);
288$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
293if (empty($reshook)) {
295 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
298 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
301 $disablelinefree =
'';
305 $search_product_category_array = array();
306 $searchCategoryProductOperator = 0;
308 $search_refProduct =
'';
309 $search_descProduct =
'';
311 $search_ref_customer =
'';
312 $search_company =
'';
313 $search_company_alias =
'';
318 $search_country =
'';
319 $search_type_thirdparty =
'';
320 $search_total_ht =
'';
321 $search_total_vat =
'';
322 $search_total_ttc =
'';
323 $search_warehouse =
'';
324 $search_multicurrency_code =
'';
325 $search_multicurrency_tx =
'';
326 $search_multicurrency_montant_ht =
'';
327 $search_multicurrency_montant_vat =
'';
328 $search_multicurrency_montant_ttc =
'';
330 $search_dateorder_start =
'';
331 $search_dateorder_end =
'';
332 $search_datedelivery_start =
'';
333 $search_datedelivery_end =
'';
334 $search_project_ref =
'';
335 $search_project =
'';
339 $search_array_options = array();
340 $search_categ_cus =
'';
341 $search_datecloture_start =
'';
342 $search_datecloture_end =
'';
343 $search_fk_cond_reglement =
'';
344 $search_fk_shipping_method =
'';
345 $search_fk_mode_reglement =
'';
346 $search_fk_input_reason =
'';
348 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
349 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
354 $objectclass =
'Commande';
355 $objectlabel =
'Orders';
356 $uploaddir =
$conf->commande->multidir_output[
$conf->entity];
357 $triggersendname =
'ORDER_SENTBYMAIL';
358 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
380$title = $langs->trans(
"Orders");
381$help_url =
"EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
385$sqlSelect =
'SELECT';
387if ($search_all || !empty($search_product_category_array) || $search_user > 0) {
388 $sqlSelect =
'SELECT DISTINCT';
390$sqlSelect .=
' 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.code_client,';
391$sqlSelect .=
" typent.code as typent_code,";
392$sqlSelect .=
" state.code_departement as state_code, state.nom as state_name,";
393$sqlSelect .=
" country.code as country_code,";
394$sqlSelect .=
' c.rowid as c_rowid, c.ref, c.ref_client, c.fk_user_author,';
395$sqlSelect .=
' c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva as multicurrency_total_vat, c.multicurrency_total_ttc,';
396$sqlSelect .=
' c.total_ht as c_total_ht, c.total_tva as c_total_tva, c.total_ttc as c_total_ttc, c.fk_warehouse as warehouse,';
397$sqlSelect .=
' c.date_valid, c.date_commande, c.note_public, c.note_private, c.date_livraison as delivery_date, c.fk_statut, c.facture as billed,';
398$sqlSelect .=
' c.date_creation as date_creation, c.tms as date_modification, c.date_cloture as date_cloture,';
399$sqlSelect .=
' p.rowid as project_id, p.ref as project_ref, p.title as project_label,';
400$sqlSelect .=
' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender,';
401$sqlSelect .=
' c.fk_cond_reglement,c.deposit_percent,c.fk_mode_reglement,c.fk_shipping_method,';
402$sqlSelect .=
' c.fk_input_reason, c.import_key,';
404$sqlSelect .=
' cdet.rowid, cdet.description, cdet.qty, cdet.product_type, cdet.fk_product, cdet.total_ht, cdet.total_tva, cdet.total_ttc,';
405$sqlSelect .=
' pr.rowid as product_rowid, pr.ref as product_ref, pr.label as product_label, pr.barcode as product_barcode, pr.tobatch as product_batch, pr.tosell as product_status, pr.tobuy as product_status_buy';
407if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
408 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
409 $sqlSelect .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
414$parameters = array();
415$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
416$sqlSelect .= $hookmanager->resPrint;
418$sql =
' FROM '.MAIN_DB_PREFIX.
'societe as s';
419$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
420$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
421$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
423$sql .=
', '.MAIN_DB_PREFIX.
'commandedet as cdet';
424$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'commande as c ON cdet.fk_commande = c.rowid';
425$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'product as pr ON pr.rowid = cdet.fk_product';
426if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
427 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_extrafields as ef on (c.rowid = ef.fk_object)";
429$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as p ON p.rowid = c.fk_projet";
430$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON c.fk_user_author = u.rowid';
432if ($search_user > 0) {
433 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ec";
434 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
437$parameters = array();
438$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
439$sql .= $hookmanager->resPrint;
441$sql .=
' WHERE c.fk_soc = s.rowid';
442$sql .=
' AND c.entity IN ('.getEntity(
'commande').
')';
443$sql .=
' AND cdet.product_type <> 9';
445if (!empty($productobuy)) {
446 $sql .=
" AND pr.tobuy = 1";
448if (!empty($productonly)) {
449 $sql .=
" AND (cdet.product_type = 0 OR cdet.product_type = 1)";
451if (!empty($disablelinefree)) {
452 $sql .=
" AND cdet.fk_product IS NOT NULL";
455 $sql .=
' AND s.rowid = '.((int) $socid);
460if ($search_refProduct) {
463if ($search_descProduct) {
464 $sql .=
natural_search(array(
'pr.label',
'cdet.description'), $search_descProduct);
469if ($search_ref_customer) {
473 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
475if ($search_billed !=
'' && $search_billed >= 0) {
476 $sql .=
' AND c.facture = '.((int) $search_billed);
478if ($search_status !=
'') {
479 if ($search_status <= 3 && $search_status >= -1) {
481 $sql .=
' AND c.fk_statut IN (1,2)';
483 $sql .=
' AND c.fk_statut = '.((int) $search_status);
486 if ($search_status == -2) {
488 $sql .=
" AND c.fk_statut IN (1,2)";
490 if ($search_status == -3) {
493 $sql .=
' AND c.fk_statut IN (1,2,3)';
497if ($search_datecloture_start) {
498 $sql .=
" AND c.date_cloture >= '".$db->idate($search_datecloture_start).
"'";
500if ($search_datecloture_end) {
501 $sql .=
" AND c.date_cloture <= '".$db->idate($search_datecloture_end).
"'";
503if ($search_dateorder_start) {
504 $sql .=
" AND c.date_commande >= '".$db->idate($search_dateorder_start).
"'";
506if ($search_dateorder_end) {
507 $sql .=
" AND c.date_commande <= '".$db->idate($search_dateorder_end).
"'";
509if ($search_datedelivery_start) {
510 $sql .=
" AND c.date_livraison >= '".$db->idate($search_datedelivery_start).
"'";
512if ($search_datedelivery_end) {
513 $sql .=
" AND c.date_livraison <= '".$db->idate($search_datedelivery_end).
"'";
524if ($search_country) {
525 $sql .=
" AND s.fk_pays IN (".$db->sanitize($search_country).
')';
527if ($search_type_thirdparty && $search_type_thirdparty !=
'-1') {
528 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
530if ($search_company) {
533if ($search_company_alias) {
536if ($search_user > 0) {
537 $sql .=
" AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".((int) $search_user);
539if ($search_total_ht !=
'') {
542if ($search_total_vat !=
'') {
545if ($search_total_ttc !=
'') {
548if ($search_warehouse !=
'' && $search_warehouse > 0) {
551if ($search_multicurrency_code !=
'') {
552 $sql .=
" AND c.multicurrency_code = '".$db->escape($search_multicurrency_code).
"'";
554if ($search_multicurrency_tx !=
'') {
555 $sql .=
natural_search(
'c.multicurrency_tx', $search_multicurrency_tx, 1);
557if ($search_multicurrency_montant_ht !=
'') {
558 $sql .=
natural_search(
'c.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
560if ($search_multicurrency_montant_vat !=
'') {
561 $sql .=
natural_search(
'c.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
563if ($search_multicurrency_montant_ttc !=
'') {
564 $sql .=
natural_search(
'c.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
567 $sql .=
natural_search(array(
"u.login",
"u.firstname",
"u.lastname"), $search_login);
569if ($search_project_ref !=
'') {
572if ($search_project !=
'') {
575if ($search_fk_cond_reglement > 0) {
576 $sql .=
" AND c.fk_cond_reglement = ".((int) $search_fk_cond_reglement);
578if ($search_fk_shipping_method > 0) {
579 $sql .=
" AND c.fk_shipping_method = ".((int) $search_fk_shipping_method);
581if ($search_fk_mode_reglement > 0) {
582 $sql .=
" AND c.fk_mode_reglement = ".((int) $search_fk_mode_reglement);
584if ($search_fk_input_reason > 0) {
585 $sql .=
" AND c.fk_input_reason = ".((int) $search_fk_input_reason);
588if ($search_sale && $search_sale !=
'-1') {
589 if ($search_sale == -2) {
590 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc)";
591 } elseif ($search_sale > 0) {
592 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc AND sc.fk_user = ".((int) $search_sale).
")";
596$searchCategoryCustomerOperator =
GETPOSTINT(
'search_category_customer_operator');
597$searchCategoryCustomerList = ($search_categ_cus !==
'-1' ? explode(
',', $search_categ_cus) : array());
598if (!empty($searchCategoryCustomerList)) {
599 $searchCategoryCustomerSqlList = array();
600 $listofcategoryid =
'';
601 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
602 if (intval($searchCategoryCustomer) == -2) {
603 $searchCategoryCustomerSqlList[] =
"NOT EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc)";
604 } elseif (intval($searchCategoryCustomer) > 0) {
605 if ($searchCategoryCustomerOperator == 0) {
606 $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).
")";
608 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryCustomer);
612 if ($listofcategoryid) {
613 $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).
"))";
615 if ($searchCategoryCustomerOperator == 1) {
616 if (!empty($searchCategoryCustomerSqlList)) {
617 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
620 if (!empty($searchCategoryCustomerSqlList)) {
621 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
626$searchCategoryProductList = $search_product_category_array;
627if (!empty($searchCategoryProductList)) {
628 $searchCategoryProjectSqlList = array();
629 $listofcategoryid =
'';
630 foreach ($searchCategoryProductList as $searchCategoryProject) {
631 if (intval($searchCategoryProject) == -2) {
632 $searchCategoryProjectSqlList[] =
"NOT EXISTS (SELECT cp.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as cp WHERE cdet.fk_product = cp.fk_product)";
633 } elseif (intval($searchCategoryProject) > 0) {
634 if ($searchCategoryProductOperator == 0) {
635 $searchCategoryProjectSqlList[] =
" EXISTS (SELECT cp.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as cp WHERE cdet.fk_product = cp.fk_product AND cp.fk_categorie = ".((int) $searchCategoryProject).
")";
637 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProject);
641 if ($listofcategoryid) {
642 $searchCategoryProjectSqlList[] =
" EXISTS (SELECT cp.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as cp WHERE cdet.fk_product = cp.fk_product AND cp.fk_categorie IN (".
$db->sanitize($listofcategoryid).
"))";
644 if ($searchCategoryProductOperator == 1) {
645 if (!empty($searchCategoryProjectSqlList)) {
646 $sql .=
" AND (".implode(
' OR ', $searchCategoryProjectSqlList).
")";
649 if (!empty($searchCategoryProjectSqlList)) {
650 $sql .=
" AND (".implode(
' AND ', $searchCategoryProjectSqlList).
")";
656include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
659$parameters = array();
660$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
661$sql .= $hookmanager->resPrint;
664$parameters = array();
665$reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object);
666if (empty($reshook)) {
667 $sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
669 $sql = $hookmanager->resPrint;
672$sql .=
$db->order($sortfield, $sortorder);
675$nbtotalofrecords =
'';
677 $result =
$db->query(
'SELECT COUNT(*) as numrows ' . $sql);
678 $obj =
$db->fetch_object($result);
680 $nbtotalofrecords = 0;
682 $nbtotalofrecords = $obj->numrows;
685 if (($page * $limit) > (
int) $nbtotalofrecords) {
691$sql .=
$db->plimit($limit + 1, $offset);
693$resql =
$db->query($sqlSelect . $sql);
698 $title = $langs->trans(
'ListOrderLigne').
' - '.$soc->name;
699 if (empty($search_company)) {
700 $search_company = $soc->name;
703 $title = $langs->trans(
'ListOrderLigne');
705 if (strval($search_status) ==
'0') {
706 $title .=
' - '.$langs->trans(
'StatusOrderDraftShort');
708 if ($search_status == 1) {
709 $title .=
' - '.$langs->trans(
'StatusOrderValidatedShort');
711 if ($search_status == 2) {
712 $title .=
' - '.$langs->trans(
'StatusOrderSentShort');
714 if ($search_status == 3) {
715 $title .=
' - '.$langs->trans(
'StatusOrderToBillShort');
717 if ($search_status == -1) {
718 $title .=
' - '.$langs->trans(
'StatusOrderCanceledShort');
720 if ($search_status == -2) {
721 $title .=
' - '.$langs->trans(
'StatusOrderToProcessShort');
723 if ($search_status == -3) {
724 $title .=
' - '.$langs->trans(
'StatusOrderValidated').
', '.(!
isModEnabled(
'shipping') ?
'' : $langs->trans(
"StatusOrderSent").
', ').$langs->trans(
'StatusOrderToBill');
727 $num =
$db->num_rows($resql);
729 $arrayofselected = is_array($toselect) ? $toselect : array();
731 if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all) {
732 $obj =
$db->fetch_object($resql);
734 header(
"Location: ".DOL_URL_ROOT.
'/commande/card.php?id='.$id);
738 llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-commande page-list_det');
742 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
743 $param .=
'&contextpage='.urlencode($contextpage);
745 if ($limit > 0 && $limit !=
$conf->liste_limit) {
746 $param .=
'&limit='.((int) $limit);
749 $param .=
'&search_all='.urlencode($search_all);
752 $param .=
'&socid='.urlencode((
string) ($socid));
755 $param .=
'&search_id='.urlencode($search_id);
758 if ($search_refProduct) {
759 $param .=
'&search_refProduct='.urlencode($search_refProduct);
761 if ($search_descProduct) {
762 $param .=
'&search_descProduct='.urlencode($search_descProduct);
764 if ($search_status !=
'') {
765 $param .=
'&search_status='.urlencode($search_status);
767 if ($search_datecloture_start) {
768 $param .=
'&search_datecloture_startday='.dol_print_date($search_datecloture_start,
'%d').
'&search_datecloture_startmonth='.
dol_print_date($search_datecloture_start,
'%m').
'&search_datecloture_startyear='.
dol_print_date($search_datecloture_start,
'%Y');
770 if ($search_datecloture_end) {
771 $param .=
'&search_datecloture_endday='.dol_print_date($search_datecloture_end,
'%d').
'&search_datecloture_endmonth='.
dol_print_date($search_datecloture_end,
'%m').
'&search_datecloture_endyear='.
dol_print_date($search_datecloture_end,
'%Y');
773 if ($search_dateorder_start) {
774 $param .=
'&search_dateorder_start_day='.dol_print_date($search_dateorder_start,
'%d').
'&search_dateorder_start_month='.
dol_print_date($search_dateorder_start,
'%m').
'&search_dateorder_start_year='.
dol_print_date($search_dateorder_start,
'%Y');
776 if ($search_dateorder_end) {
777 $param .=
'&search_dateorder_end_day='.dol_print_date($search_dateorder_end,
'%d').
'&search_dateorder_end_month='.
dol_print_date($search_dateorder_end,
'%m').
'&search_dateorder_end_year='.
dol_print_date($search_dateorder_end,
'%Y');
779 if ($search_datedelivery_start) {
780 $param .=
'&search_datedelivery_start_day='.dol_print_date($search_datedelivery_start,
'%d').
'&search_datedelivery_start_month='.
dol_print_date($search_datedelivery_start,
'%m').
'&search_datedelivery_start_year='.
dol_print_date($search_datedelivery_start,
'%Y');
782 if ($search_datedelivery_end) {
783 $param .=
'&search_datedelivery_end_day='.dol_print_date($search_datedelivery_end,
'%d').
'&search_datedelivery_end_month='.
dol_print_date($search_datedelivery_end,
'%m').
'&search_datedelivery_end_year='.
dol_print_date($search_datedelivery_end,
'%Y');
786 $param .=
'&search_ref='.urlencode($search_ref);
788 if ($search_company) {
789 $param .=
'&search_company='.urlencode($search_company);
791 if ($search_company_alias) {
792 $param .=
'&search_company_alias='.urlencode($search_company_alias);
794 if ($search_ref_customer) {
795 $param .=
'&search_ref_customer='.urlencode($search_ref_customer);
797 if ($search_user > 0) {
798 $param .=
'&search_user='.urlencode((
string) ($search_user));
800 if ($search_sale > 0) {
801 $param .=
'&search_sale='.urlencode($search_sale);
803 if ($search_total_ht !=
'') {
804 $param .=
'&search_total_ht='.urlencode($search_total_ht);
806 if ($search_total_vat !=
'') {
807 $param .=
'&search_total_vat='.urlencode($search_total_vat);
809 if ($search_total_ttc !=
'') {
810 $param .=
'&search_total_ttc='.urlencode($search_total_ttc);
812 if ($search_warehouse !=
'') {
813 $param .=
'&search_warehouse='.urlencode((
string) ($search_warehouse));
816 $param .=
'&search_login='.urlencode($search_login);
818 if ($search_multicurrency_code !=
'') {
819 $param .=
'&search_multicurrency_code='.urlencode($search_multicurrency_code);
821 if ($search_multicurrency_tx !=
'') {
822 $param .=
'&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
824 if ($search_multicurrency_montant_ht !=
'') {
825 $param .=
'&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
827 if ($search_multicurrency_montant_vat !=
'') {
828 $param .=
'&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
830 if ($search_multicurrency_montant_ttc !=
'') {
831 $param .=
'&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
833 if ($search_project_ref >= 0) {
834 $param .=
"&search_project_ref=".urlencode($search_project_ref);
836 if ($search_town !=
'') {
837 $param .=
'&search_town='.urlencode($search_town);
839 if ($search_zip !=
'') {
840 $param .=
'&search_zip='.urlencode($search_zip);
842 if ($search_state !=
'') {
843 $param .=
'&search_state='.urlencode($search_state);
845 if ($search_country !=
'') {
846 $param .=
'&search_country='.urlencode((
string) ($search_country));
848 if ($search_type_thirdparty && $search_type_thirdparty !=
'-1') {
849 $param .=
'&search_type_thirdparty='.urlencode((
string) ($search_type_thirdparty));
851 if (!empty($search_product_category_array)) {
852 foreach ($search_product_category_array as $tmpval) {
853 $param .=
'&search_categegory_product_list[]='.urlencode($tmpval);
856 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
857 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
860 $param .=
'&show_files='.urlencode((
string) ($show_files));
862 if ($optioncss !=
'') {
863 $param .=
'&optioncss='.urlencode($optioncss);
865 if ($search_billed !=
'') {
866 $param .=
'&search_billed='.urlencode($search_billed);
868 if ($search_fk_cond_reglement > 0) {
869 $param .=
'&search_fk_cond_reglement='.urlencode((
string) ($search_fk_cond_reglement));
871 if ($search_fk_shipping_method > 0) {
872 $param .=
'&search_fk_shipping_method='.urlencode((
string) ($search_fk_shipping_method));
874 if ($search_fk_mode_reglement > 0) {
875 $param .=
'&search_fk_mode_reglement='.urlencode((
string) ($search_fk_mode_reglement));
877 if ($search_fk_input_reason > 0) {
878 $param .=
'&search_fk_input_reason='.urlencode((
string) ($search_fk_input_reason));
880 if (!empty($productobuy)) {
881 $param .=
'&productobuy='.urlencode($productobuy);
883 if (!empty($productonly)) {
884 $param .=
'&productonly='.urlencode($productonly);
886 if (!empty($disablelinefree)) {
887 $param .=
'&disablelinefree='.urlencode($disablelinefree);
891 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
894 $parameters = array(
'param' => &$param);
895 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
896 $param .= $hookmanager->resPrint;
899 $arrayofmassactions = array(
903 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
905 $url = DOL_URL_ROOT.
'/commande/card.php?action=create';
906 if (!empty($socid)) {
907 $url .=
'&socid='.$socid;
912 print
'<form method="POST" id="searchFormList" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
913 if ($optioncss !=
'') {
914 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
916 print
'<input type="hidden" name="token" value="'.newToken().
'">';
917 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
918 print
'<input type="hidden" name="action" value="list">';
919 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
920 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
921 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
922 print
'<input type="hidden" name="search_status" value="'.$search_status.
'">';
923 print
'<input type="hidden" name="socid" value="'.$socid.
'">';
925 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'order', 0, $newcardbutton,
'', $limit, 0, 0, 1);
927 $topicmail =
"SendOrderRef";
928 $modelmail =
"order_send";
930 $trackid =
'ord'.$object->id;
931 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
934 foreach ($fieldstosearchall as $key => $val) {
935 $fieldstosearchall[$key] = $langs->trans($val);
937 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
942 $moreforfilter .=
'<div class="divsearchfield">';
943 $moreforfilter .=
'<input type="checkbox" id="productobuy" name="productobuy"'.(!empty($productobuy) ?
'value="productobuychecked" checked' :
'').
'><label for="productobuy">'.$langs->trans(
"productobuy").
'</label>';
944 $moreforfilter .=
'</div>';
945 $moreforfilter .=
'<div class="divsearchfield">';
946 $moreforfilter .=
'<input type="checkbox" id="productonly" name="productonly"'.(!empty($productonly) ?
'value="productonlychecked" checked' :
'').
'><label for="productonly">'.$langs->trans(
"productonly").
'</label>';
947 $moreforfilter .=
'</div>';
948 $moreforfilter .=
'<div class="divsearchfield">';
949 $moreforfilter .=
'<input type="checkbox" id="disablelinefree" name="disablelinefree"'.(!empty($disablelinefree) ?
'value="disablelinefreechecked" checked' :
'').
'><label for="disablelinefree">'.$langs->trans(
"disablelinefree").
'</label>';
950 $moreforfilter .=
'</div><br>';
953 if ($user->hasRight(
'user',
'user',
'lire')) {
954 $langs->load(
"commercial");
955 $moreforfilter .=
'<div class="divsearchfield">';
956 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
957 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth250 widthcentpercentminusx');
958 $moreforfilter .=
'</div>';
961 if ($user->hasRight(
'user',
'user',
'lire')) {
962 $moreforfilter .=
'<div class="divsearchfield">';
963 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
964 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$form->select_dolusers($search_user,
'search_user', $tmptitle,
null, 0,
'',
'',
'0', 0, 0,
'', 0,
'',
'maxwidth250 widthcentpercentminusx');
965 $moreforfilter .=
'</div>';
968 if (
isModEnabled(
"category") && $user->hasRight(
'categorie',
'lire') && ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire'))) {
970 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, $search_product_category_array,
'minwidth300imp minwidth300', $searchCategoryProductOperator ? $searchCategoryProductOperator : 0, 1, 1, $langs->transnoentitiesnoconv(
"ProductsCategoryShort"));
972 if (
isModEnabled(
"category") && $user->hasRight(
'categorie',
'lire')) {
973 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
974 $moreforfilter .=
'<div class="divsearchfield">';
975 $tmptitle = $langs->trans(
'CustomersProspectsCategoriesShort');
976 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"').$formother->select_categories(
'customer', $search_categ_cus,
'search_categ_cus', 1, $tmptitle,
'minwidth300imp maxwidth300 widthcentpercentminusx');
977 $moreforfilter .=
'</div>';
980 $moreforfilter .=
'<div class="divsearchfield">';
981 $tmptitle = $langs->trans(
'Warehouse');
982 $moreforfilter .=
img_picto($tmptitle,
'stock',
'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse,
'search_warehouse',
'', 1, 0, 0, $tmptitle, 0, 0, array(),
'minwidth300imp maxwidth300 widthcentpercentminusx');
983 $moreforfilter .=
'</div>';
987 $parameters = array();
988 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
989 if (empty($reshook)) {
990 $moreforfilter .= $hookmanager->resPrint;
992 $moreforfilter = $hookmanager->resPrint;
995 if (!empty($moreforfilter)) {
996 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
997 print $moreforfilter;
1001 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1002 $selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
1003 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
1006 $selectedfields .=
'<script>';
1007 $selectedfields .=
' $(document).ready(function() {';
1008 $selectedfields .=
' console.log("Autoclick on checkforselects");';
1009 $selectedfields .=
' $("#checkforselects").click();';
1010 $selectedfields .=
' $("#massaction").val("createbills").change();';
1011 $selectedfields .=
' });';
1012 $selectedfields .=
'</script>';
1015 print
'<div class="div-table-responsive">';
1016 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1018 print
'<tr class="liste_titre_filter">';
1021 if (
$conf->main_checkbox_left_column) {
1022 print
'<td class="liste_titre center">';
1023 $searchpicto = $form->showFilterButtons(
'left');
1028 if (!empty($arrayfields[
'rowid'][
'checked'])) {
1029 print
'<td class="liste_titre right" data-key="id">';
1030 print
'<input class="flat searchstring width50" type="text" name="search_id" value="'.dol_escape_htmltag($search_id).
'">';
1034 if (!empty($arrayfields[
'c.ref'][
'checked'])) {
1035 print
'<td class="liste_titre">';
1036 print
'<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
1040 if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1041 print
'<td class="liste_titre">';
1042 print
'<input class="flat" size="6" type="text" name="search_refProduct" value="'.dol_escape_htmltag($search_refProduct).
'">';
1046 if (!empty($arrayfields[
'pr.desc'][
'checked'])) {
1047 print
'<td class="liste_titre">';
1048 print
'<input class="flat" size="6" type="text" name="search_descProduct" value="'.dol_escape_htmltag($search_descProduct).
'">';
1052 if (!empty($arrayfields[
'cdet.qty'][
'checked'])) {
1053 print
'<td class="liste_titre"></td>';
1057 if (!empty($arrayfields[
'c.ref_client'][
'checked'])) {
1058 print
'<td class="liste_titre" align="left">';
1059 print
'<input class="flat" type="text" size="6" name="search_ref_customer" value="'.dol_escape_htmltag($search_ref_customer).
'">';
1063 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1064 print
'<td class="liste_titre"><input type="text" class="flat" size="6" name="search_project_ref" value="'.dol_escape_htmltag($search_project_ref).
'"></td>';
1067 if (!empty($arrayfields[
'p.title'][
'checked'])) {
1068 print
'<td class="liste_titre"><input type="text" class="flat" size="6" name="search_project" value="'.dol_escape_htmltag($search_project).
'"></td>';
1071 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1072 print
'<td class="liste_titre" align="left">';
1073 print
'<input class="flat maxwidth100" type="text" name="search_company" value="'.dol_escape_htmltag((
string) $search_company).
'">';
1077 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1078 print
'<td class="liste_titre" align="left">';
1079 print
'<input class="flat maxwidth100" type="text" name="search_company_alias" value="'.dol_escape_htmltag($search_company_alias).
'">';
1083 if (!empty($arrayfields[
's.town'][
'checked'])) {
1084 print
'<td class="liste_titre"><input class="flat" type="text" size="4" name="search_town" value="'.dol_escape_htmltag($search_town).
'"></td>';
1087 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1088 print
'<td class="liste_titre"><input class="flat" type="text" size="4" name="search_zip" value="'.dol_escape_htmltag($search_zip).
'"></td>';
1091 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1092 print
'<td class="liste_titre">';
1093 print
'<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1097 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1098 print
'<td class="liste_titre" align="center">';
1099 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1103 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1104 print
'<td class="liste_titre maxwidthonsmartphone" align="center">';
1105 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'),
'', 1);
1109 if (!empty($arrayfields[
'c.date_commande'][
'checked'])) {
1110 print
'<td class="liste_titre center">';
1111 print
'<div class="nowrapfordate">';
1112 print $form->selectDate($search_dateorder_start ? $search_dateorder_start : -1,
'search_dateorder_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1114 print
'<div class="nowrapfordate">';
1115 print $form->selectDate($search_dateorder_end ? $search_dateorder_end : -1,
'search_dateorder_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1119 if (!empty($arrayfields[
'c.delivery_date'][
'checked'])) {
1120 print
'<td class="liste_titre center">';
1121 print
'<div class="nowrapfordate">';
1122 print $form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1,
'search_datedelivery_start_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1124 print
'<div class="nowrapfordate">';
1125 print $form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1,
'search_datedelivery_end_', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1130 if (!empty($arrayfields[
'c.fk_shipping_method'][
'checked'])) {
1131 print
'<td class="liste_titre">';
1132 $form->selectShippingMethod($search_fk_shipping_method,
'search_fk_shipping_method',
'', 1,
'', 1);
1136 if (!empty($arrayfields[
'c.fk_cond_reglement'][
'checked'])) {
1137 print
'<td class="liste_titre">';
1138 print $form->getSelectConditionsPaiements($search_fk_cond_reglement,
'search_fk_cond_reglement', 1, 1, 1);
1142 if (!empty($arrayfields[
'c.fk_mode_reglement'][
'checked'])) {
1143 print
'<td class="liste_titre">';
1144 $form->select_types_paiements($search_fk_mode_reglement,
'search_fk_mode_reglement',
'', 0, 1, 1, 0, -1);
1148 if (!empty($arrayfields[
'c.fk_input_reason'][
'checked'])) {
1149 print
'<td class="liste_titre">';
1150 $form->selectInputReason($search_fk_input_reason,
'search_fk_input_reason',
'', 1,
'', 1);
1153 if (!empty($arrayfields[
'cdet.total_ht'][
'checked'])) {
1155 print
'<td class="liste_titre right">';
1156 print
'<input class="flat" type="text" size="4" name="search_total_ht" value="'.dol_escape_htmltag($search_total_ht).
'">';
1159 if (!empty($arrayfields[
'c.total_vat'][
'checked'])) {
1161 print
'<td class="liste_titre right">';
1162 print
'<input class="flat" type="text" size="4" name="search_total_vat" value="'.dol_escape_htmltag($search_total_vat).
'">';
1165 if (!empty($arrayfields[
'cdet.total_ttc'][
'checked'])) {
1167 print
'<td class="liste_titre right">';
1168 print
'<input class="flat" type="text" size="5" name="search_total_ttc" value="'.$search_total_ttc.
'">';
1171 if (!empty($arrayfields[
'c.fk_warehouse'][
'checked'])) {
1173 print
'<td class="liste_titre right"></td>';
1175 if (!empty($arrayfields[
'c.multicurrency_code'][
'checked'])) {
1177 print
'<td class="liste_titre">';
1178 print $form->selectMultiCurrency($search_multicurrency_code,
'search_multicurrency_code', 1);
1181 if (!empty($arrayfields[
'c.multicurrency_tx'][
'checked'])) {
1183 print
'<td class="liste_titre">';
1184 print
'<input class="flat" type="text" size="4" name="search_multicurrency_tx" value="'.dol_escape_htmltag($search_multicurrency_tx).
'">';
1187 if (!empty($arrayfields[
'c.multicurrency_total_ht'][
'checked'])) {
1189 print
'<td class="liste_titre right">';
1190 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ht" value="'.dol_escape_htmltag($search_multicurrency_montant_ht).
'">';
1193 if (!empty($arrayfields[
'c.multicurrency_total_vat'][
'checked'])) {
1195 print
'<td class="liste_titre right">';
1196 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_vat" value="'.dol_escape_htmltag($search_multicurrency_montant_vat).
'">';
1199 if (!empty($arrayfields[
'c.multicurrency_total_ttc'][
'checked'])) {
1201 print
'<td class="liste_titre right">';
1202 print
'<input class="flat" type="text" size="4" name="search_multicurrency_montant_ttc" value="'.dol_escape_htmltag($search_multicurrency_montant_ttc).
'">';
1205 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1207 print
'<td class="liste_titre" align="center">';
1208 print
'<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1211 if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
1212 print
'<td class="liste_titre"></td>';
1214 if (!empty($arrayfields[
'total_pa'][
'checked'])) {
1215 print
'<td class="liste_titre right">';
1218 if (!empty($arrayfields[
'total_margin'][
'checked'])) {
1219 print
'<td class="liste_titre right">';
1222 if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
1223 print
'<td class="liste_titre right">';
1226 if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
1227 print
'<td class="liste_titre right">';
1231 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1233 $parameters = array(
'arrayfields' => $arrayfields);
1234 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1235 print $hookmanager->resPrint;
1237 if (!empty($arrayfields[
'c.datec'][
'checked'])) {
1238 print
'<td class="liste_titre">';
1242 if (!empty($arrayfields[
'c.tms'][
'checked'])) {
1243 print
'<td class="liste_titre">';
1247 if (!empty($arrayfields[
'c.date_cloture'][
'checked'])) {
1248 print
'<td class="liste_titre center">';
1249 print
'<div class="nowrapfordate">';
1250 print $form->selectDate($search_datecloture_start ? $search_datecloture_start : -1,
'search_datecloture_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1252 print
'<div class="nowrapfordate">';
1253 print $form->selectDate($search_datecloture_end ? $search_datecloture_end : -1,
'search_datecloture_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1258 if (!empty($arrayfields[
'c.note_public'][
'checked'])) {
1259 print
'<td class="liste_titre">';
1263 if (!empty($arrayfields[
'c.note_private'][
'checked'])) {
1264 print
'<td class="liste_titre">';
1268 if (!empty($arrayfields[
'shippable'][
'checked'])) {
1269 print
'<td class="liste_titre maxwidthonsmartphone" align="center">';
1272 print
'<input type="checkbox" name="show_shippable_command" value="1"'.($show_shippable_command ?
' checked' :
'').
'>';
1273 print $langs->trans(
'ShowShippableStatus');
1275 $show_shippable_command = 1;
1280 if (!empty($arrayfields[
'c.facture'][
'checked'])) {
1281 print
'<td class="liste_titre maxwidthonsmartphone" align="center">';
1282 print $form->selectyesno(
'search_billed', $search_billed, 1, 0, 1, 1);
1286 if (!empty($arrayfields[
'c.import_key'][
'checked'])) {
1287 print
'<td class="liste_titre maxwidthonsmartphone" align="center">';
1291 if (!empty($arrayfields[
'c.fk_statut'][
'checked'])) {
1292 print
'<td class="liste_titre maxwidthonsmartphone center">';
1293 $liststatus = array(
1297 -2 => $langs->trans(
"StatusOrderValidatedShort").
'+'.$langs->trans(
"StatusOrderSentShort"),
1298 -3 => $langs->trans(
"StatusOrderValidatedShort").
'+'.$langs->trans(
"StatusOrderSentShort").
'+'.$langs->trans(
"StatusOrderDelivered"),
1303 print $form->selectarray(
'search_status', $liststatus, $search_status, -5, 0, 0,
'', 0, 0, 0,
'',
'maxwidth125', 1);
1307 if (!
$conf->main_checkbox_left_column) {
1308 print
'<td class="liste_titre" align="middle">';
1309 $searchpicto = $form->showFilterButtons();
1316 print
'<tr class="liste_titre">';
1318 if (
$conf->main_checkbox_left_column) {
1319 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1323 if (!empty($arrayfields[
'rowid'][
'checked'])) {
1325 print_liste_field_titre($arrayfields[
'rowid'][
'label'], $_SERVER[
"PHP_SELF"],
'rowid',
'', $param,
'', $sortfield, $sortorder);
1327 if (!empty($arrayfields[
'c.ref'][
'checked'])) {
1328 print_liste_field_titre($arrayfields[
'c.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'c.ref',
'', $param,
'', $sortfield, $sortorder);
1330 if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1331 print_liste_field_titre($arrayfields[
'pr.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'pr.ref',
'', $param,
'', $sortfield, $sortorder);
1333 if (!empty($arrayfields[
'pr.desc'][
'checked'])) {
1334 print_liste_field_titre($arrayfields[
'pr.desc'][
'label'], $_SERVER[
"PHP_SELF"],
'pr.desc',
'', $param,
'', $sortfield, $sortorder);
1336 if (!empty($arrayfields[
'cdet.qty'][
'checked'])) {
1337 print_liste_field_titre($arrayfields[
'cdet.qty'][
'label'], $_SERVER[
"PHP_SELF"],
'cdet.qty',
'', $param,
'', $sortfield, $sortorder);
1340 if (!empty($arrayfields[
'c.ref_client'][
'checked'])) {
1341 print_liste_field_titre($arrayfields[
'c.ref_client'][
'label'], $_SERVER[
"PHP_SELF"],
'c.ref_client',
'', $param,
'', $sortfield, $sortorder);
1343 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1344 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref",
"", $param,
'', $sortfield, $sortorder);
1346 if (!empty($arrayfields[
'p.title'][
'checked'])) {
1347 print_liste_field_titre($arrayfields[
'p.title'][
'label'], $_SERVER[
"PHP_SELF"],
"p.title",
"", $param,
'', $sortfield, $sortorder);
1349 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1350 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
's.nom',
'', $param,
'', $sortfield, $sortorder);
1352 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1353 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
's.name_alias',
'', $param,
'', $sortfield, $sortorder);
1355 if (!empty($arrayfields[
's.town'][
'checked'])) {
1356 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1358 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1359 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1361 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1362 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1364 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1365 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1367 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1368 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1370 if (!empty($arrayfields[
'c.date_commande'][
'checked'])) {
1371 print_liste_field_titre($arrayfields[
'c.date_commande'][
'label'], $_SERVER[
"PHP_SELF"],
'c.date_commande',
'', $param,
'', $sortfield, $sortorder,
'center ');
1373 if (!empty($arrayfields[
'c.delivery_date'][
'checked'])) {
1374 print_liste_field_titre($arrayfields[
'c.delivery_date'][
'label'], $_SERVER[
"PHP_SELF"],
'c.date_livraison',
'', $param,
'', $sortfield, $sortorder,
'center ');
1376 if (!empty($arrayfields[
'c.fk_shipping_method'][
'checked'])) {
1377 print_liste_field_titre($arrayfields[
'c.fk_shipping_method'][
'label'], $_SERVER[
"PHP_SELF"],
"c.fk_shipping_method",
"", $param,
'', $sortfield, $sortorder);
1379 if (!empty($arrayfields[
'c.fk_cond_reglement'][
'checked'])) {
1380 print_liste_field_titre($arrayfields[
'c.fk_cond_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"c.fk_cond_reglement",
"", $param,
'', $sortfield, $sortorder);
1382 if (!empty($arrayfields[
'c.fk_mode_reglement'][
'checked'])) {
1383 print_liste_field_titre($arrayfields[
'c.fk_mode_reglement'][
'label'], $_SERVER[
"PHP_SELF"],
"c.fk_mode_reglement",
"", $param,
'', $sortfield, $sortorder);
1385 if (!empty($arrayfields[
'c.fk_input_reason'][
'checked'])) {
1386 print_liste_field_titre($arrayfields[
'c.fk_input_reason'][
'label'], $_SERVER[
"PHP_SELF"],
"c.fk_input_reason",
"", $param,
'', $sortfield, $sortorder);
1388 if (!empty($arrayfields[
'cdet.total_ht'][
'checked'])) {
1389 print_liste_field_titre($arrayfields[
'cdet.total_ht'][
'label'], $_SERVER[
"PHP_SELF"],
'cdet.total_ht',
'', $param,
'', $sortfield, $sortorder,
'right ');
1391 if (!empty($arrayfields[
'c.total_vat'][
'checked'])) {
1392 print_liste_field_titre($arrayfields[
'c.total_vat'][
'label'], $_SERVER[
"PHP_SELF"],
'cdet.total_tva',
'', $param,
'', $sortfield, $sortorder,
'right ');
1394 if (!empty($arrayfields[
'cdet.total_ttc'][
'checked'])) {
1395 print_liste_field_titre($arrayfields[
'cdet.total_ttc'][
'label'], $_SERVER[
"PHP_SELF"],
'cdet.total_ttc',
'', $param,
'', $sortfield, $sortorder,
'right ');
1397 if (!empty($arrayfields[
'c.fk_warehouse'][
'checked'])) {
1398 print_liste_field_titre($arrayfields[
'c.fk_warehouse'][
'label'],
"",
'',
'', $param,
'', $sortfield, $sortorder);
1400 if (!empty($arrayfields[
'c.multicurrency_code'][
'checked'])) {
1401 print_liste_field_titre($arrayfields[
'c.multicurrency_code'][
'label'], $_SERVER[
'PHP_SELF'],
'c.multicurrency_code',
'', $param,
'', $sortfield, $sortorder);
1403 if (!empty($arrayfields[
'c.multicurrency_tx'][
'checked'])) {
1404 print_liste_field_titre($arrayfields[
'c.multicurrency_tx'][
'label'], $_SERVER[
'PHP_SELF'],
'c.multicurrency_tx',
'', $param,
'', $sortfield, $sortorder);
1406 if (!empty($arrayfields[
'c.multicurrency_total_ht'][
'checked'])) {
1407 print_liste_field_titre($arrayfields[
'c.multicurrency_total_ht'][
'label'], $_SERVER[
'PHP_SELF'],
'c.multicurrency_total_ht',
'', $param,
'class="right"', $sortfield, $sortorder);
1409 if (!empty($arrayfields[
'c.multicurrency_total_vat'][
'checked'])) {
1410 print_liste_field_titre($arrayfields[
'c.multicurrency_total_vat'][
'label'], $_SERVER[
'PHP_SELF'],
'c.multicurrency_total_tva',
'', $param,
'class="right"', $sortfield, $sortorder);
1412 if (!empty($arrayfields[
'c.multicurrency_total_ttc'][
'checked'])) {
1413 print_liste_field_titre($arrayfields[
'c.multicurrency_total_ttc'][
'label'], $_SERVER[
'PHP_SELF'],
'c.multicurrency_total_ttc',
'', $param,
'class="right"', $sortfield, $sortorder);
1415 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1416 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'align="center"', $sortfield, $sortorder);
1418 if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
1419 print_liste_field_titre($arrayfields[
'sale_representative'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"",
"$param",
'', $sortfield, $sortorder);
1421 if (!empty($arrayfields[
'total_pa'][
'checked'])) {
1422 print_liste_field_titre($arrayfields[
'total_pa'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1424 if (!empty($arrayfields[
'total_margin'][
'checked'])) {
1425 print_liste_field_titre($arrayfields[
'total_margin'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1427 if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
1428 print_liste_field_titre($arrayfields[
'total_margin_rate'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1430 if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
1431 print_liste_field_titre($arrayfields[
'total_mark_rate'][
'label'], $_SERVER[
'PHP_SELF'],
'',
'', $param,
'class="right"', $sortfield, $sortorder);
1437 'cdet.total_ht' => 0,
1438 'cdet.total_tva' => 0,
1439 'cdet.total_ttc' => 0,
1444 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1446 $parameters = array(
1447 'arrayfields' => $arrayfields,
1449 'sortfield' => $sortfield,
1450 'sortorder' => $sortorder,
1453 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1454 print $hookmanager->resPrint;
1455 if (!empty($arrayfields[
'c.datec'][
'checked'])) {
1456 print_liste_field_titre($arrayfields[
'c.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"c.date_creation",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1458 if (!empty($arrayfields[
'c.tms'][
'checked'])) {
1459 print_liste_field_titre($arrayfields[
'c.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"c.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1461 if (!empty($arrayfields[
'c.date_cloture'][
'checked'])) {
1462 print_liste_field_titre($arrayfields[
'c.date_cloture'][
'label'], $_SERVER[
"PHP_SELF"],
"c.date_cloture",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1464 if (!empty($arrayfields[
'c.note_public'][
'checked'])) {
1465 print_liste_field_titre($arrayfields[
'c.note_public'][
'label'], $_SERVER[
"PHP_SELF"],
"c.note_public",
"", $param,
'', $sortfield, $sortorder,
'right ');
1467 if (!empty($arrayfields[
'c.note_private'][
'checked'])) {
1468 print_liste_field_titre($arrayfields[
'c.note_private'][
'label'], $_SERVER[
"PHP_SELF"],
"c.note_private",
"", $param,
'', $sortfield, $sortorder,
'right ');
1470 if (!empty($arrayfields[
'shippable'][
'checked'])) {
1471 print_liste_field_titre($arrayfields[
'shippable'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'center ');
1473 if (!empty($arrayfields[
'c.facture'][
'checked'])) {
1474 print_liste_field_titre($arrayfields[
'c.facture'][
'label'], $_SERVER[
"PHP_SELF"],
'c.facture',
'', $param,
'', $sortfield, $sortorder,
'center ');
1476 if (!empty($arrayfields[
'c.import_key'][
'checked'])) {
1477 print_liste_field_titre($arrayfields[
'c.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"c.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
1479 if (!empty($arrayfields[
'c.fk_statut'][
'checked'])) {
1480 print_liste_field_titre($arrayfields[
'c.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"c.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
1482 if (!
$conf->main_checkbox_left_column) {
1483 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1489 $productstat_cache = array();
1490 '@phan-var-force array<int,array{stats_order_customer?:float|int,stats_order_supplier?:float|int}> $product_stat_cache';
1491 $productstat_cachevirtual = array();
1492 '@phan-var-force array<int,array{stats_order_customer?:float|int,stats_order_supplier?:float|int}> $product_stat_cachevirtual';
1493 $getNomUrl_cache = array();
1500 $with_margin_info =
false;
1502 !empty($arrayfields[
'total_pa'][
'checked'])
1503 || !empty($arrayfields[
'total_margin'][
'checked'])
1504 || !empty($arrayfields[
'total_margin_rate'][
'checked'])
1505 || !empty($arrayfields[
'total_mark_rate'][
'checked'])
1508 $with_margin_info =
true;
1520 $subtotalarray = array();
1521 $subtotalarray[
'nbfield'] = 0;
1524 $imaxinloop = ($limit ? min($num, $limit) : $num);
1525 while ($i < $imaxinloop) {
1526 $obj =
$db->fetch_object($resql);
1536 $oldref = $obj->product_ref;
1538 if ($oldref != $obj->product_ref && $sortfield ==
'pr.ref') {
1539 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_subtotal.tpl.php';
1540 $oldref = $obj->product_ref;
1543 $companystatic->id = $obj->socid;
1544 $companystatic->name = $obj->name;
1545 $companystatic->name_alias = $obj->alias;
1546 $companystatic->client = $obj->client;
1547 $companystatic->code_client = $obj->code_client;
1548 $companystatic->email = $obj->email;
1549 $companystatic->phone = $obj->phone;
1550 $companystatic->address = $obj->address;
1551 $companystatic->zip = $obj->zip;
1552 $companystatic->town = $obj->town;
1553 $companystatic->country_code = $obj->country_code;
1554 if (!isset($getNomUrl_cache[$obj->socid])) {
1555 $getNomUrl_cache[$obj->socid] = $companystatic->getNomUrl(1,
'customer');
1558 $generic_commande->id = $obj->c_rowid;
1559 $generic_commande->ref = $obj->ref;
1560 $generic_commande->statut = $obj->fk_statut;
1561 $generic_commande->status = $obj->fk_statut;
1562 $generic_commande->billed = $obj->billed;
1563 $generic_commande->date =
$db->jdate($obj->date_commande);
1564 $generic_commande->delivery_date =
$db->jdate($obj->delivery_date);
1565 $generic_commande->ref_client = $obj->ref_client;
1566 $generic_commande->total_ht = $obj->c_total_ht;
1567 $generic_commande->total_tva = $obj->c_total_tva;
1568 $generic_commande->total_ttc = $obj->c_total_ttc;
1569 $generic_commande->note_public = $obj->note_public;
1570 $generic_commande->note_private = $obj->note_private;
1572 $projectstatic->id = $obj->project_id;
1573 $projectstatic->ref = $obj->project_ref;
1574 $projectstatic->title = $obj->project_label;
1576 $marginInfo = array();
1577 if ($with_margin_info) {
1578 $generic_commande->fetch_lines();
1579 $marginInfo = $formmargin->getMarginInfosArray($generic_commande);
1580 $total_ht += $obj->total_ht;
1581 $total_margin += $marginInfo[
'total_margin'];
1584 print
'<tr class="oddeven">';
1587 if (
$conf->main_checkbox_left_column) {
1588 print
'<td class="nowrap center">';
1589 if ($massactionbutton || $massaction) {
1591 if (in_array($obj->rowid, $arrayofselected)) {
1594 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1605 if (!empty($arrayfields[
'rowid'][
'checked'])) {
1606 print
'<td class="nowrap right">'.$obj->rowid.
'</td>';
1613 if (!empty($arrayfields[
'c.ref'][
'checked'])) {
1614 print
'<td class="nowraponall">';
1615 print $generic_commande->getNomUrl(1, ($search_status != 2 ? 0 : $obj->fk_statut), 0, 0, 0, 1, 1);
1619 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
1620 print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
1629 if (!empty($arrayfields[
'pr.ref'][
'checked'])) {
1630 if (!empty($obj->product_rowid)) {
1631 $generic_product->id = $obj->product_rowid;
1632 $generic_product->ref = $obj->product_ref;
1633 $generic_product->label = $obj->product_label;
1634 $generic_product->status = $obj->product_status;
1635 $generic_product->status_buy = $obj->product_status_buy;
1636 $generic_product->status_batch = $obj->product_batch;
1637 $generic_product->barcode = $obj->product_barcode;
1638 print
'<td class="nowrap tdoverflowmax200">'.$generic_product->getNomUrl(1).
'</td>';
1640 print
'<td class="nowrap tdoverflowmax200"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
1647 if (!empty($arrayfields[
'pr.desc'][
'checked'])) {
1649 $descline = empty($obj->description) ? $obj->product_label : $obj->description;
1650 print
'<td class="nowrap tdoverflowmax200">';
1659 if (!empty($arrayfields[
'cdet.qty'][
'checked'])) {
1660 print
'<td class="nowrap right">'.$obj->qty.
'</td>';
1661 if (isset(
$totalarray[
'val'][
'cdet.qty']) || isset($subtotalarray[
'val'][
'cdet.qty'])) {
1663 $subtotalarray[
'val'][
'cdet.qty'] += $obj->qty;
1666 $subtotalarray[
'val'][
'cdet.qty'] = $obj->qty;
1673 $totalarray[
'pos'][$subtotalarray[
'nbfield']] =
'cdet.qty';
1678 if (!empty($arrayfields[
'c.ref_client'][
'checked'])) {
1679 print
'<td class="nowrap tdoverflowmax200">'.$obj->ref_client.
'</td>';
1686 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1687 print
'<td class="nowrap">';
1688 if ($obj->project_id > 0) {
1689 print $projectstatic->getNomUrl(1);
1698 if (!empty($arrayfields[
'p.title'][
'checked'])) {
1699 print
'<td class="nowrap">';
1700 if ($obj->project_id > 0) {
1701 print $projectstatic->title;
1710 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1711 print
'<td class="tdoverflowmax150">';
1712 print $getNomUrl_cache[$obj->socid];
1716 if ($user->hasRight(
'facture',
'creer')) {
1717 if (($obj->fk_statut > 0 && $obj->fk_statut < 3) || ($obj->fk_statut == 3 && $obj->billed == 0)) {
1718 print
' <a href="'.DOL_URL_ROOT.
'/commande/list.php?socid='.$companystatic->id.
'&search_billed=0&autoselectall=1">';
1719 print
img_picto($langs->trans(
"CreateInvoiceForThisCustomer").
' : '.$companystatic->name,
'object_bill',
'hideonsmartphone').
'</a>';
1729 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1730 print
'<td class="nocellnopadd">';
1738 if (!empty($arrayfields[
's.town'][
'checked'])) {
1739 print
'<td class="nocellnopadd">';
1747 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1748 print
'<td class="nocellnopadd">';
1756 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1757 print
"<td>".$obj->state_name.
"</td>\n";
1763 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1764 print
'<td class="center">';
1765 $tmparray =
getCountry($obj->fk_pays,
'all');
1766 print $tmparray[
'label'];
1773 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1774 print
'<td class="center">';
1775 if (empty($typenArray)) {
1776 $typenArray = $formcompany->typent_array(1);
1778 print $typenArray[$obj->typent_code];
1786 if (!empty($arrayfields[
'c.date_commande'][
'checked'])) {
1787 print
'<td class="center">';
1790 if ($generic_commande->hasDelay()) {
1791 print
img_picto($langs->trans(
"Late").
' : '.$generic_commande->showDelay(),
"warning");
1799 if (!empty($arrayfields[
'c.delivery_date'][
'checked'])) {
1800 print
'<td class="center" title="'.$langs->trans((
string) $arrayfields[
'c.delivery_date'][
'label']).
': '.
dol_print_date(
$db->jdate($obj->delivery_date),
'dayhour').
'">';
1808 if (!empty($arrayfields[
'c.fk_shipping_method'][
'checked'])) {
1810 $form->formSelectShippingMethod(
'', $obj->fk_shipping_method,
'none', 1);
1817 if (!empty($arrayfields[
'c.fk_cond_reglement'][
'checked'])) {
1819 $form->form_conditions_reglement($_SERVER[
'PHP_SELF'], $obj->fk_cond_reglement,
'none', 0,
'', 1, $obj->deposit_percent);
1826 if (!empty($arrayfields[
'c.fk_mode_reglement'][
'checked'])) {
1828 $form->form_modes_reglement($_SERVER[
'PHP_SELF'], $obj->fk_mode_reglement,
'none',
'', -1);
1835 if (!empty($arrayfields[
'c.fk_input_reason'][
'checked'])) {
1837 $form->formInputReason($_SERVER[
'PHP_SELF'], $obj->fk_input_reason,
'none', 0);
1844 if (!empty($arrayfields[
'cdet.total_ht'][
'checked'])) {
1845 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ht).
"</span></td>\n";
1851 $totalarray[
'pos'][$subtotalarray[
'nbfield']] =
'cdet.total_ht';
1853 if (isset(
$totalarray[
'val'][
'cdet.total_ht']) || isset($subtotalarray[
'val'][
'cdet.total_ht'])) {
1854 $totalarray[
'val'][
'cdet.total_ht'] += $obj->total_ht;
1855 $subtotalarray[
'val'][
'cdet.total_ht'] += $obj->total_ht;
1857 $totalarray[
'val'][
'cdet.total_ht'] = $obj->total_ht;
1858 $subtotalarray[
'val'][
'cdet.total_ht'] = $obj->total_ht;
1862 if (!empty($arrayfields[
'c.total_vat'][
'checked'])) {
1863 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_tva).
"</span></td>\n";
1869 $totalarray[
'pos'][$subtotalarray[
'nbfield']] =
'cdet.total_tva';
1871 $totalarray[
'val'][
'cdet.total_tva'] += $obj->total_tva;
1872 $subtotalarray[
'val'][
'cdet.total_tva'] += $obj->total_tva;
1875 if (!empty($arrayfields[
'cdet.total_ttc'][
'checked'])) {
1876 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
"</span></td>\n";
1882 $subtotalarray[
'pos'][
$totalarray[
'nbfield']] =
'cdet.total_ttc';
1884 $totalarray[
'val'][
'cdet.total_ttc'] += $obj->total_ttc;
1885 $subtotalarray[
'val'][
'cdet.total_ttc'] += $obj->total_ttc;
1888 if (!empty($arrayfields[
'c.fk_warehouse'][
'checked'])) {
1889 print
'<td class="nowrap">';
1890 if ($obj->warehouse > 0) {
1891 print
img_picto(
'',
'stock',
'class="paddingrightonly"');
1893 $formproduct->formSelectWarehouses($_SERVER[
'PHP_SELF'], $obj->warehouse,
'none');
1900 if (!empty($arrayfields[
'c.multicurrency_code'][
'checked'])) {
1901 print
'<td class="nowrap">'.$obj->multicurrency_code.
' - '.$langs->trans(
'Currency'.$obj->multicurrency_code).
"</td>\n";
1908 if (!empty($arrayfields[
'c.multicurrency_tx'][
'checked'])) {
1909 print
'<td class="nowrap">';
1910 $form->form_multicurrency_rate($_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid, $obj->multicurrency_tx,
'none', $obj->multicurrency_code);
1917 if (!empty($arrayfields[
'c.multicurrency_total_ht'][
'checked'])) {
1918 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht).
"</span></td>\n";
1924 if (!empty($arrayfields[
'c.multicurrency_total_vat'][
'checked'])) {
1925 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_vat).
"</span></td>\n";
1931 if (!empty($arrayfields[
'c.multicurrency_total_ttc'][
'checked'])) {
1932 print
'<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc).
"</span></td>\n";
1938 $userstatic->id = $obj->fk_user_author;
1939 $userstatic->login = $obj->login;
1940 $userstatic->lastname = $obj->lastname;
1941 $userstatic->firstname = $obj->firstname;
1942 $userstatic->email = $obj->user_email;
1943 $userstatic->status = $obj->user_statut;
1944 $userstatic->entity = $obj->entity;
1945 $userstatic->photo = $obj->photo;
1946 $userstatic->office_phone = $obj->office_phone;
1947 $userstatic->office_fax = $obj->office_fax;
1948 $userstatic->user_mobile = $obj->user_mobile;
1949 $userstatic->job = $obj->job;
1950 $userstatic->gender = $obj->gender;
1953 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1954 print
'<td class="tdoverflowmax200">';
1955 if ($userstatic->id) {
1956 print $userstatic->getNomUrl(-1);
1966 if (!empty($arrayfields[
'sale_representative'][
'checked'])) {
1969 if ($obj->socid > 0) {
1970 $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
1971 if ($listsalesrepresentatives < 0) {
1974 $nbofsalesrepresentative = count($listsalesrepresentatives);
1975 if ($nbofsalesrepresentative > 6) {
1977 print $nbofsalesrepresentative;
1978 } elseif ($nbofsalesrepresentative > 0) {
1980 foreach ($listsalesrepresentatives as $val) {
1981 $userstatic->id = $val[
'id'];
1982 $userstatic->lastname = $val[
'lastname'];
1983 $userstatic->firstname = $val[
'firstname'];
1984 $userstatic->email = $val[
'email'];
1985 $userstatic->status = $val[
'statut'];
1986 $userstatic->entity = $val[
'entity'];
1987 $userstatic->photo = $val[
'photo'];
1988 $userstatic->login = $val[
'login'];
1989 $userstatic->office_phone = $val[
'office_phone'];
1990 $userstatic->office_fax = $val[
'office_fax'];
1991 $userstatic->user_mobile = $val[
'user_mobile'];
1992 $userstatic->job = $val[
'job'];
1993 $userstatic->gender = $val[
'gender'];
1995 print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1,
'', 0, 0, 12) : $userstatic->getNomUrl(-2);
1997 if ($j < $nbofsalesrepresentative) {
2014 if (!empty($arrayfields[
'total_pa'][
'checked'])) {
2015 print
'<td class="right nowrap">'.price($marginInfo[
'pa_total']).
'</td>';
2021 if (!empty($arrayfields[
'total_margin'][
'checked'])) {
2022 print
'<td class="right nowrap">'.price($marginInfo[
'total_margin']).
'</td>';
2028 $totalarray[
'pos'][$subtotalarray[
'nbfield']] =
'total_margin';
2030 $totalarray[
'val'][
'total_margin'] += $marginInfo[
'total_margin'];
2031 $subtotalarray[
'val'][
'total_margin'] += $marginInfo[
'total_margin'];
2034 if (!empty($arrayfields[
'total_margin_rate'][
'checked'])) {
2035 print
'<td class="right nowrap">'.(($marginInfo[
'total_margin_rate'] ==
'') ?
'' :
price($marginInfo[
'total_margin_rate'], 0,
'', 0, 0, 2).
'%').
'</td>';
2041 if (!empty($arrayfields[
'total_mark_rate'][
'checked'])) {
2042 print
'<td class="right nowrap">'.(($marginInfo[
'total_mark_rate'] ==
'') ?
'' :
price($marginInfo[
'total_mark_rate'], 0,
'', 0, 0, 2).
'%').
'</td>';
2048 $totalarray[
'pos'][$subtotalarray[
'nbfield']] =
'total_mark_rate';
2050 if ($i >= $imaxinloop - 1) {
2051 if (!empty($total_ht)) {
2053 $subtotalarray[
'val'][
'total_mark_rate'] =
price2num($total_margin * 100 / $total_ht,
'MT');
2056 $subtotalarray[
'val'][
'total_mark_rate'] =
'';
2062 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
2064 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &
$totalarray);
2065 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
2066 print $hookmanager->resPrint;
2069 if (!empty($arrayfields[
'c.datec'][
'checked'])) {
2070 print
'<td align="center" class="nowrap">';
2079 if (!empty($arrayfields[
'c.tms'][
'checked'])) {
2080 print
'<td align="center" class="nowrap">';
2089 if (!empty($arrayfields[
'c.date_cloture'][
'checked'])) {
2090 print
'<td align="center" class="nowrap">';
2099 if (!empty($arrayfields[
'c.note_public'][
'checked'])) {
2100 print
'<td class="sensiblehtmlcontent center">';
2109 if (!empty($arrayfields[
'c.note_private'][
'checked'])) {
2110 print
'<td class="center">';
2119 if (!empty($arrayfields[
'shippable'][
'checked'])) {
2120 print
'<td class="center">';
2121 if (!empty($show_shippable_command) &&
isModEnabled(
'stock')) {
2123 if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) {
2124 $generic_commande->loadExpeditions();
2126 if (isset($generic_commande->expeditions[$obj->rowid])) {
2127 $reliquat = $obj->qty - $generic_commande->expeditions[$obj->rowid];
2129 $reliquat = $obj->qty;
2131 if ($obj->product_type == 0 && $obj->fk_product > 0) {
2133 $generic_product->id = $obj->fk_product;
2136 if (empty($productstat_cache[$obj->fk_product])) {
2137 $generic_product->load_stock(
'nobatch');
2138 $productstat_cache[$obj->fk_product][
'stock_reel'] = $generic_product->stock_reel;
2139 $productstat_cachevirtual[$obj->fk_product][
'stock_reel'] = $generic_product->stock_theorique;
2141 $generic_product->stock_reel = $productstat_cache[$obj->fk_product][
'stock_reel'];
2142 $generic_product->stock_theorique = $productstat_cachevirtual[$obj->fk_product][
'stock_reel'];
2145 if ($reliquat > $generic_product->stock_reel) {
2149 $text_info .= $reliquat.
' x '.$obj->product_ref.
' '.
dol_trunc($obj->product_label, 20);
2150 $text_info .=
' - '.$langs->trans(
"Stock").
': <span class="'.($generic_product->stock_reel > 0 ?
'ok' :
'error').
'">'.$generic_product->stock_reel.
'</span>';
2151 $text_info .=
' - '.$langs->trans(
"VirtualStock").
': <span class="'.($generic_product->stock_theorique > 0 ?
'ok' :
'error').
'">'.$generic_product->stock_theorique.
'</span>';
2152 $text_info .= ($reliquat != $obj->qty ?
' <span class="opacitymedium">('.$langs->trans(
"QtyInOtherShipments").
' '.($obj->qty - $reliquat).
')</span>' :
'');
2153 $text_info .=
'<br>';
2160 $stock_order_supplier = 0;
2163 if (empty($productstat_cache[$obj->fk_product][
'stats_order_customer'])) {
2164 $generic_product->load_stats_commande(0,
'1,2');
2165 $productstat_cache[$obj->fk_product][
'stats_order_customer'] = $generic_product->stats_commande[
'qty'];
2167 $generic_product->stats_commande[
'qty'] = $productstat_cache[$obj->fk_product][
'stats_order_customer'];
2169 $stock_order = $generic_product->stats_commande[
'qty'];
2172 if (empty($productstat_cache[$obj->fk_product][
'stats_order_supplier'])) {
2173 $generic_product->load_stats_commande_fournisseur(0,
'3');
2174 $productstat_cache[$obj->fk_product][
'stats_order_supplier'] = $generic_product->stats_commande_fournisseur[
'qty'];
2176 $generic_product->stats_commande_fournisseur[
'qty'] = $productstat_cache[$obj->fk_product][
'stats_order_supplier'];
2178 $stock_order_supplier = $generic_product->stats_commande_fournisseur[
'qty'];
2181 $text_info .= $reliquat.
' x '.$obj->product_ref.
' '.
dol_trunc($obj->product_label, 20);
2182 $text_stock_reel = $generic_product->stock_reel.
'/'.$stock_order;
2183 if ($stock_order > $generic_product->stock_reel && !($generic_product->stock_reel < $obj->qty)) {
2185 $text_warning .=
'<span class="warning">'.$langs->trans(
'Available').
' : '.$text_stock_reel.
'</span>';
2187 if ($reliquat > $generic_product->stock_reel) {
2188 $text_info .=
'<span class="warning">'.$langs->trans(
'Available').
' : '.$text_stock_reel.
'</span>';
2190 $text_info .=
'<span class="ok">'.$langs->trans(
'Available').
' : '.$text_stock_reel.
'</span>';
2193 $text_info .=
' '.$langs->trans(
'SupplierOrder').
' : '.$stock_order_supplier;
2195 $text_info .= ($reliquat != $obj->qty ?
' <span class="opacitymedium">('.$langs->trans(
"QtyInOtherShipments").
' '.($obj->qty - $reliquat).
')</span>' :
'');
2196 $text_info .=
'<br>';
2199 if ($notshippable == 0) {
2200 $text_icon =
img_picto(
'',
'dolly',
'', 0, 0, 0,
'',
'green paddingleft');
2201 $text_info = $text_icon.
' '.$langs->trans(
'Shippable').
'<br>'.$text_info;
2203 $text_icon =
img_picto(
'',
'dolly',
'', 0, 0, 0,
'',
'error paddingleft');
2204 $text_info = $text_icon.
' '.$langs->trans(
'NonShippable').
'<br>'.$text_info;
2209 print $form->textwithtooltip(
'', $text_info, 2, 1, $text_icon,
'', 2);
2212 print $form->textwithtooltip(
'', $langs->trans(
'NotEnoughForAllOrders').
'<br>'.$text_warning, 2, 1,
img_picto(
'',
'error'),
'', 2);
2222 if (!empty($arrayfields[
'c.facture'][
'checked'])) {
2223 print
'<td class="center">';
2225 print
yn($obj->billed, $langs->trans(
"Billed"));
2233 if (!empty($arrayfields[
'c.import_key'][
'checked'])) {
2234 print
'<td class="nowrap center">'.$obj->import_key.
'</td>';
2240 if (!empty($arrayfields[
'c.fk_statut'][
'checked'])) {
2241 print
'<td class="nowrap center">'.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).
'</td>';
2248 if (!
$conf->main_checkbox_left_column) {
2249 print
'<td class="nowrap center">';
2250 if ($massactionbutton || $massaction) {
2252 if (in_array($obj->rowid, $arrayofselected)) {
2255 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2265 $total += $obj->total_ht;
2266 $subtotal += $obj->total_ht;
2269 if ($sortfield ==
'pr.ref') {
2270 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_subtotal.tpl.php';
2273 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2278 foreach ($arrayfields as $key => $val) {
2279 if (!empty($val[
'checked'])) {
2283 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2288 $parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
2289 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters);
2290 print $hookmanager->resPrint;
2292 print
'</table>'.
"\n";
2295 print
'</form>'.
"\n";
2297 $hidegeneratedfilelistifempty = 1;
2298 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2299 $hidegeneratedfilelistifempty = 0;
2303 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2304 $urlsource .= str_replace(
'&',
'&', $param);
2306 $filedir = $diroutputmassaction;
2310 print $formfile->showdocuments(
'massfilesarea_orders',
'', $filedir, $urlsource, $genallowed, $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
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 customers orders.
const STATUS_SHIPMENTONPROCESS
Shipment on process.
const STATUS_CLOSED
Closed (Sent, billed or not)
const STATUS_CANCELED
Canceled status.
const STATUS_DRAFT
Draft status.
const STATUS_VALIDATED
Validated status.
Class to manage products or services.
Class to manage projects.
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)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolPrintHTML($s, $allowiframe=0, $moreallowedtags=array())
Return a string (that can be on several lines) ready to be output on a HTML page.
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 '.
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.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
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...
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
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.