Skip to content

Commit

Permalink
fix: show or hide viewInvocie btn
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJiang2021 authored and kris-liu-smile committed Nov 22, 2022
1 parent f69023e commit 0bf92e8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ export const OrderAction = (props: any) => {
orderComments,
products,
orderId,
ipStatus,
} = detailsData

const getFullPaymentAddress = (billingAddress: any) => {
Expand Down Expand Up @@ -345,7 +346,7 @@ export const OrderAction = (props: any) => {
key: 'aboutInvoice',
name: isB2BUser ? 'viewInvoice' : 'printInvoice',
variant: 'outlined',
isCanShow: true,
isCanShow: !isB2BUser || +ipStatus !== 0,
},
],
infos: {
Expand Down
2 changes: 2 additions & 0 deletions apps/storefront/src/pages/orderDetail/shared/B2BOrderData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,6 @@ export const convertB2BOrderDetails = (data: B2BOrderData) => ({
products: handleProductQuantity(data),
orderId: +data.id,
customStatus: data.customStatus,
ipStatus: +data.ipStatus || 0, // 0: no invoice, 1,2: have invoice
invoiceId: +data.invoiceId,
})
2 changes: 2 additions & 0 deletions apps/storefront/src/shared/service/b2b/graphql/orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ const orderDetail = (id: number, fn: string) => `{
isInvoiceOrder,
updatedAt,
externalOrderId,
ipStatus,
invoiceId,
orderHistoryEvent {
id,
eventType,
Expand Down

0 comments on commit 0bf92e8

Please sign in to comment.