Fix: debug of accountancy module
This commit is contained in:
parent
2fb806bfc2
commit
9e2a0cb671
@ -16,12 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/admin/fiscalyear.php
|
* \file htdocs/accountancy/admin/fiscalyear.php
|
||||||
* \ingroup fiscal year
|
* \ingroup fiscal year
|
||||||
* \brief Setup page to configure fiscal year
|
* \brief Setup page to configure fiscal year
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
||||||
@ -55,6 +55,8 @@ $object = new Fiscalyear($db);
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$max=100;
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
llxHeader('',$title);
|
llxHeader('',$title);
|
||||||
@ -68,9 +70,6 @@ $sql.= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear as f";
|
|||||||
$sql.= " WHERE f.entity = ".$conf->entity;
|
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
$max=10;
|
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$var=false;
|
$var=false;
|
||||||
@ -85,7 +84,7 @@ if ($result)
|
|||||||
print '<td>'.$langs->trans("Label").'</td>';
|
print '<td>'.$langs->trans("Label").'</td>';
|
||||||
print '<td>'.$langs->trans("DateStart").'</td>';
|
print '<td>'.$langs->trans("DateStart").'</td>';
|
||||||
print '<td>'.$langs->trans("DateEnd").'</td>';
|
print '<td>'.$langs->trans("DateEnd").'</td>';
|
||||||
print '<td>'.$langs->trans("Statut").'</td>';
|
print '<td align="right">'.$langs->trans("Statut").'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
@ -102,7 +101,7 @@ if ($result)
|
|||||||
print '<td align="left">'.$obj->label.'</td>';
|
print '<td align="left">'.$obj->label.'</td>';
|
||||||
print '<td align="left">'.dol_print_date($db->jdate($obj->date_start),'day').'</td>';
|
print '<td align="left">'.dol_print_date($db->jdate($obj->date_start),'day').'</td>';
|
||||||
print '<td align="left">'.dol_print_date($db->jdate($obj->date_end),'day').'</td>';
|
print '<td align="left">'.dol_print_date($db->jdate($obj->date_end),'day').'</td>';
|
||||||
print '<td>'.$fiscalyearstatic->LibStatut($obj->statut,5).'</td>';
|
print '<td align="right">'.$fiscalyearstatic->LibStatut($obj->statut,5).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
$i++;
|
$i++;
|
||||||
@ -115,7 +114,6 @@ if ($result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</form>';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -16,11 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/admin/fiscalyear_card.php
|
* \file htdocs/accountancy/admin/fiscalyear_card.php
|
||||||
* \brief Page to show a fiscal year
|
* \brief Page to show a fiscal year
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
||||||
@ -51,6 +51,7 @@ $object = new Fiscalyear($db);
|
|||||||
$date_start=dol_mktime(0,0,0,GETPOST('fiscalyearmonth','int'),GETPOST('fiscalyearday','int'),GETPOST('fiscalyearyear','int'));
|
$date_start=dol_mktime(0,0,0,GETPOST('fiscalyearmonth','int'),GETPOST('fiscalyearday','int'),GETPOST('fiscalyearyear','int'));
|
||||||
$date_end=dol_mktime(0,0,0,GETPOST('fiscalyearendmonth','int'),GETPOST('fiscalyearendday','int'),GETPOST('fiscalyearendyear','int'));
|
$date_end=dol_mktime(0,0,0,GETPOST('fiscalyearendmonth','int'),GETPOST('fiscalyearendday','int'),GETPOST('fiscalyearendyear','int'));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -75,8 +76,6 @@ else if ($action == 'add')
|
|||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
$db->begin();
|
|
||||||
|
|
||||||
$object->date_start = $date_start;
|
$object->date_start = $date_start;
|
||||||
$object->date_end = $date_end;
|
$object->date_end = $date_end;
|
||||||
$object->label = GETPOST('label','alpha');
|
$object->label = GETPOST('label','alpha');
|
||||||
@ -96,21 +95,27 @@ else if ($action == 'add')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$id = $object->create($user);
|
$db->begin();
|
||||||
|
|
||||||
|
$id = $object->create($user);
|
||||||
|
|
||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
{
|
{
|
||||||
|
$db->commit();
|
||||||
|
|
||||||
header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
|
header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($object->error, 'errors');
|
$db->rollback();
|
||||||
|
|
||||||
|
setEventMessage($object->error, 'errors');
|
||||||
$action='create';
|
$action='create';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$action='create';
|
$action='create';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -207,11 +212,11 @@ else if ($id)
|
|||||||
{
|
{
|
||||||
$head = fiscalyear_prepare_head($object);
|
$head = fiscalyear_prepare_head($object);
|
||||||
|
|
||||||
dol_fiche_head($head, 'card', $langs->trans("FiscalYearCard"), 0, 'cron');
|
|
||||||
|
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
{
|
{
|
||||||
print '<form name="update" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
dol_fiche_head($head, 'card', $langs->trans("FiscalYearCard"), 0, 'cron');
|
||||||
|
|
||||||
|
print '<form name="update" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
@ -252,7 +257,7 @@ else if ($id)
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
print '</div>';
|
dol_fiche_end();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -265,7 +270,9 @@ else if ($id)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
dol_fiche_head($head, 'card', $langs->trans("FiscalYearCard"), 0, 'cron');
|
||||||
|
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/fiscalyear.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/fiscalyear.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
@ -300,9 +307,9 @@ else if ($id)
|
|||||||
// Statut
|
// Statut
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="2">'.$object->getLibStatut(4).'</td></tr>';
|
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="2">'.$object->getLibStatut(4).'</td></tr>';
|
||||||
|
|
||||||
print "</table><br>";
|
print "</table>";
|
||||||
|
|
||||||
print '</div>';
|
dol_fiche_end();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Barre d'actions
|
* Barre d'actions
|
||||||
@ -16,11 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/admin/fiscalyear_card.php
|
* \file htdocs/accountancy/admin/fiscalyear_card.php
|
||||||
* \brief Page to show info of a fiscal year
|
* \brief Page to show info of a fiscal year
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
@ -34,7 +34,7 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
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/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php');
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||||
|
|||||||
@ -88,7 +88,7 @@ class Fiscalyear
|
|||||||
$sql.= ") VALUES (";
|
$sql.= ") VALUES (";
|
||||||
$sql.= " '".$this->label."'";
|
$sql.= " '".$this->label."'";
|
||||||
$sql.= ", '".$this->db->idate($this->date_start)."'";
|
$sql.= ", '".$this->db->idate($this->date_start)."'";
|
||||||
$sql.= ", '".$this->db->idate($this->date_end)."'";
|
$sql.= ", ".($this->date_end ? "'".$this->db->idate($this->date_end)."'":"null");
|
||||||
$sql.= ", ".$this->statut;
|
$sql.= ", ".$this->statut;
|
||||||
$sql.= ", ".$conf->entity;
|
$sql.= ", ".$conf->entity;
|
||||||
$sql.= ", '".$this->db->idate($now)."'";
|
$sql.= ", '".$this->db->idate($now)."'";
|
||||||
@ -109,14 +109,14 @@ class Fiscalyear
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->lasterror();
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error()." sql=".$sql;
|
$this->error=$this->db->lasterror()." sql=".$sql;
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -141,12 +141,12 @@ class Fiscalyear
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_fiscalyear ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_fiscalyear";
|
||||||
$sql .= " SET label = '".$this->label."'";
|
$sql .= " SET label = '".$this->label."'";
|
||||||
$sql .= ", date_start = '".$this->db->idate($this->date_start)."'";
|
$sql .= ", date_start = '".$this->db->idate($this->date_start)."'";
|
||||||
$sql .= ", date_end = '".$this->db->idate($this->date_end)."'";
|
$sql .= ", date_end = ".($this->date_end ? "'".$this->db->idate($this->date_end)."'" : "null");
|
||||||
$sql .= ", statut = '".$this->statut."'";
|
$sql .= ", statut = '".$this->statut."'";
|
||||||
$sql .= ", datec = " . ($this->datec != '' ? $this->db->idate($this->datec) : 'null');
|
$sql .= ", datec = " . ($this->datec != '' ? "'".$this->db->idate($this->datec)."'" : 'null');
|
||||||
$sql .= ", fk_user_modif = " . $user->id;
|
$sql .= ", fk_user_modif = " . $user->id;
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
@ -160,6 +160,7 @@ class Fiscalyear
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
|
dol_syslog($this->error, LOG_ERR);
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -194,7 +195,7 @@ class Fiscalyear
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->lasterror();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -220,7 +221,7 @@ class Fiscalyear
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->lasterror();
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@ function fiscalyear_prepare_head($object)
|
|||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT . '/admin/fiscalyear_card.php?id=' . $object->id;
|
$head[$h][0] = DOL_URL_ROOT . '/accountancy/admin/fiscalyear_card.php?id=' . $object->id;
|
||||||
$head[$h][1] = $langs->trans("Card");
|
$head[$h][1] = $langs->trans("Card");
|
||||||
$head[$h][2] = 'card';
|
$head[$h][2] = 'card';
|
||||||
$h++;
|
$h++;
|
||||||
@ -45,7 +45,7 @@ function fiscalyear_prepare_head($object)
|
|||||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'fiscalyear');
|
complete_head_from_modules($conf,$langs,$object,$head,$h,'fiscalyear');
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT . '/admin/fiscalyear_info.php?id=' . $object->id;
|
$head[$h][0] = DOL_URL_ROOT . '/accountancy/admin/fiscalyear_info.php?id=' . $object->id;
|
||||||
$head[$h][1] = $langs->trans("Info");
|
$head[$h][1] = $langs->trans("Info");
|
||||||
$head[$h][2] = 'info';
|
$head[$h][2] = 'info';
|
||||||
$h++;
|
$h++;
|
||||||
|
|||||||
@ -501,7 +501,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
$newmenu->add("/admin/modules.php?mainmenu=home", $langs->trans("Modules").$warnpicto,1);
|
$newmenu->add("/admin/modules.php?mainmenu=home", $langs->trans("Modules").$warnpicto,1);
|
||||||
$newmenu->add("/admin/menus.php?mainmenu=home", $langs->trans("Menus"),1);
|
$newmenu->add("/admin/menus.php?mainmenu=home", $langs->trans("Menus"),1);
|
||||||
$newmenu->add("/admin/ihm.php?mainmenu=home", $langs->trans("GUISetup"),1);
|
$newmenu->add("/admin/ihm.php?mainmenu=home", $langs->trans("GUISetup"),1);
|
||||||
$newmenu->add("/admin/fiscalyear.php?mainmenu=home", $langs->trans("Fiscalyear"),1);
|
|
||||||
if (! in_array($langs->defaultlang,array('en_US','en_GB','en_NZ','en_AU','fr_FR','fr_BE','es_ES','ca_ES')))
|
if (! in_array($langs->defaultlang,array('en_US','en_GB','en_NZ','en_AU','fr_FR','fr_BE','es_ES','ca_ES')))
|
||||||
{
|
{
|
||||||
if (empty($leftmenu) || $leftmenu=="setup") $newmenu->add("/admin/translation.php", $langs->trans("Translation"),1);
|
if (empty($leftmenu) || $leftmenu=="setup") $newmenu->add("/admin/translation.php", $langs->trans("Translation"),1);
|
||||||
@ -875,6 +874,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
$newmenu->add("/accountancy/bookkeeping/list.php?leftmenu=bookkeeping",$langs->trans("Bookkeeping"),0,$user->rights->accounting->mouvements->lire, '', $mainmenu, 'bookeeping');
|
$newmenu->add("/accountancy/bookkeeping/list.php?leftmenu=bookkeeping",$langs->trans("Bookkeeping"),0,$user->rights->accounting->mouvements->lire, '', $mainmenu, 'bookeeping');
|
||||||
if (empty($leftmenu) || $leftmenu=="bookeeping") $newmenu->add("/accountancy/bookkeeping/listbyyear.php",$langs->trans("ByYear"),1,$user->rights->accounting->mouvements->lire);
|
if (empty($leftmenu) || $leftmenu=="bookeeping") $newmenu->add("/accountancy/bookkeeping/listbyyear.php",$langs->trans("ByYear"),1,$user->rights->accounting->mouvements->lire);
|
||||||
if (empty($leftmenu) || $leftmenu=="bookeeping") $newmenu->add("/accountancy/bookkeeping/balancebymonth.php.php",$langs->trans("AccountBalanceByMonth"),1,$user->rights->accounting->mouvements->lire);
|
if (empty($leftmenu) || $leftmenu=="bookeeping") $newmenu->add("/accountancy/bookkeeping/balancebymonth.php.php",$langs->trans("AccountBalanceByMonth"),1,$user->rights->accounting->mouvements->lire);
|
||||||
|
|
||||||
|
$newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy", $langs->trans("Fiscalyear"),0,$user->rights->accounting->close, '', $mainmenu, 'fiscalyear');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rapports
|
// Rapports
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file accountingex/core/modules/modAccountingExpert.class.php
|
* \file accountingex/core/modules/modAccounting.class.php
|
||||||
* \ingroup Accounting Expert
|
* \ingroup Accounting Expert
|
||||||
* \brief Module to activate Accounting Expert module
|
* \brief Module to activate Accounting Expert module
|
||||||
*/
|
*/
|
||||||
@ -46,7 +46,7 @@ class modAccounting extends DolibarrModules
|
|||||||
$this->family = "financial";
|
$this->family = "financial";
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Advanced manage of accounting";
|
$this->description = "Advanced accounting management";
|
||||||
|
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
|
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
|
||||||
$this->version = 'development';
|
$this->version = 'development';
|
||||||
@ -59,119 +59,109 @@ class modAccounting extends DolibarrModules
|
|||||||
// $this->triggers = 1;
|
// $this->triggers = 1;
|
||||||
|
|
||||||
// Data directories to create when module is enabled
|
// Data directories to create when module is enabled
|
||||||
$this->dirs = array (
|
$this->dirs = array('/accounting/temp');
|
||||||
'/accountingex/temp'
|
|
||||||
);
|
|
||||||
|
|
||||||
// Config pages
|
// Config pages
|
||||||
$this->config_page_url = array('index.php@accountancy');
|
$this->config_page_url = array('index.php@accountancy');
|
||||||
|
|
||||||
// Dependencies
|
// Dependencies
|
||||||
$this->depends = array ("modFacture","modBanque","modTax"); // List of modules id that must be enabled if this module is enabled
|
$this->depends = array("modFacture","modBanque","modTax"); // List of modules id that must be enabled if this module is enabled
|
||||||
$this->requiredby = array (); // List of modules id to disable if this one is disabled
|
$this->requiredby = array(); // List of modules id to disable if this one is disabled
|
||||||
$this->conflictwith = array ("modComptabilite"); // List of modules are in conflict with this module
|
$this->conflictwith = array("modComptabilite"); // List of modules are in conflict with this module
|
||||||
$this->phpmin = array (
|
$this->phpmin = array(5, 2); // Minimum version of PHP required by module
|
||||||
5,
|
$this->need_dolibarr_version = array(3, 6); // Minimum version of Dolibarr required by module
|
||||||
2
|
$this->langfiles = array("accountancy");
|
||||||
); // Minimum version of PHP required by module
|
|
||||||
$this->need_dolibarr_version = array (
|
|
||||||
3,
|
|
||||||
6
|
|
||||||
); // Minimum version of Dolibarr required by module
|
|
||||||
$this->langfiles = array (
|
|
||||||
"accountancy"
|
|
||||||
);
|
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
$this->const = array ();
|
$this->const = array();
|
||||||
$this->const[1] = array (
|
$this->const[1] = array(
|
||||||
"MAIN_COMPANY_CODE_ALWAYS_REQUIRED",
|
"MAIN_COMPANY_CODE_ALWAYS_REQUIRED",
|
||||||
"chaine",
|
"chaine",
|
||||||
"1",
|
"1",
|
||||||
"With this constants on, third party code is always required whatever is numbering module behaviour"
|
"With this constants on, third party code is always required whatever is numbering module behaviour"
|
||||||
);
|
);
|
||||||
$this->const[2] = array (
|
$this->const[2] = array(
|
||||||
"MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED",
|
"MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED",
|
||||||
"chaine",
|
"chaine",
|
||||||
"1",
|
"1",
|
||||||
"With this constants on, bank account number is always required"
|
"With this constants on, bank account number is always required"
|
||||||
);
|
);
|
||||||
$this->const[1] = array (
|
$this->const[1] = array(
|
||||||
"ACCOUNTING_SEPARATORCSV",
|
"ACCOUNTING_SEPARATORCSV",
|
||||||
"string",
|
"string",
|
||||||
","
|
","
|
||||||
);
|
);
|
||||||
$this->const[2] = array (
|
$this->const[2] = array(
|
||||||
"ACCOUNTING_ACCOUNT_SUSPENSE",
|
"ACCOUNTING_ACCOUNT_SUSPENSE",
|
||||||
"chaine",
|
"chaine",
|
||||||
"471"
|
"471"
|
||||||
);
|
);
|
||||||
$this->const[3] = array (
|
$this->const[3] = array(
|
||||||
"ACCOUNTING_SELL_JOURNAL",
|
"ACCOUNTING_SELL_JOURNAL",
|
||||||
"chaine",
|
"chaine",
|
||||||
"VTE"
|
"VTE"
|
||||||
);
|
);
|
||||||
$this->const[4] = array (
|
$this->const[4] = array(
|
||||||
"ACCOUNTING_PURCHASE_JOURNAL",
|
"ACCOUNTING_PURCHASE_JOURNAL",
|
||||||
"chaine",
|
"chaine",
|
||||||
"ACH"
|
"ACH"
|
||||||
);
|
);
|
||||||
$this->const[5] = array (
|
$this->const[5] = array(
|
||||||
"ACCOUNTING_SOCIAL_JOURNAL",
|
"ACCOUNTING_SOCIAL_JOURNAL",
|
||||||
"chaine",
|
"chaine",
|
||||||
"SOC"
|
"SOC"
|
||||||
);
|
);
|
||||||
$this->const[6] = array (
|
$this->const[6] = array(
|
||||||
"ACCOUNTING_CASH_JOURNAL",
|
"ACCOUNTING_CASH_JOURNAL",
|
||||||
"chaine",
|
"chaine",
|
||||||
"CAI"
|
"CAI"
|
||||||
);
|
);
|
||||||
$this->const[7] = array (
|
$this->const[7] = array(
|
||||||
"ACCOUNTING_MISCELLANEOUS_JOURNAL",
|
"ACCOUNTING_MISCELLANEOUS_JOURNAL",
|
||||||
"chaine",
|
"chaine",
|
||||||
"OD"
|
"OD"
|
||||||
);
|
);
|
||||||
$this->const[8] = array (
|
$this->const[8] = array(
|
||||||
"ACCOUNTING_BANK_JOURNAL",
|
"ACCOUNTING_BANK_JOURNAL",
|
||||||
"chaine",
|
"chaine",
|
||||||
"BQ"
|
"BQ"
|
||||||
); // Deprecated Move into llx_bank_account
|
); // Deprecated Move into llx_bank_account
|
||||||
$this->const[9] = array (
|
$this->const[9] = array(
|
||||||
"ACCOUNTING_ACCOUNT_TRANSFER_CASH",
|
"ACCOUNTING_ACCOUNT_TRANSFER_CASH",
|
||||||
"chaine",
|
"chaine",
|
||||||
"58"
|
"58"
|
||||||
);
|
);
|
||||||
$this->const[10] = array (
|
$this->const[10] = array(
|
||||||
"CHARTOFACCOUNTS",
|
"CHARTOFACCOUNTS",
|
||||||
"chaine",
|
"chaine",
|
||||||
"2"
|
"2"
|
||||||
);
|
);
|
||||||
$this->const[11] = array (
|
$this->const[11] = array(
|
||||||
"ACCOUNTING_MODELCSV",
|
"ACCOUNTING_MODELCSV",
|
||||||
"chaine",
|
"chaine",
|
||||||
"0"
|
"0"
|
||||||
);
|
);
|
||||||
$this->const[12] = array (
|
$this->const[12] = array(
|
||||||
"ACCOUNTING_LENGTH_GACCOUNT",
|
"ACCOUNTING_LENGTH_GACCOUNT",
|
||||||
"chaine",
|
"chaine",
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
$this->const[13] = array (
|
$this->const[13] = array(
|
||||||
"ACCOUNTING_LENGTH_AACCOUNT",
|
"ACCOUNTING_LENGTH_AACCOUNT",
|
||||||
"chaine",
|
"chaine",
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
$this->const[14] = array (
|
$this->const[14] = array(
|
||||||
"ACCOUNTING_LIMIT_LIST_VENTILATION",
|
"ACCOUNTING_LIMIT_LIST_VENTILATION",
|
||||||
"chaine",
|
"chaine",
|
||||||
"50"
|
"50"
|
||||||
);
|
);
|
||||||
$this->const[15] = array (
|
$this->const[15] = array(
|
||||||
"ACCOUNTING_LIST_SORT_VENTILATION_TODO",
|
"ACCOUNTING_LIST_SORT_VENTILATION_TODO",
|
||||||
"yesno",
|
"yesno",
|
||||||
"1"
|
"1"
|
||||||
);
|
);
|
||||||
$this->const[16] = array (
|
$this->const[16] = array(
|
||||||
"ACCOUNTING_LIST_SORT_VENTILATION_DONE",
|
"ACCOUNTING_LIST_SORT_VENTILATION_DONE",
|
||||||
"yesno",
|
"yesno",
|
||||||
"1"
|
"1"
|
||||||
@ -181,18 +171,18 @@ class modAccounting extends DolibarrModules
|
|||||||
$this->tabs = array();
|
$this->tabs = array();
|
||||||
|
|
||||||
// Css
|
// Css
|
||||||
$this->module_parts = array ();
|
$this->module_parts = array();
|
||||||
|
|
||||||
// Boxes
|
// Boxes
|
||||||
$this->boxes = array ();
|
$this->boxes = array();
|
||||||
|
|
||||||
// Permissions
|
// Permissions
|
||||||
$this->rights_class = 'accounting';
|
$this->rights_class = 'accounting';
|
||||||
|
|
||||||
$this->rights = array (); // Permission array used by this module
|
$this->rights = array(); // Permission array used by this module
|
||||||
$r = 0;
|
$r = 0;
|
||||||
|
|
||||||
$this->rights[$r][0] = 50401;
|
$this->rights[$r][0] = 50401; // TODO Goal of this permission compared to others ???
|
||||||
$this->rights[$r][1] = 'Access_accountancy';
|
$this->rights[$r][1] = 'Access_accountancy';
|
||||||
$this->rights[$r][2] = 'r';
|
$this->rights[$r][2] = 'r';
|
||||||
$this->rights[$r][3] = 0;
|
$this->rights[$r][3] = 0;
|
||||||
@ -240,8 +230,16 @@ class modAccounting extends DolibarrModules
|
|||||||
$this->rights[$r][5] = 'lire';
|
$this->rights[$r][5] = 'lire';
|
||||||
$r++;
|
$r++;
|
||||||
|
|
||||||
|
$this->rights[$r][0] = 50430;
|
||||||
|
$this->rights[$r][1] = 'Define and close a fiscal year';
|
||||||
|
$this->rights[$r][2] = 'r';
|
||||||
|
$this->rights[$r][3] = 0;
|
||||||
|
$this->rights[$r][4] = 'fiscalyear';
|
||||||
|
$this->rights[$r][5] = '';
|
||||||
|
$r++;
|
||||||
|
|
||||||
// Main menu entries
|
// Main menu entries
|
||||||
$this->menus = array ();
|
$this->menus = array();
|
||||||
$r = 0;
|
$r = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user