From fd9a51209faf463cf06c19aa1539d54010b6bd35 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 10 Sep 2024 11:21:03 -0700 Subject: [PATCH 01/13] IO-2913 ADP Payroll Reports Uses ADPPayroll Split Signed-off-by: Allan Carr --- .../report-center-modal.component.jsx | 46 ++++++++++++------- .../shop-info/shop-info.general.component.jsx | 33 +++++++------ client/src/translations/en_us/common.json | 2 + client/src/translations/es/common.json | 2 + client/src/translations/fr/common.json | 2 + client/src/utils/TemplateConstants.js | 26 +++++++++++ 6 files changed, 82 insertions(+), 29 deletions(-) diff --git a/client/src/components/report-center-modal/report-center-modal.component.jsx b/client/src/components/report-center-modal/report-center-modal.component.jsx index 71439f287..974e62de7 100644 --- a/client/src/components/report-center-modal/report-center-modal.component.jsx +++ b/client/src/components/report-center-modal/report-center-modal.component.jsx @@ -34,28 +34,34 @@ export function ReportCenterModalComponent({ reportCenterModal, bodyshop }) { const [form] = Form.useForm(); const [search, setSearch] = useState(""); const { - treatments: { Enhanced_Payroll } + treatments: { Enhanced_Payroll, ADPPayroll } } = useSplitTreatments({ attributes: {}, - names: ["Enhanced_Payroll"], + names: ["Enhanced_Payroll", "ADPPayroll"], splitKey: bodyshop.imexshopid }); const [loading, setLoading] = useState(false); const { t } = useTranslation(); const Templates = TemplateList("report_center"); - const ReportsList = - Enhanced_Payroll.treatment === "on" - ? Object.keys(Templates) - .map((key) => { - return Templates[key]; - }) - .filter((temp) => temp.enhanced_payroll === undefined || temp.enhanced_payroll === true) - : Object.keys(Templates) - .map((key) => { - return Templates[key]; - }) - .filter((temp) => temp.enhanced_payroll === undefined || temp.enhanced_payroll === false); + const ReportsList = Object.keys(Templates) + .map((key) => Templates[key]) + .filter((temp) => { + const enhancedPayrollOn = Enhanced_Payroll.treatment === "on"; + const adpPayrollOn = ADPPayroll.treatment === "on"; + + if (enhancedPayrollOn && adpPayrollOn) { + return temp.enhanced_payroll !== false || temp.adp_payroll !== false; + } + if (enhancedPayrollOn) { + return temp.enhanced_payroll !== false && temp.adp_payroll !== true; + } + if (adpPayrollOn) { + return temp.adp_payroll !== false && temp.enhanced_payroll !== true; + } + + return temp.enhanced_payroll !== true && temp.adp_payroll !== true; + }); const { open } = reportCenterModal; @@ -104,7 +110,7 @@ export function ReportCenterModalComponent({ reportCenterModal, bodyshop }) { to: values.to, subject: Templates[values.key]?.subject }, - values.sendbyexcel === "excel" ? "x" : values.sendby === "email" ? "e" : "p", + values.sendbytext === "text" ? values.sendbytext : values.sendbyexcel === "excel" ? "x" : values.sendby === "email" ? "e" : "p", id ); setLoading(false); @@ -291,7 +297,15 @@ export function ReportCenterModalComponent({ reportCenterModal, bodyshop }) { ); - if (reporttype !== "excel") + if (reporttype === "text") + return ( + + + {t("general.labels.text")} + + + ); + if (reporttype !== "excel" || reporttype !== "text") return ( diff --git a/client/src/components/shop-info/shop-info.general.component.jsx b/client/src/components/shop-info/shop-info.general.component.jsx index 20cc88d36..2a62fdead 100644 --- a/client/src/components/shop-info/shop-info.general.component.jsx +++ b/client/src/components/shop-info/shop-info.general.component.jsx @@ -7,13 +7,13 @@ import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; import DatePickerRanges from "../../utils/DatePickerRanges"; +import InstanceRenderManager from "../../utils/instanceRenderMgr"; +import FeatureWrapper, { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component"; import CurrencyInput from "../form-items-formatted/currency-form-item.component"; import FormItemEmail from "../form-items-formatted/email-form-item.component"; import PhoneFormItem, { PhoneItemFormatterValidation } from "../form-items-formatted/phone-form-item.component"; import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; -import InstanceRenderManager from "../../utils/instanceRenderMgr"; -import FeatureWrapper, { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component"; // TODO: Client Update, this might break const timeZonesList = Intl.supportedValuesOf("timeZone"); const mapStateToProps = createStructuredSelector({ @@ -28,10 +28,10 @@ export function ShopInfoGeneral({ form, bodyshop }) { const { t } = useTranslation(); const { - treatments: { ClosingPeriod } + treatments: { ClosingPeriod, ADPPayroll } } = useSplitTreatments({ attributes: {}, - names: ["ClosingPeriod"], + names: ["ClosingPeriod", "ADPPayroll"], splitKey: bodyshop && bodyshop.imexshopid }); @@ -98,7 +98,6 @@ export function ShopInfoGeneral({ form, bodyshop }) { - {ClosingPeriod.treatment === "on" && ( - <> - - - - + + + + )} + {ADPPayroll.treatment === "on" && ( + + + + )} + {ADPPayroll.treatment === "on" && ( + + + )} diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 12795c272..45ea63ff1 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -2927,6 +2927,8 @@ "vendor": "Vendor" }, "templates": { + "adp_payroll_flat": "ADP Payroll - Flat Rate", + "adp_payroll_straight": "ADP Payroll - Straight Time", "anticipated_revenue": "Anticipated Revenue", "ar_aging": "AR Aging", "attendance_detail": "Attendance (All Employees)", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 91bb9417c..3765acb6c 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -2927,6 +2927,8 @@ "vendor": "" }, "templates": { + "adp_payroll_flat": "", + "adp_payroll_straight": "", "anticipated_revenue": "", "ar_aging": "", "attendance_detail": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 642bf0c41..41b3c154a 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -2927,6 +2927,8 @@ "vendor": "" }, "templates": { + "adp_payroll_flat": "", + "adp_payroll_straight": "", "anticipated_revenue": "", "ar_aging": "", "attendance_detail": "", diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index 2aa482fb6..4fdcf6e3e 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -2158,6 +2158,32 @@ export const TemplateList = (type, context) => { field: i18n.t("tasks.fields.created_at") }, group: "jobs" + }, + adp_payroll_flat: { + title: i18n.t("reportcenter.templates.adp_payroll_flat"), + subject: i18n.t("reportcenter.templates.adp_payroll_flat"), + key: "adp_payroll_flat", + reporttype: "text", + disabled: false, + rangeFilter: { + object: i18n.t("reportcenter.labels.objects.timetickets"), + field: i18n.t("timetickets.fields.committed_at") + }, + group: "payroll", + adp_payroll: true + }, + adp_payroll_straight: { + title: i18n.t("reportcenter.templates.adp_payroll_straight"), + subject: i18n.t("reportcenter.templates.adp_payroll_straight"), + key: "adp_payroll_straight", + reporttype: "text", + disabled: false, + rangeFilter: { + object: i18n.t("reportcenter.labels.objects.timetickets"), + field: i18n.t("timetickets.fields.date") + }, + group: "payroll", + adp_payroll: true } } : {}), From 0193ff9e65db50bc32a7454aafc68b72d2511c57 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 10 Sep 2024 11:55:42 -0700 Subject: [PATCH 02/13] IO-2915 Customer Portion Totals - Federal Tax Signed-off-by: Allan Carr --- .../job-totals.table.totals.component.jsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/client/src/components/job-totals-table/job-totals.table.totals.component.jsx b/client/src/components/job-totals-table/job-totals.table.totals.component.jsx index 2d4372a09..a8b5e0604 100644 --- a/client/src/components/job-totals-table/job-totals.table.totals.component.jsx +++ b/client/src/components/job-totals-table/job-totals.table.totals.component.jsx @@ -141,10 +141,14 @@ export function JobTotalsTableTotals({ bodyshop, job }) { key: t("jobs.fields.ded_amt"), total: job.job_totals.totals.custPayable.deductible }, - // { - // key: t("jobs.fields.federal_tax_payable"), - // total: job.job_totals.totals.custPayable.federal_tax, - // }, + ...(InstanceRenderManager({ + imex: [{ + key: t("jobs.fields.federal_tax_payable"), + total: job.job_totals.totals.custPayable.federal_tax + }], + rome: [], + promanager: "USE_ROME" + })), { key: t("jobs.fields.other_amount_payable"), total: job.job_totals.totals.custPayable.other_customer_amount From 3bfa556b02ad350595e7f1bcf4383455f7169d51 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 10 Sep 2024 15:54:15 -0700 Subject: [PATCH 03/13] IO-2733 Added countdown timer to PWA Refresh & cache busting meta. --- .circleci/config.yml | 6 +- bodyshop_translations.babel | 2016 ++++- client/index.html | 3 + .../update-alert/update-alert.component.jsx | 53 +- client/src/translations/en_us/common.json | 7144 +++++++++-------- client/src/translations/es/common.json | 7144 +++++++++-------- client/src/translations/fr/common.json | 7144 +++++++++-------- client/src/utils/countdownHook.js | 84 + 8 files changed, 12872 insertions(+), 10722 deletions(-) create mode 100644 client/src/utils/countdownHook.js diff --git a/.circleci/config.yml b/.circleci/config.yml index 4f35873a2..215cdc075 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -226,7 +226,9 @@ jobs: command: | curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash hasura migrate apply --endpoint https://db.test.romeonline.io/ --admin-secret << parameters.secret >> + sleep 5 hasura metadata apply --endpoint https://db.test.romeonline.io/ --admin-secret << parameters.secret >> + sleep 10 hasura metadata reload --endpoint https://db.test.romeonline.io/ --admin-secret << parameters.secret >> - jira/notify: environment: Test (Rome) - Hasura @@ -313,7 +315,9 @@ jobs: command: | curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash hasura migrate apply --endpoint https://db.test.bodyshop.app/ --admin-secret << parameters.secret >> + sleep 5 hasura metadata apply --endpoint https://db.test.bodyshop.app/ --admin-secret << parameters.secret >> + sleep 10 hasura metadata reload --endpoint https://db.test.bodyshop.app/ --admin-secret << parameters.secret >> - jira/notify: environment: Test (ImEX) - Hasura @@ -433,7 +437,7 @@ workflows: branches: only: master-AIO - rome-hasura-migrate: - secret: ${HASURA_PROD_SECRET} + secret: ${HASURA_ROME_PROD_SECRET} filters: branches: only: master-AIO diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index fd7c9e586..bf5cbd528 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -1,4 +1,4 @@ - +