diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 60ff4b125c3..36739254d06 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -37,6 +37,11 @@ $mesg = ''; $action = GETPOST('action'); $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); +$search_account = GETPOST("search_account"); +$search_label = GETPOST("search_label"); +$search_accountparent = GETPOST("search_accountparent"); +$search_pcgtype = GETPOST("search_pcgtype"); +$search_pcgsubtype = GETPOST("search_pcgsubtype"); // Security check if (!$user->admin) @@ -83,6 +88,15 @@ if ($action == 'disable') { } } +if (GETPOST("button_removefilter")) +{ + $search_account=""; + $search_label=""; + $search_accountparent=""; + $search_pcgtype=""; + $search_pcgsubtype=""; +} + /* * View * @@ -96,20 +110,20 @@ $sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa, " . MAIN_DB_PREFIX $sql .= " WHERE aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $pcgver; -if (strlen(trim($_GET["search_account"]))) { - $sql .= " AND aa.account_number like '%" . $_GET["search_account"] . "%'"; +if (strlen(trim($search_account))) { + $sql .= " AND aa.account_number like '%" . $search_account . "%'"; } -if (strlen(trim($_GET["search_label"]))) { - $sql .= " AND aa.label like '%" . $_GET["search_label"] . "%'"; +if (strlen(trim($search_label))) { + $sql .= " AND aa.label like '%" . $search_label . "%'"; } -if (strlen(trim($_GET["search_accountparent"]))) { - $sql .= " AND aa.account_parent like '%" . $_GET["search_accountparent"] . "%'"; +if (strlen(trim($search_accountparent))) { + $sql .= " AND aa.account_parent like '%" . $search_accountparent . "%'"; } -if (strlen(trim($_GET["search_pcgtype"]))) { - $sql .= " AND aa.pcg_type like '%" . $_GET["search_pcgtype"] . "%'"; +if (strlen(trim($search_pcgtype))) { + $sql .= " AND aa.pcg_type like '%" . $search_pcgtype . "%'"; } -if (strlen(trim($_GET["search_pcgsubtype"]))) { - $sql .= " AND aa.pcg_subtype like '%" . $_GET["search_pcgsubtype"] . "%'"; +if (strlen(trim($search_pcgsubtype))) { + $sql .= " AND aa.pcg_subtype like '%" . $search_pcgsubtype . "%'"; } $sql .= $db->order($sortfield, $sortorder); @@ -141,18 +155,20 @@ if ($result) { print_liste_field_titre($langs->trans("Pcgtype"), $_SERVER["PHP_SELF"], "aa.pcg_type", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Pcgsubtype"), $_SERVER["PHP_SELF"], "aa.pcg_subtype", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Active"), $_SERVER["PHP_SELF"], "aa.active", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre(" "); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder); print ''; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ' '; - print ''; - print ''; + print ''; + print ''; + print ' '; + print ''; print ''; print ''; @@ -180,11 +196,13 @@ if ($result) { } print ''; - print ''; + // Action + print ''; if ($user->admin) { print ''; print img_edit(); - print ' '; + print ''; + print ' '; print ''; print img_delete(); print ''; diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 9ebdea5fefc..ad6ca01b6ca 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -181,11 +181,6 @@ else if ($id) if ($action == 'update') { - // WYSIWYG Editor - $htmlacc = new FormVentilation($db); - - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; - $soc = new Societe($db); if ($object->socid) { $soc->fetch($object->socid); diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 9e109c7feeb..608c62cf1d0 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -35,8 +35,6 @@ $langs->load("accounting"); $id = GETPOST('id', 'int'); if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); $action = GETPOST('action'); $piece_num = GETPOST("piece_num"); @@ -238,7 +236,9 @@ if ($action == 'create') { print ''; print ''; -} else { +} +else +{ $book = new BookKeeping($db); $result = $book->fetch_per_mvt($piece_num); if ($result < 0) { @@ -309,14 +309,12 @@ if ($action == 'create') { print ''; print '' . $line->montant . ''; print '' . $line->sens . ''; - print ''; - if ($user->rights->accounting->access) { - print ''; - } + print ''; print ''; print ''; - } else { + } + else { print '' . $line->numero_compte . ''; print '' . $line->code_tiers . ''; print '' . $line->label_compte . ''; @@ -324,16 +322,15 @@ if ($action == 'create') { print '' . $line->credit . ''; print '' . $line->montant . ''; print '' . $line->sens . ''; - + print ''; - if ($user->rights->accouting->access) { - print ''; - print img_edit(); - print ' '; - print ''; - print img_delete(); - print ''; - } + print ''; + print img_edit(); + print ' '; + print ''; + print img_delete(); + print ''; + print ''; } print "\n"; @@ -342,7 +339,7 @@ if ($action == 'create') { if ($action == "" || $action == 'add') { $var = ! $var; print ""; - + print '
'; print '' . "\n"; print '' . "\n"; @@ -359,14 +356,13 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''; } - print ""; } } - } else { + } + else { print_fiche_titre($langs->trans("NoRecords")); } } diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index b0e5096699b..21da5bacbb9 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -36,6 +36,11 @@ $page = GETPOST("page"); $sortorder = GETPOST("sortorder"); $sortfield = GETPOST("sortfield"); $action = GETPOST('action', 'alpha'); +$search_doc_type = GETPOST("search_doc_type"); +$search_doc_ref = GETPOST("search_doc_ref"); +$search_account = GETPOST("search_account"); +$search_thirdparty = GETPOST("search_thirdparty"); +$search_journal = GETPOST("search_journal"); if ($sortorder == "") $sortorder = "ASC"; @@ -46,6 +51,15 @@ $offset = $conf->liste_limit * $page; $formventilation = new FormVentilation($db); +if (GETPOST("button_removefilter")) +{ + $search_doc_type=""; + $search_doc_ref=""; + $search_account=""; + $search_thirdparty=""; + $search_journal=""; +} + /* * Action */ @@ -100,25 +114,25 @@ else { $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num "; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk"; - if (dol_strlen(trim(GETPOST("search_doc_type")))) { + if (dol_strlen(trim($search_doc_type))) { - $sql .= " WHERE bk.doc_type LIKE '%" . GETPOST("search_doc_type") . "%'"; + $sql .= " WHERE bk.doc_type LIKE '%" . $search_doc_type . "%'"; - if (dol_strlen(trim(GETPOST("search_doc_ref")))) { - $sql .= " AND bk.doc_ref LIKE '%" . GETPOST("search_doc_ref") . "%'"; + if (dol_strlen(trim($search_doc_ref))) { + $sql .= " AND bk.doc_ref LIKE '%" . $search_doc_ref . "%'"; } } - if (dol_strlen(trim(GETPOST("search_doc_ref")))) { - $sql .= " WHERE bk.doc_ref LIKE '%" . GETPOST("search_doc_ref") . "%'"; + if (dol_strlen(trim($search_doc_ref))) { + $sql .= " WHERE bk.doc_ref LIKE '%" . $search_doc_ref . "%'"; } - if (dol_strlen(trim(GETPOST("search_compte")))) { - $sql .= " WHERE bk.numero_compte LIKE '%" . GETPOST("search_compte") . "%'"; + if (dol_strlen(trim($search_account))) { + $sql .= " WHERE bk.numero_compte LIKE '%" . $search_account . "%'"; } - if (dol_strlen(trim(GETPOST("search_tiers")))) { - $sql .= " WHERE bk.code_tiers LIKE '%" . GETPOST("search_tiers") . "%'"; + if (dol_strlen(trim($search_thirdparty))) { + $sql .= " WHERE bk.code_tiers LIKE '%" . $search_thirdparty . "%'"; } - if (dol_strlen(trim(GETPOST("search_journal")))) { - $sql .= " WHERE bk.code_journal LIKE '%" . GETPOST("search_journal") . "%'"; + if (dol_strlen(trim($search_journal))) { + $sql .= " WHERE bk.code_journal LIKE '%" . $search_journal . "%'"; } $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit + 1, $offset); @@ -149,7 +163,7 @@ else { print ''; print '
'; - print ""; + print '
'; print ''; print_liste_field_titre($langs->trans("Doctype"), $_SERVER['PHP_SELF'], "bk.doc_type", "", "", "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "bk.doc_date", "", "", "", $sortfield, $sortorder); @@ -157,29 +171,31 @@ else { print_liste_field_titre($langs->trans("Numerocompte"), $_SERVER['PHP_SELF'], "bk.numero_compte", "", "", "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Code_tiers"), $_SERVER['PHP_SELF'], "bk.code_tiers", "", "", "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "bk_label_compte", "", "", "", $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "bk.debit", "", "", "", $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "bk.credit", "", "", "", $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "bk.montant", "", "", "", $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "bk.sens", "", "", "", $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "bk.debit", "", "", 'align="center"', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "bk.credit", "", "", 'align="center"', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "bk.montant", "", "", 'align="center"', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "bk.sens", "", "", 'align="center"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "bk.code_journal", "", "", "", $sortfield, $sortorder); - print_liste_field_titre(" "); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder); print "\n"; print ''; print ''; - print ''; + print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; print ''; print ''; - print ''; - print ''; + print ''; print ''; print ''; @@ -201,9 +217,9 @@ else { print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print "\n"; $i ++; } diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 91a0eb5df8b..28d3d0c1f79 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -40,14 +40,12 @@ $id = GETPOST('id'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); /* * Actions */ -if ($action == 'ventil' && $user->rights->accounting->access) +if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) { if (! GETPOST('cancel', 'alpha')) { @@ -109,7 +107,7 @@ if (! empty($id)) { print ''; $linkback=''.$langs->trans("Back").''; - print_fiche_titre($langs->trans('AccountingVentilationCustomer'),$linkback,'setup'); + print_fiche_titre($langs->trans('CustomersVentilation'),$linkback,'setup'); print '
      '; - print ''; + print ''; + print ''; + print ' '; + print ''; print '
' . price($obj->debit) . '' . price($obj->credit) . '' . price($obj->montant) . '' . $obj->sens . '' . $obj->sens . '' . $obj->code_journal . '' . img_edit() . '' . img_edit() . '
'; diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 9ae070c25e0..cb40b7b361b 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -93,8 +93,8 @@ if ($action == 'validatehistory') { */ llxHeader('', $langs->trans("CustomersVentilation")); -$textprevyear = "" . img_previous() . ""; -$textnextyear = " " . img_next() . ""; +$textprevyear = '' . img_previous() . ''; +$textnextyear = ' ' . img_next() . ''; print_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear); @@ -197,7 +197,7 @@ print "
\n"; print "
\n"; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -212,7 +212,7 @@ print ''; print ''; print ''; -$sql = "SELECT '" . $langs->trans("Vide") . "' AS 'Total',"; +$sql = "SELECT '" . $langs->trans("TotalVente") . "' AS 'Total',"; $sql .= " ROUND(SUM(IF(MONTH(f.datef)=1,fd.total_ht,0)),2) AS 'Janvier',"; $sql .= " ROUND(SUM(IF(MONTH(f.datef)=2,fd.total_ht,0)),2) AS 'Fevrier',"; $sql .= " ROUND(SUM(IF(MONTH(f.datef)=3,fd.total_ht,0)),2) AS 'Mars',"; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index dcd8fca4d41..1f9b0549121 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -68,8 +68,6 @@ $action = GETPOST('action'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); /* * View diff --git a/htdocs/accountancy/journal/cashjournal.php b/htdocs/accountancy/journal/cashjournal.php index 8af84a9ed58..fb5a15a513c 100644 --- a/htdocs/accountancy/journal/cashjournal.php +++ b/htdocs/accountancy/journal/cashjournal.php @@ -62,8 +62,6 @@ $date_endyear = GETPOST('date_endyear'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); $action = GETPOST('action'); diff --git a/htdocs/accountancy/journal/index.php b/htdocs/accountancy/journal/index.php index 272d76fa20f..36286ce265e 100644 --- a/htdocs/accountancy/journal/index.php +++ b/htdocs/accountancy/journal/index.php @@ -36,8 +36,6 @@ $langs->load("accountancy"); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); llxHeader('', 'Journaux', ''); diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 789aa1111af..97d52124c01 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -55,8 +55,6 @@ $date_endyear = GETPOST('date_endyear'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); $action = GETPOST('action'); diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index a7c0266998f..5bb1f989a92 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -56,8 +56,6 @@ $date_endyear = GETPOST('date_endyear'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); $action = GETPOST('action'); diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index b0078839b55..45c8de9b165 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -46,10 +46,9 @@ $codeventil = GETPOST('codeventil'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->ventilation->dispatch) - accessforbidden(); -if ($action == 'ventil' && $user->rights->accounting->access) { +if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) +{ $sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det"; $sql .= " SET fk_code_ventilation = " . $codeventil; $sql .= " WHERE rowid = " . $id; @@ -103,7 +102,7 @@ if ($_GET["id"]) { print ''; print ''; - print_fiche_titre($langs->trans("Ventilation")); + print_fiche_titre($langs->trans("SuppliersVentilation")); print '
' . $langs->trans("TotalVente") . '
' . $langs->trans("Total") . '' . $langs->trans("JanuaryMin") . '' . $langs->trans("FebruaryMin") . '' . $langs->trans("MarchMin") . '' . $langs->trans("NovemberMin") . '' . $langs->trans("DecemberMin") . '' . $langs->trans("Total") . '
'; diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 7d633c575f1..edebcfd9d46 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -92,10 +92,10 @@ if ($action == 'validatehistory') { llxHeader('', $langs->trans("SuppliersVentilation")); -$textprevyear = "" . img_previous() . ""; -$textnextyear = " " . img_next() . ""; +$textprevyear = '' . img_previous() . ''; +$textnextyear = ' ' . img_next() . ''; -print_fiche_titre($langs->trans("AccountingVentilationSupplier") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear); +print_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear); print '' . $langs->trans("DescVentilSupplier") . ''; print '
' . $langs->trans("ValidateHistory") . '
'; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 1d6e12b1357..71b6d29ea42 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -952,7 +952,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->accounting->enabled)) { $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy", $langs->trans("Fiscalyear"),0,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); - $newmenu->add("/accountancy/admin/account.php?mainmenu=home", $langs->trans("Chartofaccounts"),0,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); + $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy", $langs->trans("Chartofaccounts"),0,$user->rights->accounting->chartofaccount, '', $mainmenu, 'chartofaccount'); } } diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 9a544b1ece0..e074bfe82f1 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -229,6 +229,14 @@ class modAccounting extends DolibarrModules $this->rights[$r][4] = 'fiscalyear'; $this->rights[$r][5] = ''; $r++; + + $this->rights[$r][0] = 50440; + $this->rights[$r][1] = 'Manage chart of accounts'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'chartofaccount'; + $this->rights[$r][5] = ''; + $r++; // Main menu entries $this->menus = array(); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 4760f73f855..9c2290cc629 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -36,7 +36,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (! empty($conf->agenda->enabled))require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +//if (! empty($conf->agenda->enabled))require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; if (! empty($conf->multicompany->enabled)) dol_include_once('/multicompany/class/actions_multicompany.class.php');