diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index eca8a4bdca0..a3912aebc89 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -134,6 +134,7 @@ $elementList = array(); '2' => $langs->trans('AccountingJournalType2'), '3' => $langs->trans('AccountingJournalType3'), '4' => $langs->trans('AccountingJournalType4'), + '5' => $langs->trans('AccountingJournalType5'), '9' => $langs->trans('AccountingJournalType9') ); diff --git a/htdocs/compta/bank/various_payment/index.php b/htdocs/compta/bank/various_payment/index.php index 39c6d27be4f..6594bacea7f 100644 --- a/htdocs/compta/bank/various_payment/index.php +++ b/htdocs/compta/bank/various_payment/index.php @@ -16,9 +16,9 @@ */ /** - * \file htdocs/compta/bank/various_payment/index.php - * \ingroup bank - * \brief List of various payments + * \file htdocs/compta/bank/various_payment/index.php + * \ingroup bank + * \brief List of various payments */ require '../../../main.inc.php'; @@ -44,7 +44,7 @@ $search_account = GETPOST('search_account','int'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -75,7 +75,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_label=""; $search_amount=""; $search_account=''; - $typeid=""; + $typeid=""; } /* @@ -103,11 +103,11 @@ if ($search_label) $sql.=natural_search(array('v.label'), $search_label); if ($search_amount) $sql.=natural_search("v.amount", $search_amount, 1); if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account; if ($filtre) { - $filtre=str_replace(":","=",$filtre); - $sql .= " AND ".$filtre; + $filtre=str_replace(":","=",$filtre); + $sql .= " AND ".$filtre; } if ($typeid) { - $sql .= " AND v.fk_typepayment=".$typeid; + $sql .= " AND v.fk_typepayment=".$typeid; } $sql.= $db->order($sortfield,$sortorder); @@ -116,48 +116,48 @@ $totalnboflines=0; $result=$db->query($sql); if ($result) { - $totalnboflines = $db->num_rows($result); + $totalnboflines = $db->num_rows($result); } $sql.= $db->plimit($limit+1,$offset); $result = $db->query($sql); if ($result) { - $num = $db->num_rows($result); - $i = 0; - $total = 0 ; + $num = $db->num_rows($result); + $i = 0; + $total = 0 ; $var=true; $param=''; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($typeid) $param.='&typeid='.$typeid; if ($optioncss != '') $param.='&optioncss='.$optioncss; print '
'; - $db->free($result); + $db->free($result); } else { - dol_print_error($db); + dol_print_error($db); } diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 6b42e7ad500..fd4d2a4e7f7 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -357,6 +357,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM $sql = "SELECT rowid, code, label, nature"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal"; $sql.= " WHERE entity = ".$conf->entity; + $sql.= " active = 1"; $sql.= " ORDER BY label"; $resql = $db->query($sql); @@ -373,10 +374,10 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM $nature=''; // Must match array $sourceList defined into journals_list.php - if ($objp->nature == 2) $nature="sells"; - if ($objp->nature == 3) $nature="purchases"; - if ($objp->nature == 4) $nature="bank"; - if ($objp->nature == 5) $nature="expensereports"; + if ($objp->nature == 2 && ! empty($conf->facture->enabled)) $nature="sells"; + if ($objp->nature == 3 && ! empty($conf->fournisseur->enabled)) $nature="purchases"; + if ($objp->nature == 4 && ! empty($conf->banque->enabled)) $nature="bank"; + if ($objp->nature == 5 && ! empty($conf->expensereport->enabled)) $nature="expensereports"; if ($objp->nature == 1) $nature="various"; if ($objp->nature == 9) $nature="hasnew"; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 66bfdcbce87..d1a26d2de1c 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -992,6 +992,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $sql = "SELECT rowid, code, label, nature"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal"; $sql.= " WHERE entity = ".$conf->entity; + $sql.= " AND active = 1"; $sql.= " ORDER BY label"; $resql = $db->query($sql); diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 5706307a16c..c9147419650 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -20,7 +20,7 @@ /** * \file htdocs/holiday/list.php * \ingroup holiday - * \brief List of holiday. + * \brief List of holiday */ require('../main.inc.php'); @@ -63,10 +63,10 @@ $month_start = GETPOST('month_start'); $year_start = GETPOST('year_start'); $month_end = GETPOST('month_end'); $year_end = GETPOST('year_end'); -$search_employe = GETPOST('search_employe'); +$search_employee = GETPOST('search_employee'); $search_valideur = GETPOST('search_valideur'); $search_statut = GETPOST('select_statut'); -$type = GETPOST('type','int'); +$search_type = GETPOST('search_type','int'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( @@ -91,10 +91,10 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $year_start=""; $month_end=""; $year_end=""; - $search_employe=""; + $search_employee=""; $search_valideur=""; $search_statut=""; - $type=''; + $search_type=''; } @@ -121,13 +121,13 @@ llxHeader('', $langs->trans('CPTitreMenu')); $order = $db->order($sortfield,$sortorder).$db->plimit($limit + 1, $offset); -// WHERE +// Ref if(!empty($search_ref)) { $filter.= " AND cp.rowid LIKE '%".$db->escape($search_ref)."%'\n"; } -// DATE START +// Start date if($year_start > 0) { if($month_start > 0) { $filter .= " AND (cp.date_debut BETWEEN '".$db->idate(dol_get_first_day($year_start,$month_start,1))."' AND '".$db->idate(dol_get_last_day($year_start,$month_start,1))."')"; @@ -142,7 +142,7 @@ if($year_start > 0) { } } -// DATE FIN +// End date if($year_end > 0) { if($month_end > 0) { $filter .= " AND (cp.date_fin BETWEEN '".$db->idate(dol_get_first_day($year_end,$month_end,1))."' AND '".$db->idate(dol_get_last_day($year_end,$month_end,1))."')"; @@ -157,7 +157,7 @@ if($year_end > 0) { } } -// DATE CREATE +// Create date if($year_create > 0) { if($month_create > 0) { $filter .= " AND (cp.date_create BETWEEN '".$db->idate(dol_get_first_day($year_create,$month_create,1))."' AND '".$db->idate(dol_get_last_day($year_create,$month_create,1))."')"; @@ -172,17 +172,22 @@ if($year_create > 0) { } } -// EMPLOYE -if(!empty($search_employe) && $search_employe != -1) { - $filter.= " AND cp.fk_user = '".$db->escape($search_employe)."'\n"; +// Employee +if(!empty($search_employee) && $search_employee != -1) { + $filter.= " AND cp.fk_user = '".$db->escape($search_employee)."'\n"; } -// VALIDEUR +// Validator if(!empty($search_valideur) && $search_valideur != -1) { $filter.= " AND cp.fk_validator = '".$db->escape($search_valideur)."'\n"; } -// STATUT +// Type +if (!empty($search_type) && $search_type != -1) { + $filter.= ' AND cp.fk_type IN ('.$db->escape($search_type).')'; +} + +// Status if(!empty($search_statut) && $search_statut != -1) { $filter.= " AND cp.statut = '".$db->escape($search_statut)."'\n"; } @@ -194,7 +199,6 @@ if (!empty($sall)) if (empty($user->rights->holiday->read_all)) $filter.=' AND cp.fk_user IN ('.join(',',$childids).')'; -if ($type > 0) $filter.=' AND cp.fk_type IN ('.$db->escape($type).')'; // Récupération de l'ID de l'utilisateur $user_id = $user->id; @@ -297,34 +301,34 @@ if ($sall) print '| '; print ''; print ' | '; -// DATE CREATE +// Create date print ''; print ''; $formother->select_year($year_create,'year_create',1, $min_year, 0); print ' | '; -// UTILISATEUR +// User if ($user->rights->holiday->write_all) { print ''; - print $form->select_dolusers($search_employe,"search_employe",1,"",0,'','',0,0,0,'',0,'','maxwidth200'); + print $form->select_dolusers($search_employee,"search_employee",1,"",0,'','',0,0,0,'',0,'','maxwidth200'); print ' | '; } else { //print ''; print ' | '; - print $form->select_dolusers($user->id,"search_employe",1,"",1,'','',0,0,0,'',0,'','maxwidth200'); + print $form->select_dolusers($user->id,"search_employee",1,"",1,'','',0,0,0,'',0,'','maxwidth200'); print ' | '; } -// APPROVER +// Approve if($user->rights->holiday->write_all) { print ''; @@ -352,30 +356,30 @@ foreach($typeleaves as $key => $val) //$labeltoshow .= ($val['delay'] > 0 ? ' ('.$langs->trans("NoticePeriod").': '.$val['delay'].' '.$langs->trans("days").')':''); $arraytypeleaves[$val['rowid']]=$labeltoshow; } -print $form->selectarray('type', $arraytypeleaves, (GETPOST('type')?GETPOST('type'):''), 1); +print $form->selectarray('search_type', $arraytypeleaves, (GETPOST('search_type')?GETPOST('search_type'):''), 1); print ' | '; -// DUREE +// Duration print ''; -// DATE DEBUT +// Start date print ' | '; print ''; $formother->select_year($year_start,'year_start',1, $min_year, $max_year); print ' | '; -// DATE FIN +// End date print ''; print ''; $formother->select_year($year_end,'year_end',1, $min_year, $max_year); print ' | '; -// STATUT +// Status print ''; $holiday->selectStatutCP($search_statut); print ' | '; -// ACTION +// Actions print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; @@ -404,7 +408,7 @@ if (! empty($holiday->holiday)) foreach($holiday->holiday as $infos_CP) { - // Utilisateur + // User $userstatic->id=$infos_CP['fk_user']; $userstatic->lastname=$infos_CP['user_lastname']; $userstatic->firstname=$infos_CP['user_firstname']; @@ -412,7 +416,7 @@ if (! empty($holiday->holiday)) $userstatic->statut=$infos_CP['user_statut']; $userstatic->photo=$infos_CP['user_photo']; - // Valideur + // Validator $approbatorstatic->id=$infos_CP['fk_validator']; $approbatorstatic->lastname=$infos_CP['validator_lastname']; $approbatorstatic->firstname=$infos_CP['validator_firstname']; |