Merge branch 'develop' into New-status-for-webhook
This commit is contained in:
commit
88c90b0f8a
7 changed files with 56 additions and 8 deletions
|
|
@ -775,10 +775,11 @@ class AccountancyCategory // extends CommonObject
|
|||
*
|
||||
* @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups
|
||||
* @param int $active 1= active, 0=not active
|
||||
* @param int $id_report id of the report
|
||||
* @return never|array<array{rowid:string,code:string,label:string,formula:string,position:string,category_type:string,sens:string,bc:string}>|int Array of groups or -1 if error
|
||||
* @see getCatsCpts(), getCptsCat()
|
||||
*/
|
||||
public function getCats($categorytype = -1, $active = 1)
|
||||
public function getCats($categorytype = -1, $active = 1, $id_report = 1)
|
||||
{
|
||||
global $conf, $mysoc;
|
||||
|
||||
|
|
@ -790,6 +791,7 @@ class AccountancyCategory // extends CommonObject
|
|||
$sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type, c.sens";
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element." as c";
|
||||
$sql .= " WHERE c.active = " . (int) $active;
|
||||
$sql .= " AND c.fk_report=".((int) $id_report);
|
||||
$sql .= " AND c.entity = ".$conf->entity;
|
||||
if ($categorytype >= 0) {
|
||||
$sql .= " AND c.category_type = 1";
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyreport.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
|
|
@ -45,6 +46,8 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php
|
|||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('compta', 'bills', 'donation', 'salaries', 'accountancy'));
|
||||
|
||||
$id_report = GETPOSTINT('id_report');
|
||||
|
||||
$error = 0;
|
||||
|
||||
$mesg = '';
|
||||
|
|
@ -238,7 +241,12 @@ if ($modecompta == "CREANCES-DETTES") {
|
|||
$builddate = dol_now();
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
} elseif ($modecompta == "BOOKKEEPING") {
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPersonalizedAccountGroups");
|
||||
$accountingreportstatic = new AccountancyReport($db);
|
||||
$accountingreportstatic->fetch($id_report);
|
||||
$reportLabel = '';
|
||||
$reportLabel = $accountingreportstatic->label;
|
||||
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPersonalizedAccountGroups").' '.$reportLabel;
|
||||
$calcmode = $langs->trans("CalcModeBookkeeping");
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
|
||||
|
|
@ -292,8 +300,8 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||
// $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
|
||||
} elseif ($modecompta == "BOOKKEEPING") {
|
||||
// Get array of all report groups that are active
|
||||
$cats = $AccCat->getCats(); // WARNING: Computed groups must be after group they include
|
||||
$unactive_cats = $AccCat->getCats(-1, 0);
|
||||
$cats = $AccCat->getCats(-1, 1, $id_report); // WARNING: Computed groups must be after group they include
|
||||
$unactive_cats = $AccCat->getCats(-1, 0, $id_report);
|
||||
|
||||
/*
|
||||
$sql = 'SELECT DISTINCT t.numero_compte as nb FROM '.MAIN_DB_PREFIX.'accounting_bookkeeping as t, '.MAIN_DB_PREFIX.'accounting_account as aa';
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class box_last_modified_ticket extends ModeleBoxes
|
|||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
global $user, $langs;
|
||||
|
||||
$this->max = $max;
|
||||
|
||||
|
|
|
|||
|
|
@ -619,7 +619,9 @@ class ExtraFields
|
|||
$sql = "DELETE FROM ".$this->db->prefix()."extrafields";
|
||||
$sql .= " WHERE name = '".$this->db->escape($attrname)."'";
|
||||
$sql .= " AND entity IN (0,".$conf->entity.')';
|
||||
$sql .= " AND elementtype = '".$this->db->escape($elementtype)."'";
|
||||
if (!empty($elementtype)) {
|
||||
$sql .= " AND elementtype = '".$this->db->escape($elementtype)."'";
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::delete_label", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
|
|
|||
|
|
@ -1702,7 +1702,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
|
|||
$newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_product', 110);
|
||||
$newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_closure', 120);
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
$newmenu->add("/accountancy/admin/report_list.php?id=32&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingReport"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 125);
|
||||
$newmenu->add("/accountancy/admin/report_list.php?id=32&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingReport"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_report', 125);
|
||||
}
|
||||
$newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 130);
|
||||
}
|
||||
|
|
@ -1844,7 +1844,40 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
|
|||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) {
|
||||
$newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->hasRight('accounting', 'comptarapport', 'lire'));
|
||||
$newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report", $langs->trans("ByPredefinedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
|
||||
$newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
|
||||
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
global $mysoc;
|
||||
|
||||
// Multi personalized reports
|
||||
$sql = "SELECT rowid, code, label";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_accounting_report";
|
||||
$sql .= " WHERE entity = ".((int) $conf->entity);
|
||||
$sql .= " AND fk_country = ".((int) $mysoc->country_id);
|
||||
$sql .= " AND active = 1";
|
||||
$sql .= " ORDER BY label DESC";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$numr = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ($numr > 0) {
|
||||
while ($i < $numr) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
$newmenu->add('/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report&id_report='.$objp->rowid, $langs->trans("Personalized") . " - " . $objp->label, 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
// Should not happen. Entries are added
|
||||
$newmenu->add('', $langs->trans("NoReportDefined"), 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
$db->free($resql);
|
||||
} else {
|
||||
$newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire'));
|
||||
}
|
||||
}
|
||||
|
||||
$modecompta = 'CREANCES-DETTES';
|
||||
|
|
|
|||
|
|
@ -229,6 +229,8 @@ AccountingAccountGroupsDesc=You can define here some groups of accounting accoun
|
|||
ByAccounts=By accounts
|
||||
ByPredefinedAccountGroups=By predefined groups
|
||||
ByPersonalizedAccountGroups=By personalized groups
|
||||
Personalized=Personalized
|
||||
NoReportDefined=No personalized reports defined
|
||||
NotMatch=Not Set
|
||||
DeleteMvt=Delete some lines from accounting
|
||||
DelMonth=Month to delete
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ parameters:
|
|||
treatPhpDocTypesAsCertain: false
|
||||
ignoreErrors:
|
||||
- '#.*phan-var#'
|
||||
- '#Right side of && is always true#'
|
||||
internalErrorsCountLimit: 50
|
||||
cache:
|
||||
# nodesByFileCountMax: 512
|
||||
|
|
|
|||
Loading…
Reference in a new issue