Fix amount of memberships
This commit is contained in:
parent
9eda9c1e21
commit
19a203bd40
@ -366,7 +366,7 @@ class AdherentType extends CommonObject
|
||||
$sql .= "libelle = '".$this->db->escape($this->label)."',";
|
||||
$sql .= "morphy = '".$this->db->escape($this->morphy)."',";
|
||||
$sql .= "subscription = '".$this->db->escape($this->subscription)."',";
|
||||
$sql .= "amount = '".$this->db->escape($this->amount)."',";
|
||||
$sql .= "amount = ".((empty($this->amount) && $this->amount == '') ? 'null' : ((float) $this->amount)).",";
|
||||
$sql .= "duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."',";
|
||||
$sql .= "note = '".$this->db->escape($this->note)."',";
|
||||
$sql .= "vote = ".(integer) $this->db->escape($this->vote).",";
|
||||
|
||||
@ -198,8 +198,8 @@ foreach ($data as $val) {
|
||||
//print '</a>';
|
||||
print '</td>';
|
||||
print '<td class="right">'.$val['nb'].'</td>';
|
||||
print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>';
|
||||
print '<td class="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>';
|
||||
print '<td class="right"><span class="amount">'.price(price2num($val['total'], 'MT'), 1).'</span></td>';
|
||||
print '<td class="right"><span class="amount">'.price(price2num($val['avg'], 'MT'), 1).'</span></td>';
|
||||
print '</tr>';
|
||||
$oldyear = $year;
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ $label = GETPOST("label", "alpha");
|
||||
$morphy = GETPOST("morphy", "alpha");
|
||||
$status = GETPOST("status", "int");
|
||||
$subscription = GETPOST("subscription", "int");
|
||||
$amount = price2num(GETPOST('amount', 'alpha'), 'MT');
|
||||
$amount = GETPOST('amount', 'alpha');
|
||||
$duration_value = GETPOST('duration_value', 'int');
|
||||
$duration_unit = GETPOST('duration_unit', 'alpha');
|
||||
$vote = GETPOST("vote", "int");
|
||||
@ -119,7 +119,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) {
|
||||
$object->morphy = trim($morphy);
|
||||
$object->status = (int) $status;
|
||||
$object->subscription = (int) $subscription;
|
||||
$object->amount = $amount;
|
||||
$object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));
|
||||
$object->duration_value = $duration_value;
|
||||
$object->duration_unit = $duration_unit;
|
||||
$object->note = trim($comment);
|
||||
@ -166,12 +166,11 @@ if ($action == 'update' && $user->rights->adherent->configurer) {
|
||||
$object->fetch($rowid);
|
||||
|
||||
$object->oldcopy = clone $object;
|
||||
|
||||
$object->label= trim($label);
|
||||
$object->morphy = trim($morphy);
|
||||
$object->status = (int) $status;
|
||||
$object->subscription = (int) $subscription;
|
||||
$object->amount = $amount;
|
||||
$object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));;
|
||||
$object->duration_value = $duration_value;
|
||||
$object->duration_unit = $duration_unit;
|
||||
$object->note = trim($comment);
|
||||
@ -306,7 +305,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center">'.yn($objp->subscription).'</td>';
|
||||
print '<td class="center">'.price($objp->amount).'</td>';
|
||||
print '<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount)).'</span></td>';
|
||||
print '<td class="center">'.yn($objp->vote).'</td>';
|
||||
print '<td class="center">'.$membertype->getLibStatut(5).'</td>';
|
||||
if ($user->rights->adherent->configurer) {
|
||||
@ -446,7 +445,7 @@ if ($rowid > 0) {
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Amount").'</td><td>';
|
||||
print price($object->amount);
|
||||
print ((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount));
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
@ -594,24 +593,24 @@ if ($rowid > 0) {
|
||||
$titre .= " (".$membertype->label.")";
|
||||
}
|
||||
|
||||
$param = "&rowid=".$object->id;
|
||||
$param = "&rowid=".urlencode($object->id);
|
||||
if (!empty($status)) {
|
||||
$param .= "&status=".$status;
|
||||
$param .= "&status=".urlencode($status);
|
||||
}
|
||||
if (!empty($search_lastname)) {
|
||||
$param .= "&search_lastname=".$search_lastname;
|
||||
$param .= "&search_lastname=".urlencode($search_lastname);
|
||||
}
|
||||
if (!empty($search_firstname)) {
|
||||
$param .= "&search_firstname=".$search_firstname;
|
||||
$param .= "&search_firstname=".urlencode($search_firstname);
|
||||
}
|
||||
if (!empty($search_login)) {
|
||||
$param .= "&search_login=".$search_login;
|
||||
$param .= "&search_login=".urlencode($search_login);
|
||||
}
|
||||
if (!empty($search_email)) {
|
||||
$param .= "&search_email=".$search_email;
|
||||
$param .= "&search_email=".urlencode($search_email);
|
||||
}
|
||||
if (!empty($filter)) {
|
||||
$param .= "&filter=".$filter;
|
||||
$param .= "&filter=".urlencode($filter);
|
||||
}
|
||||
|
||||
if ($sall) {
|
||||
@ -797,7 +796,9 @@ if ($rowid > 0) {
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>';
|
||||
print '<input name="amount" size="5" value="'.price($object->amount).'">';
|
||||
print '<input name="amount" size="5" value="';
|
||||
print ((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount));
|
||||
print '">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user