Skip to content
Snippets Groups Projects
Commit d029ebe4 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Possibilité de saisir une adhésion à 0

parent d0858b2c
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,7 @@ $typeid=isset($_GET["typeid"])?$_GET["typeid"]:$_POST["typeid"]; ...@@ -60,7 +60,7 @@ $typeid=isset($_GET["typeid"])?$_GET["typeid"]:$_POST["typeid"];
* Actions * Actions
*/ */
if ($_POST["action"] == 'cotisation' && ! $_POST["cancel"]) if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisation' && ! $_POST["cancel"])
{ {
$langs->load("banks"); $langs->load("banks");
...@@ -93,17 +93,21 @@ if ($_POST["action"] == 'cotisation' && ! $_POST["cancel"]) ...@@ -93,17 +93,21 @@ if ($_POST["action"] == 'cotisation' && ! $_POST["cancel"])
if ($adht->cotisation) if ($adht->cotisation)
{ {
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) if (! is_numeric($_POST["cotisation"]))
{
// If field is '' or not a numeric value
$errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
$action='addsubscription';
}
else
{
if ($_POST["cotisation"] && $conf->banque->enabled && $conf->global->ADHERENT_BANK_USE)
{ {
if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")); if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label"));
if (! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); if (! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode"));
if (! $_POST["accountid"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("FinancialAccount")); if (! $_POST["accountid"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("FinancialAccount"));
if ($errmsg) $action='addsubscription'; if ($errmsg) $action='addsubscription';
} }
if (! $_POST["cotisation"] > 0)
{
$errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
$action='addsubscription';
} }
} }
......
...@@ -216,7 +216,7 @@ if ($_GET["action"] == 'create') ...@@ -216,7 +216,7 @@ if ($_GET["action"] == 'create')
print $htmls->selectyesno("vote",0,1); print $htmls->selectyesno("vote",0,1);
print '</td></tr>'; print '</td></tr>';
print '<tr><td valign="top">'.$langs->trans("Comments").'</td><td>'; print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"60\" rows=\"3\"></textarea></td></tr>"; print "<textarea name=\"comment\" wrap=\"soft\" cols=\"60\" rows=\"3\"></textarea></td></tr>";
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>'; print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
...@@ -277,7 +277,7 @@ if ($rowid > 0) ...@@ -277,7 +277,7 @@ if ($rowid > 0)
print yn($adht->vote); print yn($adht->vote);
print '</tr>'; print '</tr>';
print '<tr><td valign="top">'.$langs->trans("Comments").'</td><td>'; print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
print nl2br($adht->commentaire)."</td></tr>"; print nl2br($adht->commentaire)."</td></tr>";
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>'; print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
...@@ -347,7 +347,7 @@ if ($rowid > 0) ...@@ -347,7 +347,7 @@ if ($rowid > 0)
print $htmls->selectyesno("vote",$adht->vote,1); print $htmls->selectyesno("vote",$adht->vote,1);
print '</td></tr>'; print '</td></tr>';
print '<tr><td valign="top">'.$langs->trans("Comments").'</td><td>'; print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"90\" rows=\"3\">".$adht->commentaire."</textarea></td></tr>"; print "<textarea name=\"comment\" wrap=\"soft\" cols=\"90\" rows=\"3\">".$adht->commentaire."</textarea></td></tr>";
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>'; print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment