From fd177b17462ef5d811401a4e61af75c23a396b8d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Aug 2010 15:25:39 +0000 Subject: [PATCH] Start to work on invoice/payment creation on subscription creation --- htdocs/adherents/card_subscriptions.php | 331 +++++++++++++--------- htdocs/adherents/class/adherent.class.php | 12 +- htdocs/adherents/cotisations.php | 198 ++++--------- htdocs/adherents/fiche.php | 52 +--- htdocs/core/class/html.form.class.php | 4 +- htdocs/langs/en_US/admin.lang | 2 +- htdocs/langs/en_US/members.lang | 4 + htdocs/langs/fr_FR/admin.lang | 2 +- htdocs/langs/fr_FR/members.lang | 8 +- 9 files changed, 272 insertions(+), 341 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index c5a8039cee5..0babb24352e 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -65,8 +65,7 @@ if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisatio $adh->id = $rowid; $result=$adh->fetch($rowid); - - $adht->fetch($adh->typeid); + $result=$adht->fetch($adh->typeid); // Subscription informations $datecotisation=0; @@ -98,6 +97,8 @@ if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisatio $num_chq=$_POST["num_chq"]; $emetteur_nom=$_POST["chqemetteur"]; $emetteur_banque=$_POST["chqbank"]; + $option=$_POST["paymentsave"]; + if (empty($option)) $option='none'; // Check if a payment is mandatory or not if ($adht->cotisation) // Type adherent soumis a cotisation @@ -110,9 +111,9 @@ if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisatio } else { - if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) + if ($conf->banque->enabled && $_POST["paymentsave"] != 'none') { - if ($_POST["cotisation"]) + if ($_POST["cotisation"]) { if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")); if (! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); @@ -131,7 +132,7 @@ if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisatio { $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, $option); if ($crowid > 0) { @@ -181,9 +182,6 @@ $adht->fetch($adh->typeid); $adho->fetch_optionals(); -/* - * Affichage onglets - */ $head = member_prepare_head($adh); dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, 'user'); @@ -219,7 +217,7 @@ print ''.$langs->trans("Status").''.$adh->getLib print "\n"; print ''; -print "\n"; +dol_fiche_end(); if ($errmsg) @@ -236,7 +234,6 @@ if ($errmsg) /* * Barre d'actions - * */ print '
'; @@ -253,145 +250,165 @@ print "
\n"; -/* - * Bandeau des cotisations - * - */ - -print ''; - -print ''; -print ''; + print ''; - print '
'; - - -/* - * Liste des cotisations - * - */ -$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe,"; -$sql.= " c.rowid as crowid, c.cotisation,"; -$sql.= " c.dateadh,"; -$sql.= " c.datef,"; -$sql.= " c.fk_bank,"; -$sql.= " b.rowid as bid,"; -$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 "\n"; - - print ''; - print ''; - print ''; - print ''; - print ''; - if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) - { - print ''; - } - print "\n"; - - $var=True; - while ($i < $num) - { - $objp = $db->fetch_object($result); - $var=!$var; - print ""; - $cotisationstatic->ref=$objp->crowid; - $cotisationstatic->id=$objp->crowid; - print ''; - print '\n"; - print '\n"; - print ''; - if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) - { - print ''; - } - print ""; - $i++; - } - print "
'.$langs->trans("Ref").''.$langs->trans("DateSubscription").''.$langs->trans("DateEnd").''.$langs->trans("Amount").''.$langs->trans("Account").'
'.$cotisationstatic->getNomUrl(1).''.dol_print_date($db->jdate($objp->dateadh),'day')."'.dol_print_date($db->jdate($objp->datef),'day')."'.price($objp->cotisation).''; - if ($objp->bid) - { - $accountstatic->label=$objp->label; - $accountstatic->id=$objp->baid; - print $accountstatic->getNomUrl(1); - } - else - { - print ' '; - } - print '
"; -} -else -{ - dol_print_error($db); -} - -print '
'; - - // Date fin cotisation -print "\n"; +print "
\n"; print ''; print ''; print ''; print '
'.$langs->trans("SubscriptionEndDate"); print ''; if ($adh->datefin) { - if ($adh->datefin < time()) - { - print dol_print_date($adh->datefin,'day'); - if ($adh->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie - } - else - { - print dol_print_date($adh->datefin,'day'); - } + if ($adh->datefin < time()) + { + print dol_print_date($adh->datefin,'day'); + if ($adh->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie + } + else + { + print dol_print_date($adh->datefin,'day'); + } } else { - print $langs->trans("SubscriptionNotReceived"); - if ($adh->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie + print $langs->trans("SubscriptionNotReceived"); + if ($adh->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie } print '
'; +print '
'; /* - * Add new subscription + * List of subscriptions + */ +if ($action != 'addsubscription') +{ + $sql = "SELECT d.rowid, d.prenom, d.nom, d.societe,"; + $sql.= " c.rowid as crowid, c.cotisation,"; + $sql.= " c.dateadh,"; + $sql.= " c.datef,"; + $sql.= " c.fk_bank,"; + $sql.= " b.rowid as bid,"; + $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 "\n"; + + print ''; + print ''; + print ''; + print ''; + print ''; + if ($conf->banque->enabled) + { + print ''; + } + print "\n"; + + $var=True; + while ($i < $num) + { + $objp = $db->fetch_object($result); + $var=!$var; + print ""; + $cotisationstatic->ref=$objp->crowid; + $cotisationstatic->id=$objp->crowid; + print ''; + print '\n"; + print '\n"; + print ''; + if ($conf->banque->enabled) + { + print ''; + } + print ""; + $i++; + } + print "
'.$langs->trans("Ref").''.$langs->trans("DateSubscription").''.$langs->trans("DateEnd").''.$langs->trans("Amount").''.$langs->trans("Account").'
'.$cotisationstatic->getNomUrl(1).''.dol_print_date($db->jdate($objp->dateadh),'day')."'.dol_print_date($db->jdate($objp->datef),'day')."'.price($objp->cotisation).''; + if ($objp->bid) + { + $accountstatic->label=$objp->label; + $accountstatic->id=$objp->baid; + print $accountstatic->getNomUrl(1); + } + else + { + print ' '; + } + print '
"; + } + else + { + dol_print_error($db); + } +} + + + +/* + * Add new subscription form */ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer) { print '
'; + + print_fiche_titre($langs->trans("NewCotisation")); + + $bankdirect=0; // Option to write to bank is on by default + $bankviainvoice=0; // Option to write via invoice is on by default + $invoiceonly=0; + if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE && (empty($_POST['paymentsave']) || $_POST["paymentsave"] == 'bankdirect')) $bankdirect=1; + if ($conf->banque->enabled && $conf->societe->enabled && $conf->facture->enabled && $adh->fk_soc) $bankviainvoice=1; + // TODO A virer + $bankviainvoice=0; + print "\n\n\n"; + if ($conf->use_javascript_ajax) + { + print ''; + } + print '
'; print ''; print ''; print ''; print "\n"; - // Title subscription - print ''; - $today=mktime(); $datefrom=0; $dateto=0; // Date start subscription - print ''; + print ''; // Label - print ''; + print ''; print ''; - // Bank account - if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) + // Bank account transaction + if ($conf->banque->enabled || $conf->facture->enabled) { - // Title payments - print ''; + $company=new Societe($db); + if ($adh->fk_soc) + { + $result=$company->fetch($adh->fk_soc); + } + + // Title payments + //print ''; + + // Define a way to write payment + print ''; + print ''; // Bank account - print '\n"; // Payment mode - print '\n"; - print ''; - print ''; + print ''; - print ''; - print ''; + print ''; - print ''; - print ''; - + print ''; } } - print ''; + print ''; + + print ''; print ''; + print '
'.$langs->trans("NewCotisation").'
'.$langs->trans("DateSubscription").''; + print '
'.$langs->trans("DateSubscription").''; if ($_POST["reday"]) { $datefrom=dol_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]); @@ -427,48 +444,85 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer) if ($adht->cotisation) { // Amount - print '
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans("Label").'
'.$langs->trans("Label").'
'.$langs->trans("Payment").'
'.$langs->trans("Payment").'
'.$langs->trans('MoreActions'); + print ''; + print ' '.$langs->trans("None").'
'; + if ($conf->banque->enabled) + { + print ' '.$langs->trans("MoreActionBankDirect").'
'; + } + if ($conf->banque->enabled && $conf->societe->enabled && $conf->facture->enabled) + { + print 'fk_soc) || empty($bankviainvoice)) print ' disabled="true"'; + print '> '.$langs->trans("MoreActionBankViaInvoice"); + if ($adh->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; + else print ' ('.$langs->trans("NoThirdPartyAssociatedToMember").')'; + print '
'; + } + if ($conf->societe->enabled && $conf->facture->enabled) + { + print 'fk_soc) || empty($bankviainvoice)) print ' disabled="true"'; + print '> '.$langs->trans("MoreActionInvoiceOnly"); + if ($adh->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; + else print ' ('.$langs->trans("NoThirdPartyAssociatedToMember").')'; + print '
'; + } + print '
'.$langs->trans("FinancialAccount").''; + print '
'.$langs->trans("FinancialAccount").''; $html->select_comptes($_POST["accountid"],'accountid',0,'',1); print "
'.$langs->trans("PaymentMode").''; + print '
'.$langs->trans("PaymentMode").''; $html->select_types_paiements($_POST["operation"],'operation'); print "
'.$langs->trans('Numero'); + print '
'.$langs->trans('Numero'); print ' ('.$langs->trans("ChequeOrTransferNumber").')'; print '
'.$langs->trans('CheckTransmitter'); + print '
'.$langs->trans('CheckTransmitter'); print ' ('.$langs->trans("ChequeMaker").')'; print '
'.$langs->trans('Bank'); + print '
'.$langs->trans('Bank'); print ' ('.$langs->trans("ChequeBank").')'; print '
'.$langs->trans("SendAcknowledgementByMail").'
 
'.$langs->trans("SendAcknowledgementByMail").''; if (! $adh->email) { @@ -495,23 +549,22 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer) print $html->textwithpicto($tmp,$helpcontent,1,'help'); } print '
'; + print '
'; - - print '
'; + print '
'; print ''; print '     '; print ''; - print '
'; print ''; print "\n\n\n"; } -print ''; -print ''; - +//print ''; +//print ''; $db->close(); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 251a17aac35..6f71db226e9 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1143,9 +1143,10 @@ class Adherent extends CommonObject * \param emetteur_nom Nom emetteur cheque * \param emetteur_banque Nom banque emetteur cheque * \param datesubend Date fin adhesion + * \param option 'none'=No more action, 'bankdirect'=Add direct bank transaction, 'bankviainvoice'=Add bank transaction via invoice and payment * \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, $option='none') { global $conf,$langs,$user; @@ -1174,7 +1175,6 @@ class Adherent extends CommonObject $cotisation->note=$label; $rowid=$cotisation->create($user); - if ($rowid > 0) { // Update denormalized subscription end date (read database subscription to find values) @@ -1189,7 +1189,7 @@ class Adherent extends CommonObject } // Insertion dans la gestion bancaire si configure pour - if ($conf->global->ADHERENT_BANK_USE && $accountid) + if ($option == 'bankdirect' && $accountid) { $acct=new Account($this->db); $result=$acct->fetch($accountid); @@ -1229,6 +1229,12 @@ class Adherent extends CommonObject } } + // Create invoice and payment + if ($option == 'bankviainvoice' && $accountid) + { + // TODO + } + // Change properties of object (used by triggers) $this->last_subscription_date=$dateop; $this->last_subscription_amount=$montant; diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index 5eb1d713c39..38049cd4cd3 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -48,91 +48,13 @@ $pagenext = $page + 1; $msg=''; $date_select=isset($_GET["date_select"])?$_GET["date_select"]:$_POST["date_select"]; -// Desactivation fonctions insertions en banque apres coup -// Cette fonction me semble pas utile. Si on a fait des adhesions alors que module banque -// pas actif c'est qu'on voulait pas d'insertion en banque. -// si on active apres coup, on va pas modifier toutes les adhesions pour avoir une ecriture -// en banque mais on va mettre le solde banque direct a la valeur apres toutes les adh�sions. -$allowinsertbankafter=0; - if (! $user->rights->adherent->cotisation->lire) - accessforbidden(); +accessforbidden(); /* -* Actions -*/ - -// Insertion de la cotisation dans le compte banquaire -if ($allowinsertbankafter && $_POST["action"] == '2bank' && $_POST["rowid"] !='') -{ - if ($conf->global->ADHERENT_BANK_USE) - { - if (! $_POST["accountid"]) - { - $msg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("BankAccount")).'
'; - } - if (! $_POST["paymenttypeid"]) - { - $msg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("OperationType")).'
'; - } - - // Cr�er un tiers + facture et enregistrer son paiement ? -> Non requis avec module compta expert - // Eventuellement offrir option a la creation adhesion - - if (! $msg) - { - $db->begin(); - - $dateop=time(); - - $cotisation=new Cotisation($db); - $result=$cotisation->fetch($_POST["rowid"]); - $adherent=new Adherent($db); - $result=$adherent->fetch($cotisation->fk_adherent); - - if ($result > 0) - { - $amount=$cotisation->amount; - - $acct=new Account($db); - $acct->fetch($_POST["accountid"]); - $insertid=$acct->addline($dateop, $_POST["paymenttypeid"], $_POST["label"], $amount, $_POST["num_chq"],ADHERENT_BANK_CATEGORIE,$user); - if ($insertid < 0) - { - dol_print_error($db,$acct->error); - } - else - { - $inserturlid=$acct->add_url_line($insertid, $adherent->rowid, DOL_URL_ROOT.'/adherents/fiche.php?rowid=', $adherent->getFullname($langs), 'member'); - - // Met a jour la table cotisation - $sql="UPDATE ".MAIN_DB_PREFIX."cotisation"; - $sql.=" SET fk_bank=".$insertid.","; - $sql.=" note='".addslashes($_POST["label"])."'"; - $sql.=" WHERE rowid=".$_POST["rowid"]; - dol_syslog("cotisations sql=".$sql); - $result = $db->query($sql); - if ($result) - { - //Header("Location: cotisations.php"); - $db->commit(); - } - else - { - $db->rollback(); - dol_print_error($db); - } - } - } - else - { - $db->rollback(); - dol_print_error($db,$cotisation->error); - } - } - } -} + * Actions + */ /* @@ -155,7 +77,7 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank=b.rowid"; $sql.= " WHERE d.rowid = c.fk_adherent"; if (isset($date_select) && $date_select != '') { - $sql.= " AND dateadh LIKE '$date_select%'"; + $sql.= " AND dateadh LIKE '$date_select%'"; } $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($conf->liste_limit+1, $offset); @@ -169,7 +91,7 @@ if ($result) $title=$langs->trans("ListOfSubscriptions"); if (! empty($date_select)) $title.=' ('.$langs->trans("Year").' '.$date_select.')'; $param.="&statut=$statut&date_select=$date_select"; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num); print ''; @@ -179,21 +101,21 @@ if ($result) print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.nom",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Login"),"cotisations.php","d.login",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),"cotisations.php","c.note",$param,"",'align="left"',$sortfield,$sortorder); - if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) + if ($conf->banque->enabled) { - print_liste_field_titre($langs->trans("Bank"),"cotisations.php","b.fk_account",$pram,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Account"),"cotisations.php","b.fk_account",$pram,"","",$sortfield,$sortorder); } print_liste_field_titre($langs->trans("Date"),"cotisations.php","c.dateadh",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateEnd"),"cotisations.php","c.datef",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Amount"),"cotisations.php","c.cotisation",$param,"",'align="right"',$sortfield,$sortorder); print "\n"; - // Static objects + // Static objects $cotisation=new Cotisation($db); $adherent=new Adherent($db); $accountstatic=new Account($db); - $var=true; + $var=true; $total=0; while ($i < $num && $i < $conf->liste_limit) { @@ -209,39 +131,29 @@ if ($result) $var=!$var; - if ($allowinsertbankafter && ! $objp->fk_account && $conf->banque->enabled && $conf->global->ADHERENT_BANK_USE && $objp->cotisation) - { - print ""; - print ''; - } + if ($allowinsertbankafter && ! $objp->fk_account && $conf->banque->enabled && $objp->cotisation) + { + print ""; + print ''; + } print ""; - // Ref - print ''; + // Ref + print ''; - // Nom - print ''; + // Nom + print ''; - // Login - print ''; + // Login + print ''; - // Libelle - print '"; - // print ""; - print ''; - } - else - { - print dol_trunc($objp->note,32); - } - print ''; + // Libelle + print ''; - // Banque - if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) + // Banque + if ($conf->banque->enabled) { if ($objp->fk_account) { @@ -252,40 +164,40 @@ if ($result) } else { - print "\n"; + { + print ''; + print ''; + $html = new Form($db); + $html->select_comptes('','accountid',0,'',1); + print '
'; + $html->select_types_paiements('','paymenttypeid'); + print ''; + } + else + { + print ' '; + } + print "\n"; } } - // Date start - print '\n"; + // Date start + print '\n"; - // Date end - print '\n"; + // Date end + print '\n"; - // Price - print ''; + // Price + print ''; print ""; - if ($allowinsertbankafter && ! $objp->fk_account && $conf->banque->enabled && $conf->global->ADHERENT_BANK_USE && $objp->cotisation) - { - print "\n"; - } - $i++; + if ($allowinsertbankafter && ! $objp->fk_account && $conf->banque->enabled && $objp->cotisation) + { + print "\n"; + } + $i++; } // Total @@ -295,9 +207,9 @@ if ($result) print "\n"; print "\n"; print "\n"; - if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) + if ($conf->banque->enabled) { - print ''; + print ''; } print ''; print ''; @@ -311,7 +223,7 @@ if ($result) } else { - dol_print_error($db); + dol_print_error($db); } diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 372393769a1..b704c3d3c09 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -466,39 +466,6 @@ if ($_POST["action"] == 'add' && $user->rights->adherent->creer) $result=$adh->create($user); if ($result > 0) { - if ($cotisation > 0) - { - $crowid=$adh->cotisation($datecotisation, $cotisation); - - // insertion dans la gestion banquaire si configure pour - if ($global->conf->ADHERENT_BANK_USE) - { - $dateop=time(); - $amount=$cotisation; - $acct=new Account($db,$_POST["accountid"]); - $insertid=$acct->addline($dateop, $_POST["operation"], $_POST["label"], $amount, $_POST["num_chq"], '', $user); - if ($insertid == '') - { - dol_print_error($db); - } - else - { - // met a jour la table cotisation - $sql ="UPDATE ".MAIN_DB_PREFIX."cotisation"; - $sql.=" SET fk_bank=$insertid WHERE rowid=$crowid "; - $result = $db->query($sql); - if ($result) - { - //Header("Location: fiche.php"); - } - else - { - dol_print_error($db); - } - } - } - } - $db->commit(); $rowid=$adh->id; $action=''; @@ -1101,7 +1068,7 @@ if ($rowid && $action != 'edit') $formquestion=array( array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name)); - $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$adh->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion); + $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$adh->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); if ($ret == 'html') print '
'; } @@ -1132,7 +1099,7 @@ if ($rowid && $action != 'edit') // Cree un tableau formulaire $formquestion=array(); if ($adh->email) $formquestion[0]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?true:false)); - $ret=$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion); + $ret=$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1); if ($ret == 'html') print '
'; } @@ -1487,21 +1454,6 @@ if ($rowid && $action != 'edit') print ''; print "
\n"; - - /* - * Bandeau des cotisations - */ - - print '
'.$cotisation->getNomUrl(1).''.$cotisation->getNomUrl(1).''.$adherent->getNomUrl(1).''.$adherent->getNomUrl(1).''.$adherent->login.''.$adherent->login.''; - if ($allowinsertbankafter && $user->rights->banque->modifier && ! $objp->fk_account && $conf->banque->enabled && $conf->global->ADHERENT_BANK_USE && $objp->cotisation) - { - print "trans("Subscriptions").' '.dol_print_date($db->jdate($objp->dateadh),"%Y")."\" >\n"; - // print "'; + print dol_trunc($objp->note,32); + print '"; + print ""; if ($allowinsertbankafter && $objp->cotisation) - { - print ''; - print ''; - $html = new Form($db); - $html->select_comptes('','accountid',0,'',1); - print '
'; - $html->select_types_paiements('','paymenttypeid'); - print ''; - } - else - { - print ' '; - } - print "
'.dol_print_date($db->jdate($objp->dateadh),'day')."'.dol_print_date($db->jdate($objp->dateadh),'day')."'.dol_print_date($db->jdate($objp->datef),'day')."'.dol_print_date($db->jdate($objp->datef),'day')."'.price($objp->cotisation).''.price($objp->cotisation).'
       
'; - - print ''; - print ''; - print '
'; - - print ''; - - print '
'; - } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7b4e5b3b001..379e117df8b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1569,7 +1569,7 @@ class Form $this->load_cache_types_paiements(); - print ''; if ($empty) print ''; foreach($this->cache_types_paiements as $id => $arraytypes) { @@ -1710,7 +1710,7 @@ class Form $i = 0; if ($num) { - print ''; if ($useempty) { print ''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e81805c2edc..ae1895d5fae 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -880,7 +880,7 @@ InterventionsSetup=Interventions module setup ##### Members ##### MembersSetup=Members module setup MemberMainOptions=Main options -AddSubscriptionIntoAccount=Add subscriptions into bank or cash account, of bank module +AddSubscriptionIntoAccount=Suggest by default to create a bank transaction, in bank module, when adding a new payed subscription AdherentMailRequired=EMail required to create a new member MemberSendInformationByMailByDefault=Checkbox to send mail confirmation to members (validation or new subscription) is on by default ##### LDAP setup ##### diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index a8fdfa9fc33..aa415b3f8f3 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -150,3 +150,7 @@ HTPasswordExport=htpassword file generation NoThirdPartyAssociatedToMember=No third party associated to this member ThirdPartyDolibarr=Dolibarr third party MembersAndSubscriptions= Members and Suscriptions +MoreActions=Complementary action on recording +MoreActionBankDirect=Create a direct transaction record on account +MoreActionBankViaInvoice=Create an invoice and payment on account +MoreActionInvoiceOnly=Create an invoice with no payment diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 8b209aea829..799950bd8bb 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -892,7 +892,7 @@ FreeLegalTextOnInterventions= Mention complémentaire sur les fiches d'intervent ##### Members #####= undefined MembersSetup= Configuration du module Adhérents MemberMainOptions= Options principales -AddSubscriptionIntoAccount= Enregistrer cotisations dans compte bancaire ou caisse, du module banque +AddSubscriptionIntoAccount= Proposer par défaut la création d'une écriture bancaire, dans le module banque, à l'enregistrement d'une adhésion payante AdherentMailRequired= EMail obligatoire pour créer un nouvel adhérent MemberSendInformationByMailByDefault= Case à cocher pour envoyer un mail de confirmation (validation ou nouvelle cotisation) aux adhérents. Est à oui par défaut. ##### LDAP setup #####= undefined diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index c036413c7c2..92f1faead8a 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -137,7 +137,7 @@ DescADHERENT_MAIL_COTIS_SUBJECT=Sujet du mail de validation cotisation DescADHERENT_MAIL_COTIS=Mail de validation d'une adhésion DescADHERENT_MAIL_RESIL_SUBJECT=Sujet du mail de résiliation DescADHERENT_MAIL_RESIL=Mail de résiliation -DescADHERENT_MAIL_FROM=Mail émetteur pour les mails automatics +DescADHERENT_MAIL_FROM=Mail émetteur pour les mails automatiques DescADHERENT_ETIQUETTE_TYPE=Format pages étiquettes DescADHERENT_CARD_TYPE=Format pages cartes d'adhérent DescADHERENT_CARD_HEADER_TEXT=Texte imprimé sur le haut des cartes d'adhérent @@ -149,4 +149,8 @@ ShowTypeCard=Voir type '%s' HTPasswordExport=Génération fichier htpassword NoThirdPartyAssociatedToMember=Pas de tiers associé à cet adhérent ThirdPartyDolibarr=Tiers Dolibarr -MembersAndSubscriptions= Adhérents et Adhésions \ No newline at end of file +MembersAndSubscriptions= Adhérents et Adhésions +MoreActions=Action complémentaire à l'enregistrement +MoreActionBankDirect=Création transaction sur compte directement +MoreActionBankViaInvoice=Création facture avec paiement sur compte +MoreActionInvoiceOnly=Création facture sans paiement