New: Some enhancements on member management when bank synchro is enbled

This commit is contained in:
Laurent Destailleur 2008-11-15 00:10:42 +00:00
parent 5c6e79a66c
commit 1f3b344a27
17 changed files with 479 additions and 383 deletions

View File

@ -1000,18 +1000,18 @@ class Adherent extends CommonObject
} }
/** /**
\brief Fonction qui insere la cotisation dans la base de donnees * \brief Fonction qui insere la cotisation dans la base de donnees
et eventuellement liens dans banques, mailman, etc... * et eventuellement liens dans banques, mailman, etc...
\param date Date d'effet de la cotisation * \param date Date d'effet de la cotisation
\param montant Montant cotisation (accepte 0 pour les adherents non soumis e cotisation) * \param montant Montant cotisation (accepte 0 pour les adherents non soumis e cotisation)
\param account_id Id compte bancaire * \param account_id Id compte bancaire
\param operation Type operation (si Id compte bancaire fourni) * \param operation Type operation (si Id compte bancaire fourni)
\param label Label operation (si Id compte bancaire fourni) * \param label Label operation (si Id compte bancaire fourni)
\param num_chq Numero cheque (si Id compte bancaire fourni) * \param num_chq Numero cheque (si Id compte bancaire fourni)
\param emetteur_nom Nom emetteur cheque * \param emetteur_nom Nom emetteur cheque
\param emetteur_banque Nom banque emetteur cheque * \param emetteur_banque Nom banque emetteur cheque
\param datesubend Date fin adhesion * \param datesubend Date fin adhesion
\return int rowid de l'entree ajoutee, <0 si erreur * \return int rowid de l'entree ajoutee, <0 si erreur
*/ */
function cotisation($date, $montant, $accountid=0, $operation='', $label='', $num_chq='', $emetteur_nom='', $emetteur_banque='', $datesubend=0) function cotisation($date, $montant, $accountid=0, $operation='', $label='', $num_chq='', $emetteur_nom='', $emetteur_banque='', $datesubend=0)
{ {

View File

@ -18,71 +18,71 @@
*/ */
/** /**
\file htdocs/adherents/adherent_type.class.php \file htdocs/adherents/adherent_type.class.php
\ingroup adherent \ingroup adherent
\brief Fichier de la classe gérant les types d'adhérents \brief Fichier de la classe gérant les types d'adhérents
\author Rodolphe Quiedeville \author Rodolphe Quiedeville
\version $Id$ \version $Id$
*/ */
require_once(DOL_DOCUMENT_ROOT."/commonobject.class.php"); require_once(DOL_DOCUMENT_ROOT."/commonobject.class.php");
/** /**
\class AdherentType \class AdherentType
\brief Classe gérant les types d'adhérents \brief Classe gérant les types d'adhérents
*/ */
class AdherentType extends CommonObject class AdherentType extends CommonObject
{ {
var $error; var $error;
var $errors=array(); var $errors=array();
var $db; var $db;
var $table_element = 'adherent_type'; var $table_element = 'adherent_type';
var $id;
var $libelle;
var $statut;
var $cotisation; /**< Soumis à la cotisation */
var $vote; /**< droit de vote ? */
var $note; /**< commentaire */
var $mail_valid; /**< mail envoye lors de la validation */
var $id;
var $libelle;
var $statut;
var $cotisation; /**< Soumis à la cotisation */
var $vote; /**< droit de vote ? */
var $note; /**< commentaire */
var $mail_valid; /**< mail envoye lors de la validation */
/** /**
\brief AdherentType \brief AdherentType
\param DB handler accès base de données \param DB handler accès base de données
*/ */
function AdherentType($DB) function AdherentType($DB)
{ {
$this->db = $DB ; $this->db = $DB ;
$this->statut = 1; $this->statut = 1;
} }
/** /**
\brief print_error_list \brief print_error_list
*/ */
function print_error_list() function print_error_list()
{ {
$num = sizeof($this->error); $num = sizeof($this->error);
for ($i = 0 ; $i < $num ; $i++) for ($i = 0 ; $i < $num ; $i++)
{ {
print "<li>" . $this->error[$i]; print "<li>" . $this->error[$i];
} }
} }
/** /**
\brief Fonction qui permet de créer le status de l'adhérent \brief Fonction qui permet de créer le status de l'adhérent
\param userid userid de l'adhérent \param userid userid de l'adhérent
\return > 0 si ok, < 0 si ko \return > 0 si ok, < 0 si ko
*/ */
function create($userid) function create($userid)
{ {
$this->statut=trim($this->statut); $this->statut=trim($this->statut);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type (libelle)"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type (libelle)";
$sql.= " VALUES ('".addslashes($this->libelle)."')"; $sql.= " VALUES ('".addslashes($this->libelle)."')";
@ -101,71 +101,70 @@ class AdherentType extends CommonObject
} }
/** /**
\brief Met a jour en base données du type \brief Met a jour en base données du type
\return > 0 si ok, < 0 si ko \return > 0 si ok, < 0 si ko
*/ */
function update() function update()
{
$this->libelle=trim($this->libelle);
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent_type ";
$sql.= "SET ";
$sql.= "statut=".$this->statut.",";
$sql.= "libelle = '".addslashes($this->libelle) ."',";
$sql.= "cotisation='".$this->cotisation."',";
$sql.= "note='".addslashes($this->note)."',";
$sql.= "vote='".$this->vote."',";
$sql.= "mail_valid='".addslashes($this->mail_valid)."'";
$sql .= " WHERE rowid = $this->id";
$result = $this->db->query($sql);
if ($result)
{ {
$this->libelle=trim($this->libelle);
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent_type ";
$sql.= "SET ";
$sql.= "statut=".$this->statut.",";
$sql.= "libelle = '".addslashes($this->libelle) ."',";
$sql.= "cotisation='".$this->cotisation."',";
$sql.= "note='".addslashes($this->note)."',";
$sql.= "vote='".$this->vote."',";
$sql.= "mail_valid='".addslashes($this->mail_valid)."'";
$sql .= " WHERE rowid = $this->id";
$result = $this->db->query($sql);
if ($result)
{
return 1; return 1;
} }
else else
{ {
$this->error=$this->db->error().' sql='.$sql; $this->error=$this->db->error().' sql='.$sql;
return -1; return -1;
}
} }
}
/**
\brief Fonction qui permet de supprimer le status de l'adhérent
\param rowid
*/
/**
* \brief Fonction qui permet de supprimer le status de l'adhérent
* \param rowid
*/
function delete($rowid) function delete($rowid)
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type WHERE rowid = $rowid"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type WHERE rowid = $rowid";
if ( $this->db->query( $sql) ) if ( $this->db->query( $sql) )
{ {
if ( $this->db->affected_rows() ) if ( $this->db->affected_rows() )
{ {
return 1; return 1;
} }
else else
{ {
return 0; return 0;
} }
} }
else else
{ {
print "Err : ".$this->db->error(); print "Err : ".$this->db->error();
return 0; return 0;
} }
} }
/** /**
\brief Fonction qui permet de récupérer le status de l'adhérent \brief Fonction qui permet de récupérer le status de l'adhérent
\param rowid \param rowid
\return int <0 si KO, >0 si OK \return int <0 si KO, >0 si OK
*/ */
function fetch($rowid) function fetch($rowid)
{ {
$sql = "SELECT d.rowid, d.libelle, d.statut, d.cotisation, d.mail_valid, d.note, d.vote"; $sql = "SELECT d.rowid, d.libelle, d.statut, d.cotisation, d.mail_valid, d.note, d.vote";
@ -179,7 +178,7 @@ class AdherentType extends CommonObject
if ($this->db->num_rows($resql)) if ($this->db->num_rows($resql))
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->ref = $obj->rowid; $this->ref = $obj->rowid;
$this->libelle = $obj->libelle; $this->libelle = $obj->libelle;
@ -198,58 +197,65 @@ class AdherentType extends CommonObject
} }
} }
/**
* Return list of members' type
*
* @return array List of types
*/
function liste_array() function liste_array()
{
$projets = array();
$sql = "SELECT rowid, libelle FROM ".MAIN_DB_PREFIX."adherent_type";
if ($this->db->query($sql) )
{ {
$nump = $this->db->num_rows(); $projets = array();
if ($nump) $sql = "SELECT rowid, libelle FROM ".MAIN_DB_PREFIX."adherent_type";
{
$i = 0; $resql=$this->db->query($sql);
while ($i < $nump) if ($resql)
{ {
$obj = $this->db->fetch_object(); $nump = $this->db->num_rows($resql);
$projets[$obj->rowid] = $obj->libelle; if ($nump)
$i++; {
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($resql);
$projets[$obj->rowid] = $obj->libelle;
$i++;
}
}
return $projets;
} }
} else
return $projets; {
} print $this->db->error();
else }
{
print $this->db->error();
} }
}
/**
/**
* \brief Renvoie nom clicable (avec eventuellement le picto) * \brief Renvoie nom clicable (avec eventuellement le picto)
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul * \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* \param maxlen Longueur max libelle
* \param option Page lien
* \return string Chaine avec URL * \return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0) function getNomUrl($withpicto=0,$maxlen=0)
{ {
global $langs; global $langs;
$result=''; $result='';
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/type.php?rowid='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/adherents/type.php?rowid='.$this->id.'">';
$lienfin='</a>'; $lienfin='</a>';
$picto='group'; $picto='group';
$label=$langs->trans("ShowType"); $label=$langs->trans("ShowTypeCard",$this->libelle);
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin); if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$lien.$this->libelle.$lienfin; $result.=$lien.($maxlen?dolibarr_trunc($this->libelle,$maxlen):$this->libelle).$lienfin;
return $result; return $result;
} }

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -16,16 +16,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/adherents/card_subscriptions.php * \file htdocs/adherents/card_subscriptions.php
\ingroup adherent * \ingroup adherent
\brief Onglet d'ajout, edition, suppression des adh<64>sions d'un adh<EFBFBD>rent * \brief Onglet d'ajout, edition, suppression des adh<64>sions d'un adh<EFBFBD>rent
\version $Revision$ * \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/member.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/member.lib.php");
@ -54,7 +52,7 @@ $rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"];
$typeid=isset($_GET["typeid"])?$_GET["typeid"]:$_POST["typeid"]; $typeid=isset($_GET["typeid"])?$_GET["typeid"]:$_POST["typeid"];
if (! $user->rights->adherent->cotisation->lire) if (! $user->rights->adherent->cotisation->lire)
accessforbidden(); accessforbidden();
/* /*
@ -63,50 +61,53 @@ if (! $user->rights->adherent->cotisation->lire)
if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisation' && ! $_POST["cancel"]) if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisation' && ! $_POST["cancel"])
{ {
$langs->load("banks"); $langs->load("banks");
$adh->id = $rowid; $adh->id = $rowid;
$result=$adh->fetch($rowid); $result=$adh->fetch($rowid);
$adht->fetch($adh->typeid); $adht->fetch($adh->typeid);
$datecotisation=0; // Subscription informations
$datecotisation=0;
$datesubend=0; $datesubend=0;
if ($_POST["reyear"] && $_POST["remonth"] && $_POST["reday"]) if ($_POST["reyear"] && $_POST["remonth"] && $_POST["reday"])
{ {
$datecotisation=dolibarr_mktime(0, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $datecotisation=dolibarr_mktime(0, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
} }
if ($_POST["endyear"] && $_POST["endmonth"] && $_POST["endday"]) if ($_POST["endyear"] && $_POST["endmonth"] && $_POST["endday"])
{ {
$datesubend=dolibarr_mktime(0, 0, 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]); $datesubend=dolibarr_mktime(0, 0, 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
} }
$cotisation=$_POST["cotisation"]; $cotisation=$_POST["cotisation"]; // Amount of subscription
$accountid=$_POST["accountid"];
$operation=$_POST["operation"];
$label=$_POST["label"]; $label=$_POST["label"];
$num_chq=$_POST["num_chq"];
$emetteur_nom=$_POST["chqemetteur"];
$emetteur_banque=$_POST["chqbank"];
if (! $datecotisation) if (! $datecotisation)
{ {
$errmsg=$langs->trans("BadDateFormat"); $errmsg=$langs->trans("BadDateFormat");
$action='addsubscription'; $action='addsubscription';
} }
if (! $datesubend) if (! $datesubend)
{ {
$datesubend=dolibarr_time_plus_duree(dolibarr_time_plus_duree($datecotisation,$defaultdelay,$defaultdelayunit),-1,'d'); $datesubend=dolibarr_time_plus_duree(dolibarr_time_plus_duree($datecotisation,$defaultdelay,$defaultdelayunit),-1,'d');
} }
// Payment informations
$accountid=$_POST["accountid"];
$operation=$_POST["operation"]; // Payment mode
$num_chq=$_POST["num_chq"];
$emetteur_nom=$_POST["chqemetteur"];
$emetteur_banque=$_POST["chqbank"];
if ($adht->cotisation) // Type adherent soumis a cotisation if ($adht->cotisation) // Type adherent soumis a cotisation
{ {
if (! is_numeric($_POST["cotisation"])) if (! is_numeric($_POST["cotisation"]))
{ {
// If field is '' or not a numeric value // If field is '' or not a numeric value
$errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
$action='addsubscription'; $action='addsubscription';
} }
else else
{ {
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE)
@ -125,37 +126,37 @@ if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisatio
} }
} }
} }
if ($action=='cotisation') if ($action=='cotisation')
{ {
$db->begin(); $db->begin();
$crowid=$adh->cotisation($datecotisation, $cotisation, $accountid, $operation, $label, $num_chq, $emetteur_nom, $emetteur_banque, $datesubend); $crowid=$adh->cotisation($datecotisation, $cotisation, $accountid, $operation, $label, $num_chq, $emetteur_nom, $emetteur_banque, $datesubend);
if ($crowid > 0)
{
$db->commit();
// Envoi mail if ($crowid > 0)
if ($_POST["sendmail"]) {
{ $db->commit();
$result=$adh->send_an_email($conf->global->ADHERENT_MAIL_COTIS,$conf->global->ADHERENT_MAIL_COTIS_SUBJECT,array(),array(),array(),"","",0,-1);
// Envoi mail
if ($_POST["sendmail"])
{
$result=$adh->send_an_email($conf->global->ADHERENT_MAIL_COTIS,$conf->global->ADHERENT_MAIL_COTIS_SUBJECT,array(),array(),array(),"","",0,-1);
if ($result < 0) $errmsg=$adh->error; if ($result < 0) $errmsg=$adh->error;
} }
$_POST["cotisation"]=''; $_POST["cotisation"]='';
$_POST["accountid"]=''; $_POST["accountid"]='';
$_POST["operation"]=''; $_POST["operation"]='';
$_POST["label"]=''; $_POST["label"]='';
$_POST["num_chq"]=''; $_POST["num_chq"]='';
} }
else else
{ {
$db->rollback(); $db->rollback();
$errmsg=$adh->error; $errmsg=$adh->error;
$action = 'addsubscription'; $action = 'addsubscription';
} }
} }
} }
@ -181,8 +182,8 @@ $adho->fetch_optionals();
/* /*
* Affichage onglets * Affichage onglets
*/ */
$head = member_prepare_head($adh); $head = member_prepare_head($adh);
dolibarr_fiche_head($head, 'subscription', $langs->trans("Member")); dolibarr_fiche_head($head, 'subscription', $langs->trans("Member"));
@ -227,15 +228,15 @@ if ($errmsg)
$langs->load("errors"); $langs->load("errors");
$errmsg=$langs->trans($errmsg); $errmsg=$langs->trans($errmsg);
} }
print '<div class="error">'.$errmsg.'</div>'; print '<div class="error">'.$errmsg.'</div>';
print "\n"; print "\n";
} }
/* /*
* Barre d'actions * Barre d'actions
* *
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
// Lien nouvelle cotisation si non brouillon et non r<>sili<6C> // Lien nouvelle cotisation si non brouillon et non r<>sili<6C>
@ -252,9 +253,9 @@ print "<br>\n";
/* /*
* Bandeau des cotisations * Bandeau des cotisations
* *
*/ */
print '<table border=0 width="100%">'; print '<table border=0 width="100%">';
@ -263,9 +264,9 @@ print '<td valign="top" width="50%">';
/* /*
* Liste des cotisations * Liste des cotisations
* *
*/ */
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe,"; $sql = "SELECT d.rowid, d.prenom, d.nom, d.societe,";
$sql.= " c.rowid as crowid, c.cotisation,"; $sql.= " c.rowid as crowid, c.cotisation,";
$sql.= " ".$db->pdate("c.dateadh")." as dateadh,"; $sql.= " ".$db->pdate("c.dateadh")." as dateadh,";
@ -281,60 +282,60 @@ $sql.= " WHERE d.rowid = c.fk_adherent AND d.rowid=".$rowid;
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
$cotisationstatic=new Cotisation($db); $cotisationstatic=new Cotisation($db);
$accountstatic=new Account($db); $accountstatic=new Account($db);
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
print "<table class=\"noborder\" width=\"100%\">\n"; print "<table class=\"noborder\" width=\"100%\">\n";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Ref").'</td>'; print '<td>'.$langs->trans("Ref").'</td>';
print '<td align="center">'.$langs->trans("DateSubscription").'</td>'; print '<td align="center">'.$langs->trans("DateSubscription").'</td>';
print '<td align="center">'.$langs->trans("DateEnd").'</td>'; print '<td align="center">'.$langs->trans("DateEnd").'</td>';
print '<td align="right">'.$langs->trans("Amount").'</td>'; print '<td align="right">'.$langs->trans("Amount").'</td>';
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE)
{
print '<td align="right">'.$langs->trans("Account").'</td>';
}
print "</tr>\n";
$var=True;
while ($i < $num)
{
$objp = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]>";
$cotisationstatic->ref=$objp->crowid;
$cotisationstatic->id=$objp->crowid;
print '<td>'.$cotisationstatic->getNomUrl(1).'</td>';
print '<td align="center">'.dolibarr_print_date($objp->dateadh,'day')."</td>\n";
print '<td align="center">'.dolibarr_print_date($objp->datef,'day')."</td>\n";
print '<td align="right">'.price($objp->cotisation).'</td>';
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE)
{ {
print '<td align="right">'; print '<td align="right">'.$langs->trans("Account").'</td>';
if ($objp->bid)
{
$accountstatic->label=$objp->label;
$accountstatic->id=$objp->baid;
print $accountstatic->getNomUrl(1);
}
else
{
print '&nbsp;';
}
print '</td>';
} }
print "</tr>"; print "</tr>\n";
$i++;
} $var=True;
print "</table>"; while ($i < $num)
{
$objp = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]>";
$cotisationstatic->ref=$objp->crowid;
$cotisationstatic->id=$objp->crowid;
print '<td>'.$cotisationstatic->getNomUrl(1).'</td>';
print '<td align="center">'.dolibarr_print_date($objp->dateadh,'day')."</td>\n";
print '<td align="center">'.dolibarr_print_date($objp->datef,'day')."</td>\n";
print '<td align="right">'.price($objp->cotisation).'</td>';
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE)
{
print '<td align="right">';
if ($objp->bid)
{
$accountstatic->label=$objp->label;
$accountstatic->id=$objp->baid;
print $accountstatic->getNomUrl(1);
}
else
{
print '&nbsp;';
}
print '</td>';
}
print "</tr>";
$i++;
}
print "</table>";
} }
else else
{ {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
print '</td><td valign="top">'; print '</td><td valign="top">';
@ -366,10 +367,10 @@ print '</td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
/* /*
* Ajout d'une nouvelle cotisation * Ajout d'une nouvelle cotisation
*/ */
if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer) if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer)
{ {
print '<br>'; print '<br>';
@ -380,6 +381,7 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer)
print '<input type="hidden" name="rowid" value="'.$rowid.'">'; print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print "<table class=\"border\" width=\"100%\">\n"; print "<table class=\"border\" width=\"100%\">\n";
// Title subscription
print '<tr><td colspan="2"><b>'.$langs->trans("NewCotisation").'</b></td></tr>'; print '<tr><td colspan="2"><b>'.$langs->trans("NewCotisation").'</b></td></tr>';
$today=mktime(); $today=mktime();
@ -422,42 +424,51 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer)
if ($adht->cotisation) if ($adht->cotisation)
{ {
// Amount
print '<tr><td>'.$langs->trans("Amount").'</td><td><input type="text" name="cotisation" size="6" value="'.$_POST["cotisation"].'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; print '<tr><td>'.$langs->trans("Amount").'</td><td><input type="text" name="cotisation" size="6" value="'.$_POST["cotisation"].'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) // Label
{
print '<tr><td>'.$langs->trans("FinancialAccount").'</td><td>';
$html->select_comptes($_POST["accountid"],'accountid',0,'',1);
print "</td></tr>\n";
}
print '<tr><td>'.$langs->trans("PaymentMode").'</td><td>';
$html->select_types_paiements($_POST["operation"],'operation');
print "</td></tr>\n";
print '<tr><td>'.$langs->trans('Numero');
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>'; // \todo a traduire
print '</td>';
print '<td><input name="num_chq" type="text" size="8" value="'.(empty($_POST['num_chq'])?'':$_POST['num_chq']).'"></td></tr>';
print '<tr><td>'.$langs->trans('CheckTransmitter');
print ' <em>('.$langs->trans("ChequeMaker").')</em>'; // \todo a traduire
print '</td>';
print '<td><input name="chqemetteur" size="32" type="text" value="'.(empty($_POST['chqemetteur'])?$facture->client->nom:$_POST['chqemetteur']).'"></td></tr>';
print '<tr><td>'.$langs->trans('Bank');
print ' <em>('.$langs->trans("ChequeBank").')</em>'; // \todo a traduire
print '</td>';
print '<td><input name="chqbank" size="32" type="text" value="'.(empty($_POST['chqbank'])?'':$_POST['chqbank']).'"></td></tr>';
print '<tr><td>'.$langs->trans("Label").'</td>'; print '<tr><td>'.$langs->trans("Label").'</td>';
print '<td><input name="label" type="text" size="32" value="'.$langs->trans("Subscription").' '; print '<td><input name="label" type="text" size="32" value="'.$langs->trans("Subscription").' ';
print dolibarr_print_date(($datefrom?$datefrom:time()),"%Y").'" ></td></tr>'; print dolibarr_print_date(($datefrom?$datefrom:time()),"%Y").'" ></td></tr>';
}
// Bank account
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE)
{
// Title payments
print '<tr><td colspan="2"><b>'.$langs->trans("Payment").'</b></td></tr>';
// Bank account
print '<tr><td>'.$langs->trans("FinancialAccount").'</td><td>';
$html->select_comptes($_POST["accountid"],'accountid',0,'',1);
print "</td></tr>\n";
// Payment mode
print '<tr><td>'.$langs->trans("PaymentMode").'</td><td>';
$html->select_types_paiements($_POST["operation"],'operation');
print "</td></tr>\n";
print '<tr><td>'.$langs->trans('Numero');
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
print '</td>';
print '<td><input name="num_chq" type="text" size="8" value="'.(empty($_POST['num_chq'])?'':$_POST['num_chq']).'"></td></tr>';
print '<tr><td>'.$langs->trans('CheckTransmitter');
print ' <em>('.$langs->trans("ChequeMaker").')</em>';
print '</td>';
print '<td><input name="chqemetteur" size="32" type="text" value="'.(empty($_POST['chqemetteur'])?$facture->client->nom:$_POST['chqemetteur']).'"></td></tr>';
print '<tr><td>'.$langs->trans('Bank');
print ' <em>('.$langs->trans("ChequeBank").')</em>';
print '</td>';
print '<td><input name="chqbank" size="32" type="text" value="'.(empty($_POST['chqbank'])?'':$_POST['chqbank']).'"></td></tr>';
}
}
print '<tr><td>'.$langs->trans("SendAcknowledgementByMail").'</td>'; print '<tr><td>'.$langs->trans("SendAcknowledgementByMail").'</td>';
print '<td>'; print '<td>';
if (! $adh->email) if (! $adh->email)
{ {
print $langs->trans("NoEMail"); print $langs->trans("NoEMail");
} }

View File

@ -152,12 +152,12 @@ class Cotisation extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."cotisation SET "; $sql = "UPDATE ".MAIN_DB_PREFIX."cotisation SET ";
$sql .= " fk_adherent = ".$this->fk_adherent.","; $sql .= " fk_adherent = ".$this->fk_adherent.",";
$sql .= " fk_bank = ".($this->fk_bank ? $this->fk_bank : 'null').",";
$sql .= " note=".($this->note ? "'".addslashes($this->note)."'" : 'null').","; $sql .= " note=".($this->note ? "'".addslashes($this->note)."'" : 'null').",";
$sql .= " cotisation = '".price2num($this->amount)."',"; $sql .= " cotisation = '".price2num($this->amount)."',";
$sql .= " dateadh='".$this->db->idate($this->dateh)."',"; $sql .= " dateadh='".$this->db->idate($this->dateh)."',";
$sql .= " datef='".$this->db->idate($this->datef)."',"; $sql .= " datef='".$this->db->idate($this->datef)."',";
$sql .= " datec='".$this->db->idate($this->datec)."'"; $sql .= " datec='".$this->db->idate($this->datec)."',";
$sql .= " fk_bank = ".($this->fk_bank ? $this->fk_bank : 'null');
$sql .= " WHERE rowid = ".$this->id; $sql .= " WHERE rowid = ".$this->id;
dolibarr_syslog("Cotisation::update sql=".$sql); dolibarr_syslog("Cotisation::update sql=".$sql);

View File

@ -935,7 +935,7 @@ if ($rowid && $action != 'edit')
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td class="valeur">'.$adh->phone_mobile.'</td></tr>'; print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td class="valeur">'.$adh->phone_mobile.'</td></tr>';
// EMail // EMail
print '<tr><td>'.$langs->trans("EMail").'</td><td class="valeur">'.$adh->email.'&nbsp;</td></tr>'; print '<tr><td>'.$langs->trans("EMail").'</td><td class="valeur">'.dol_print_email($adh->email).'&nbsp;</td></tr>';
// Date naissance // Date naissance
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dolibarr_print_date($adh->naiss,'day').'&nbsp;</td></tr>'; print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dolibarr_print_date($adh->naiss,'day').'&nbsp;</td></tr>';

View File

@ -88,6 +88,7 @@ if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update
// Modifie valeures // Modifie valeures
$subscription->dateh=dolibarr_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']); $subscription->dateh=dolibarr_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
$subscription->datef=dolibarr_mktime($_POST['datesubendhour'], $_POST['datesubendmin'], 0, $_POST['datesubendmonth'], $_POST['datesubendday'], $_POST['datesubendyear']); $subscription->datef=dolibarr_mktime($_POST['datesubendhour'], $_POST['datesubendmin'], 0, $_POST['datesubendmonth'], $_POST['datesubendday'], $_POST['datesubendyear']);
$subscription->note=$_POST["note"];
$subscription->amount=$_POST["amount"]; $subscription->amount=$_POST["amount"];
//print 'datef='.$subscription->datef.' '.$_POST['datesubendday']; //print 'datef='.$subscription->datef.' '.$_POST['datesubendday'];
@ -143,7 +144,7 @@ if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'confirm_d
/* /*
* * View
*/ */
llxHeader(); llxHeader();
@ -168,7 +169,8 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
********************************************/ ********************************************/
$subscription->fetch($rowid); $subscription->fetch($rowid);
$result=$adh->fetch($subscription->fk_adherent);
/* /*
* Affichage onglets * Affichage onglets
*/ */
@ -197,6 +199,12 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
// Ref // Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td class="valeur" colspan="2">'.$subscription->ref.'&nbsp;</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td class="valeur" colspan="2">'.$subscription->ref.'&nbsp;</td></tr>';
// Member
$adh->ref=$adh->fullname;
print '<tr>';
print '<td>'.$langs->trans("Member").'</td><td class="valeur" colspan="3">'.$adh->getNomUrl(1,0,'subscription').'</td>';
print '</tr>';
// Date start subscription // Date start subscription
print '<tr><td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="2">'; print '<tr><td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="2">';
$form->select_date($subscription->dateh,'datesub',1,1,0,'update',1); $form->select_date($subscription->dateh,'datesub',1,1,0,'update',1);
@ -213,6 +221,19 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur" colspan="2">'; print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur" colspan="2">';
print '<input type="text" class="flat" size="10" name="amount" value="'.price($subscription->amount).'"></td></tr>'; print '<input type="text" class="flat" size="10" name="amount" value="'.price($subscription->amount).'"></td></tr>';
// Label
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur" colspan="2">';
print '<input type="text" class="flat" size="60" name="note" value="'.$subscription->note.'"></td></tr>';
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE)
{
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="2">';
$bankline=new AccountLine($db);
$result=$bankline->fetch($subscription->fk_bank);
print $bankline->getNomUrl(1,0,'showall');
print '</td></tr>';
}
print '<tr><td colspan="3" align="center">'; print '<tr><td colspan="3" align="center">';
print '<input type="submit" class="button" name="submit" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button" name="submit" value="'.$langs->trans("Save").'">';
print ' &nbsp; &nbsp; &nbsp; '; print ' &nbsp; &nbsp; &nbsp; ';
@ -296,8 +317,11 @@ if ($rowid && $action != 'edit')
// Amount // Amount
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur" colspan="3">'.price($subscription->amount).'</td></tr>'; print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur" colspan="3">'.price($subscription->amount).'</td></tr>';
// Bank account // Amount
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur" colspan="3">'.$subscription->note.'</td></tr>';
// Bank account
if ($conf->banque->enabled) if ($conf->banque->enabled)
{ {
if ($subscription->fk_bank) if ($subscription->fk_bank)
@ -309,13 +333,17 @@ if ($rowid && $action != 'edit')
$result=$bank->fetch($bankline->fk_account); $result=$bank->fetch($bankline->fk_account);
print '<tr>'; print '<tr>';
print '<td valign="top" width="140">'.$langs->trans('BankAccount').'</td>'; print '<td>'.$langs->trans('BankTransactionLine').'</td>';
print '<td>'.$bank->getNomUrl(1).'</td>'; print '<td colspan="3">';
print '<td>'.$langs->trans("BankLineConciliated").'</td><td>'.yn($bankline->rappro).'</td>'; $bankline=new AccountLine($db);
$result=$bankline->fetch($subscription->fk_bank);
print $bankline->getNomUrl(1,0,'showall');
print '</td>';
print '</tr>'; print '</tr>';
} }
} }
print "</table>\n"; print "</table>\n";
print '</form>'; print '</form>';

View File

@ -19,14 +19,15 @@
*/ */
/** /**
\file htdocs/adherents/liste.php * \file htdocs/adherents/liste.php
\ingroup adherent * \ingroup adherent
\brief Page listant les adh<EFBFBD>rents * \brief Page to list all members of fundation
\version $Id$ * \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php");
require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php");
$langs->load("members"); $langs->load("members");
$langs->load("companies"); $langs->load("companies");
@ -38,6 +39,10 @@ $langs->load("companies");
llxHeader(); llxHeader();
$form=new Form($db);
$membertypestatic=new AdherentType($db);
$sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"]; $sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"];
@ -66,9 +71,9 @@ if ($sall)
$sql.=" OR d.email like '%".$sall."%' OR d.login like '%".$sall."%' OR d.adresse like '%".$sall."%'"; $sql.=" OR d.email like '%".$sall."%' OR d.login like '%".$sall."%' OR d.adresse like '%".$sall."%'";
$sql.=" OR d.ville like '%".$sall."%' OR d.note like '%".$sall."%')"; $sql.=" OR d.ville like '%".$sall."%' OR d.note like '%".$sall."%')";
} }
if ($_GET["type"]) if ($_REQUEST["type"] > 0)
{ {
$sql.=" AND t.rowid=".$_GET["type"]; $sql.=" AND t.rowid=".$_REQUEST["type"];
} }
if (isset($_GET["statut"])) if (isset($_GET["statut"]))
{ {
@ -111,10 +116,10 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql.= " ".$db->order($sortfield,$sortorder); $sql.= " ".$db->order($sortfield,$sortorder);
$sql.= " ".$db->plimit($conf->liste_limit+1, $offset); $sql.= " ".$db->plimit($conf->liste_limit+1, $offset);
$result = $db->query($sql); $resql = $db->query($sql);
if ($result) if ($resql)
{ {
$num = $db->num_rows($result); $num = $db->num_rows($resql);
$i = 0; $i = 0;
$titre=$langs->trans("MembersList"); $titre=$langs->trans("MembersList");
@ -131,9 +136,11 @@ if ($result)
$titre=$langs->trans("MembersListQualified"); $titre=$langs->trans("MembersListQualified");
} }
if ($_GET["type"]) { if ($_REQUEST["type"] > 0)
$objp = $db->fetch_object($result); {
$titre.=" (".$objp->type.")"; $membertype=new AdherentType($db);
$result=$membertype->fetch($_REQUEST["type"]);
$titre.=" (".$membertype->libelle.")";
} }
$param=""; $param="";
@ -165,9 +172,12 @@ if ($result)
print '<input class="flat" type="text" name="search_nom" value="'.$_REQUEST["search_nom"].'" size="12"></td>'; print '<input class="flat" type="text" name="search_nom" value="'.$_REQUEST["search_nom"].'" size="12"></td>';
print '<td align="left">'; print '<td align="left">';
print '<input class="flat" type="text" name="search_login" value="'.$_REQUEST["search_login"].'" size="12"></td>'; print '<input class="flat" type="text" name="search_login" value="'.$_REQUEST["search_login"].'" size="8"></td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">';
$listetype=$membertypestatic->liste_array();
$form->select_array("type", $listetype, $_REQUEST["type"], 1, 0, 0, 0, '', 0, 16);
print '</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
@ -186,12 +196,7 @@ if ($result)
$var=True; $var=True;
while ($i < $num && $i < $conf->liste_limit) while ($i < $num && $i < $conf->liste_limit)
{ {
if ($_GET["type"] && $i==0) $objp = $db->fetch_object($resql);
{
# Fetch deja fait
} else {
$objp = $db->fetch_object($result);
}
$adh=new Adherent($db); $adh=new Adherent($db);
@ -211,17 +216,21 @@ if ($result)
print "<td>".$objp->login."</td>\n"; print "<td>".$objp->login."</td>\n";
// Type // Type
print '<td><a href="type.php?rowid='.$objp->type_id.'">'.img_object($langs->trans("ShowType"),"group").' '.$objp->type.'</a></td>'; print '<td nowrap="nowrap">';
$membertypestatic->id=$objp->type_id;
$membertypestatic->libelle=$objp->type;
print $membertypestatic->getNomUrl(1,16);
print '</td>';
// Moral/Physique // Moral/Physique
print "<td>".$adh->getmorphylib($objp->morphy)."</td>\n"; print "<td>".$adh->getmorphylib($objp->morphy)."</td>\n";
// EMail // EMail
print "<td>".$objp->email."</td>\n"; print "<td>".dol_print_email($objp->email)."</td>\n";
// Statut // Statut
print "<td>"; print "<td>";
print $adh->LibStatut($objp->statut,$objp->cotisation,$objp->datefin,4); print $adh->LibStatut($objp->statut,$objp->cotisation,$objp->datefin,2);
print "</td>"; print "</td>";
// Date fin cotisation // Date fin cotisation

View File

@ -756,6 +756,7 @@ class Account extends CommonObject
*/ */
class AccountLine class AccountLine
{ {
var $error;
var $db; var $db;
var $rowid; var $rowid;
@ -766,8 +767,11 @@ class AccountLine
var $amount; var $amount;
var $label; var $label;
var $note; var $note;
var $fk_account;
var $bank_account_label;
/** /**
* Constructeur * Constructeur
*/ */
@ -788,11 +792,12 @@ class AccountLine
*/ */
function fetch($rowid) function fetch($rowid)
{ {
$sql = "SELECT datec, datev, dateo, amount, label, fk_account,"; $sql = "SELECT b.datec, b.datev, b.dateo, b.amount, b.label as label, b.fk_account,";
$sql.= " fk_user_author, fk_user_rappro,"; $sql.= " b.fk_user_author, b.fk_user_rappro,";
$sql.= " fk_type, num_releve, num_chq, rappro, note"; $sql.= " b.fk_type, b.num_releve, b.num_chq, b.rappro, b.note,";
$sql.= " FROM ".MAIN_DB_PREFIX."bank"; $sql.= " ba.label as bank_account_label";
$sql.= " WHERE rowid = ".$rowid; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= " WHERE b.fk_account = ba.rowid AND b.rowid = ".$rowid;
dolibarr_syslog("AccountLine::fetch sql=".$sql); dolibarr_syslog("AccountLine::fetch sql=".$sql);
$result = $this->db->query($sql); $result = $this->db->query($sql);
@ -821,6 +826,8 @@ class AccountLine
$this->num_chq = $obj->num_chq; $this->num_chq = $obj->num_chq;
$this->rappro = $obj->rappro; $this->rappro = $obj->rappro;
$this->bank_account_label = $obj->bank_account_label;
} }
$this->db->free($result); $this->db->free($result);
return 1; return 1;
@ -955,7 +962,15 @@ class AccountLine
} }
} }
function getNomUrl($withpicto=0)
/**
* \brief Renvoie nom clicable (avec eventuellement le picto)
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* \param maxlen Longueur max libelle
* \param option Option ('showall')
* \return string Chaine avec URL
*/
function getNomUrl($withpicto=0,$maxlen=0,$option='')
{ {
global $langs; global $langs;
@ -966,6 +981,20 @@ class AccountLine
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowTransaction"),'account').$lienfin.' '); if ($withpicto) $result.=($lien.img_object($langs->trans("ShowTransaction"),'account').$lienfin.' ');
$result.=$lien.$this->rowid.$lienfin; $result.=$lien.$this->rowid.$lienfin;
if ($option == 'showall')
{
$result.=' (';
$result.=$langs->trans("BankAccount").': ';
$accountstatic=new Account($this->db);
$accountstatic->id=$this->fk_account;
$accountstatic->label=$this->bank_account_label;
$result.=$accountstatic->getNomUrl(0).', ';
$result.=$langs->trans("BankLineConciliated").': ';
$result.=yn($this->rappro);
$result.=')';
}
return $result; return $result;
} }
} }

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -14,16 +14,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/compta/bank/info.php \file htdocs/compta/bank/info.php
\ingroup banque \ingroup banque
\brief Onglet info d'une ecriture bancaire \brief Onglet info d'une ecriture bancaire
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -57,7 +54,7 @@ $hselected = $h;
$h++; $h++;
dolibarr_fiche_head($head, $hselected, $langs->trans("LineRecord").": ".$line->ref); dolibarr_fiche_head($head, $hselected, $langs->trans("LineRecord"));
print '<table width="100%"><tr><td>'; print '<table width="100%"><tr><td>';
dolibarr_print_object_info($line); dolibarr_print_object_info($line);

View File

@ -20,10 +20,10 @@
*/ */
/** /**
\file htdocs/compta/bank/ligne.php * \file htdocs/compta/bank/ligne.php
\ingroup compta * \ingroup compta
\brief Page edition d'une ecriture bancaire * \brief Page edition d'une ecriture bancaire
\version $Id$ * \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -90,7 +90,7 @@ if ($_POST["action"] == "update")
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
if ($objp->rappro) if ($objp->rappro)
die ("Vous ne pouvez pas modifier une <20>criture d<>j<EFBFBD> rapproch<63>e"); die ("Conciliation of a line already conciliated is not possible");
} }
$db->begin(); $db->begin();
@ -198,7 +198,7 @@ $head[$h][0] = DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$_GET["rowid"];
$head[$h][1] = $langs->trans("Info"); $head[$h][1] = $langs->trans("Info");
$h++; $h++;
dolibarr_fiche_head($head, $hselected, $langs->trans('LineRecord').': '.$_GET["rowid"]); dolibarr_fiche_head($head, $hselected, $langs->trans('LineRecord'));
$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro,"; $sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro,";
@ -217,8 +217,8 @@ if ($result)
// Confirmations // Confirmations
if ($_GET["action"] == 'delete_categ') if ($_GET["action"] == 'delete_categ')
{ {
$html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&amp;cat1=".$_GET["fk_categ"]."&amp;orig_account=".$orig_account,$langs->trans("RemoveFromCategory"),$langs->trans("RemoveFromCategoryConfirm"),"confirm_delete_categ"); $html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&amp;cat1=".$_GET["fk_categ"]."&amp;orig_account=".$orig_account,$langs->trans("RemoveFromCategory"),$langs->trans("RemoveFromCategoryConfirm"),"confirm_delete_categ");
print '<br>'; print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -232,20 +232,23 @@ if ($result)
$links=$acct->get_url($rowid); $links=$acct->get_url($rowid);
// Tableau sur 4 colonne si deja rapproche, sinon sur 5 colonnes // Ref
print '<tr><td width="20%">'.$langs->trans("Ref")."</td>";
print '<td colspan="4">'.$objp->rowid.'</td>';
print '</tr>';
// Author // Author
print '<tr><td width="20%">'.$langs->trans("Author")."</td>"; print '<tr><td width="20%">'.$langs->trans("Author")."</td>";
if ($objp->fk_user_author) if ($objp->fk_user_author)
{ {
$author=new User($db,$objp->fk_user_author); $author=new User($db,$objp->fk_user_author);
$author->fetch(); $author->fetch();
print '<td colspan="4"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$author->id.'">'; print '<td colspan="4"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$author->id.'">';
print img_object($langs->trans("ShowUser"),'user').' '.$author->fullname.'</a></td>'; print img_object($langs->trans("ShowUser"),'user').' '.$author->fullname.'</a></td>';
} }
else else
{ {
print '<td colspan="4">&nbsp;</td>'; print '<td colspan="4">&nbsp;</td>';
} }
print "</tr>"; print "</tr>";
@ -267,14 +270,14 @@ if ($result)
print '<tr><td>'.$langs->trans("DateOperation").'</td>'; print '<tr><td>'.$langs->trans("DateOperation").'</td>';
if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate)) if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
{ {
print '<td colspan="3">'; print '<td colspan="3">';
$html->select_date($objp->do,'dateo','','','','update'); $html->select_date($objp->do,'dateo','','','','update');
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'"></td>'; print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
} }
else else
{ {
print '<td colspan="4">'; print '<td colspan="4">';
print dolibarr_print_date($objp->do); print dolibarr_print_date($objp->do);
} }
print '</td></tr>'; print '</td></tr>';
@ -308,7 +311,7 @@ if ($result)
print '<input name="label" class="flat" value="'; print '<input name="label" class="flat" value="';
if (eregi('^\((.*)\)$',$objp->label,$reg)) if (eregi('^\((.*)\)$',$objp->label,$reg))
{ {
// Label g<>n<EFBFBD>rique car entre parenth<74>ses. On l'affiche en le traduisant // Label g<>n<EFBFBD>rique car entre parenth<74>ses. On l'affiche en le traduisant
print $langs->trans($reg[1]); print $langs->trans($reg[1]);
} }
else else
@ -321,16 +324,16 @@ if ($result)
} }
else else
{ {
print '<td colspan="4">'; print '<td colspan="4">';
if (eregi('^\((.*)\)$',$objp->label,$reg)) if (eregi('^\((.*)\)$',$objp->label,$reg))
{ {
// Label g<>n<EFBFBD>rique car entre parenth<74>ses. On l'affiche en le traduisant // Label g<>n<EFBFBD>rique car entre parenth<74>ses. On l'affiche en le traduisant
print $langs->trans($reg[1]); print $langs->trans($reg[1]);
} }
else else
{ {
print $objp->label; print $objp->label;
} }
} }
print '</td></tr>'; print '</td></tr>';
@ -397,14 +400,14 @@ if ($result)
print "<tr><td>".$langs->trans("Amount")."</td>"; print "<tr><td>".$langs->trans("Amount")."</td>";
if (! $objp->rappro && $user->rights->banque->modifier) if (! $objp->rappro && $user->rights->banque->modifier)
{ {
print '<td colspan="3">'; print '<td colspan="3">';
print '<input name="amount" class="flat" size="10" value="'.price($objp->amount).'"> '.$langs->trans("Currency".$conf->monnaie); print '<input name="amount" class="flat" size="10" value="'.price($objp->amount).'"> '.$langs->trans("Currency".$conf->monnaie);
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">'; print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
} }
else else
{ {
print '<td colspan="4">'; print '<td colspan="4">';
print price($objp->amount); print price($objp->amount);
} }
print "</td></tr>"; print "</td></tr>";

View File

@ -128,7 +128,7 @@ $head[$h][1] = $langs->trans("Info");
$h++; $h++;
dolibarr_fiche_head($head, $hselected, $langs->trans("Payment").": ".$paiement->ref); dolibarr_fiche_head($head, $hselected, $langs->trans("Payment"));
/* /*
* Confirmation de la suppression du paiement * Confirmation de la suppression du paiement
@ -158,25 +158,6 @@ print '<table class="border" width="100%">';
// Ref // Ref
print '<tr><td valign="top" width="140">'.$langs->trans('Ref').'</td><td colspan="3">'.$paiement->id.'</td></tr>'; print '<tr><td valign="top" width="140">'.$langs->trans('Ref').'</td><td colspan="3">'.$paiement->id.'</td></tr>';
// Bank account
if ($conf->banque->enabled)
{
if ($paiement->bank_account)
{
$bankline=new AccountLine($db);
$bankline->fetch($paiement->bank_line);
$bank=new Account($db);
$bank->fetch($bankline->fk_account);
print '<tr>';
print '<td valign="top" width="140">'.$langs->trans('BankAccount').'</td>';
print '<td>'.$bank->getNomUrl(1).'</td>';
print '<td>'.$langs->trans("BankLineConciliated").'</td><td>'.yn($bankline->rappro).'</td>';
print '</tr>';
}
}
// Date // Date
print '<tr><td valign="top" width="120">'.$langs->trans('Date').'</td><td colspan="3">'.dolibarr_print_date($paiement->date,'day').'</td></tr>'; print '<tr><td valign="top" width="120">'.$langs->trans('Date').'</td><td colspan="3">'.dolibarr_print_date($paiement->date,'day').'</td></tr>';
@ -196,6 +177,23 @@ print '<tr><td valign="top">'.$langs->trans('Amount').'</td><td colspan="3">'.pr
// Note // Note
print '<tr><td valign="top">'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($paiement->note).'</td></tr>'; print '<tr><td valign="top">'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($paiement->note).'</td></tr>';
// Bank account
if ($conf->banque->enabled)
{
if ($paiement->bank_account)
{
$bankline=new AccountLine($db);
$bankline->fetch($paiement->bank_line);
print '<tr>';
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
print '<td colspan="3">';
print $bankline->getNomUrl(1,0,'showall');
print '</td>';
print '</tr>';
}
}
print '</table>'; print '</table>';

View File

@ -55,7 +55,16 @@ $hselected = $h;
$h++; $h++;
dolibarr_fiche_head($head, $hselected, $langs->trans("Payment").": ".$paiement->ref); dolibarr_fiche_head($head, $hselected, $langs->trans("Payment"));
print '<table class="border" width="100%">';
// Ref
print '<tr><td valign="top" width="140">'.$langs->trans('Ref').'</td><td colspan="3">'.$paiement->id.'</td></tr>';
print '</table>';
print '<br>';
print '<table width="100%"><tr><td>'; print '<table width="100%"><tr><td>';
dolibarr_print_object_info($paiement); dolibarr_print_object_info($paiement);

View File

@ -2795,8 +2795,9 @@ class Form
* \param optionType Type de l'option: 1 pour des fonctions javascript * \param optionType Type de l'option: 1 pour des fonctions javascript
* \param option Valeur de l'option en fonction du type choisi * \param option Valeur de l'option en fonction du type choisi
* \param translate Traduire la valeur * \param translate Traduire la valeur
* \param maxlen Length maximum for labels
*/ */
function select_array($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $optionType=0, $option='', $translate=0) function select_array($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $optionType=0, $option='', $translate=0, $maxlen=0)
{ {
global $langs; global $langs;
// \TODO Simplify optionType and option (only one should be necessary) // \TODO Simplify optionType and option (only one should be necessary)
@ -2827,12 +2828,14 @@ class Form
if ($key_in_label) if ($key_in_label)
{ {
$selectOptionValue = $key.' - '.($translate?$langs->trans($value):$value); $newval=($translate?$langs->trans($value):$value);
$selectOptionValue = $key.' - '.($maxlen?dolibarr_trunc($newval,$maxlen):$newval);
print $selectOptionValue; print $selectOptionValue;
} }
else else
{ {
$selectOptionValue = ($translate?$langs->trans($value):$value); $newval=($translate?$langs->trans($value):$value);
$selectOptionValue = ($maxlen?dolibarr_trunc($newval,$maxlen):$newval);
if ($value == '' || $value == '-') { $selectOptionValue='&nbsp;'; } if ($value == '' || $value == '-') { $selectOptionValue='&nbsp;'; }
print $selectOptionValue; print $selectOptionValue;
} }

View File

@ -121,4 +121,5 @@ TransactionWithOtherAccount=Account transfert
PaymentNumberUpdateSucceeded=Payment number updated succesfully PaymentNumberUpdateSucceeded=Payment number updated succesfully
PaymentNumberUpdateFailed=Payment number could not be updated PaymentNumberUpdateFailed=Payment number could not be updated
PaymentDateUpdateSucceeded=Payment date update succesfully PaymentDateUpdateSucceeded=Payment date update succesfully
PaymentDateUpdateFailed=Payment date could not be updated PaymentDateUpdateFailed=Payment date could not be updated
BankTransactionLine=Bank transaction

View File

@ -131,4 +131,4 @@ DescADHERENT_ETIQUETTE_TYPE=Labels format
DescADHERENT_CARD_HEADER_TEXT=Text printed on top of member cards DescADHERENT_CARD_HEADER_TEXT=Text printed on top of member cards
DescADHERENT_CARD_TEXT=Text printed on member cards DescADHERENT_CARD_TEXT=Text printed on member cards
DescADHERENT_CARD_FOOTER_TEXT=Text printed on bottom of member cards DescADHERENT_CARD_FOOTER_TEXT=Text printed on bottom of member cards
ShowTypeCard=Show type %s

View File

@ -121,4 +121,5 @@ TransactionWithOtherAccount=Transfert de compte
PaymentNumberUpdateSucceeded=Numéro de paiement mis à jour PaymentNumberUpdateSucceeded=Numéro de paiement mis à jour
PaymentNumberUpdateFailed=Impossible de mettre le numéro de paiement à jour PaymentNumberUpdateFailed=Impossible de mettre le numéro de paiement à jour
PaymentDateUpdateSucceeded=Date de paiement mise à jour PaymentDateUpdateSucceeded=Date de paiement mise à jour
PaymentDateUpdateFailed=Impossible de mettre la date de paiement à jour PaymentDateUpdateFailed=Impossible de mettre la date de paiement à jour
BankTransactionLine=Ecriture bancaire

View File

@ -131,3 +131,4 @@ DescADHERENT_ETIQUETTE_TYPE=Format
DescADHERENT_CARD_HEADER_TEXT=Texte imprimé sur le haut des cartes adhérents DescADHERENT_CARD_HEADER_TEXT=Texte imprimé sur le haut des cartes adhérents
DescADHERENT_CARD_TEXT=Texte imprimé sur les cartes adhérents DescADHERENT_CARD_TEXT=Texte imprimé sur les cartes adhérents
DescADHERENT_CARD_FOOTER_TEXT=Texte imprimé sur le bas des cartes adhérents DescADHERENT_CARD_FOOTER_TEXT=Texte imprimé sur le bas des cartes adhérents
ShowTypeCard=Voir type %s