taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 5c2af7962aa739efddff94a9a01d9b8900104d30
parent dbbafc284f61561d62092db595f1e9eb38b9fdd6
Author: Sebastian <sebasjm@gmail.com>
Date:   Mon, 13 May 2024 09:21:38 -0300

support undefined taxes

Diffstat:
Mpackages/merchant-backoffice-ui/src/paths/instance/products/list/Table.tsx | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/list/Table.tsx @@ -506,6 +506,7 @@ function difference(price: string, tax: number) { ps[1] = `${p - tax}`; return ps.join(":"); } -function sum(taxes: TalerMerchantApi.Tax[]) { +function sum(taxes: TalerMerchantApi.Tax[] | undefined) { + if (taxes === undefined) return 0; return taxes.reduce((p, c) => p + parseInt(c.tax.split(":")[1], 10), 0); }