[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] 04/07: upgrade amount api
From: |
gnunet |
Subject: |
[taler-wallet-core] 04/07: upgrade amount api |
Date: |
Fri, 04 Nov 2022 15:56:21 +0100 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository wallet-core.
commit 80ab8ccce9a9ce46b445d0857769aadd640073a3
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Fri Nov 4 10:58:13 2022 -0300
upgrade amount api
---
.../src/paths/instance/orders/create/CreatePage.tsx | 2 +-
.../src/paths/instance/orders/details/DetailPage.tsx | 2 +-
.../merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git
a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx
b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx
index bcdd0b606..fa0dd7a5a 100644
---
a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx
+++
b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx
@@ -140,7 +140,7 @@ export function CreatePage({
}: Props): VNode {
const [value, valueHandler] = useState(with_defaults(instanceConfig));
const config = useConfigContext();
- const zero = Amounts.getZero(config.currency);
+ const zero = Amounts.zeroOfCurrency(config.currency);
const inventoryList = Object.values(value.inventoryProducts || {});
const productList = Object.values(value.products || {});
diff --git
a/packages/merchant-backoffice-ui/src/paths/instance/orders/details/DetailPage.tsx
b/packages/merchant-backoffice-ui/src/paths/instance/orders/details/DetailPage.tsx
index 0aac9ded0..3445a86df 100644
---
a/packages/merchant-backoffice-ui/src/paths/instance/orders/details/DetailPage.tsx
+++
b/packages/merchant-backoffice-ui/src/paths/instance/orders/details/DetailPage.tsx
@@ -432,7 +432,7 @@ function PaidPage({
const refund_taken = order.refund_details.reduce((prev, cur) => {
if (cur.pending) return prev;
return Amounts.add(prev, Amounts.parseOrThrow(cur.amount)).amount;
- }, Amounts.getZero(amount.currency));
+ }, Amounts.zeroOfCurrency(amount.currency));
value.refund_taken = Amounts.stringify(refund_taken);
return (
diff --git
a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx
b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx
index 29a9670bc..02d5b0bfc 100644
--- a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx
@@ -268,14 +268,14 @@ export function RefundModal({
.map((r) => r.amount)
.reduce(
(p, c) => Amounts.add(p, Amounts.parseOrThrow(c)).amount,
- Amounts.getZero(config.currency)
+ Amounts.zeroOfCurrency(config.currency)
);
const orderPrice =
order.order_status === "paid"
? Amounts.parseOrThrow(order.contract_terms.amount)
: undefined;
const totalRefundable = !orderPrice
- ? Amounts.getZero(totalRefunded.currency)
+ ? Amounts.zeroOfCurrency(totalRefunded.currency)
: refunds.length
? Amounts.sub(orderPrice, totalRefunded).amount
: orderPrice;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-wallet-core] branch master updated (66460e565 -> f79bca0ab), gnunet, 2022/11/04
- [taler-wallet-core] 04/07: upgrade amount api,
gnunet <=
- [taler-wallet-core] 02/07: es6 and ts lib, gnunet, 2022/11/04
- [taler-wallet-core] 01/07: fix imports, gnunet, 2022/11/04
- [taler-wallet-core] 07/07: fix dependecies version, gnunet, 2022/11/04
- [taler-wallet-core] 06/07: fix some test style and SWRConfig type compilation, gnunet, 2022/11/04
- [taler-wallet-core] 05/07: better type signature for undefinedIfEmpty, gnunet, 2022/11/04
- [taler-wallet-core] 03/07: add index.js to import that point to folders, gnunet, 2022/11/04