New: Add conciliate feature into menu

This commit is contained in:
Laurent Destailleur 2010-12-05 20:34:34 +00:00
parent ad19fc1ca9
commit 3aa7d0bb45
3 changed files with 13 additions and 9 deletions

View File

@ -719,11 +719,11 @@ if ($account || $_GET["ref"])
{ {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($acct->type != 2 && $acct->rappro) // Si non compte cash et rapprochable if ($acct->type != 2 && $acct->rappro) // If not cash account and can be reconciliate
{ {
if ($user->rights->banque->consolidate) if ($user->rights->banque->consolidate)
{ {
print '<a class="butAction" href="rappro.php?account='.$acct->id.'">'.$langs->trans("Conciliate").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$acct->id.'">'.$langs->trans("Conciliate").'</a>';
} }
else else
{ {

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copytight (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copytight (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -56,7 +56,7 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
// Entry for each bank account // Entry for each bank account
if ($user->rights->banque->lire) if ($user->rights->banque->lire)
{ {
$sql = "SELECT rowid, label, courant"; $sql = "SELECT rowid, label, courant, rappro, courant";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE entity = ".$conf->entity; $sql.= " WHERE entity = ".$conf->entity;
$sql.= " AND clos = 0"; $sql.= " AND clos = 0";
@ -73,6 +73,10 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/fiche.php?id=".$objp->rowid,$objp->label,1,$user->rights->banque->lire); $menu->add_submenu(DOL_URL_ROOT."/compta/bank/fiche.php?id=".$objp->rowid,$objp->label,1,$user->rights->banque->lire);
if ($objp->rappro && $objp->courant != 2) // If not cash account and can be reconciliate
{
$menu->add_submenu(DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
}
/* /*
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/annuel.php?account=".$objp->rowid ,$langs->trans("IOMonthlyReporting")); $menu->add_submenu(DOL_URL_ROOT."/compta/bank/annuel.php?account=".$objp->rowid ,$langs->trans("IOMonthlyReporting"));
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/graph.php?account=".$objp->rowid ,$langs->trans("Graph")); $menu->add_submenu(DOL_URL_ROOT."/compta/bank/graph.php?account=".$objp->rowid ,$langs->trans("Graph"));
@ -81,6 +85,7 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
$i++; $i++;
} }
} }
else dol_print_error($db);
$db->free($resql); $db->free($resql);
} }

View File

@ -143,15 +143,14 @@ if ($resql)
$var=True; $var=True;
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
print_titre($langs->trans("Reconciliation").': <a href="account.php?account='.$_GET["account"].'">'.$acct->label.'</a>'); print_fiche_titre($langs->trans("Reconciliation").': <a href="account.php?account='.$_GET["account"].'">'.$acct->label.'</a>');
print '<br>'; print '<br>';
if ($mesg) print $mesg."<br>"; if ($mesg) print $mesg."<br>";
// Affiche nom des derniers releves // Show last bank receipts
$nbmax=5; $nbmax=5;
$liste=""; $liste="";
$sql = "SELECT distinct num_releve FROM ".MAIN_DB_PREFIX."bank"; $sql = "SELECT distinct num_releve FROM ".MAIN_DB_PREFIX."bank";
$sql.= " WHERE fk_account=".$_GET["account"]; $sql.= " WHERE fk_account=".$_GET["account"];
$sql.= " ORDER BY num_releve DESC"; $sql.= " ORDER BY num_releve DESC";
@ -169,9 +168,9 @@ if ($resql)
$i++; $i++;
$liste='<a href="releve.php?account='.$_GET["account"].'&amp;num='.$objr->num_releve.'">'.$objr->num_releve.'</a> &nbsp; '.$liste; $liste='<a href="releve.php?account='.$_GET["account"].'&amp;num='.$objr->num_releve.'">'.$objr->num_releve.'</a> &nbsp; '.$liste;
} }
if ($num >= $nbmax) $liste="... &nbsp; ".$liste; if ($numr >= $nbmax) $liste="... &nbsp; ".$liste;
print $liste; print $liste;
if ($num > 0) print '<br><br>'; if ($numr > 0) print '<br><br>';
else print $langs->trans("None").'<br><br>'; else print $langs->trans("None").'<br><br>';
} }
else else