Closed VariableVic closed 3 weeks ago
This pull request includes several changes to how spending limits are handled across different parts of the codebase, specifically removing the multiplication and division by 100 to simplify the calculations.
Changes to spending limit calculations:
apps/backend/src/admin/components/employees/employees-create-form.tsx
spending_limit
EmployeesCreateForm
apps/backend/src/admin/components/employees/employees-update-form.tsx
EmployeesUpdateForm
apps/backend/src/admin/routes/companies/[companyId]/page.tsx
CompanyDetails
apps/storefront/src/lib/util/check-spending-limit.ts
checkSpendingLimit
apps/storefront/src/lib/util/convert-cart-to-csv.ts
totalTax
cartToCsv
apps/storefront/src/modules/account/components/employees-card/employee.tsx
Employee
This pull request includes several changes to how spending limits are handled across different parts of the codebase, specifically removing the multiplication and division by 100 to simplify the calculations.
Changes to spending limit calculations:
apps/backend/src/admin/components/employees/employees-create-form.tsx
: Removed the multiplication by 100 when parsingspending_limit
in theEmployeesCreateForm
component.apps/backend/src/admin/components/employees/employees-update-form.tsx
: Removed the multiplication by 100 when parsingspending_limit
in theEmployeesUpdateForm
component.apps/backend/src/admin/routes/companies/[companyId]/page.tsx
: Updated theCompanyDetails
component to remove the division by 100 when formattingspending_limit
. (apps/backend/src/admin/routes/companies/[companyId]/page.tsxL147-R147)apps/storefront/src/lib/util/check-spending-limit.ts
: Removed the division by 100 in thecheckSpendingLimit
function.apps/storefront/src/lib/util/convert-cart-to-csv.ts
: Removed the division by 100 when calculatingtotalTax
in thecartToCsv
function.apps/storefront/src/modules/account/components/employees-card/employee.tsx
: Updated theEmployee
component to remove the division by 100 when settingspending_limit
and the multiplication by 100 when submitting the form. [1] [2]