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

@ -134,10 +134,9 @@ class AdherentType extends CommonObject
} }
/** /**
\brief Fonction qui permet de supprimer le status de l'adhérent * \brief Fonction qui permet de supprimer le status de l'adhérent
\param rowid * \param rowid
*/ */
function delete($rowid) function delete($rowid)
{ {
@ -198,23 +197,28 @@ class AdherentType extends CommonObject
} }
} }
/**
* Return list of members' type
*
* @return array List of types
*/
function liste_array() function liste_array()
{ {
$projets = array(); $projets = array();
$sql = "SELECT rowid, libelle FROM ".MAIN_DB_PREFIX."adherent_type"; $sql = "SELECT rowid, libelle FROM ".MAIN_DB_PREFIX."adherent_type";
if ($this->db->query($sql) ) $resql=$this->db->query($sql);
if ($resql)
{ {
$nump = $this->db->num_rows(); $nump = $this->db->num_rows($resql);
if ($nump) if ($nump)
{ {
$i = 0; $i = 0;
while ($i < $nump) while ($i < $nump)
{ {
$obj = $this->db->fetch_object(); $obj = $this->db->fetch_object($resql);
$projets[$obj->rowid] = $obj->libelle; $projets[$obj->rowid] = $obj->libelle;
$i++; $i++;
@ -233,9 +237,11 @@ class AdherentType extends CommonObject
/** /**
* \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;
@ -245,11 +251,11 @@ class AdherentType extends CommonObject
$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,15 +16,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$
*/ */
/** /**
\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");
@ -70,6 +68,7 @@ if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisatio
$adht->fetch($adh->typeid); $adht->fetch($adh->typeid);
// Subscription informations
$datecotisation=0; $datecotisation=0;
$datesubend=0; $datesubend=0;
if ($_POST["reyear"] && $_POST["remonth"] && $_POST["reday"]) if ($_POST["reyear"] && $_POST["remonth"] && $_POST["reday"])
@ -80,14 +79,8 @@ if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisatio
{ {
$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)
{ {
@ -99,6 +92,14 @@ if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisatio
$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"]))
@ -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,37 +424,46 @@ 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>';
// Label
print '<tr><td>'.$langs->trans("Label").'</td>';
print '<td><input name="label" type="text" size="32" value="'.$langs->trans("Subscription").' ';
print dolibarr_print_date(($datefrom?$datefrom:time()),"%Y").'" ></td></tr>';
// Bank account
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) 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>'; print '<tr><td>'.$langs->trans("FinancialAccount").'</td><td>';
$html->select_comptes($_POST["accountid"],'accountid',0,'',1); $html->select_comptes($_POST["accountid"],'accountid',0,'',1);
print "</td></tr>\n"; print "</td></tr>\n";
}
// Payment mode
print '<tr><td>'.$langs->trans("PaymentMode").'</td><td>'; print '<tr><td>'.$langs->trans("PaymentMode").'</td><td>';
$html->select_types_paiements($_POST["operation"],'operation'); $html->select_types_paiements($_POST["operation"],'operation');
print "</td></tr>\n"; print "</td></tr>\n";
print '<tr><td>'.$langs->trans('Numero'); print '<tr><td>'.$langs->trans('Numero');
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>'; // \todo a traduire print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
print '</td>'; print '</td>';
print '<td><input name="num_chq" type="text" size="8" value="'.(empty($_POST['num_chq'])?'':$_POST['num_chq']).'"></td></tr>'; 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 '<tr><td>'.$langs->trans('CheckTransmitter');
print ' <em>('.$langs->trans("ChequeMaker").')</em>'; // \todo a traduire print ' <em>('.$langs->trans("ChequeMaker").')</em>';
print '</td>'; print '</td>';
print '<td><input name="chqemetteur" size="32" type="text" value="'.(empty($_POST['chqemetteur'])?$facture->client->nom:$_POST['chqemetteur']).'"></td></tr>'; 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 '<tr><td>'.$langs->trans('Bank');
print ' <em>('.$langs->trans("ChequeBank").')</em>'; // \todo a traduire print ' <em>('.$langs->trans("ChequeBank").')</em>';
print '</td>'; print '</td>';
print '<td><input name="chqbank" size="32" type="text" value="'.(empty($_POST['chqbank'])?'':$_POST['chqbank']).'"></td></tr>'; 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 '<td><input name="label" type="text" size="32" value="'.$langs->trans("Subscription").' ';
print dolibarr_print_date(($datefrom?$datefrom:time()),"%Y").'" ></td></tr>';
} }
print '<tr><td>'.$langs->trans("SendAcknowledgementByMail").'</td>'; print '<tr><td>'.$langs->trans("SendAcknowledgementByMail").'</td>';

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,6 +169,7 @@ 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; ';
@ -297,6 +318,9 @@ 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>';
// Amount
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur" colspan="3">'.$subscription->note.'</td></tr>';
// Bank account // Bank account
if ($conf->banque->enabled) if ($conf->banque->enabled)
{ {
@ -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,6 +767,9 @@ class AccountLine
var $amount; var $amount;
var $label; var $label;
var $note; var $note;
var $fk_account;
var $bank_account_label;
/** /**
@ -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,";
@ -232,7 +232,10 @@ 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>";

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

@ -122,3 +122,4 @@ 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

@ -122,3 +122,4 @@ PaymentNumberUpdateSucceeded=Num
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