forked from Wavyzz/dolibarr
New: Ajout onglet info sur fiche ecriture bancaire
This commit is contained in:
@@ -55,7 +55,9 @@ class Account
|
|||||||
var $adresse_proprio;
|
var $adresse_proprio;
|
||||||
var $type_lib=array();
|
var $type_lib=array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur
|
||||||
|
*/
|
||||||
function Account($DB, $rowid=0)
|
function Account($DB, $rowid=0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -327,7 +329,8 @@ class Account
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* \brief Charge en memoire depuis la base le compte
|
* \brief Charge en memoire depuis la base le compte
|
||||||
|
* \param id Id du compte <20> r<>cup<75>rer
|
||||||
*/
|
*/
|
||||||
function fetch($id)
|
function fetch($id)
|
||||||
{
|
{
|
||||||
@@ -531,4 +534,113 @@ class Account
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class AccountLine
|
||||||
|
{
|
||||||
|
var $db;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur
|
||||||
|
*/
|
||||||
|
function AccountLine($DB, $rowid=0)
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
$this->db = $DB;
|
||||||
|
$this->rowid = $rowid;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Charge en memoire depuis la base, une ecriture sur le compte
|
||||||
|
* \param id Id de la ligne <20>criture <20> r<>cup<75>rer
|
||||||
|
*/
|
||||||
|
function fetch($rowid)
|
||||||
|
{
|
||||||
|
$sql = "SELECT datec, datev, dateo, amount, label, fk_user_author, fk_user_rappro,";
|
||||||
|
$sql.= " fk_type, num_releve, num_chq, rappro, note";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank";
|
||||||
|
$sql.= " WHERE rowid = ".$rowid;
|
||||||
|
|
||||||
|
$result = $this->db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
if ($this->db->num_rows($result))
|
||||||
|
{
|
||||||
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
|
$this->rowid = $rowid;
|
||||||
|
$this->ref = $rowid;
|
||||||
|
|
||||||
|
$this->datec = $obj->datec;
|
||||||
|
$this->datev = $obj->datev;
|
||||||
|
$this->dateo = $obj->dateo;
|
||||||
|
$this->amount = $obj->amount;
|
||||||
|
$this->label = $obj->label;
|
||||||
|
$this->note = $obj->note;
|
||||||
|
|
||||||
|
$this->fk_user_author = $obj->fk_user_author;
|
||||||
|
$this->fk_user_rappro = $obj->fk_user_rappro;
|
||||||
|
|
||||||
|
$this->fk_type = $obj->fk_type;
|
||||||
|
$this->num_releve = $obj->num_releve;
|
||||||
|
$this->num_chq = $obj->num_chq;
|
||||||
|
|
||||||
|
$this->rappro = $obj->rappro;
|
||||||
|
}
|
||||||
|
$this->db->free($result);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dolibarr_print_error($this->db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Charge les informations d'ordre info dans l'objet facture
|
||||||
|
* \param id Id de la facture a charger
|
||||||
|
*/
|
||||||
|
function info($rowid)
|
||||||
|
{
|
||||||
|
$sql = 'SELECT b.rowid, '.$this->db->pdate('datec').' as datec,';
|
||||||
|
$sql.= ' fk_user_author, fk_user_rappro';
|
||||||
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'bank as b';
|
||||||
|
$sql.= ' WHERE b.rowid = '.$rowid;
|
||||||
|
|
||||||
|
$result=$this->db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
if ($this->db->num_rows($result))
|
||||||
|
{
|
||||||
|
$obj = $this->db->fetch_object($result);
|
||||||
|
$this->id = $obj->rowid;
|
||||||
|
|
||||||
|
if ($obj->fk_user_author)
|
||||||
|
{
|
||||||
|
$cuser = new User($this->db, $obj->fk_user_author);
|
||||||
|
$cuser->fetch();
|
||||||
|
$this->user_creation = $cuser;
|
||||||
|
}
|
||||||
|
if ($obj->fk_user_rappro)
|
||||||
|
{
|
||||||
|
$ruser = new User($this->db, $obj->fk_user_rappro);
|
||||||
|
$ruser->fetch();
|
||||||
|
$this->user_rappro = $ruser;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->date_creation = $obj->datec;
|
||||||
|
//$this->date_rappro = $obj->daterappro; // \todo pas encore g<>r<EFBFBD>e
|
||||||
|
}
|
||||||
|
$this->db->free($result);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dolibarr_print_error($this->db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
|
||||||
if (!$user->rights->banque->lire)
|
if (!$user->rights->banque->lire)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
$account=isset($_GET["account"])?$_GET["account"]:$_POST["account"];
|
$account=isset($_GET["account"])?$_GET["account"]:$_POST["account"];
|
||||||
@@ -41,52 +41,46 @@ $action=isset($_GET["action"])?$_GET["action"]:$_POST["action"];
|
|||||||
$page=isset($_GET["page"])?$_GET["page"]:0;
|
$page=isset($_GET["page"])?$_GET["page"]:0;
|
||||||
|
|
||||||
if ($_POST["action"] == 'add' && $account && ! isset($_POST["cancel"]))
|
if ($_POST["action"] == 'add' && $account && ! isset($_POST["cancel"]))
|
||||||
{
|
{
|
||||||
|
if ($_POST["credit"] > 0)
|
||||||
if ($_POST["credit"] > 0)
|
|
||||||
{
|
{
|
||||||
$amount = $_POST["credit"];
|
$amount = $_POST["credit"];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$amount = - $_POST["debit"];
|
$amount = - $_POST["debit"];
|
||||||
}
|
}
|
||||||
|
|
||||||
$dateop = $_POST["dateoy"].$_POST["dateo"];
|
|
||||||
$operation=$_POST["operation"];
|
|
||||||
$label=$_POST["label"];
|
|
||||||
$operation=$_POST["operation"];
|
|
||||||
$num_chq=$_POST["num_chq"];
|
|
||||||
$cat1=$_POST["cat1"];
|
|
||||||
|
|
||||||
$acct=new Account($db,$account);
|
$dateop = $_POST["dateoy"].$_POST["dateo"];
|
||||||
|
$operation=$_POST["operation"];
|
||||||
|
$label=$_POST["label"];
|
||||||
|
$operation=$_POST["operation"];
|
||||||
|
$num_chq=$_POST["num_chq"];
|
||||||
|
$cat1=$_POST["cat1"];
|
||||||
|
|
||||||
$insertid = $acct->addline($dateop, $operation, $label, $amount, $num_chq, $cat1);
|
$acct=new Account($db,$account);
|
||||||
|
|
||||||
if ($insertid)
|
$insertid = $acct->addline($dateop, $operation, $label, $amount, $num_chq, $cat1);
|
||||||
|
|
||||||
|
if ($insertid)
|
||||||
{
|
{
|
||||||
Header("Location: account.php?account=" . $account);
|
Header("Location: account.php?account=" . $account);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($_GET["action"] == 'del' && $account && $user->rights->banque->modifier)
|
if ($_GET["action"] == 'del' && $account && $user->rights->banque->modifier)
|
||||||
{
|
{
|
||||||
$acct=new Account($db,$account);
|
$acct=new Account($db,$account);
|
||||||
$acct->deleteline($_GET["rowid"]);
|
$acct->deleteline($_GET["rowid"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************************
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
|
|
||||||
if ($account > 0)
|
if ($account > 0)
|
||||||
{
|
{
|
||||||
if ($vline)
|
if ($vline)
|
||||||
@@ -177,21 +171,21 @@ if ($account > 0)
|
|||||||
$limitsql = $nbline;
|
$limitsql = $nbline;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Formulaire de recherche
|
* Formulaire de recherche
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$mesg='';
|
$mesg='';
|
||||||
|
|
||||||
$nbpage=floor($total_lines/$viewline)+($total_lines % $viewline > 0?1:0); // Nombre de page total
|
$nbpage=floor($total_lines/$viewline)+($total_lines % $viewline > 0?1:0); // Nombre de page total
|
||||||
if ($limitsql > $viewline)
|
if ($limitsql > $viewline)
|
||||||
{
|
{
|
||||||
$mesg.='<a href="account.php?account='.$acct->id.'&page='.($page+1).'">'.img_previous().'</a>';
|
$mesg.='<a href="account.php?account='.$acct->id.'&page='.($page+1).'">'.img_previous().'</a>';
|
||||||
}
|
}
|
||||||
$mesg.= ' Page '.($nbpage-$page).'/'.$nbpage.' ';
|
$mesg.= ' Page '.($nbpage-$page).'/'.$nbpage.' ';
|
||||||
if ($total_lines > $limitsql )
|
if ($total_lines > $limitsql )
|
||||||
{
|
{
|
||||||
$mesg.= '<a href="account.php?account='.$acct->id.'&page='.($page-1).'">'.img_next().'</a>';
|
$mesg.= '<a href="account.php?account='.$acct->id.'&page='.($page-1).'">'.img_next().'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -249,7 +243,7 @@ if ($account > 0)
|
|||||||
print "<tr class=\"noborder\"><td colspan=\"8\"> </td></tr>\n";
|
print "<tr class=\"noborder\"><td colspan=\"8\"> </td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ligne de titre
|
// Ligne de titre tableau des acritures
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Value").'</td><td>'.$langs->trans("Type").'</td><td>'.$langs->trans("Description").'</td>';
|
print '<td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Value").'</td><td>'.$langs->trans("Type").'</td><td>'.$langs->trans("Description").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("Debit").'</td><td align="right">'.$langs->trans("Credit").'</td>';
|
print '<td align="right">'.$langs->trans("Debit").'</td><td align="right">'.$langs->trans("Credit").'</td>';
|
||||||
@@ -279,16 +273,11 @@ if ($account > 0)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type";
|
$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b ";
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||||
$sql .= " WHERE fk_account=".$acct->id;
|
$sql.= " WHERE fk_account=".$acct->id;
|
||||||
|
if ($req_debit) $sql .= " AND b.amount = -".$req_debit;
|
||||||
if ($req_debit)
|
if ($req_credit) $sql .= " AND b.amount = ".$req_credit;
|
||||||
{
|
$sql.= $sql_rech;
|
||||||
$sql .= " AND b.amount = -".$req_debit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql .= $sql_rech;
|
|
||||||
|
|
||||||
if ($vue)
|
if ($vue)
|
||||||
{
|
{
|
||||||
if ($vue == 'credit')
|
if ($vue == 'credit')
|
||||||
@@ -300,9 +289,8 @@ if ($account > 0)
|
|||||||
$sql .= " AND b.amount < 0 ";
|
$sql .= " AND b.amount < 0 ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$sql.= " ORDER BY b.datev ASC";
|
||||||
$sql .= " ORDER BY b.datev ASC";
|
$sql.= $db->plimit($limitsql, 0);
|
||||||
$sql .= $db->plimit($limitsql, 0);
|
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@@ -405,9 +393,16 @@ function _print_lines($db,$result,$sql,$acct)
|
|||||||
{
|
{
|
||||||
print ' - ';
|
print ' - ';
|
||||||
print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
|
print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
|
||||||
// if ($links[$key]['type']=='payment') { print img_object($langs->trans('ShowPayment'),'payment').' '; }
|
if ($links[$key]['type']=='payment') {
|
||||||
// if ($links[$key]['type']=='company') { print img_object($langs->trans('ShowCustomer'),'company').' '; }
|
//print img_object($langs->trans('ShowPayment'),'payment').' ';
|
||||||
print $links[$key]['label'].'</a>';
|
print $langs->trans("Payment");
|
||||||
|
}
|
||||||
|
else if ($links[$key]['type']=='company') {
|
||||||
|
//print img_object($langs->trans('ShowCustomer'),'company').' ';
|
||||||
|
print $links[$key]['label'];
|
||||||
|
}
|
||||||
|
else print $links[$key]['label'];
|
||||||
|
print '</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ llxHeader();
|
|||||||
print_titre($langs->trans("AccountSetup"));
|
print_titre($langs->trans("AccountSetup"));
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print "<tr class=\"liste_titre\">";
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Ref")."</td><td>".$langs->trans("Label")."</td><td>".$langs->trans("Type")."</td><td>".$langs->trans("Bank").'</td>';
|
print '<td>'.$langs->trans("Ref")."</td><td>".$langs->trans("Type")."</td><td>".$langs->trans("Bank").'</td>';
|
||||||
print '<td align="left">'.$langs->trans("AccountIdShort").'</a></td>';
|
print '<td align="left">'.$langs->trans("AccountIdShort").'</a></td>';
|
||||||
print '<td align="center">'.$langs->trans("Conciliable").'</a></td>';
|
print '<td align="center">'.$langs->trans("Conciliable").'</a></td>';
|
||||||
print '<td align="center">'.$langs->trans("Status").'</a></td>';
|
print '<td align="center">'.$langs->trans("Status").'</a></td>';
|
||||||
@@ -65,7 +65,7 @@ if ($result)
|
|||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]><td>$objp->rowid</td><td><a href=\"fiche.php?id=$objp->rowid\">$objp->label</a></td>";
|
print '<tr '.$bc[$var].'><td><a href="fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowAccount"),'account').' '.$objp->label.'</td>';
|
||||||
print '<td>'.$account->type_lib[$objp->type].'</td>';
|
print '<td>'.$account->type_lib[$objp->type].'</td>';
|
||||||
print '<td>'.$objp->bank.' </td><td>'.$objp->number.' </td>';
|
print '<td>'.$objp->bank.' </td><td>'.$objp->number.' </td>';
|
||||||
print '<td align="center">'.yn($objp->rappro).'</td>';
|
print '<td align="center">'.yn($objp->rappro).'</td>';
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
$solde = $acc->solde();
|
$solde = $acc->solde();
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'><td width="30%">';
|
print '<tr '.$bc[$var].'><td width="30%">';
|
||||||
print '<a href="account.php?account='.$acc->id.'">'.$acc->label.'</a>';
|
print '<a href="account.php?account='.$acc->id.'">'.img_object($langs->trans("ShowAccount"),'account').' '.$acc->label.'</a>';
|
||||||
print '</td><td>'.$acc->bank."</td><td>$acc->number</td>";
|
print '</td><td>'.$acc->bank."</td><td>$acc->number</td>";
|
||||||
print '<td align="center">'.yn($acc->rappro).'</td>';
|
print '<td align="center">'.yn($acc->rappro).'</td>';
|
||||||
print '<td align="center">'.$acc->status[$acc->clos].'</td>';
|
print '<td align="center">'.$acc->status[$acc->clos].'</td>';
|
||||||
@@ -147,7 +147,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
$solde = $acc->solde();
|
$solde = $acc->solde();
|
||||||
|
|
||||||
print "<tr ".$bc[$var]."><td>";
|
print "<tr ".$bc[$var]."><td>";
|
||||||
print '<a href="account.php?account='.$acc->id.'">'.$acc->label.'</a>';
|
print '<a href="account.php?account='.$acc->id.'">'.img_object($langs->trans("ShowAccount"),'account').' '.$acc->label.'</a>';
|
||||||
print "</td><td>$acc->bank</td><td>$acc->number</td>";
|
print "</td><td>$acc->bank</td><td>$acc->number</td>";
|
||||||
print '<td align="center">'.yn($acc->rappro).'</td>';
|
print '<td align="center">'.yn($acc->rappro).'</td>';
|
||||||
print '<td align="center">'.$acc->status[$acc->clos].'</td>';
|
print '<td align="center">'.$acc->status[$acc->clos].'</td>';
|
||||||
@@ -189,7 +189,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
$solde = $acc->solde();
|
$solde = $acc->solde();
|
||||||
|
|
||||||
print "<tr ".$bc[$var]."><td>";
|
print "<tr ".$bc[$var]."><td>";
|
||||||
print '<a href="account.php?account='.$acc->id.'">'.$acc->label.'</a>';
|
print '<a href="account.php?account='.$acc->id.'">'.img_object($langs->trans("ShowAccount"),'account').' '.$acc->label.'</a>';
|
||||||
print '</td><td>'.$acc->bank.'</td>';
|
print '</td><td>'.$acc->bank.'</td>';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
|
|||||||
75
htdocs/compta/bank/info.php
Normal file
75
htdocs/compta/bank/info.php
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2005 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
|
||||||
|
* the Free Software Foundation; either version 2 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, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
* $Source$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\file htdocs/compta/bank/info.php
|
||||||
|
\ingroup banque
|
||||||
|
\brief Onglet info d'une ecriture bancaire
|
||||||
|
\version $Revision$
|
||||||
|
*/
|
||||||
|
|
||||||
|
require("./pre.inc.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/paiement.class.php");
|
||||||
|
|
||||||
|
$langs->load("banks");
|
||||||
|
$langs->load("companies");
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Visualisation de la fiche
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
llxHeader();
|
||||||
|
|
||||||
|
$line = new AccountLine($db);
|
||||||
|
$line->fetch($_GET["rowid"], $user);
|
||||||
|
$line->info($_GET["rowid"]);
|
||||||
|
|
||||||
|
|
||||||
|
$h=0;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$_GET["rowid"];
|
||||||
|
$head[$h][1] = $langs->trans("Card");
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$_GET["rowid"];
|
||||||
|
$head[$h][1] = $langs->trans("Info");
|
||||||
|
$hselected = $h;
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
|
||||||
|
dolibarr_fiche_head($head, $hselected, $langs->trans("LineRecord").": ".$line->ref);
|
||||||
|
|
||||||
|
print '<table width="100%"><tr><td>';
|
||||||
|
dolibarr_print_object_info($line);
|
||||||
|
print '</td></tr></table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
// Juste pour <20>viter bug IE qui r<>organise mal div pr<70>c<EFBFBD>dents si celui-ci absent
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
$db->close();
|
||||||
|
|
||||||
|
llxFooter('$Date$ - $Revision$');
|
||||||
|
?>
|
||||||
@@ -180,6 +180,10 @@ $head[$h][1] = $langs->trans('Card');
|
|||||||
$hselected=$h;
|
$hselected=$h;
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$_GET["rowid"];
|
||||||
|
$head[$h][1] = $langs->trans("Info");
|
||||||
|
$h++;
|
||||||
|
|
||||||
dolibarr_fiche_head($head, $hselected, $langs->trans('LineRecord').': '.$_GET["rowid"]);
|
dolibarr_fiche_head($head, $hselected, $langs->trans('LineRecord').': '.$_GET["rowid"]);
|
||||||
|
|
||||||
|
|
||||||
@@ -329,9 +333,16 @@ if ($result)
|
|||||||
{
|
{
|
||||||
if ($key) print '<br>';
|
if ($key) print '<br>';
|
||||||
print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
|
print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
|
||||||
if ($links[$key]['type']=='payment') { print img_object($langs->trans('ShowPayment'),'payment').' '; }
|
if ($links[$key]['type']=='payment') {
|
||||||
if ($links[$key]['type']=='company') { print img_object($langs->trans('ShowCustomer'),'company').' '; }
|
print img_object($langs->trans('ShowPayment'),'payment').' ';
|
||||||
print $links[$key]['label'].'</a>';
|
print $langs->trans("Payment");
|
||||||
|
}
|
||||||
|
else if ($links[$key]['type']=='company') {
|
||||||
|
print img_object($langs->trans('ShowCustomer'),'company').' ';
|
||||||
|
print $links[$key]['label'];
|
||||||
|
}
|
||||||
|
else print $links[$key]['label'];
|
||||||
|
print '</a>';
|
||||||
}
|
}
|
||||||
print '</td><td> </td></tr>';
|
print '</td><td> </td></tr>';
|
||||||
}
|
}
|
||||||
@@ -419,8 +430,9 @@ print "</tr>";
|
|||||||
print "</form>";
|
print "</form>";
|
||||||
|
|
||||||
$sql = "SELECT c.label, c.rowid";
|
$sql = "SELECT c.label, c.rowid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."bank_class as a, ".MAIN_DB_PREFIX."bank_categ as c WHERE a.lineid=$rowid AND a.fk_categ = c.rowid ";
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank_class as a, ".MAIN_DB_PREFIX."bank_categ as c";
|
||||||
$sql .= " ORDER BY c.label";
|
$sql.= " WHERE a.lineid=".$rowid." AND a.fk_categ = c.rowid";
|
||||||
|
$sql.= " ORDER BY c.label";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -79,30 +79,32 @@ if ($_POST['action'] == 'confirm_valide' && $_POST['confirm'] == 'yes' && $user-
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
llxHeader();
|
|
||||||
|
|
||||||
|
|
||||||
print '<div class="tabs">';
|
|
||||||
print '<a href="fiche.php?id='.$_GET['id'].'" id="active" class="tab">'.$langs->trans('Payment').'</a>';
|
|
||||||
print '<a class="tab" href="info.php?id='.$_GET['id'].'">'.$langs->trans('Info').'</a>';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '<div class="tabBar">';
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Visualisation de la fiche
|
* Visualisation de la fiche
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
llxHeader();
|
||||||
|
|
||||||
$paiement = new Paiement($db);
|
$paiement = new Paiement($db);
|
||||||
$paiement->fetch($_GET['id']);
|
$paiement->fetch($_GET['id']);
|
||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
|
|
||||||
|
$h=0;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$_GET["id"];
|
||||||
|
$head[$h][1] = $langs->trans("Card");
|
||||||
|
$hselected = $h;
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/compta/paiement/info.php?id='.$_GET["id"];
|
||||||
|
$head[$h][1] = $langs->trans("Info");
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
|
||||||
|
dolibarr_fiche_head($head, $hselected, $langs->trans("Payment").": ".$paiement->ref);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la suppression du paiement
|
* Confirmation de la suppression du paiement
|
||||||
*/
|
*/
|
||||||
@@ -127,10 +129,12 @@ print '<tr><td valign="top" width="140">'.$langs->trans('Ref').'</td><td>'.$paie
|
|||||||
if ($paiement->bank_account)
|
if ($paiement->bank_account)
|
||||||
{
|
{
|
||||||
// Si compte renseign<67>, on affiche libelle
|
// Si compte renseign<67>, on affiche libelle
|
||||||
print '<tr><td valign="top" width="140">';
|
|
||||||
$bank=new Account($db);
|
$bank=new Account($db);
|
||||||
$bank->fetch($paiement->bank_account);
|
$bank->fetch($paiement->bank_account);
|
||||||
print $langs->trans('BankAccount').'</td><td><a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$bank->id.'">'.$bank->label.'</a></td></tr>';
|
|
||||||
|
print '<tr>';
|
||||||
|
print '<td valign="top" width="140">'.$langs->trans('BankAccount').'</td>';
|
||||||
|
print '<td><a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$bank->id.'">'.img_object($langs->trans("ShowAccount"),'account').' '.$bank->label.'</a></td></tr>';
|
||||||
}
|
}
|
||||||
print '<tr><td valign="top" width="140">'.$langs->trans('Date').'</td><td>'.dolibarr_print_date($paiement->date).'</td></tr>';
|
print '<tr><td valign="top" width="140">'.$langs->trans('Date').'</td><td>'.dolibarr_print_date($paiement->date).'</td></tr>';
|
||||||
print '<tr><td valign="top">'.$langs->trans('Type').'</td><td>'.$paiement->type_libelle.'</td></tr>';
|
print '<tr><td valign="top">'.$langs->trans('Type').'</td><td>'.$paiement->type_libelle.'</td></tr>';
|
||||||
@@ -152,10 +156,10 @@ $sql = 'SELECT f.facnumber, f.total_ttc, pf.amount, f.rowid as facid, f.paye, f.
|
|||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s';
|
$sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s';
|
||||||
$sql .= ' WHERE pf.fk_facture = f.rowid AND f.fk_soc = s.idp';
|
$sql .= ' WHERE pf.fk_facture = f.rowid AND f.fk_soc = s.idp';
|
||||||
$sql .= ' AND pf.fk_paiement = '.$paiement->id;
|
$sql .= ' AND pf.fk_paiement = '.$paiement->id;
|
||||||
|
$resql=$db->query($sql);
|
||||||
if ($db->query($sql))
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$total = 0;
|
$total = 0;
|
||||||
@@ -171,7 +175,7 @@ if ($db->query($sql))
|
|||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object();
|
$objp = $db->fetch_object($resql);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.img_object($langs->trans('ShowBill'),'bill').' ';
|
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.img_object($langs->trans('ShowBill'),'bill').' ';
|
||||||
@@ -193,7 +197,7 @@ if ($db->query($sql))
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
$db->free();
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
* $Source$
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,31 +33,42 @@ require_once(DOL_DOCUMENT_ROOT."/paiement.class.php");
|
|||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|
||||||
llxHeader();
|
|
||||||
|
|
||||||
print '<div class="tabs">';
|
|
||||||
print '<a class="tab" href="fiche.php?id='.$_GET["id"].'">'.$langs->trans("Payment").'</a>';
|
|
||||||
print '<a class="tab" href="info.php?id='.$_GET["id"].'" id="active">'.$langs->trans("Info").'</a>';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Visualisation de la fiche
|
* Visualisation de la fiche
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
llxHeader();
|
||||||
|
|
||||||
$paiement = new Paiement($db);
|
$paiement = new Paiement($db);
|
||||||
$paiement->fetch($_GET["id"], $user);
|
$paiement->fetch($_GET["id"], $user);
|
||||||
$paiement->info($_GET["id"]);
|
$paiement->info($_GET["id"]);
|
||||||
|
|
||||||
print '<div class="tabBar">';
|
|
||||||
|
$h=0;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$_GET["id"];
|
||||||
|
$head[$h][1] = $langs->trans("Card");
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/compta/paiement/info.php?id='.$_GET["id"];
|
||||||
|
$head[$h][1] = $langs->trans("Info");
|
||||||
|
$hselected = $h;
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
|
||||||
|
dolibarr_fiche_head($head, $hselected, $langs->trans("Payment").": ".$paiement->ref);
|
||||||
|
|
||||||
print '<table width="100%"><tr><td>';
|
print '<table width="100%"><tr><td>';
|
||||||
print '<br>';
|
|
||||||
dolibarr_print_object_info($paiement);
|
dolibarr_print_object_info($paiement);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
// Juste pour <20>viter bug IE qui r<>organise mal div pr<70>c<EFBFBD>dents si celui-ci absent
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|||||||
@@ -74,4 +74,6 @@ AccountIdShort=Number
|
|||||||
EditBankRecord=Edit record
|
EditBankRecord=Edit record
|
||||||
LineRecord=Transaction
|
LineRecord=Transaction
|
||||||
AddBankRecord=Add transaction
|
AddBankRecord=Add transaction
|
||||||
AddBankRecordLong=Add transaction manually
|
AddBankRecordLong=Add transaction manually
|
||||||
|
ConciliatedBy=Conciliated by
|
||||||
|
DateConciliating=Conciliate date
|
||||||
@@ -74,4 +74,6 @@ AccountIdShort=Num
|
|||||||
EditBankRecord=Editer <20>criture
|
EditBankRecord=Editer <20>criture
|
||||||
LineRecord=Ecriture
|
LineRecord=Ecriture
|
||||||
AddBankRecord=Ajouter <20>criture
|
AddBankRecord=Ajouter <20>criture
|
||||||
AddBankRecordLong=Saisie d'une <20>criture manuelle hors facture
|
AddBankRecordLong=Saisie d'une <20>criture manuelle hors facture
|
||||||
|
ConciliatedBy=Rapproch<63> par
|
||||||
|
DateConciliating=Date rapprochement
|
||||||
@@ -436,6 +436,12 @@ function dolibarr_print_object_info($object)
|
|||||||
|
|
||||||
if (isset($object->date_cloture))
|
if (isset($object->date_cloture))
|
||||||
print $langs->trans("DateClosing")." : " . dolibarr_print_date($object->date_cloture,"%A %d %B %Y %H:%M:%S") . '<br>';
|
print $langs->trans("DateClosing")." : " . dolibarr_print_date($object->date_cloture,"%A %d %B %Y %H:%M:%S") . '<br>';
|
||||||
|
|
||||||
|
if (isset($object->user_rappro) && $object->user_rappro->fullname )
|
||||||
|
print $langs->trans("ConciliatedBy")." : " . $object->user_rappro->fullname . '<br>';
|
||||||
|
|
||||||
|
if (isset($object->date_rappro))
|
||||||
|
print $langs->trans("DateConciliating")." : " . dolibarr_print_date($object->date_rappro,"%A %d %B %Y %H:%M:%S") . '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
* $Source$
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,7 +36,7 @@
|
|||||||
class Paiement
|
class Paiement
|
||||||
{
|
{
|
||||||
var $id;
|
var $id;
|
||||||
var $db;
|
var $ref;
|
||||||
var $facid;
|
var $facid;
|
||||||
var $datepaye;
|
var $datepaye;
|
||||||
var $amount;
|
var $amount;
|
||||||
@@ -52,6 +51,7 @@ class Paiement
|
|||||||
// fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...)
|
// fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...)
|
||||||
// fk_paiement dans llx_paiement_facture est le rowid du paiement
|
// fk_paiement dans llx_paiement_facture est le rowid du paiement
|
||||||
|
|
||||||
|
var $db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Constructeur de la classe
|
* \brief Constructeur de la classe
|
||||||
@@ -64,12 +64,12 @@ class Paiement
|
|||||||
$this->db = $DB ;
|
$this->db = $DB ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief R<>cup<75>re l'objet paiement
|
* \brief R<>cup<75>re l'objet paiement
|
||||||
* \param id id du paiement a r<>cup<75>rer
|
* \param id id du paiement a r<>cup<75>rer
|
||||||
*/
|
* \return int <0 si ko, >0 si ok
|
||||||
|
*/
|
||||||
function fetch($id)
|
function fetch($id)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT p.rowid,'.$this->db->pdate('p.datep').' as dp, p.amount, p.statut, p.fk_bank';
|
$sql = 'SELECT p.rowid,'.$this->db->pdate('p.datep').' as dp, p.amount, p.statut, p.fk_bank';
|
||||||
$sql .=', c.libelle as paiement_type';
|
$sql .=', c.libelle as paiement_type';
|
||||||
@@ -85,6 +85,7 @@ class Paiement
|
|||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object();
|
$obj = $this->db->fetch_object();
|
||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
|
$this->ref = $obj->rowid;
|
||||||
$this->date = $obj->dp;
|
$this->date = $obj->dp;
|
||||||
$this->numero = $obj->num_paiement;
|
$this->numero = $obj->num_paiement;
|
||||||
$this->bank_account = $obj->fk_account;
|
$this->bank_account = $obj->fk_account;
|
||||||
@@ -97,14 +98,14 @@ class Paiement
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return 0;
|
return -2;
|
||||||
}
|
}
|
||||||
$this->db->free();
|
$this->db->free();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($this->db);
|
dolibarr_print_error($this->db);
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user