From 2cac79b5602e170eb50c4267224a0717b37c1224 Mon Sep 17 00:00:00 2001
From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com>
Date: Wed, 27 Mar 2024 10:22:55 +0100
Subject: [PATCH 1/2] tax value 4 digits integer part
---
src/CONST.ts | 1 +
src/pages/workspace/taxes/ValuePage.tsx | 2 +-
src/pages/workspace/taxes/WorkspaceCreateTaxPage.tsx | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/CONST.ts b/src/CONST.ts
index 47caa5e64a90..c57ac575f7e6 100755
--- a/src/CONST.ts
+++ b/src/CONST.ts
@@ -4153,6 +4153,7 @@ const CONST = {
},
},
+ MAX_TAX_RATE_INTEGER_PLACES: 4,
MAX_TAX_RATE_DECIMAL_PLACES: 4,
} as const;
diff --git a/src/pages/workspace/taxes/ValuePage.tsx b/src/pages/workspace/taxes/ValuePage.tsx
index 4ec932fbcc14..54b02554e106 100644
--- a/src/pages/workspace/taxes/ValuePage.tsx
+++ b/src/pages/workspace/taxes/ValuePage.tsx
@@ -92,7 +92,7 @@ function ValuePage({
// The default currency uses 2 decimal places, so we substract it
extraDecimals={CONST.MAX_TAX_RATE_DECIMAL_PLACES - 2}
// We increase the amount max length. We have to add 2 places for one digit and comma.
- amountMaxLength={CONST.MAX_TAX_RATE_DECIMAL_PLACES + 2}
+ amountMaxLength={CONST.MAX_TAX_RATE_DECIMAL_PLACES + CONST.MAX_TAX_RATE_INTEGER_PLACES}
extraSymbol={%}
ref={inputCallbackRef}
/>
diff --git a/src/pages/workspace/taxes/WorkspaceCreateTaxPage.tsx b/src/pages/workspace/taxes/WorkspaceCreateTaxPage.tsx
index 9d7c1a400870..aabcfa5f322b 100644
--- a/src/pages/workspace/taxes/WorkspaceCreateTaxPage.tsx
+++ b/src/pages/workspace/taxes/WorkspaceCreateTaxPage.tsx
@@ -109,7 +109,7 @@ function WorkspaceCreateTaxPage({
// The default currency uses 2 decimal places, so we substract it
extraDecimals={CONST.MAX_TAX_RATE_DECIMAL_PLACES - 2}
// We increase the amount max length. We have to add 2 places for one digit and comma.
- amountMaxLength={CONST.MAX_TAX_RATE_DECIMAL_PLACES + 2}
+ amountMaxLength={CONST.MAX_TAX_RATE_DECIMAL_PLACES + CONST.MAX_TAX_RATE_INTEGER_PLACES}
extraSymbol={%}
/>
From 7f2b5ddbc721f95ddde9c20f2ad2113410d0d296 Mon Sep 17 00:00:00 2001
From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com>
Date: Wed, 27 Mar 2024 10:59:05 +0100
Subject: [PATCH 2/2] fix omment
---
src/pages/workspace/taxes/ValuePage.tsx | 2 +-
src/pages/workspace/taxes/WorkspaceCreateTaxPage.tsx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pages/workspace/taxes/ValuePage.tsx b/src/pages/workspace/taxes/ValuePage.tsx
index 54b02554e106..392fb90bbd22 100644
--- a/src/pages/workspace/taxes/ValuePage.tsx
+++ b/src/pages/workspace/taxes/ValuePage.tsx
@@ -91,7 +91,7 @@ function ValuePage({
hideCurrencySymbol
// The default currency uses 2 decimal places, so we substract it
extraDecimals={CONST.MAX_TAX_RATE_DECIMAL_PLACES - 2}
- // We increase the amount max length. We have to add 2 places for one digit and comma.
+ // We increase the amount max length to support the extra decimals.
amountMaxLength={CONST.MAX_TAX_RATE_DECIMAL_PLACES + CONST.MAX_TAX_RATE_INTEGER_PLACES}
extraSymbol={%}
ref={inputCallbackRef}
diff --git a/src/pages/workspace/taxes/WorkspaceCreateTaxPage.tsx b/src/pages/workspace/taxes/WorkspaceCreateTaxPage.tsx
index aabcfa5f322b..e76e57768963 100644
--- a/src/pages/workspace/taxes/WorkspaceCreateTaxPage.tsx
+++ b/src/pages/workspace/taxes/WorkspaceCreateTaxPage.tsx
@@ -108,7 +108,7 @@ function WorkspaceCreateTaxPage({
hideCurrencySymbol
// The default currency uses 2 decimal places, so we substract it
extraDecimals={CONST.MAX_TAX_RATE_DECIMAL_PLACES - 2}
- // We increase the amount max length. We have to add 2 places for one digit and comma.
+ // We increase the amount max length to support the extra decimals.
amountMaxLength={CONST.MAX_TAX_RATE_DECIMAL_PLACES + CONST.MAX_TAX_RATE_INTEGER_PLACES}
extraSymbol={%}
/>