Merge pull request #11951 from aspangaro/11.0_accountancy_portal
NEW Accountancy - Add an option to hide FAQ on index and add specific widget in this area
This commit is contained in:
commit
035da6a711
@ -82,7 +82,6 @@ if ($action == 'update') {
|
||||
}
|
||||
}
|
||||
|
||||
// TO DO Mutualize code for yes/no constants
|
||||
if ($action == 'setlistsorttodo') {
|
||||
$setlistsorttodo = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity);
|
||||
@ -212,7 +211,7 @@ if (! empty($user->admin))
|
||||
{
|
||||
// TO DO Mutualize code for yes/no constants
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
|
||||
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
|
||||
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setlistsorttodo&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
@ -224,7 +223,7 @@ if (! empty($user->admin))
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr>';
|
||||
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
|
||||
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setlistsortdone&value=0">';
|
||||
@ -237,7 +236,7 @@ if (! empty($user->admin))
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr>';
|
||||
print '<td>' . $langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
|
||||
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setenabledraftexport&value=0">';
|
||||
@ -250,7 +249,7 @@ if (! empty($user->admin))
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr>';
|
||||
print '<td>' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . '</td>';
|
||||
if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
|
||||
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=0">';
|
||||
@ -263,7 +262,7 @@ if (! empty($user->admin))
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr>';
|
||||
print '<td>' . $langs->trans("ACCOUNTANCY_COMBO_FOR_AUX") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setenablesubsidiarylist&value=0">';
|
||||
@ -276,7 +275,7 @@ if (! empty($user->admin))
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr>';
|
||||
print '<td>' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
|
||||
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=0">';
|
||||
|
||||
@ -235,7 +235,7 @@ class AccountingJournal extends CommonObject
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowAccoutingJournal");
|
||||
$label=$langs->trans("ShowAccountingJournal");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
|
||||
@ -406,7 +406,7 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a link to the object card (with optionaly the picto)
|
||||
* Return a link to the object card (with optionally the picto)
|
||||
*
|
||||
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
|
||||
* @param string $option On what the link point to ('nolink', ...)
|
||||
@ -1309,7 +1309,7 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete bookkepping by importkey
|
||||
* Delete bookkeeping by importkey
|
||||
*
|
||||
* @param string $importkey Import key
|
||||
* @return int Result
|
||||
@ -1337,7 +1337,7 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete bookkepping by year
|
||||
* Delete bookkeeping by year
|
||||
*
|
||||
* @param string $delyear Year to delete
|
||||
* @param string $journal Journal to delete
|
||||
@ -1379,7 +1379,7 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete bookkepping by piece number
|
||||
* Delete bookkeeping by piece number
|
||||
*
|
||||
* @param int $piecenum Piecenum to delete
|
||||
* @return int Result
|
||||
@ -1624,12 +1624,12 @@ class BookKeeping extends CommonObject
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Export bookkeping
|
||||
* Export bookkeeping
|
||||
*
|
||||
* @param string $model Model
|
||||
* @return int Result
|
||||
*/
|
||||
public function export_bookkeping($model = 'ebp')
|
||||
public function export_bookkeeping($model = 'ebp')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
@ -1641,7 +1641,7 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
||||
$sql .= " WHERE entity IN (" . getEntity('accountancy') . ")";
|
||||
|
||||
dol_syslog(get_class($this) . "::export_bookkeping", LOG_DEBUG);
|
||||
dol_syslog(get_class($this) . "::export_bookkeeping", LOG_DEBUG);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@ -1679,7 +1679,7 @@ class BookKeeping extends CommonObject
|
||||
return $num;
|
||||
} else {
|
||||
$this->error = "Error " . $this->db->lasterror();
|
||||
dol_syslog(get_class($this) . "::export_bookkeping " . $this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this) . "::export_bookkeeping " . $this->error, LOG_ERR);
|
||||
return - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -26,6 +26,7 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta","bills","other","accountancy","loans","banks","admin","dict"));
|
||||
@ -41,8 +42,17 @@ $hookmanager->initHooks(array('accountancyindex'));
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// None
|
||||
if (GETPOST('addbox')) // Add box (when submit is done from a form when ajax disabled)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
|
||||
$zone=GETPOST('areacode', 'aZ09');
|
||||
$userid=GETPOST('userid', 'int');
|
||||
$boxorder=GETPOST('boxorder', 'aZ09');
|
||||
$boxorder.=GETPOST('boxcombo', 'aZ09');
|
||||
|
||||
$result=InfoBox::saveboxorder($db, $zone, $boxorder, $userid);
|
||||
if ($result > 0) setEventMessages($langs->trans("BoxAdded"), null);
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -50,14 +60,32 @@ $hookmanager->initHooks(array('accountancyindex'));
|
||||
|
||||
llxHeader('', $langs->trans("AccountancyArea"));
|
||||
|
||||
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy');
|
||||
//dol_fiche_head();
|
||||
|
||||
$step = 0;
|
||||
|
||||
if ($conf->accounting->enabled)
|
||||
{
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
||||
$step = 0;
|
||||
|
||||
$resultboxes=FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
|
||||
|
||||
print load_fiche_titre($langs->trans("AccountancyArea"), $resultboxes['selectboxlist'], 'accountancy');
|
||||
|
||||
print '<div align="right"><a href="#" id="show_hide">';
|
||||
print img_picto('', 'chevron-down');
|
||||
print ' ' . $langs->trans("ShowFAQ");
|
||||
print '</a></div>';
|
||||
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#show_hide").click(function () {
|
||||
jQuery( "#idfaq" ).toggle({
|
||||
duration: 400,
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
print '<div class="hideobject" id="idfaq">'; // hideobject is to start hidden
|
||||
print "<br>\n";
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
||||
print "<br>\n";print "<br>\n";
|
||||
|
||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||
@ -172,12 +200,49 @@ if ($conf->accounting->enabled)
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64+$step))."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
print '<div class="fichecenter fichecenterbis">';
|
||||
|
||||
/*
|
||||
* Show boxes
|
||||
*/
|
||||
$boxlist.='<div class="twocolumns">';
|
||||
|
||||
$boxlist.='<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
|
||||
if(!empty($nbworkboardcount))
|
||||
{
|
||||
$boxlist.=$boxwork;
|
||||
}
|
||||
|
||||
$boxlist.=$resultboxes['boxlista'];
|
||||
|
||||
$boxlist.= '</div>';
|
||||
|
||||
$boxlist.= '<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
|
||||
|
||||
$boxlist.=$boxstat;
|
||||
$boxlist.=$resultboxes['boxlistb'];
|
||||
|
||||
$boxlist.= '</div>';
|
||||
$boxlist.= "\n";
|
||||
|
||||
$boxlist.='</div>';
|
||||
|
||||
|
||||
print $boxlist;
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy');
|
||||
|
||||
print $langs->trans("Module10Desc")."<br>\n";
|
||||
}
|
||||
//dol_fiche_end();
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('admin', 'boxes'));
|
||||
$langs->loadLangs(array('admin', 'boxes', 'accountancy'));
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
|
||||
175
htdocs/core/boxes/box_accountancy_last_manual_entries.php
Normal file
175
htdocs/core/boxes/box_accountancy_last_manual_entries.php
Normal file
@ -0,0 +1,175 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/boxes/box_accountancy_last_manual_entries.php
|
||||
* \ingroup Accountancy
|
||||
* \brief Module to generated widget of last manual entries
|
||||
*/
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
||||
|
||||
|
||||
/**
|
||||
* Class to manage the box to show last manual entries
|
||||
*/
|
||||
class box_accountancy_last_manual_entries extends ModeleBoxes
|
||||
{
|
||||
public $boxcode="accountancy_last_manual_entries";
|
||||
public $boximg="object_invoice";
|
||||
public $boxlabel="BoxLastManualEntries";
|
||||
public $depends = array("accounting");
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
public $param;
|
||||
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
public function __construct($db, $param)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden = ! ($user->rights->accounting->mouvements->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load data for box to show them later
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
|
||||
$this->max = $max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
|
||||
$bookkeepingstatic = new BookKeeping($db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastManualEntries", $max));
|
||||
|
||||
if ($user->rights->accounting->mouvements->lire)
|
||||
{
|
||||
$sql = "SELECT DISTINCT b.piece_num";
|
||||
$sql.= ", b.doc_date as date_movement";
|
||||
$sql.= ", b.label_operation";
|
||||
$sql.= ", b.montant";
|
||||
$sql.= ", b.code_journal";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b";
|
||||
$sql.= " WHERE b.fk_doc = 0";
|
||||
$sql.= " AND b.entity = ".$conf->entity;
|
||||
$sql.= " ORDER BY b.piece_num DESC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
$line = 0;
|
||||
|
||||
while ($line < $num) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$date = $db->jdate($objp->date_movement);
|
||||
$journal = $objp->code_journal;
|
||||
$label = $objp->label_operation;
|
||||
$amount = $objp->montant;
|
||||
|
||||
$bookkeepingstatic->id = $objp->id;
|
||||
$bookkeepingstatic->piece_num = $objp->piece_num;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => '',
|
||||
'text' => $bookkeepingstatic->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($date, 'day'),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="center"',
|
||||
'text' => $journal,
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
|
||||
'text' => $label,
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="nowrap right"',
|
||||
'text' => price($amount, 0, $langs, 0, -1, -1, $conf->currency),
|
||||
);
|
||||
|
||||
$line++;
|
||||
}
|
||||
|
||||
if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center"','text'=>$langs->trans("NoRecordedManualEntries"));
|
||||
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'class="nohover opacitymedium left"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
{
|
||||
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||
}
|
||||
}
|
||||
134
htdocs/core/boxes/box_accountancy_suspense_account.php
Normal file
134
htdocs/core/boxes/box_accountancy_suspense_account.php
Normal file
@ -0,0 +1,134 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/boxes/box_accountancy_suspense_account.php
|
||||
* \ingroup Accountancy
|
||||
* \brief Module to generated widget of suspense account
|
||||
*/
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
||||
|
||||
|
||||
/**
|
||||
* Class to manage the box to show suspense account
|
||||
*/
|
||||
class box_accountancy_suspense_account extends ModeleBoxes
|
||||
{
|
||||
public $boxcode="accountancy_suspense_account";
|
||||
public $boximg="object_invoice";
|
||||
public $boxlabel="BoxSuspenseAccount";
|
||||
public $depends = array("accounting");
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
public $param;
|
||||
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
public function __construct($db, $param)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden = ! ($user->rights->accounting->mouvements->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load data for box to show them later
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function loadBox()
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
|
||||
$bookkeepingstatic = new BookKeeping($db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleSuspenseAccount"));
|
||||
|
||||
if ($user->rights->accounting->mouvements->lire)
|
||||
{
|
||||
$suspenseAccount = $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE;
|
||||
if (! empty($suspenseAccount) && $suspenseAccount > 0)
|
||||
{
|
||||
$sql = "SELECT COUNT(*) as nb_suspense_account";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as b";
|
||||
$sql .= " WHERE b.numero_compte = ". $suspenseAccount;
|
||||
$sql .= " AND b.entity = " . $conf->entity;
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$obj=$db->fetch_object($result);
|
||||
$nbSuspenseAccount = $obj->nb_suspense_account;
|
||||
}
|
||||
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'text' => $langs->trans("NumberOfLinesInSuspenseAccount") . ':'
|
||||
);
|
||||
|
||||
$this->info_box_contents[0][1] = array(
|
||||
'td' => 'class="right"',
|
||||
'text' => '<a href="' . DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?search_accountancy_code_start='.$suspenseAccount.'&search_accountancy_code_end='.$suspenseAccount.'">' . $nbSuspenseAccount . '</a>',
|
||||
'asis' => 1
|
||||
);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'class="nohover opacitymedium left"',
|
||||
'text' => $langs->trans("SuspenseAccountNotDefined")
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'class="nohover opacitymedium left"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
{
|
||||
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||
}
|
||||
}
|
||||
@ -989,8 +989,8 @@ class FormOther
|
||||
* Class 'Form' must be known.
|
||||
*
|
||||
* @param User $user Object User
|
||||
* @param String $areacode Code of area for pages ('0'=value for Home page)
|
||||
* @return array array('selectboxlist'=>, 'boxactivated'=>, 'boxlista'=>, 'boxlistb'=>)
|
||||
* @param String $areacode Code of area for pages - 0 = Home page ... See getListOfPagesForBoxes()
|
||||
* @return array array('selectboxlist'=>, 'boxactivated'=>, 'boxlista'=>, 'boxlistb'=>)
|
||||
*/
|
||||
public static function getBoxesArea($user, $areacode)
|
||||
{
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
class InfoBox
|
||||
{
|
||||
/**
|
||||
* Name of positions 0=Home, 1=...
|
||||
* Name of positions (See below)
|
||||
*
|
||||
* @return string[] Array with list of zones
|
||||
*/
|
||||
@ -81,7 +81,7 @@ class InfoBox
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $mode 'available' or 'activated'
|
||||
* @param string $zone Name or area (-1 for all, 0 for Homepage, 1 for xxx, ...)
|
||||
* @param string $zone Name or area (-1 for all, 0 for Homepage, 1 for Accountancy, 2 for xxx, ...)
|
||||
* @param User|null $user Object user to filter
|
||||
* @param array $excludelist Array of box id (box.box_id = boxes_def.rowid) to exclude
|
||||
* @param int $includehidden Include also hidden boxes
|
||||
@ -110,7 +110,7 @@ class InfoBox
|
||||
{
|
||||
$sql = "SELECT d.rowid as box_id, d.file, d.note, d.tms";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."boxes_def as d";
|
||||
$sql.= " WHERE d.entity IN (0,".$conf->entity.")";
|
||||
$sql.= " WHERE d.entity IN (0,".$conf->entity.")";
|
||||
}
|
||||
|
||||
dol_syslog(get_class()."::listBoxes get default box list for mode=".$mode." userid=".(is_object($user)?$user->id:'')."", LOG_DEBUG);
|
||||
@ -152,7 +152,7 @@ class InfoBox
|
||||
// box properties
|
||||
$box->rowid = (empty($obj->rowid) ? '' : $obj->rowid);
|
||||
$box->id = (empty($obj->box_id) ? '' : $obj->box_id);
|
||||
$box->position = ($obj->position == '' ? '' : $obj->position); // '0' must staty '0'
|
||||
$box->position = ($obj->position == '' ? '' : $obj->position); // '0' must stay '0'
|
||||
$box->box_order = (empty($obj->box_order) ? '' : $obj->box_order);
|
||||
$box->fk_user = (empty($obj->fk_user) ? 0 : $obj->fk_user);
|
||||
$box->sourcefile= $relsourcefile;
|
||||
|
||||
@ -162,7 +162,10 @@ class modAccounting extends DolibarrModules
|
||||
$this->module_parts = array();
|
||||
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
$this->boxes = array(
|
||||
0=>array('file'=>'box_accountancy_last_manual_entries.php', 'enabledbydefaulton'=>'accountancyindex'),
|
||||
1=>array('file'=>'box_accountancy_suspense_account.php', 'enabledbydefaulton'=>'accountancyindex')
|
||||
);
|
||||
|
||||
// Permissions
|
||||
$this->rights_class = 'accounting';
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
# Dolibarr language file - en_US - Accounting Expert
|
||||
# Dolibarr language file - en_US - Accountancy (Double entries)
|
||||
Accountancy=Accountancy
|
||||
Accounting=Accounting
|
||||
ACCOUNTING_EXPORT_SEPARATORCSV=Column separator for export file
|
||||
ACCOUNTING_EXPORT_DATE=Date format for export file
|
||||
@ -256,6 +257,7 @@ ListOfProductsWithoutAccountingAccount=List of products not bound to any account
|
||||
ChangeBinding=Change the binding
|
||||
Accounted=Accounted in ledger
|
||||
NotYetAccounted=Not yet accounted in ledger
|
||||
ShowFAQ=Show FAQ
|
||||
|
||||
## Admin
|
||||
ApplyMassCategories=Apply mass categories
|
||||
@ -264,7 +266,7 @@ CategoryDeleted=Category for the accounting account has been removed
|
||||
AccountingJournals=Accounting journals
|
||||
AccountingJournal=Accounting journal
|
||||
NewAccountingJournal=New accounting journal
|
||||
ShowAccoutingJournal=Show accounting journal
|
||||
ShowAccountingJournal=Show accounting journal
|
||||
NatureOfJournal=Nature of Journal
|
||||
AccountingJournalType1=Miscellaneous operations
|
||||
AccountingJournalType2=Sales
|
||||
|
||||
@ -86,4 +86,11 @@ ForProposals=Proposals
|
||||
LastXMonthRolling=The latest %s month rolling
|
||||
ChooseBoxToAdd=Add widget to your dashboard
|
||||
BoxAdded=Widget was added in your dashboard
|
||||
BoxTitleUserBirthdaysOfMonth=Birthdays of this month (users)
|
||||
BoxTitleUserBirthdaysOfMonth=Birthdays of this month (users)
|
||||
BoxLastManualEntries=Last manual entries in accountancy
|
||||
BoxTitleLastManualEntries=%s last manual entries
|
||||
NoRecordedManualEntries=No manual entries record in accountancy
|
||||
BoxSuspenseAccount=Count accountancy operation with suspense account
|
||||
BoxTitleSuspenseAccount=Number of unallocated lines
|
||||
NumberOfLinesInSuspenseAccount=Number of line in suspense account
|
||||
SuspenseAccountNotDefined=Suspense account isn't defined
|
||||
|
||||
Loading…
Reference in New Issue
Block a user