mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Les cotisations adhrents sont mises sur un onglet a part.
Tache #6424: Ajouter case a cocher "Envoyer mail confirmation" sur cotisation
This commit is contained in:
parent
947a0141f1
commit
2b06e1ff20
|
|
@ -188,7 +188,7 @@ class Adherent
|
|||
}
|
||||
else
|
||||
{
|
||||
$this->error=$langs->trans("ErrorFailedToSendPassword");
|
||||
$this->error=$langs->trans("ErrorFailedToSendMail",$from,$this->email).'. '.$mailfile->error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -677,7 +677,7 @@ class Adherent
|
|||
$tab=array();
|
||||
$sql = "SELECT *";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_options";
|
||||
$sql .= " WHERE adhid=$rowid";
|
||||
$sql .= " WHERE adhid=".$rowid;
|
||||
|
||||
$result=$this->db->query( $sql);
|
||||
|
||||
|
|
|
|||
415
htdocs/adherents/card_subscriptions.php
Normal file
415
htdocs/adherents/card_subscriptions.php
Normal file
|
|
@ -0,0 +1,415 @@
|
|||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* 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/adherents/fiche.php
|
||||
\ingroup adherent
|
||||
\brief Page d'ajout, edition, suppression d'une fiche adhérent
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/member.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_options.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/adherents/cotisation.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/includes/xmlrpc/xmlrpc.php");
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("bills");
|
||||
$langs->load("members");
|
||||
$langs->load("users");
|
||||
|
||||
$user->getrights('adherent');
|
||||
|
||||
$adh = new Adherent($db);
|
||||
$adho = new AdherentOptions($db);
|
||||
$errmsg='';
|
||||
|
||||
$action=isset($_GET["action"])?$_GET["action"]:$_POST["action"];
|
||||
$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"];
|
||||
$typeid=isset($_GET["typeid"])?$_GET["typeid"]:$_POST["typeid"];
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($_POST["action"] == 'cotisation' && ! $_POST["cancel"])
|
||||
{
|
||||
$langs->load("banks");
|
||||
|
||||
$adh->id = $rowid;
|
||||
$adh->fetch($rowid);
|
||||
|
||||
$reday=$_POST["reday"];
|
||||
$remonth=$_POST["remonth"];
|
||||
$reyear=$_POST["reyear"];
|
||||
if ($_POST["reyear"] && $_POST["remonth"] && $_POST["reday"])
|
||||
{
|
||||
$datecotisation=dolibarr_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||
}
|
||||
$cotisation=$_POST["cotisation"];
|
||||
|
||||
$accountid=$_POST["accountid"];
|
||||
$operation=$_POST["operation"];
|
||||
$label=$_POST["label"];
|
||||
$num_chq=$_POST["num_chq"];
|
||||
|
||||
|
||||
if (! $datecotisation)
|
||||
{
|
||||
$errmsg=$langs->trans("BadDateFormat");
|
||||
$action='addsubscription';
|
||||
}
|
||||
|
||||
if (! $_POST["cotisation"] > 0)
|
||||
{
|
||||
$errmsg=$langs->trans("ErrorFieldRequired",$langs->trans("Amount"));
|
||||
$action='addsubscription';
|
||||
}
|
||||
if ($conf->global->ADHERENT_BANK_USE)
|
||||
{
|
||||
if (! $_POST["accountid"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->trans("FinancialAccount"));
|
||||
if (! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->trans("PaymentMode"));
|
||||
if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->trans("Label"));
|
||||
if ($errmsg) $action='addsubscription';
|
||||
}
|
||||
|
||||
if ($action=='cotisation')
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$crowid=$adh->cotisation($datecotisation, $cotisation, $accountid, $operation, $label, $num_chq);
|
||||
|
||||
if ($crowid > 0)
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
// Envoi mail
|
||||
if ($_POST["sendmail"])
|
||||
{
|
||||
$result=$adh->send_an_email($adh->email,$conf->global->ADHERENT_MAIL_COTIS,$conf->global->ADHERENT_MAIL_COTIS_SUBJECT);
|
||||
if ($result < 0) $errmsg=$adh->error;
|
||||
}
|
||||
|
||||
$_POST["cotisation"]='';
|
||||
$_POST["accountid"]='';
|
||||
$_POST["operation"]='';
|
||||
$_POST["label"]='';
|
||||
$_POST["num_chq"]='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dolibarr_print_error($db,$adh->error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
|
||||
if ($errmsg)
|
||||
{
|
||||
print '<div class="error">'.$errmsg.'</div>';
|
||||
print "\n";
|
||||
}
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$adho->fetch_optionals();
|
||||
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Mode affichage */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
$adh = new Adherent($db);
|
||||
$adh->id = $rowid;
|
||||
$adh->fetch($rowid);
|
||||
$adh->fetch_optionals($rowid);
|
||||
|
||||
$adht = new AdherentType($db);
|
||||
$adht->fetch($adh->typeid);
|
||||
|
||||
$html = new Form($db);
|
||||
|
||||
|
||||
/*
|
||||
* Affichage onglets
|
||||
*/
|
||||
$head = member_prepare_head($adh);
|
||||
|
||||
dolibarr_fiche_head($head, 'subscription', $langs->trans("Member"));
|
||||
|
||||
|
||||
print '<form action="fiche.php" method="post">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td class="valeur">'.$adh->id.' </td></tr>';
|
||||
|
||||
// Nom
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$adh->nom.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Prenom
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$adh->prenom.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Login
|
||||
print '<tr><td>'.$langs->trans("Login").'</td><td class="valeur">'.$adh->login.' </td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adh->type."</td></tr>\n";
|
||||
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$adh->getLibStatut(4).'</td></tr>';
|
||||
|
||||
|
||||
print "</table>\n";
|
||||
print '</form>';
|
||||
|
||||
print "</div>\n";
|
||||
|
||||
|
||||
/*
|
||||
* Barre d'actions
|
||||
*
|
||||
*/
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($action != 'addsubscription')
|
||||
{
|
||||
print "<a class=\"butAction\" href=\"card_subscriptions.php?rowid=$rowid&action=addsubscription\">".$langs->trans("NewSubscription")."</a>";
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Bandeau des cotisations
|
||||
*
|
||||
*/
|
||||
|
||||
print '<table border=0 width="100%">';
|
||||
|
||||
print '<tr>';
|
||||
print '<td valign="top" width="50%">';
|
||||
|
||||
|
||||
/*
|
||||
* Liste des cotisations
|
||||
*
|
||||
*/
|
||||
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe,";
|
||||
$sql.= " c.rowid as crowid, c.cotisation, ".$db->pdate("c.dateadh")." as dateadh, c.fk_bank,";
|
||||
$sql.= " ba.rowid as baid, ba.label, ba.bank";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."cotisation as c";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank = b.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||
$sql.= " WHERE d.rowid = c.fk_adherent AND d.rowid=".$rowid;
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$cotisationstatic=new Cotisation($db);
|
||||
$accountstatic=new Account($db);
|
||||
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Ref").'</td>';
|
||||
print '<td>'.$langs->trans("DateSubscription").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Amount").'</td>';
|
||||
if ($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>".dolibarr_print_date($objp->dateadh,'day')."</td>\n";
|
||||
print '<td align="right">'.price($objp->cotisation).'</td>';
|
||||
if ($conf->global->ADHERENT_BANK_USE)
|
||||
{
|
||||
print '<td align="right">';
|
||||
if ($objp->fk_bank)
|
||||
{
|
||||
$accountstatic->label=$objp->label;
|
||||
$accountstatic->id=$objp->baid;
|
||||
print $accountstatic->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>";
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
print '</td><td valign="top">';
|
||||
|
||||
|
||||
// Date fin cotisation
|
||||
print "<table class=\"border\" width=\"100%\">\n";
|
||||
print '<tr><td>'.$langs->trans("SubscriptionEndDate");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($adh->datefin)
|
||||
{
|
||||
if ($adh->datefin < time())
|
||||
{
|
||||
print dolibarr_print_date($adh->datefin,'day')." ".img_warning($langs->trans("Late"));
|
||||
}
|
||||
else
|
||||
{
|
||||
print dolibarr_print_date($adh->datefin,'day');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("SubscriptionNotReceived")." ".img_warning($langs->trans("Late"));
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
/*
|
||||
* Ajout d'une nouvelle cotisation
|
||||
*/
|
||||
if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer)
|
||||
{
|
||||
print '<br>';
|
||||
print "\n\n<!-- Form add subscription -->\n";
|
||||
|
||||
print '<form name="cotisation" method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="action" value="cotisation">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print "<table class=\"border\" width=\"100%\">\n";
|
||||
|
||||
print '<tr><td colspan="2"><b>'.$langs->trans("NewCotisation").'</b></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DateSubscription").'</td><td>';
|
||||
if ($adh->datefin > 0)
|
||||
{
|
||||
$html->select_date(dolibarr_time_plus_duree($adh->datefin,1,'d'),'','','','',"cotisation");
|
||||
}
|
||||
else
|
||||
{
|
||||
$html->select_date('','','','','',"cotisation");
|
||||
}
|
||||
print "</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->global->ADHERENT_BANK_USE)
|
||||
{
|
||||
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>(Numéro chèque ou virement)</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>(Emetteur du chèque)</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>(Banque du chèque)</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 '<td><input name="label" type="text" size="32" value="'.$langs->trans("Subscription").' ';
|
||||
print strftime("%Y",($adh->datefin?$adh->datefin:time())).'" ></td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans("SendAcknowledgementByMail").'</td>';
|
||||
print '<td><input name="sendmail" type="checkbox"'.($conf->global->ADHERENT_MAIL_COTIS?' checked="true"':'').'></td></tr>';
|
||||
|
||||
|
||||
print '<tr><td colspan="2" align="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
print "\n<!-- End form subscription -->\n\n";
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -499,7 +499,7 @@ if ($action == 'edit')
|
|||
*/
|
||||
$head = member_prepare_head($adh);
|
||||
|
||||
dolibarr_fiche_head($head, 'general', $langs->trans("Member").": ".$adh->fullname);
|
||||
dolibarr_fiche_head($head, 'general', $langs->trans("Member"));
|
||||
|
||||
|
||||
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
|
|
@ -515,7 +515,7 @@ if ($action == 'edit')
|
|||
print '<tr><td>'.$langs->trans("Ref").'</td><td class="valeur" colspan="2">'.$adh->id.' </td></tr>';
|
||||
|
||||
// Nom
|
||||
print '<tr><td>'.$langs->trans("Name").'</td><td><input type="text" name="nom" size="40" value="'.$adh->nom.'"></td>';
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td><input type="text" name="nom" size="40" value="'.$adh->nom.'"></td>';
|
||||
// Notes
|
||||
print '<td valign="top" width="50%">'.$langs->trans("Notes").'</td></tr>';
|
||||
|
||||
|
|
@ -632,7 +632,7 @@ if ($action == 'create')
|
|||
// Login
|
||||
print '<tr><td>'.$langs->trans("Login").'*</td><td><input type="text" name="member_login" size="40" value="'.$adh->login.'"></td></tr>';
|
||||
|
||||
// Mot de pass
|
||||
// Mot de passe
|
||||
print '<tr><td>'.$langs->trans("Password").'*</td><td><input type="password" name="member_pass" size="40" value="'.$adh->pass.'"></td></tr>';
|
||||
|
||||
// Type
|
||||
|
|
@ -759,13 +759,13 @@ if ($rowid && $action != 'edit')
|
|||
*/
|
||||
$head = member_prepare_head($adh);
|
||||
|
||||
dolibarr_fiche_head($head, 'general', $langs->trans("Member").": ".$adh->fullname);
|
||||
dolibarr_fiche_head($head, 'general', $langs->trans("Member"));
|
||||
|
||||
|
||||
// Confirmation de la suppression de l'adhérent
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_delete");
|
||||
$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete");
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
|
@ -835,19 +835,22 @@ if ($rowid && $action != 'edit')
|
|||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td class="valeur" colspan="3">'.$adh->id.' </td></tr>';
|
||||
|
||||
// Nom
|
||||
print '<tr><td>'.$langs->trans("Lastname").'*</td><td class="valeur">'.$adh->nom.' </td>';
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$adh->nom.' </td>';
|
||||
print '<td valign="top" width="50%">'.$langs->trans("Notes").'</td></tr>';
|
||||
|
||||
// Prenom
|
||||
print '<tr><td>'.$langs->trans("Firstname").'*</td><td class="valeur">'.$adh->prenom.' </td>';
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$adh->prenom.' </td>';
|
||||
print '<td rowspan="'.(13+count($adh->array_options)).'" valign="top" width="50%">';
|
||||
print nl2br($adh->commentaire).' </td></tr>';
|
||||
|
||||
// Login
|
||||
print '<tr><td>'.$langs->trans("Login").'*</td><td class="valeur">'.$adh->login.' </td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Login").'</td><td class="valeur">'.$adh->login.' </td></tr>';
|
||||
|
||||
// Password
|
||||
print '<tr><td>'.$langs->trans("Password").'</td><td>'.eregi_replace('.','*',$adh->pass).'</td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td>'.$langs->trans("Type").'*</td><td class="valeur">'.$adh->type."</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adh->type."</td></tr>\n";
|
||||
|
||||
// Morphy
|
||||
print '<tr><td>'.$langs->trans("Person").'</td><td class="valeur">'.$adh->getmorphylib().'</td></tr>';
|
||||
|
|
@ -987,155 +990,8 @@ if ($rowid && $action != 'edit')
|
|||
print '<tr>';
|
||||
print '<td valign="top" width="50%">';
|
||||
|
||||
|
||||
/*
|
||||
* Liste des cotisations
|
||||
*
|
||||
*/
|
||||
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe,";
|
||||
$sql.= " c.rowid as crowid, c.cotisation, ".$db->pdate("c.dateadh")." as dateadh, c.fk_bank,";
|
||||
$sql.= " ba.rowid as baid, ba.label, ba.bank";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."cotisation as c";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank = b.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||
$sql.= " WHERE d.rowid = c.fk_adherent AND d.rowid=".$rowid;
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$cotisationstatic=new Cotisation($db);
|
||||
$accountstatic=new Account($db);
|
||||
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Ref").'</td>';
|
||||
print '<td>'.$langs->trans("DateSubscription").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Amount").'</td>';
|
||||
if ($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>".dolibarr_print_date($objp->dateadh)."</td>\n";
|
||||
print '<td align="right">'.price($objp->cotisation).'</td>';
|
||||
if ($conf->global->ADHERENT_BANK_USE)
|
||||
{
|
||||
print '<td align="right">';
|
||||
if ($objp->fk_bank)
|
||||
{
|
||||
$accountstatic->label=$objp->label;
|
||||
$accountstatic->id=$objp->baid;
|
||||
print $accountstatic->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>";
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
print '</td><td valign="top">';
|
||||
|
||||
|
||||
/*
|
||||
* Ajout d'une nouvelle cotisation
|
||||
*/
|
||||
if ($user->rights->adherent->cotisation->creer)
|
||||
{
|
||||
print "\n\n<!-- Form add subscription -->\n";
|
||||
|
||||
print '<form name="cotisation" method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print "<table class=\"border\" width=\"100%\">\n";
|
||||
|
||||
print '<tr><td>'.$langs->trans("SubscriptionEndDate");
|
||||
print '<input type="hidden" name="action" value="cotisation">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($adh->datefin)
|
||||
{
|
||||
if ($adh->datefin < time())
|
||||
{
|
||||
print dolibarr_print_date($adh->datefin)." ".img_warning($langs->trans("Late"));
|
||||
}
|
||||
else
|
||||
{
|
||||
print dolibarr_print_date($adh->datefin);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("SubscriptionNotReceived")." ".img_warning($langs->trans("Late"));
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td colspan="2"><b>'.$langs->trans("NewCotisation").'</b></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DateSubscription").'</td><td>';
|
||||
if ($adh->datefin > 0)
|
||||
{
|
||||
$html->select_date(dolibarr_time_plus_duree($adh->datefin,1,'d'),'','','','',"cotisation");
|
||||
}
|
||||
else
|
||||
{
|
||||
$html->select_date('','','','','',"cotisation");
|
||||
}
|
||||
print "</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->global->ADHERENT_BANK_USE)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("PaymentMode").'</td><td>';
|
||||
$html->select_types_paiements($_POST["operation"],'operation');
|
||||
print "</td></tr>\n";
|
||||
|
||||
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("Numero").'</td><td>';
|
||||
print '<input name="num_chq" type="text" size="8" value="'.$_POST["num_chq"].'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td>'.$langs->trans("Label").'</td>';
|
||||
print '<td><input name="label" type="text" size="50" value="'.$langs->trans("Subscription").' ';
|
||||
print strftime("%Y",($adh->datefin?$adh->datefin:time())).'" ></td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
print "\n<!-- End form subscription -->\n\n";
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ $adh->info($_GET["id"]);
|
|||
*/
|
||||
$head = member_prepare_head($adh);
|
||||
|
||||
dolibarr_fiche_head($head, 'info', $langs->trans("Member").": ".$adh->fullname);
|
||||
dolibarr_fiche_head($head, 'info', $langs->trans("Member"));
|
||||
|
||||
|
||||
print '<table width="100%"><tr><td>';
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ if (! $result)
|
|||
*/
|
||||
$head = member_prepare_head($adh);
|
||||
|
||||
dolibarr_fiche_head($head, 'ldap', $langs->trans("Member").": ".$adh->fullname);
|
||||
dolibarr_fiche_head($head, 'ldap', $langs->trans("Member"));
|
||||
|
||||
|
||||
|
||||
|
|
@ -96,18 +96,18 @@ print '<table class="border" width="100%">';
|
|||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td class="valeur">'.$adh->id.' </td></tr>';
|
||||
|
||||
// Nom
|
||||
print '<tr><td>'.$langs->trans("Lastname").'*</td><td class="valeur">'.$adh->nom.' </td>';
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$adh->nom.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Prenom
|
||||
print '<tr><td width="15%">'.$langs->trans("Firstname").'*</td><td class="valeur">'.$adh->prenom.' </td>';
|
||||
print '<tr><td width="15%">'.$langs->trans("Firstname").'</td><td class="valeur">'.$adh->prenom.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Login
|
||||
print '<tr><td>'.$langs->trans("Login").'*</td><td class="valeur">'.$adh->login.' </td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Login").'</td><td class="valeur">'.$adh->login.' </td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td>'.$langs->trans("Type").'*</td><td class="valeur">'.$adh->type."</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adh->type."</td></tr>\n";
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ ReceivedCustomersPaymentsToValid=Received customers payments to validate
|
|||
PaymentsReportsForYear=Payments reports for %s
|
||||
PaymentsReports=Payments reports
|
||||
PaymentsAlreadyDone=Payments already done
|
||||
PaymentMode=Payment rule
|
||||
PaymentRule=Payment rule
|
||||
PaymentMode=Payment type
|
||||
PaymentConditions=Payment term
|
||||
PaymentConditionsShort=Payment term
|
||||
PaymentAmount=Payment amount
|
||||
|
|
|
|||
|
|
@ -351,6 +351,7 @@ CloseWindow=Close window
|
|||
Question=Question
|
||||
Response=Response
|
||||
Priority=Priority
|
||||
SendAcknowledgementByMail=Send Ack. by mail
|
||||
# Countries
|
||||
CountryFR=France
|
||||
CountryBE=Belgium
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ ReceivedCustomersPaymentsToValid=Paiements clients re
|
|||
PaymentsReportsForYear=Rapports de paiements pour %s
|
||||
PaymentsReports=Rapports de paiements
|
||||
PaymentsAlreadyDone=Versements déjà effectués
|
||||
PaymentRule=Condition de réglement
|
||||
PaymentMode=Mode règlement
|
||||
PaymentConditionsShort=Conditions règlement
|
||||
ClassifyPayed=Classer 'Payée'
|
||||
|
|
|
|||
|
|
@ -351,6 +351,7 @@ CloseWindow=Fermer fen
|
|||
Question=Question
|
||||
Response=Réponse
|
||||
Priority=Priorité
|
||||
SendAcknowledgementByMail=Envoi A.R. par mail
|
||||
# Countries
|
||||
CountryFR=France
|
||||
CountryBE=Belgique
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ class CMailFile
|
|||
//$this->send_to_file();
|
||||
|
||||
$errorlevel=error_reporting();
|
||||
//error_reporting($errorlevel ^ E_WARNING); // Désactive warnings
|
||||
error_reporting($errorlevel ^ E_WARNING); // Désactive warnings
|
||||
|
||||
if (! $conf->global->MAIN_DISABLE_ALL_MAILS)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -50,6 +50,11 @@ function member_prepare_head($member)
|
|||
$h++;
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$member->id;
|
||||
$head[$h][1] = $langs->trans("Subscriptions");
|
||||
$head[$h][2] = 'subscription';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/adherents/info.php?id='.$member->id;
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$head[$h][2] = 'info';
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user