***ing decimals
This commit is contained in:
parent
4867e8f6d0
commit
1577db322f
1 changed files with 29 additions and 21 deletions
|
|
@ -33,15 +33,18 @@ select
|
|||
case
|
||||
when pa.id_payaway_plan is not null
|
||||
then
|
||||
(
|
||||
p.amount - greatest(
|
||||
p.amount * pa.payaway_percentage,
|
||||
pa.payaway_minimum_commission_local_curr * cer.rate
|
||||
)
|
||||
)::decimal(19, 4)
|
||||
else 0
|
||||
end as amount_due_to_host_in_txn_currency,
|
||||
case
|
||||
when pa.id_payaway_plan is not null
|
||||
then
|
||||
(
|
||||
(
|
||||
p.amount - greatest(
|
||||
p.amount * pa.payaway_percentage,
|
||||
|
|
@ -49,20 +52,24 @@ select
|
|||
)
|
||||
)
|
||||
* ser.rate
|
||||
)::decimal(19, 4)
|
||||
else 0
|
||||
end as amount_due_to_host_in_gbp,
|
||||
case
|
||||
when pa.id_payaway_plan is not null
|
||||
then
|
||||
greatest(
|
||||
p.amount * pa.payaway_percentage,
|
||||
pa.payaway_minimum_commission_local_curr * cer.rate
|
||||
)
|
||||
else p.amount
|
||||
end as superhog_fee_in_txn_currency,
|
||||
case
|
||||
when pa.id_payaway_plan is not null
|
||||
then
|
||||
(
|
||||
greatest(
|
||||
p.amount * pa.payaway_percentage,
|
||||
pa.payaway_minimum_commission_local_curr * cer.rate
|
||||
)
|
||||
)::decimal(19, 4)
|
||||
else p.amount
|
||||
end as superhog_fee_in_txn_currency,
|
||||
case
|
||||
when pa.id_payaway_plan is not null
|
||||
then
|
||||
(
|
||||
(
|
||||
greatest(
|
||||
p.amount * pa.payaway_percentage,
|
||||
|
|
@ -70,7 +77,8 @@ select
|
|||
)
|
||||
)
|
||||
* ser.rate
|
||||
else p.amount * ser.rate
|
||||
)::decimal(19, 4)
|
||||
else (p.amount * ser.rate)::decimal(19, 4)
|
||||
end as superhog_fee_in_gbp
|
||||
from stg_core__verification_to_payment vtp
|
||||
left join stg_core__payment p on vtp.id_payment = p.id_payment
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue