From 56c1b6f992ed9cad4ab70dece9f8ae8bde8c7ba3 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Mon, 11 Sep 2023 09:07:38 -0700 Subject: [PATCH 1/4] IO-2368 Confirm that there are successful transaction --- .../jobs-close-export-button.component.jsx | 2 +- .../jobs-export-all-button/jobs-export-all-button.component.jsx | 2 +- .../payable-export-all-button.component.jsx | 2 +- .../payable-export-button/payable-export-button.component.jsx | 2 +- .../payment-export-button/payment-export-button.component.jsx | 2 +- .../payments-export-all-button.component.jsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx b/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx index 795e60110..8bbda03e1 100644 --- a/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx +++ b/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx @@ -192,7 +192,7 @@ export function JobsCloseExportButton({ }); } } - if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { + if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo && successfulTransactions.length > 0) { notification.open({ type: "success", key: "jobsuccessexport", diff --git a/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx b/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx index 15fdb32b4..3204d7311 100644 --- a/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx +++ b/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx @@ -190,7 +190,7 @@ export function JobsExportAllButton({ }); } } - if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { + if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo && successfulTransactions.length > 0) { notification.open({ type: "success", key: "jobsuccessexport", diff --git a/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx b/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx index 723fd0526..c448e4f4a 100644 --- a/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx +++ b/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx @@ -192,7 +192,7 @@ export function PayableExportAll({ }); } } - if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { + if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo && successfulTransactions.length > 0) { notification.open({ type: "success", key: "billsuccessexport", diff --git a/client/src/components/payable-export-button/payable-export-button.component.jsx b/client/src/components/payable-export-button/payable-export-button.component.jsx index 1836acb18..c2970b8d8 100644 --- a/client/src/components/payable-export-button/payable-export-button.component.jsx +++ b/client/src/components/payable-export-button/payable-export-button.component.jsx @@ -185,7 +185,7 @@ export function PayableExportButton({ }); } } - if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { + if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo && successfulTransactions.length > 0) { notification.open({ type: "success", key: "billsuccessexport", diff --git a/client/src/components/payment-export-button/payment-export-button.component.jsx b/client/src/components/payment-export-button/payment-export-button.component.jsx index 91f9ccc88..931254b92 100644 --- a/client/src/components/payment-export-button/payment-export-button.component.jsx +++ b/client/src/components/payment-export-button/payment-export-button.component.jsx @@ -191,7 +191,7 @@ export function PaymentExportButton({ }); } } - if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { + if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo && successfulTransactions.length > 0) { notification.open({ type: "success", key: "paymentsuccessexport", diff --git a/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx b/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx index 721e906d5..0b2e6cd7b 100644 --- a/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx +++ b/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx @@ -179,7 +179,7 @@ export function PaymentsExportAllButton({ }); } } - if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { + if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo && successfulTransactions.length > 0) { notification.open({ type: "success", key: "paymentsuccessexport", From 53e3b3fa037a110f24be84dbdae6e9382185bf58 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Mon, 11 Sep 2023 11:15:50 -0700 Subject: [PATCH 2/4] IO-2395 Payment Expansion Formatting --- .../payment-expanded-row.component.jsx | 19 ++++++++++++------- client/src/graphql/jobs.queries.js | 2 +- client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/client/src/components/payment-expanded-row/payment-expanded-row.component.jsx b/client/src/components/payment-expanded-row/payment-expanded-row.component.jsx index 6266457a7..a96683b70 100644 --- a/client/src/components/payment-expanded-row/payment-expanded-row.component.jsx +++ b/client/src/components/payment-expanded-row/payment-expanded-row.component.jsx @@ -1,15 +1,17 @@ -import React, { useState } from "react"; import { useMutation, useQuery } from "@apollo/client"; +import { Button, Descriptions, InputNumber, Modal, notification } from "antd"; +import axios from "axios"; +import moment from "moment"; +import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; import { GET_REFUNDABLE_AMOUNT_BY_JOBID, INSERT_PAYMENT_RESPONSE, QUERY_PAYMENT_RESPONSE_BY_PAYMENT_ID, } from "../../graphql/payment_response.queries"; -import { Button, Descriptions, InputNumber, Modal, notification } from "antd"; -import moment from "moment"; -import axios from "axios"; import { INSERT_NEW_PAYMENT } from "../../graphql/payments.queries"; -import { useTranslation } from "react-i18next"; +import CurrencyFormatter from "../../utils/CurrencyFormatter"; +import { DateTimeFormatter } from "../../utils/DateFormatter"; const { confirm } = Modal; @@ -137,10 +139,10 @@ const PaymentExpandedRowComponent = ({ record, bodyshop }) => { {payment_response?.response?.nameOnCard ?? ""} - {record.amount} + {record.amount} - {moment(record.created_at).format("YYYY-MM-DD HH:mm:ss")} + {{record.created_at}} {record.transactionid} @@ -151,6 +153,9 @@ const PaymentExpandedRowComponent = ({ record, bodyshop }) => { {record.type} + + {record.paymentnum} + {payment_response && ( Date: Mon, 11 Sep 2023 11:45:35 -0700 Subject: [PATCH 3/4] Add CIECA PFT to job. --- hasura/metadata/tables.yaml | 3 +++ .../down.sql | 4 ++++ .../up.sql | 2 ++ 3 files changed, 9 insertions(+) create mode 100644 hasura/migrations/1694457793769_alter_table_public_jobs_add_column_cieca_pft/down.sql create mode 100644 hasura/migrations/1694457793769_alter_table_public_jobs_add_column_cieca_pft/up.sql diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index 7b3e5a4b7..1d05bd8fd 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -3274,6 +3274,7 @@ - cat_no - category - cieca_pfl + - cieca_pft - cieca_stl - cieca_ttl - ciecaid @@ -3541,6 +3542,7 @@ - cat_no - category - cieca_pfl + - cieca_pft - cieca_stl - cieca_ttl - ciecaid @@ -3819,6 +3821,7 @@ - cat_no - category - cieca_pfl + - cieca_pft - cieca_stl - cieca_ttl - ciecaid diff --git a/hasura/migrations/1694457793769_alter_table_public_jobs_add_column_cieca_pft/down.sql b/hasura/migrations/1694457793769_alter_table_public_jobs_add_column_cieca_pft/down.sql new file mode 100644 index 000000000..2d4c20d18 --- /dev/null +++ b/hasura/migrations/1694457793769_alter_table_public_jobs_add_column_cieca_pft/down.sql @@ -0,0 +1,4 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- alter table "public"."jobs" add column "cieca_pft" jsonb +-- null default jsonb_build_object(); diff --git a/hasura/migrations/1694457793769_alter_table_public_jobs_add_column_cieca_pft/up.sql b/hasura/migrations/1694457793769_alter_table_public_jobs_add_column_cieca_pft/up.sql new file mode 100644 index 000000000..5baeecbb8 --- /dev/null +++ b/hasura/migrations/1694457793769_alter_table_public_jobs_add_column_cieca_pft/up.sql @@ -0,0 +1,2 @@ +alter table "public"."jobs" add column "cieca_pft" jsonb + null default jsonb_build_object(); From dcc29f23d420b27adc600dd96d6a2cb99d336a32 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 14 Sep 2023 11:18:40 -0700 Subject: [PATCH 4/4] Respect default import status on new creation. --- .../jobs-available-table.container.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/components/jobs-available-table/jobs-available-table.container.jsx b/client/src/components/jobs-available-table/jobs-available-table.container.jsx index d632324b5..0e74276b2 100644 --- a/client/src/components/jobs-available-table/jobs-available-table.container.jsx +++ b/client/src/components/jobs-available-table/jobs-available-table.container.jsx @@ -3,7 +3,7 @@ import { useApolloClient, useLazyQuery, useMutation, - useQuery + useQuery, } from "@apollo/client"; import { useTreatments } from "@splitsoftware/splitio-react"; import { Col, notification, Row } from "antd"; @@ -20,7 +20,7 @@ import { logImEXEvent } from "../../firebase/firebase.utils"; import { DELETE_AVAILABLE_JOB, QUERY_AVAILABLE_JOBS, - QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK + QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK, } from "../../graphql/available-jobs.queries"; import { INSERT_NEW_JOB, UPDATE_JOB } from "../../graphql/jobs.queries"; import { INSERT_NEW_NOTE } from "../../graphql/notes.queries"; @@ -28,7 +28,7 @@ import { SEARCH_VEHICLE_BY_VIN } from "../../graphql/vehicles.queries"; import { insertAuditTrail } from "../../redux/application/application.actions"; import { selectBodyshop, - selectCurrentUser + selectCurrentUser, } from "../../redux/user/user.selectors"; import confirmDialog from "../../utils/asyncConfirm"; import AuditTrailMapping from "../../utils/AuditTrailMappings"; @@ -135,6 +135,7 @@ export function JobsAvailableContainer({ owner_owing: Dinero(newTotals.totals.custPayable.total).toFormat("0.00"), job_totals: newTotals, date_open: moment(), + status: bodyshop.md_ro_statuses.default_imported, notes: { data: { created_by: currentUser.email,