mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 21:23:45 +01:00
Show tax note conditionally and update zero-tax disclaimer wording (#34454)
* Hide tax note when tax is included and update zero-tax disclaimer wording * fix: update taxes_may_be_added key in all non-English locale files GitOrigin-RevId: 9cd0e0aba6d548221e97d383b0a2e52a2e0a077c
This commit is contained in:
@@ -1981,7 +1981,6 @@
|
||||
"student_disclaimer": "",
|
||||
"subject": "",
|
||||
"subject_area": "",
|
||||
"subject_to_additional_vat": "",
|
||||
"submit_title": "",
|
||||
"subscribe": "",
|
||||
"subscribe_now": "",
|
||||
@@ -2038,6 +2037,7 @@
|
||||
"take_survey": "",
|
||||
"tax_id_number": "",
|
||||
"tax_id_type": "",
|
||||
"taxes_may_be_added": "",
|
||||
"tell_the_project_owner_and_ask_them_to_upgrade": "",
|
||||
"template": "",
|
||||
"template_description": "",
|
||||
|
||||
+6
-4
@@ -7,13 +7,15 @@ type PriceExceptionsProps = {
|
||||
|
||||
export function PriceExceptions({ subscription }: PriceExceptionsProps) {
|
||||
const { t } = useTranslation()
|
||||
const { activeCoupons } = subscription.payment
|
||||
const { activeCoupons, taxRate } = subscription.payment
|
||||
|
||||
return (
|
||||
<>
|
||||
<p>
|
||||
<i>* {t('subject_to_additional_vat')}</i>
|
||||
</p>
|
||||
{!(taxRate > 0) && (
|
||||
<p>
|
||||
<i>* {t('taxes_may_be_added')}</i>
|
||||
</p>
|
||||
)}
|
||||
{activeCoupons.length > 0 && (
|
||||
<>
|
||||
<i>* {t('coupons_not_included')}:</i>
|
||||
|
||||
+1
-3
@@ -178,9 +178,7 @@ function UpgradeSuccess({
|
||||
components={[<strong />, <strong />]} // eslint-disable-line react/jsx-key
|
||||
/>
|
||||
</p>
|
||||
<p>
|
||||
<i>* {t('subject_to_additional_vat')}</i>
|
||||
</p>
|
||||
<PriceExceptions subscription={subscription} />
|
||||
{benefitsText && <p>{benefitsText}</p>}
|
||||
<p>
|
||||
<Trans
|
||||
|
||||
@@ -1743,7 +1743,6 @@
|
||||
"student_disclaimer": "Studierabatten er gælder for alle studerende ved gymnasier og videregående uddannelsesinstitutioner. Vi kontakter dig muligvis for at bekræfte at du kvalificerer dig til denne rabat. ",
|
||||
"students": "Studerende",
|
||||
"subject": "Emne",
|
||||
"subject_to_additional_vat": "Priser kan skulle pålægges yderligere afgifter, afhængigt af hvor du er.",
|
||||
"submit": "indsend",
|
||||
"submit_title": "Indsend",
|
||||
"subscribe": "Tilmeld",
|
||||
@@ -1784,6 +1783,7 @@
|
||||
"tags": "Tags",
|
||||
"take_me_home": "Tag mig hjem!",
|
||||
"take_survey": "Besvar spørgeskema",
|
||||
"taxes_may_be_added": "Priser kan skulle pålægges yderligere afgifter, afhængigt af hvor du er.",
|
||||
"template": "Skabelon",
|
||||
"template_approved_by_publisher": "Denne skabelon er blevet godkendt af forlaget",
|
||||
"template_description": "Skabelonsbeskrivelse",
|
||||
|
||||
@@ -1385,7 +1385,6 @@
|
||||
"student": "Student",
|
||||
"student_disclaimer": "Der Bildungsrabatt gilt für alle Studierenden an weiterführenden und höheren Bildungseinrichtungen (Schulen und Universitäten). Wir können dich kontaktieren, damit du den Anspruch auf den Rabatt bestätigst.",
|
||||
"subject": "Betreff",
|
||||
"subject_to_additional_vat": "Die Preise können je nach Land der zusätzlichen Mehrwertsteuer unterliegen.",
|
||||
"submit": "Absenden",
|
||||
"submit_title": "Einreichen",
|
||||
"subscribe": "Abonnieren",
|
||||
@@ -1421,6 +1420,7 @@
|
||||
"tags": "Stichworte",
|
||||
"take_me_home": "Bring mich nach Hause!",
|
||||
"take_survey": "An Umfrage teilnehmen",
|
||||
"taxes_may_be_added": "Die Preise können je nach Land der zusätzlichen Mehrwertsteuer unterliegen.",
|
||||
"template": "Vorlage",
|
||||
"template_approved_by_publisher": "Diese Vorlage wurde vom Verlag genehmigt",
|
||||
"template_description": "Vorlagenbeschreibung",
|
||||
|
||||
@@ -2560,7 +2560,6 @@
|
||||
"students": "Students",
|
||||
"subject": "Subject",
|
||||
"subject_area": "Subject area",
|
||||
"subject_to_additional_vat": "Prices may be subject to additional VAT, depending on your country.",
|
||||
"submit": "submit",
|
||||
"submit_title": "Submit",
|
||||
"subscribe": "Subscribe",
|
||||
@@ -2628,6 +2627,7 @@
|
||||
"take_survey": "Take survey",
|
||||
"tax_id_number": "Tax ID number",
|
||||
"tax_id_type": "Tax ID type",
|
||||
"taxes_may_be_added": "Taxes may be added, depending on your billing address.",
|
||||
"tell_the_project_owner_and_ask_them_to_upgrade": "<0>Tell the project owner</0> and ask them to upgrade their Overleaf plan if you need more compile time.",
|
||||
"template": "Template",
|
||||
"template_approved_by_publisher": "This template has been approved by the publisher",
|
||||
|
||||
@@ -1008,7 +1008,6 @@
|
||||
"student": "Étudiant·e",
|
||||
"student_disclaimer": "Cette réduction pour l’éducation s’applique à tous les étudiant·e·s des établissements du secondaire ou du supérieur (lycées et universités). Nous pouvons être amenés à vous contacter pour confirmer votre éligibilité à cette réduction.",
|
||||
"subject": "Objet",
|
||||
"subject_to_additional_vat": "Selon votre pays, les prix peuvent en plus être sujets à la TVA.",
|
||||
"submit": "envoyer",
|
||||
"submit_title": "Publier",
|
||||
"subscribe": "S’abonner",
|
||||
@@ -1035,6 +1034,7 @@
|
||||
"tag_name_is_already_used": "L’étiquette \"__tagName__\" existe déjà",
|
||||
"tags": "Étiquettes",
|
||||
"take_me_home": "Retour à la maison !",
|
||||
"taxes_may_be_added": "Selon votre pays, les prix peuvent en plus être sujets à la TVA.",
|
||||
"template_description": "Description des modèles",
|
||||
"template_gallery": "Galerie de modèles",
|
||||
"template_not_found_description": "Cette méthode de création de projets à partir de modèles n’est plus disponible. Merci de vous rendre sur notre galerie des modèles pour trouver d’autres modèles.",
|
||||
|
||||
@@ -761,7 +761,6 @@
|
||||
"student": "Student",
|
||||
"student_disclaimer": "Studentrabatten gäller för alla studenter på gymnasienivå eller högre. Vi kan komma att kontakta dig för att bekräfta din behörighet för rabatten.",
|
||||
"subject": "Ämne",
|
||||
"subject_to_additional_vat": "Moms kan tillkomma till priser beroende på ditt land.",
|
||||
"submit": "Skicka",
|
||||
"submit_title": "Skicka in",
|
||||
"subscribe": "Prenumerera",
|
||||
@@ -786,6 +785,7 @@
|
||||
"syntax_validation": "Kodkontroll",
|
||||
"tag_name_cannot_exceed_characters": "Taggnamnet får inte överstiga __maxLength__ tecken.",
|
||||
"take_me_home": "Ta mig härifrån!",
|
||||
"taxes_may_be_added": "Moms kan tillkomma till priser beroende på ditt land.",
|
||||
"template_approved_by_publisher": "Denna mall har godkänts av utgivaren",
|
||||
"template_description": "Mallbeskrivning",
|
||||
"template_gallery": "Mallgalleri",
|
||||
|
||||
@@ -1979,7 +1979,6 @@
|
||||
"students": "学生",
|
||||
"subject": "主题",
|
||||
"subject_area": "主题区",
|
||||
"subject_to_additional_vat": "价格可能会受到额外的增值税,取决于您的国家。",
|
||||
"submit": "提交",
|
||||
"submit_title": "提交",
|
||||
"subscribe": "订阅",
|
||||
@@ -2030,6 +2029,7 @@
|
||||
"tags": "标签",
|
||||
"take_me_home": "我要返回!",
|
||||
"take_survey": "参加调查",
|
||||
"taxes_may_be_added": "价格可能会受到额外的增值税,取决于您的国家。",
|
||||
"tell_the_project_owner_and_ask_them_to_upgrade": "如果您需要更多编译时间,<0>告诉项目所有者</0>并要求他们升级其 Overleaf 计划。",
|
||||
"template": "模版",
|
||||
"template_approved_by_publisher": "该模板已获得发布者批准",
|
||||
|
||||
+11
-3
@@ -82,9 +82,17 @@ describe('<ActiveSubscription />', function () {
|
||||
|
||||
screen.getByRole('heading', { name: subscription.plan.name, level: 3 })
|
||||
|
||||
screen.getByText(
|
||||
'* Prices may be subject to additional VAT, depending on your country.'
|
||||
)
|
||||
if (subscription.payment.taxRate > 0) {
|
||||
expect(
|
||||
screen.queryByText(
|
||||
'* Taxes may be added, depending on your billing address.'
|
||||
)
|
||||
).to.be.null
|
||||
} else {
|
||||
screen.getByText(
|
||||
'* Taxes may be added, depending on your billing address.'
|
||||
)
|
||||
}
|
||||
|
||||
screen.getByRole('link', { name: 'View invoices' })
|
||||
|
||||
|
||||
+24
-1
@@ -4,6 +4,7 @@ import SuccessfulSubscription from '../../../../../../frontend/js/features/subsc
|
||||
import { renderWithSubscriptionDashContext } from '../../helpers/render-with-subscription-dash-context'
|
||||
import {
|
||||
annualActiveSubscription,
|
||||
annualActiveSubscriptionEuro,
|
||||
annualActiveSubscriptionPro,
|
||||
} from '../../fixtures/subscriptions'
|
||||
import { ExposedSettings } from '../../../../../../types/exposed-settings'
|
||||
@@ -123,7 +124,7 @@ describe('successful subscription page', function () {
|
||||
).to.equal(
|
||||
`The next payment of ${annualActiveSubscriptionPro.payment.displayPrice} will be collected on ${annualActiveSubscriptionPro.payment.nextPaymentDueAt}.`
|
||||
)
|
||||
screen.getByText(/prices may be subject to additional vat/i)
|
||||
screen.getByText(/taxes may be added, depending on your billing address/i)
|
||||
|
||||
screen.getByText(/full access to every AI tool/i, { exact: false })
|
||||
|
||||
@@ -162,5 +163,27 @@ describe('successful subscription page', function () {
|
||||
|
||||
screen.getByRole('heading', { name: /thanks for subscribing/i })
|
||||
})
|
||||
|
||||
it('hides tax disclaimer when tax is already included in the price', function () {
|
||||
renderWithSubscriptionDashContext(
|
||||
<UserProvider>
|
||||
<SuccessfulSubscription />
|
||||
</UserProvider>,
|
||||
{
|
||||
metaTags: [
|
||||
{
|
||||
name: 'ol-ExposedSettings',
|
||||
value: {
|
||||
adminEmail: 'foo@example.com',
|
||||
} as ExposedSettings,
|
||||
},
|
||||
{ name: 'ol-subscription', value: annualActiveSubscriptionEuro },
|
||||
{ name: 'ol-isUpgrade', value: true },
|
||||
],
|
||||
}
|
||||
)
|
||||
|
||||
expect(screen.queryByText(/taxes may be added/i)).to.be.null
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user