fix broken case logic

This commit is contained in:
Pablo Martin 2024-09-25 16:12:36 +02:00
parent 070d067709
commit bea2e0d926

View file

@ -29,15 +29,19 @@ with
coalesce(vat.vat_rate, 0) as vat_rate, coalesce(vat.vat_rate, 0) as vat_rate,
case case
when when
vpt.verification_payment_type in {{ vat_applicable_services }} vpt.verification_payment_type = 'Waiver'
and pamu.id_payaway_plan is null -- superhog takes waiver and pamu.id_payaway_plan is null -- superhog takes waiver
then true then true
when vpt.verification_payment_type in ('Fee', 'CheckInCover')
then true
else false else false
end as is_service_subject_to_vat, end as is_service_subject_to_vat,
case case
when vpt.verification_payment_type not in {{ vat_applicable_services }}
then false
when when
vpt.verification_payment_type not in {{ vat_applicable_services }} vpt.verification_payment_type = 'Waiver'
or pamu.id_payaway_plan is not null -- host takes waiver and pamu.id_payaway_plan is not null -- host takes waiver
then false then false
when vat.vat_rate = 0 when vat.vat_rate = 0
then false then false