Skip to content

Commit 828615d

Browse files
committed
multiply printify total costs by VAT in generateUnroundedPriceInUsd
* closes #314
1 parent f781286 commit 828615d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/pricing/generateUnroundedPriceInUsd.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ProductVariant } from "@/interfaces/PrintifyTypes";
22
import { getShippingCostInCents } from "../printify/shipping/getShippingCostsInCents";
33
import { CountryCode } from "../stripe/createCheckoutSession";
4+
import { UK_VAT_MULTIPLIER } from "@/app/data/consts";
45

56
const MARK_UP_IN_USD = 5;
67

@@ -24,7 +25,10 @@ export async function generateUnroundedPriceInUsd({
2425
const totalCostInCentsWithoutTax =
2526
selectedVariant.cost + printifyShippingCostInCents;
2627

27-
const totalCostInUsd = totalCostInCentsWithoutTax / 100; // we don't need to pay VAT until we make 85k
28+
const totalCostInCentsWithVAT =
29+
totalCostInCentsWithoutTax * UK_VAT_MULTIPLIER;
30+
31+
const totalCostInUsd = totalCostInCentsWithVAT / 100; // we don't need to pay VAT until we make 85k
2832

2933
const unroundedPriceInUsd = totalCostInUsd + MARK_UP_IN_USD;
3034

0 commit comments

Comments
 (0)