From 58d1859640f44e2b95a290c7102ad2970be4a0c2 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Fri, 13 Aug 2021 16:17:16 -0700 Subject: [PATCH] IO-1306 Show Export Attempts on export screens. --- bodyshop_translations.babel | 26 +++++++++++++++++++ .../accounting-payables-table.component.jsx | 11 ++++++++ .../accounting-payments-table.component.jsx | 10 +++++++ ...accounting-receivables-table.component.jsx | 12 ++++++++- .../jobs-close-auto-allocate.component.jsx | 2 +- client/src/graphql/accounting.queries.js | 12 +++++++++ client/src/translations/en_us/common.json | 3 +++ client/src/translations/es/common.json | 3 +++ client/src/translations/fr/common.json | 3 +++ 9 files changed, 80 insertions(+), 2 deletions(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 9533a47db..d2694e8ff 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -12906,6 +12906,32 @@ + + labels + + + attempts + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + diff --git a/client/src/components/accounting-payables-table/accounting-payables-table.component.jsx b/client/src/components/accounting-payables-table/accounting-payables-table.component.jsx index c28c95ca1..64e335833 100644 --- a/client/src/components/accounting-payables-table/accounting-payables-table.component.jsx +++ b/client/src/components/accounting-payables-table/accounting-payables-table.component.jsx @@ -109,6 +109,17 @@ export default function AccountingPayablesTableComponent({ loading, bills }) { ), }, + { + title: t("exportlogs.labels.attempts"), + dataIndex: "attempts", + key: "attempts", + + render: (text, record) => { + const success = record.exportlogs.filter((e) => e.successful).length; + const attempts = record.exportlogs.length; + return `${success}/${attempts}`; + }, + }, { title: t("general.labels.actions"), dataIndex: "actions", diff --git a/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx b/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx index be98297b6..2edc4a0a4 100644 --- a/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx +++ b/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx @@ -108,7 +108,17 @@ export default function AccountingPayablesTableComponent({ {record.exportedat} ), }, + { + title: t("exportlogs.labels.attempts"), + dataIndex: "attempts", + key: "attempts", + render: (text, record) => { + const success = record.exportlogs.filter((e) => e.successful).length; + const attempts = record.exportlogs.length; + return `${success}/${attempts}`; + }, + }, { title: t("general.labels.actions"), dataIndex: "actions", diff --git a/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx b/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx index 5492e83ec..da2e4885c 100644 --- a/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx +++ b/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx @@ -114,11 +114,21 @@ export default function AccountingReceivablesTableComponent({ loading, jobs }) { ); }, }, + { + title: t("exportlogs.labels.attempts"), + dataIndex: "attempts", + key: "attempts", + + render: (text, record) => { + const success = record.exportlogs.filter((e) => e.successful).length; + const attempts = record.exportlogs.length; + return `${success}/${attempts}`; + }, + }, { title: t("general.labels.actions"), dataIndex: "actions", key: "actions", - sorter: (a, b) => a.clm_total - b.clm_total, render: (text, record) => ( diff --git a/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx b/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx index cbdca4501..ede82520d 100644 --- a/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx +++ b/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx @@ -61,7 +61,7 @@ export function JobsCloseAutoAllocate({ bodyshop, joblines, form, disabled }) { ); }; - const overlay = ( + const overlay = bodyshop.cdk_dealerid && ( {bodyshop.md_responsibility_centers.dms_defaults.map((mapping) => ( {mapping.name} diff --git a/client/src/graphql/accounting.queries.js b/client/src/graphql/accounting.queries.js index d9fa75c83..750a881ba 100644 --- a/client/src/graphql/accounting.queries.js +++ b/client/src/graphql/accounting.queries.js @@ -24,6 +24,10 @@ export const QUERY_JOBS_FOR_EXPORT = gql` clm_total clm_no ins_co_nm + exportlogs { + id + successful + } } } `; @@ -37,6 +41,10 @@ export const QUERY_BILLS_FOR_EXPORT = gql` invoice_number is_credit_memo total + exportlogs { + id + successful + } job { id ro_number @@ -73,6 +81,10 @@ export const QUERY_PAYMENTS_FOR_EXPORT = gql` transactionid paymentnum date + exportlogs { + id + successful + } } } `; diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index f9331b5ae..e0d383298 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -825,6 +825,9 @@ "exportlogs": { "fields": { "createdat": "Created At" + }, + "labels": { + "attempts": "Export Attempts" } }, "general": { diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index a94a19a5d..10257da69 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -825,6 +825,9 @@ "exportlogs": { "fields": { "createdat": "" + }, + "labels": { + "attempts": "" } }, "general": { diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index c224706ef..b170e2669 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -825,6 +825,9 @@ "exportlogs": { "fields": { "createdat": "" + }, + "labels": { + "attempts": "" } }, "general": {