Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: better condition for Anrok sync actions #1710

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/layouts/CustomerInvoiceDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ const CustomerInvoiceDetails = () => {
if (retryTaxProviderVoidingResult?.id) {
addToast({
severity: 'success',
translateKey: 'text_1724769707909qoy2v4pxvku',
translateKey: 'text_172535279177716n7p2svtdb',
})
}
},
Expand Down
36 changes: 20 additions & 16 deletions src/pages/InvoiceOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,12 @@ const InvoiceOverview = memo(
!!invoice?.customer?.xeroCustomer?.externalCustomerId && !!invoice?.externalIntegrationId
const showNetsuiteSection =
!!connectedNetsuiteIntegration?.accountId && !!invoice?.externalIntegrationId
const showAnrokSection =
!!invoice?.customer?.anrokCustomer?.externalAccountId || invoice?.taxProviderVoidable
const showAnrokReSyncButton = invoice?.taxProviderVoidable
const showAnrokLink =
(invoice?.status === InvoiceStatusTypeEnum.Finalized ||
invoice?.status === InvoiceStatusTypeEnum.Voided) &&
!!invoice?.customer?.anrokCustomer?.externalAccountId
const showAnrokSection = showAnrokReSyncButton || showAnrokLink
const showExternalAppsSection = showXeroSection || showNetsuiteSection || showAnrokSection

return (
Expand Down Expand Up @@ -296,7 +300,20 @@ const InvoiceOverview = memo(
<Typography variant="caption" color="grey600" noWrap>
{translate('text_1724772240299r3u9nouqflf')}
</Typography>
{invoice.taxProviderVoidable ? (
{showAnrokLink ? (
<InlineLink
target="_blank"
rel="noopener noreferrer"
to={buildAnrokInvoiceUrl(
invoice?.customer?.anrokCustomer?.externalAccountId,
invoice?.id,
)}
>
<Typography variant="body" color="info600">
{invoice?.id} <Icon name="outside" />
</Typography>
</InlineLink>
) : (
<Stack direction="row" alignItems="center" gap={2}>
<Icon name="warning-filled" color="warning" />
<Typography variant="body" color="grey600" noWrap>
Expand All @@ -318,19 +335,6 @@ const InvoiceOverview = memo(
<Icon name="processing" color="info" size="small" animation="spin" />
)}
</Stack>
) : (
<InlineLink
target="_blank"
rel="noopener noreferrer"
to={buildAnrokInvoiceUrl(
invoice?.customer?.anrokCustomer?.externalAccountId,
invoice?.id,
)}
>
<Typography variant="body" color="info600">
{invoice?.id} <Icon name="outside" />
</Typography>
</InlineLink>
)}
</InfoLine>
)}
Expand Down
4 changes: 2 additions & 2 deletions translations/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -2353,7 +2353,6 @@
"text_1724438705077s7oxv5be87m": "The invoice cannot be refreshed due to tax errors",
"text_1724674592260h33v56rycaw": "This invoice contains a tax error",
"text_1724702284063xef0c9kyhyl": "Sync invoice to Anrok",
"text_1724769707909qoy2v4pxvku": "NetSuite synchronisation successfully triggered.",
"text_1724772240299r3u9nouqflf": "Anrok invoice url",
"text_1724773425162ehwcxw6ynrp": "Invoice not synced to Anrok",
"text_1724774217640gd4bmfl8ne3": "Sync voided invoice to Anrok",
Expand Down Expand Up @@ -2381,5 +2380,6 @@
"text_172434514289283gmf8bdhh3": "Request access to progressive billing",
"text_1724346450317iqs2rtvx1tp": "Hello, I would like to access your progressive billing add-on. \n\nPlease let me know if you need more info!",
"text_1724936123802q74m2xxak3o": "Usage already billed",
"text_17250100329108guatmyl9tj": "Unknown"
"text_17250100329108guatmyl9tj": "Unknown",
"text_172535279177716n7p2svtdb": "Anrok synchronisation successfully triggered."
}
Loading