Fix price format in payment pages
This commit is contained in:
parent
3c4ed55179
commit
424e8a3139
@ -155,7 +155,7 @@ if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
|
||||
|
||||
if (GETPOST('action','aZ09') == 'dopayment')
|
||||
{
|
||||
$PRICE=price2num(GETPOST("newamount"),'MT');
|
||||
$PRICE=price2num(GETPOST("newamount",'alpha'),'MT');
|
||||
$email=GETPOST("email");
|
||||
|
||||
$origfulltag=GETPOST("fulltag",'alpha');
|
||||
@ -305,7 +305,7 @@ if (! GETPOST("source") && $valid)
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -392,7 +392,7 @@ if (GETPOST("source") == 'order' && $valid)
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -480,7 +480,7 @@ if (GETPOST("source") == 'invoice' && $valid)
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -656,7 +656,7 @@ if (GETPOST("source") == 'contractline' && $valid)
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -754,7 +754,7 @@ if (GETPOST("source") == 'membersubscription' && $valid)
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'">'.price($member->last_subscription_amount);
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
if (empty($amount) && ! GETPOST('newamount')) $_GET['newamount']=$member->last_subscription_amount;
|
||||
if (empty($amount) && ! GETPOST('newamount','alpha')) $_GET['newamount']=$member->last_subscription_amount;
|
||||
}
|
||||
|
||||
// Amount
|
||||
@ -764,7 +764,7 @@ if (GETPOST("source") == 'membersubscription' && $valid)
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'">';
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
$valtoshow=GETPOST("newamount",'int');
|
||||
$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
|
||||
if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow);
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price($valtoshow).'">';
|
||||
|
||||
@ -268,7 +268,7 @@ if ($action == 'dopayment')
|
||||
{
|
||||
if ($paymentmethod == 'paypal')
|
||||
{
|
||||
$PAYPAL_API_PRICE=price2num(GETPOST("newamount"),'MT');
|
||||
$PAYPAL_API_PRICE=price2num(GETPOST("newamount",'alpha'),'MT');
|
||||
$PAYPAL_PAYMENT_TYPE='Sale';
|
||||
|
||||
$origfulltag=GETPOST("fulltag",'alpha');
|
||||
@ -366,7 +366,7 @@ if ($action == 'dopayment')
|
||||
|
||||
if ($paymentmethod == 'stripe')
|
||||
{
|
||||
if (GETPOST('newamount')) $amount = GETPOST('newamount');
|
||||
if (GETPOST('newamount','alpha')) $amount = price2num(GETPOST('newamount','alpha'),'MT');
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors');
|
||||
@ -647,7 +647,7 @@ if (! $source)
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -738,7 +738,7 @@ if ($source == 'order')
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -858,7 +858,7 @@ if ($source == 'invoice')
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"), 'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -1079,7 +1079,7 @@ if ($source == 'contractline')
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -1202,7 +1202,7 @@ if ($source == 'membersubscription')
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'">'.price($member->last_subscription_amount);
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
if (empty($amount) && ! GETPOST('newamount')) $_GET['newamount']=$member->last_subscription_amount;
|
||||
if (empty($amount) && ! GETPOST('newamount','alpha')) $_GET['newamount']=$member->last_subscription_amount;
|
||||
}
|
||||
|
||||
// Amount
|
||||
@ -1217,7 +1217,7 @@ if ($source == 'membersubscription')
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'">';
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
$valtoshow=GETPOST("newamount",'int');
|
||||
$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
|
||||
// force default subscription amount to value defined into constant...
|
||||
if (! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
|
||||
if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
|
||||
@ -1232,7 +1232,7 @@ if ($source == 'membersubscription')
|
||||
}
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
//$valtoshow=GETPOST("newamount",'int');
|
||||
//$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
|
||||
if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow);
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price($valtoshow).'">';
|
||||
|
||||
@ -192,7 +192,7 @@ if (! empty($conf->global->PAYPAL_SECURITY_TOKEN))
|
||||
|
||||
if (GETPOST('action','aZ09') == 'dopayment')
|
||||
{
|
||||
$PAYPAL_API_PRICE=price2num(GETPOST("newamount"),'MT');
|
||||
$PAYPAL_API_PRICE=price2num(GETPOST("newamount",'alpha'),'MT');
|
||||
$PAYPAL_PAYMENT_TYPE='Sale';
|
||||
|
||||
$origfulltag=GETPOST("fulltag",'alpha');
|
||||
@ -375,21 +375,19 @@ if (! GETPOST("source"))
|
||||
$fulltag=$tag;
|
||||
|
||||
// Creditor
|
||||
|
||||
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Creditor");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$creditor.'</b>';
|
||||
print '<input type="hidden" name="creditor" value="'.$creditor.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Amount
|
||||
|
||||
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Amount");
|
||||
if (empty($amount)) print ' ('.$langs->trans("ToComplete").')';
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'">';
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -402,7 +400,6 @@ if (! GETPOST("source"))
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Tag
|
||||
|
||||
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("PaymentCode");
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><b style="word-break: break-all;">'.$fulltag.'</b>';
|
||||
print '<input type="hidden" name="tag" value="'.$tag.'">';
|
||||
@ -475,7 +472,7 @@ if (GETPOST("source") == 'order')
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -585,7 +582,7 @@ if (GETPOST("source") == 'invoice')
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -783,7 +780,7 @@ if (GETPOST("source") == 'contractline')
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -902,7 +899,7 @@ if (GETPOST("source") == 'membersubscription')
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'">'.price($member->last_subscription_amount);
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
if (empty($amount) && ! GETPOST('newamount')) $_GET['newamount']=$member->last_subscription_amount;
|
||||
if (empty($amount) && ! GETPOST('newamount','alpha')) $_GET['newamount']=$member->last_subscription_amount;
|
||||
}
|
||||
|
||||
// Amount
|
||||
@ -917,7 +914,7 @@ if (GETPOST("source") == 'membersubscription')
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'">';
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
$valtoshow=GETPOST("newamount",'int');
|
||||
$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
|
||||
if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow);
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price($valtoshow).'">';
|
||||
|
||||
@ -202,7 +202,7 @@ else if (! empty($conf->global->ONLINE_PAYMENT_CREDITOR)) $creditor=$conf->globa
|
||||
|
||||
if ($action == 'dopayment') // We click on button Create payment
|
||||
{
|
||||
if (GETPOST('newamount')) $amount = GETPOST('newamount');
|
||||
if (GETPOST('newamount','alpha')) $amount = price2num(GETPOST('newamount','alpha'),'MT');
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors');
|
||||
@ -455,7 +455,7 @@ if (! GETPOST("source"))
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -541,7 +541,7 @@ if (GETPOST("source") == 'order')
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -652,7 +652,7 @@ if (GETPOST("source") == 'invoice')
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -852,7 +852,7 @@ if (GETPOST("source") == 'contractline')
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
|
||||
}
|
||||
else {
|
||||
print '<b>'.price($amount).'</b>';
|
||||
@ -971,7 +971,7 @@ if (GETPOST("source") == 'membersubscription')
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'">'.price($member->last_subscription_amount);
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
if (empty($amount) && ! GETPOST('newamount')) $_GET['newamount']=$member->last_subscription_amount;
|
||||
if (empty($amount) && ! GETPOST('newamount','alpha')) $_GET['newamount']=$member->last_subscription_amount;
|
||||
}
|
||||
|
||||
// Amount
|
||||
@ -986,7 +986,7 @@ if (GETPOST("source") == 'membersubscription')
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'">';
|
||||
if (empty($amount) || ! is_numeric($amount))
|
||||
{
|
||||
$valtoshow=GETPOST("newamount",'int');
|
||||
$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
|
||||
if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow);
|
||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
|
||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price($valtoshow).'">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user