diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 7ac673d7383..9cf20dfee22 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -170,6 +170,9 @@ $arrayfields = array( 'p.fin_validite'=>array('label'=>"DateEnd", 'checked'=>1), 'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0), 'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0), + 'p.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'enabled'=>!empty($conf->expedition->enabled)), + 'p.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0), + 'p.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0), 'p.total_ht'=>array('label'=>"AmountHT", 'checked'=>1), 'p.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0), 'p.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0), @@ -189,14 +192,9 @@ $arrayfields = array( 'p.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500), 'p.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), 'p.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))), - 'p.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0, 'position'=>512), - 'p.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0, 'position'=>514), 'p.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), - ); -if (!empty($conf->expedition->enabled)) { - $arrayfields['p.fk_shipping_method']=array('label'=>"SendingMethod", 'checked'=>0, 'position'=>513); -} + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -691,6 +689,27 @@ if ($resql) print ajax_combobox('search_availability'); print ''; } + // Shipping Method + if (!empty($arrayfields['p.fk_shipping_method']['checked'])) + { + print ''; + $form->selectShippingMethod($search_fk_shipping_method, 'search_fk_shipping_method', '', 1, '', 1); + print ''; + } + // Payment term + if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) + { + print ''; + $form->select_conditions_paiements($search_fk_cond_reglement, 'search_fk_cond_reglement', -1, 1, 1); + print ''; + } + // Payment mode + if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) + { + print ''; + $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1); + print ''; + } if (!empty($arrayfields['p.total_ht']['checked'])) { // Amount @@ -820,30 +839,6 @@ if ($resql) print ''; } - if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) - { - // Payment term - print ''; - $form->select_conditions_paiements($search_fk_cond_reglement, 'search_fk_cond_reglement', -1, 1); - print ''; - } - - if (!empty($conf->expedition->enabled) && !empty($arrayfields['p.fk_shipping_method']['checked'])) - { - // Shipping Method - print ''; - $form->selectShippingMethod($search_fk_shipping_method, 'search_fk_shipping_method', '', 1); - print ''; - } - - if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) - { - // Payment mode - print ''; - $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 0, 0, -1); - print ''; - } - // Status if (!empty($arrayfields['p.fk_statut']['checked'])) { @@ -876,6 +871,9 @@ if ($resql) if (!empty($arrayfields['p.fin_validite']['checked'])) print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, 'align="center"', $sortfield, $sortorder); if (!empty($arrayfields['p.date_livraison']['checked'])) print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'ddelivery', '', $param, 'align="center"', $sortfield, $sortorder); if (!empty($arrayfields['ava.rowid']['checked'])) print_liste_field_titre($arrayfields['ava.rowid']['label'], $_SERVER["PHP_SELF"], 'availability', '', $param, '', $sortfield, $sortorder); + if (!empty($arrayfields['p.fk_shipping_method']['checked'])) print_liste_field_titre($arrayfields['p.fk_shipping_method']['label'], $_SERVER["PHP_SELF"], "p.fk_shipping_method", "", $param, '', $sortfield, $sortorder); + if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) print_liste_field_titre($arrayfields['p.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "p.fk_cond_reglement", "", $param, '', $sortfield, $sortorder); + if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['p.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "p.fk_mode_reglement", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'], $_SERVER["PHP_SELF"], 'p.total_ht', '', $param, 'class="right"', $sortfield, $sortorder); if (!empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'], $_SERVER["PHP_SELF"], 'p.tva', '', $param, 'class="right"', $sortfield, $sortorder); if (!empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'], $_SERVER["PHP_SELF"], 'p.total', '', $param, 'class="right"', $sortfield, $sortorder); @@ -901,9 +899,6 @@ if ($resql) if (!empty($arrayfields['p.date_cloture']['checked'])) print_liste_field_titre($arrayfields['p.date_cloture']['label'], $_SERVER["PHP_SELF"], "p.date_cloture", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); if (!empty($arrayfields['p.note_public']['checked'])) print_liste_field_titre($arrayfields['p.note_public']['label'], $_SERVER["PHP_SELF"], "p.note_public", "", $param, '', $sortfield, $sortorder, 'center nowrap '); if (!empty($arrayfields['p.note_private']['checked'])) print_liste_field_titre($arrayfields['p.note_private']['label'], $_SERVER["PHP_SELF"], "p.note_private", "", $param, '', $sortfield, $sortorder, 'center nowrap '); - if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) print_liste_field_titre($arrayfields['p.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "p.fk_cond_reglement", "", $param, '', $sortfield, $sortorder); - if (!empty($conf->expedition->enabled) && !empty($arrayfields['p.fk_shipping_method']['checked'])) print_liste_field_titre($arrayfields['p.fk_shipping_method']['label'], $_SERVER["PHP_SELF"], "p.fk_shipping_method", "", $param, '', $sortfield, $sortorder); - if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['p.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "p.fk_mode_reglement", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'], $_SERVER["PHP_SELF"], "p.fk_statut", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); print ''."\n"; @@ -1113,7 +1108,30 @@ if ($resql) print ''; if (!$i) $totalarray['nbfield']++; } - + //Shipping Method + if (!empty($arrayfields['p.fk_shipping_method']['checked'])) + { + print ''; + $form->formSelectShippingMethod('', $obj->fk_shipping_method, 'none', 1); + print ''; + if (!$i) $totalarray['nbfield']++; + } + // Payment terms + if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) + { + print ''; + $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none'); + print ''; + if (!$i) $totalarray['nbfield']++; + } + // Payment mode + if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) + { + print ''; + $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); + print ''; + if (!$i) $totalarray['nbfield']++; + } // Amount HT if (!empty($arrayfields['p.total_ht']['checked'])) { @@ -1154,7 +1172,6 @@ if ($resql) if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_invoiced'; $totalarray['val']['p.total_invoiced'] += $totalInvoicedTTC; } - // Currency if (!empty($arrayfields['p.multicurrency_code']['checked'])) { @@ -1300,31 +1317,6 @@ if ($resql) print ''; if (!$i) $totalarray['nbfield']++; } - // Payment terms - if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) - { - print ''; - $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none'); - print ''; - if (!$i) $totalarray['nbfield']++; - } - //Shipping Method - if (!empty($conf->expedition->enabled) && !empty($arrayfields['p.fk_shipping_method']['checked'])) - { - print ''; - $form->formSelectShippingMethod('', $obj->fk_shipping_method, 'none', 1); - print ''; - if (!$i) $totalarray['nbfield']++; - } - - // Payment mode - if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) - { - print ''; - $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); - print ''; - if (!$i) $totalarray['nbfield']++; - } // Status if (!empty($arrayfields['p.fk_statut']['checked'])) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index b6cd0e6f755..4d309f1062e 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -156,6 +156,9 @@ $arrayfields = array( 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55), 'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60), 'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE), 'position'=>65), + 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'position'=>66), + 'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0, 'position'=>67), + 'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0, 'position'=>68), 'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>75), 'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>80), 'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>85), @@ -172,12 +175,10 @@ $arrayfields = array( 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140), 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'position'=>990, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>145), 'shippable'=>array('label'=>"Shippable", 'checked'=>1, 'position'=>995, 'enabled'=>(!empty($conf->expedition->enabled)), 'position'=>150), - 'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0, 'position'=>151), - 'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0, 'position'=>153), 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000, 'position'=>155) ); if (!empty($conf->expedition->enabled)) { - $arrayfields['c.fk_shipping_method']=array('label'=>"SendingMethod", 'checked'=>0, 'position'=>152); + } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -743,6 +744,27 @@ if ($resql) print ''; print ''; } + // Shipping Method + if (!empty($arrayfields['c.fk_shipping_method']['checked'])) + { + print ''; + $form->selectShippingMethod($search_fk_shipping_method, 'search_fk_shipping_method', '', 1, '', 1); + print ''; + } + // Payment term + if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) + { + print ''; + $form->select_conditions_paiements($search_fk_cond_reglement, 'search_fk_cond_reglement', -1, 1, 1); + print ''; + } + // Payment mode + if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) + { + print ''; + $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1); + print ''; + } if (!empty($arrayfields['c.total_ht']['checked'])) { // Amount @@ -868,29 +890,6 @@ if ($resql) print $form->selectyesno('search_billed', $search_billed, 1, 0, 1, 1); print ''; } - if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) - { - // Payment term - print ''; - $form->select_conditions_paiements($search_fk_cond_reglement, 'search_fk_cond_reglement', -1, 1); - print ''; - } - - if (!empty($conf->expedition->enabled) && !empty($arrayfields['c.fk_shipping_method']['checked'])) - { - // Shipping Method - print ''; - $form->selectShippingMethod($search_fk_shipping_method, 'search_fk_shipping_method', '', 1); - print ''; - } - - if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) - { - // Payment mode - print ''; - $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 0, 0, -1); - print ''; - } // Status if (!empty($arrayfields['c.fk_statut']['checked'])) { @@ -928,6 +927,9 @@ if ($resql) if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['c.date_commande']['checked'])) print_liste_field_titre($arrayfields['c.date_commande']['label'], $_SERVER["PHP_SELF"], 'c.date_commande', '', $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['c.date_delivery']['checked'])) print_liste_field_titre($arrayfields['c.date_delivery']['label'], $_SERVER["PHP_SELF"], 'c.date_livraison', '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['c.fk_shipping_method']['checked'])) print_liste_field_titre($arrayfields['c.fk_shipping_method']['label'], $_SERVER["PHP_SELF"], "c.fk_shipping_method", "", $param, '', $sortfield, $sortorder); + if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) print_liste_field_titre($arrayfields['c.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "c.fk_cond_reglement", "", $param, '', $sortfield, $sortorder); + if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['c.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "c.fk_mode_reglement", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'], $_SERVER["PHP_SELF"], 'c.total_ht', '', $param, '', $sortfield, $sortorder, 'right '); if (!empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'], $_SERVER["PHP_SELF"], 'c.tva', '', $param, '', $sortfield, $sortorder, 'right '); if (!empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'], $_SERVER["PHP_SELF"], 'c.total_ttc', '', $param, '', $sortfield, $sortorder, 'right '); @@ -951,9 +953,6 @@ if ($resql) if (!empty($arrayfields['c.note_private']['checked'])) print_liste_field_titre($arrayfields['c.note_private']['label'], $_SERVER["PHP_SELF"], "c.note_private", "", $param, '', $sortfield, $sortorder, 'right '); if (!empty($arrayfields['shippable']['checked'])) print_liste_field_titre($arrayfields['shippable']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'], $_SERVER["PHP_SELF"], 'c.facture', '', $param, '', $sortfield, $sortorder, 'center '); - if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) print_liste_field_titre($arrayfields['c.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "c.fk_cond_reglement", "", $param, '', $sortfield, $sortorder); - if (!empty($conf->expedition->enabled) && !empty($arrayfields['c.fk_shipping_method']['checked'])) print_liste_field_titre($arrayfields['c.fk_shipping_method']['label'], $_SERVER["PHP_SELF"], "c.fk_shipping_method", "", $param, '', $sortfield, $sortorder); - if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['c.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "c.fk_mode_reglement", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'], $_SERVER["PHP_SELF"], "c.fk_statut", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'maxwidthsearch center '); print ''."\n"; @@ -1137,6 +1136,31 @@ if ($resql) print ''; if (!$i) $totalarray['nbfield']++; } + //Shipping Method + if (!empty($arrayfields['c.fk_shipping_method']['checked'])) + { + print ''; + $form->formSelectShippingMethod('', $obj->fk_shipping_method, 'none', 1); + print ''; + if (!$i) $totalarray['nbfield']++; + } + // Payment terms + if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) + { + print ''; + $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none'); + print ''; + if (!$i) $totalarray['nbfield']++; + } + // Payment mode + if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) + { + print ''; + $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); + print ''; + if (!$i) $totalarray['nbfield']++; + } + // Amount HT if (!empty($arrayfields['c.total_ht']['checked'])) { @@ -1369,33 +1393,6 @@ if ($resql) print ''.yn($obj->billed).''; if (!$i) $totalarray['nbfield']++; } - - // Payment terms - if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) - { - print ''; - $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none'); - print ''; - if (!$i) $totalarray['nbfield']++; - } - //Shipping Method - if (!empty($conf->expedition->enabled) && !empty($arrayfields['c.fk_shipping_method']['checked'])) - { - print ''; - $form->formSelectShippingMethod('', $obj->fk_shipping_method, 'none', 1); - print ''; - if (!$i) $totalarray['nbfield']++; - } - - // Payment mode - if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) - { - print ''; - $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); - print ''; - if (!$i) $totalarray['nbfield']++; - } - // Status if (!empty($arrayfields['c.fk_statut']['checked'])) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ed0511a8e1d..2b5b91dbf07 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3748,9 +3748,10 @@ class Form * @param string $filtre To filter list * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. * @param string $moreattrib To add more attribute on select + * @param int $noinfoadmin 0=Add admin info, 1=Disable admin info * @return void */ - public function selectShippingMethod($selected = '', $htmlname = 'shipping_method_id', $filtre = '', $useempty = 0, $moreattrib = '') + public function selectShippingMethod($selected = '', $htmlname = 'shipping_method_id', $filtre = '', $useempty = 0, $moreattrib = '', $noinfoadmin = 0) { global $langs, $conf, $user; @@ -3785,7 +3786,7 @@ class Form $i++; } print ""; - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); + if ($user->admin && empty($noinfoadmin)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print ajax_combobox('select'.$htmlname); } else {