Update newpayment.php

This commit is contained in:
daraelmin 2021-05-01 20:17:29 +02:00 committed by GitHub
parent 8457fef1a2
commit 031d258b32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1444,20 +1444,18 @@ if ($source == 'member' || $source == 'membersubscription') {
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("LastMemberType");
print '</td><td class="CTableRow'.($var ? '1' : '2').'">'.dol_escape_htmltag($member->type);
print "</td></tr>\n";
}
if (!empty($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE)) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$adht = new AdherentType($db);
// Amount by member type
$amountbytype = array(); // TODO Read the amount of subscription into table of types
$amountbytype = $adht->amount_by_type(1);
// Set the member type
$member->typeid = (int) (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $member->typeid);
// If we change the type of membership, we set also label of new type
$member->type = dol_getIdFromCode($db, $member->typeid, 'adherent_type', 'rowid', 'libelle');
// Set amount for the subscription
$amount = (!empty($member->last_subscription_amount)) ? $member->last_subscription_amount : $amountbytype[$member->typeid];
$amount = (!empty($amountbytype[$member->typeid])) ? $amountbytype[$member->typeid] : $member->last_subscription_amount;
// list member type
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$adht = new AdherentType($db);
if ( !$action) {
$form = new Form($db); // so we can call method selectarray
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("NewSubscription");