Add menu and clean

This commit is contained in:
Anthony Berton 2022-08-23 11:37:08 +02:00
parent be2ecf1c3a
commit b3c903723f
3 changed files with 13 additions and 24 deletions

View File

@ -75,7 +75,6 @@ $search_product_category = GETPOST('search_product_category', 'int');
// Détail commande
$search_refProduct = GETPOST('search_refProduct', 'alpha');
$search_descProduct = GETPOST('search_descProduct', 'alpha');
$check_orderdetail = GETPOST('check_orderdetail', 'alpha');
$search_ref = GETPOST('search_ref', 'alpha') != '' ?GETPOST('search_ref', 'alpha') : GETPOST('sref', 'alpha');
$search_ref_customer = GETPOST('search_ref_customer', 'alpha');
@ -169,6 +168,10 @@ if (empty($user->socid)) {
$checkedtypetiers = 0;
$arrayfields = array(
// Détail commande
'pr.ref'=> array('label'=>'ProductRef', 'checked'=>1, 'position'=>1),
'pr.desc'=> array('label'=>'ProductDescription', 'checked'=>1, 'position'=>1),
'cdet.qty'=> array('label'=>'QtyOrdered', 'checked'=>1, 'position'=>1),
'c.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5),
'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>-1, 'position'=>10),
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>-1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>20),
@ -211,13 +214,6 @@ $arrayfields = array(
'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000)
);
// Détail commande
if (!empty($check_orderdetail)) {
$arrayfields['cdet.qty'] = array('label'=>'QtyOrdered', 'checked'=>1, 'position'=>1);
$arrayfields['pr.desc'] = array('label'=>'ProductDescription', 'checked'=>1, 'position'=>1);
$arrayfields['pr.ref'] = array('label'=>'ProductRef', 'checked'=>1, 'position'=>1);
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
@ -810,10 +806,8 @@ $sql .= ' c.fk_cond_reglement,c.deposit_percent,c.fk_mode_reglement,c.fk_shippin
$sql .= ' c.fk_input_reason, c.import_key';
// Détail commande
if (!empty($check_orderdetail)) {
$sql .= ', cdet.description, cdet.qty, ';
$sql .= ' 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';
}
$sql .= ', cdet.description, cdet.qty, ';
$sql .= ' 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';
if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
$sql .= ", cc.fk_categorie, cc.fk_soc";
@ -837,13 +831,9 @@ if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
}
// Détail commande
if (!empty($check_orderdetail)) {
$sql .= ', '.MAIN_DB_PREFIX.'commandedet as cdet';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande as c ON cdet.fk_commande=c.rowid';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as pr ON pr.rowid=cdet.fk_product';
} else {
$sql .= ', '.MAIN_DB_PREFIX.'commande as c';
}
$sql .= ', '.MAIN_DB_PREFIX.'commandedet as cdet';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande as c ON cdet.fk_commande=c.rowid';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as pr ON pr.rowid=cdet.fk_product';
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande_extrafields as ef on (c.rowid = ef.fk_object)";
@ -1353,11 +1343,6 @@ if ($resql) {
print '<br>';
}
// Détail commande
if (!empty($conf->global->ORDER_ADD_OPTION_SHOW_DETAIL_LIST)) {
print '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_orderdetail" name="check_orderdetail" class="check_orderdetail"'.($check_orderdetail ? ' checked' : '').'><label for="check_orderdetail"> <span class="check_orderdetail_text">'.$langs->trans("OrderShowDetail").'</span></label> &nbsp; </div>';
}
if ($sall) {
foreach ($fieldstosearchall as $key => $val) {
$fieldstosearchall[$key] = $langs->trans($val);

View File

@ -1324,6 +1324,9 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left
//$newmenu->add("/commande/list.php?leftmenu=orders&search_status=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire);
$newmenu->add("/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire);
}
if ($conf->global->MAIN_FEATURES_LEVEL >= 2 && empty($user->socid)) {
$newmenu->add("/commande/list_line.php?leftmenu=orders", $langs->trans("ListOrderLigne"), 1, $user->rights->commande->lire);
}
$newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire);
}

View File

@ -96,6 +96,7 @@ OrdersStatisticsSuppliers=Purchase order statistics
NumberOfOrdersByMonth=Number of orders by month
AmountOfOrdersByMonthHT=Amount of orders by month (excl. tax)
ListOfOrders=List of orders
ListOrderLigne=Lines of orders
CloseOrder=Close order
ConfirmCloseOrder=Are you sure you want to set this order to delivered? Once an order is delivered, it can be set to billed.
ConfirmDeleteOrder=Are you sure you want to delete this order?