New: Ajout permission ddi pourpermettre le rapprochement bancaire sans permettre la saisie libre d'criture bancaire

This commit is contained in:
Laurent Destailleur 2007-05-27 19:17:34 +00:00
parent ad62fe4dc8
commit 5996cd5576
5 changed files with 104 additions and 64 deletions

View File

@ -559,20 +559,21 @@ if ($account > 0)
}
else
{
if ($user->rights->banque->modifier)
print '<td align="center">';
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
{
print '<td align="center">';
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$acct->id.'&amp;page='.$page.'">';
print img_edit();
print '</a> &nbsp;';
print '</a>';
}
print '&nbsp;';
if ($user->rights->banque->modifier)
{
print '<a href="'.DOL_URL_ROOT.'/compta/bank/account.php?action=delete&amp;rowid='.$objp->rowid.'&amp;account='.$acct->id.'&amp;page='.$page.'">';
print img_delete();
print '</a></td>';
}
else
{
print "<td align=\"center\">&nbsp;</td>";
print '</a>';
}
print '</td>';
}
print "</tr>";
@ -609,15 +610,26 @@ if ($account > 0)
{
print '<div class="tabsAction">';
if ($user->rights->banque->modifier && $acct->type != 2 && $acct->rappro) // Si non compte cash et rapprochable
if ($acct->type != 2 && $acct->rappro) // Si non compte cash et rapprochable
{
print '<a class="butAction" href="rappro.php?account='.$acct->id.'">'.$langs->trans("Conciliate").'</a>';
if ($user->rights->banque->consolidate)
{
print '<a class="butAction" href="rappro.php?account='.$acct->id.'">'.$langs->trans("Conciliate").'</a>';
}
else
{
print '<font class="butActionRefused">'.$langs->trans("Conciliate").'</font>';
}
}
if ($user->rights->banque->modifier)
{
print '<a class="butAction" href="account.php?action=addline&amp;account='.$acct->id.'&amp;page='.$page.'">'.$langs->trans("AddBankRecord").'</a>';
}
else
{
print '<font class="butActionRefused">'.$langs->trans("AddBankRecord").'</font>';
}
print '</div>';
}

View File

@ -31,7 +31,7 @@
require("./pre.inc.php");
if (!$user->rights->banque->modifier)
if (!$user->rights->banque->modifier && !$user->rights->banque->consolidate)
accessforbidden();
$langs->load("banks");

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -30,17 +30,18 @@
require("./pre.inc.php");
$langs->load("banks");
$langs->load("bills");
$user->getrights('compta');
if (! $user->rights->banque->modifier) accessforbidden();
if (! $user->rights->banque->consolidate) accessforbidden();
/*
* Action rapprochement
*/
if ($_POST["action"] == 'rappro')
if ($user->rights->banque->consolidate && $_POST["action"] == 'rappro')
{
// Definition, nettoyage parametres
$valrappro=1;
@ -232,6 +233,22 @@ if ($resql)
print '</a>';
$newline=0;
}
elseif ($links[$key]['type']=='payment_supplier') {
print '<a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$links[$key]['url_id'].'">';
if (eregi('^\((.*)\)$',$links[$key]['label'],$reg))
{
// Label générique car entre parenthèses. On l'affiche en le traduisant
if ($reg[1]=='paiement') $reg[1]='Payment';
print img_object($langs->trans('ShowPayment'),'payment').' ';
print $langs->trans($reg[1]);
}
else
{
print $links[$key]['label'];
}
print '</a>';
$newline=0;
}
elseif ($links[$key]['type']=='company') {
print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowCustomer'),'company').' ';

View File

@ -45,66 +45,73 @@ class modBanque extends DolibarrModules
* \brief Constructeur. Definit les noms, constantes et boites
* \param DB handler d'accès base
*/
function modBanque($DB)
{
$this->db = $DB ;
$this->id = 'banque'; // Same value xxx than in file modXxx.class.php file
$this->numero = 85 ;
function modBanque($DB)
{
$this->db = $DB ;
$this->id = 'banque'; // Same value xxx than in file modXxx.class.php file
$this->numero = 85 ;
$this->family = "financial";
$this->name = "Banque";
$this->description = "Gestion des comptes financiers de type Comptes bancaires ou postaux";
$this->family = "financial";
$this->name = "Banque";
$this->description = "Gestion des comptes financiers de type Comptes bancaires ou postaux";
$this->revision = explode(' ','$Revision$');
$this->version = $this->revision[1];
$this->revision = explode(' ','$Revision$');
$this->version = $this->revision[1];
$this->const_name = 'MAIN_MODULE_BANQUE';
$this->special = 0;
$this->picto='account';
$this->const_name = 'MAIN_MODULE_BANQUE';
$this->special = 0;
$this->picto='account';
// Dépendances
$this->depends = array();
$this->requiredby = array("modComptabilite","modComptabiliteExpert");
$this->conflictwith = array();
$this->langfiles = array("banks");
// Constantes
$this->const = array();
// Dépendances
$this->depends = array();
$this->requiredby = array("modComptabilite","modComptabiliteExpert");
$this->conflictwith = array();
$this->langfiles = array("banks");
// Constantes
$this->const = array();
$this->dirs = array();
$this->dirs = array();
// Boites
$this->boxes = array();
// Boites
$this->boxes = array();
$this->boxes[0][0] = "Soldes Comptes Bancaires";
$this->boxes[0][1] = "box_comptes.php";
$this->boxes[0][0] = "Soldes Comptes Bancaires";
$this->boxes[0][1] = "box_comptes.php";
// Permissions
$this->rights = array();
$this->rights_class = 'banque';
$r=0;
$r++;
$this->rights[$r][0] = 111; // id de la permission
$this->rights[$r][1] = 'Lire les comptes bancaires'; // libelle de la permission
$this->rights[$r][2] = 'a'; // type de la permission (déprécié à ce jour)
$this->rights[$r][3] = 1; // La permission est-elle une permission par défaut
$this->rights[$r][4] = 'lire';
// Permissions
$this->rights = array();
$this->rights_class = 'banque';
$r=0;
$r++;
$this->rights[$r][0] = 111; // id de la permission
$this->rights[$r][1] = 'Lire les comptes bancaires'; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (déprécié à ce jour)
$this->rights[$r][3] = 1; // La permission est-elle une permission par défaut
$this->rights[$r][4] = 'lire';
$r++;
$this->rights[$r][0] = 112; // id de la permission
$this->rights[$r][1] = 'Créer modifier rapprocher transactions'; // libelle de la permission
$this->rights[$r][2] = 'a'; // type de la permission (déprécié à ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par défaut
$this->rights[$r][4] = 'modifier';
$r++;
$this->rights[$r][0] = 112; // id de la permission
$this->rights[$r][1] = 'Créer/modifier/supprimer écriture bancaire'; // libelle de la permission
$this->rights[$r][2] = 'w'; // type de la permission (déprécié à ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par défaut
$this->rights[$r][4] = 'modifier';
$r++;
$this->rights[$r][0] = 113; // id de la permission
$this->rights[$r][1] = 'Configurer les comptes bancaires (créer, gérer catégories)'; // libelle de la permission
$this->rights[$r][2] = 'a'; // type de la permission (déprécié à ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par défaut
$this->rights[$r][4] = 'configurer';
}
$r++;
$this->rights[$r][0] = 113; // id de la permission
$this->rights[$r][1] = 'Configurer les comptes bancaires (créer, gérer catégories)'; // libelle de la permission
$this->rights[$r][2] = 'a'; // type de la permission (déprécié à ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par défaut
$this->rights[$r][4] = 'configurer';
$r++;
$this->rights[$r][0] = 114; // id de la permission
$this->rights[$r][1] = 'Rapprocher transactions'; // libelle de la permission
$this->rights[$r][2] = 'w'; // type de la permission (déprécié à ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par défaut
$this->rights[$r][4] = 'consolidate';
}
/**

View File

@ -16,6 +16,10 @@ update llx_bank_url set type='payment_supplier' where (type='' or type is null)
alter table llx_bank_url modify `type` enum("?","company","payment","payment_supplier","member","subscription","donation","sc","payment_sc") NOT NULL;
insert into llx_rights_def (id, libelle, module, type, bydefault, subperms, perms) values (114,'Rapprocher transactions','banque','w',0,null,'consolidate');
update llx_rights_def set libelle='Créer/modifier/supprimer écriture bancaire' where perms='modifier' AND module='banque';
update llx_actioncomm set fk_action = 9 where fk_action = 10;
ALTER TABLE llx_cotisation ADD UNIQUE INDEX uk_cotisation (fk_adherent,dateadh);