Debug accountancy module. Page for bank journalization is still KO.

This commit is contained in:
Laurent Destailleur 2017-05-05 16:54:05 +02:00
parent 885a636351
commit fc5f4007a1
4 changed files with 27 additions and 10 deletions

View File

@ -61,6 +61,8 @@ if ($page == -1) { $page = 0 ; }
$offset = $listlimit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (empty($sortfield)) $sortfield='code';
if (empty($sortorder)) $sortorder='ASC';
$error = 0;
@ -125,7 +127,8 @@ complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,
// Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
$elementList = array();
$sourceList = array(
// Must match ids defined into eldy.lib.php
$sourceList = array(
'1' => $langs->trans('AccountingJournalType1'),
'2' => $langs->trans('AccountingJournalType2'),
'3' => $langs->trans('AccountingJournalType3'),

View File

@ -1007,8 +1007,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
// Multi journal
$sql = "SELECT rowid, code, label, nature";
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal";
// $sql.= " WHERE entity = ".$conf->entity;
$sql.= " ORDER BY code";
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " ORDER BY nature";
$resql = $db->query($sql);
if ($resql)
@ -1021,14 +1021,25 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
while ($i < $numr)
{
$objp = $db->fetch_object($resql);
if ($objp->nature == 1) $nature="sells";
if ($objp->nature == 2) $nature="purchases";
if ($objp->nature == 3) $nature="bank";
if ($objp->nature == 4) $nature="various";
$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 == 1) $nature="various";
if ($objp->nature == 9) $nature="hasnew";
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&code_journal='.$objp->code,dol_trunc($objp->label,25),2,$user->rights->accounting->comptarapport->lire);
// To enable when page exists
if (empty($conf->global->MAIN_FEATURES_LEVEL))
{
if ($nature == 'various' || $nature == 'hasnew') $nature='';
}
if ($nature)
{
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&code_journal='.$objp->code,dol_trunc($objp->label,25),2,$user->rights->accounting->comptarapport->lire);
}
$i++;
}
}

View File

@ -120,6 +120,8 @@ INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (
INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (4,'OD', 'Journal des opérations diverses', 0, 1);
INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (5,'AN', 'Journal des à-nouveaux', 9, 1);
ALTER TABLE llx_accounting_journal ADD COLUMN entity integer DEFAULT 1;
ALTER TABLE llx_paiementfourn ADD COLUMN model_pdf varchar(255);

View File

@ -20,6 +20,7 @@
create table llx_accounting_journal
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1,
code varchar(32) NOT NULL,
label varchar(128) NOT NULL,
nature smallint DEFAULT 0 NOT NULL, -- type of journals (1:various operations / 2:sale / 3:purchase / 4:bank / 9: has-new)