Gestion de la banque et nom emetteur d'un chque sur adhsion.
This commit is contained in:
parent
4f36789a4b
commit
f013b5897b
@ -746,17 +746,22 @@ class Adherent
|
||||
\brief Fonction qui insère la cotisation dans la base de données
|
||||
et eventuellement liens dans banques, mailman, etc...
|
||||
\param date Date d'effet de la cotisation
|
||||
\param montant Montant cotisation
|
||||
\param montant Montant cotisation (accepte 0 pour les adhérents non soumis à cotisation)
|
||||
\param account_id Id compte bancaire
|
||||
\param operation Type 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 emetteur_nom Nom emetteur chèque
|
||||
\param emetteur_banque Nom banque emetteur chèque
|
||||
\return int rowid de l'entrée ajoutée, <0 si erreur
|
||||
*/
|
||||
function cotisation($date, $montant, $accountid=0, $operation='', $label='', $num_chq='')
|
||||
function cotisation($date, $montant, $accountid=0, $operation='', $label='', $num_chq='', $emetteur_nom='', $emetteur_banque='')
|
||||
{
|
||||
global $conf,$langs,$user;
|
||||
|
||||
// Nettoyage parametres
|
||||
if (! $montant) $montant=0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."cotisation (fk_adherent, datec, dateadh, cotisation)";
|
||||
@ -790,7 +795,7 @@ class Adherent
|
||||
|
||||
$dateop=time();
|
||||
|
||||
$insertid=$acct->addline($dateop, $operation, $label, $montant, $num_chq, '', $user);
|
||||
$insertid=$acct->addline($dateop, $operation, $label, $montant, $num_chq, '', $user, $emetteur_nom, $emetteur_banque);
|
||||
if ($insertid > 0)
|
||||
{
|
||||
$inserturlid=$acct->add_url_line($insertid, $this->id, DOL_URL_ROOT.'/adherents/fiche.php?rowid=', $this->getFullname(), 'member');
|
||||
|
||||
@ -81,7 +81,8 @@ if ($_POST["action"] == 'cotisation' && ! $_POST["cancel"])
|
||||
$operation=$_POST["operation"];
|
||||
$label=$_POST["label"];
|
||||
$num_chq=$_POST["num_chq"];
|
||||
|
||||
$emetteur_nom=$_POST["chqemetteur"];
|
||||
$emetteur_banque=$_POST["chqbank"];
|
||||
|
||||
if (! $datecotisation)
|
||||
{
|
||||
@ -109,7 +110,7 @@ if ($_POST["action"] == 'cotisation' && ! $_POST["cancel"])
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$crowid=$adh->cotisation($datecotisation, $cotisation, $accountid, $operation, $label, $num_chq);
|
||||
$crowid=$adh->cotisation($datecotisation, $cotisation, $accountid, $operation, $label, $num_chq, $emetteur_nom, $emetteur_banque);
|
||||
|
||||
if ($crowid > 0)
|
||||
{
|
||||
@ -398,7 +399,16 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer)
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans("SendAcknowledgementByMail").'</td>';
|
||||
print '<td><input name="sendmail" type="checkbox"'.($conf->global->ADHERENT_MAIL_COTIS?' checked="true"':'').'></td></tr>';
|
||||
print '<td>';
|
||||
if (! $adh->email)
|
||||
{
|
||||
print $langs->trans("NoEMail");
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input name="sendmail" type="checkbox"'.($conf->global->ADHERENT_MAIL_COTIS?' checked="true"':'').'>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '<tr><td colspan="2" align="center">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user