diff --git a/client/src/components/bill-reexport-button/bill-reexport-button.component.jsx b/client/src/components/bill-reexport-button/bill-reexport-button.component.jsx index ae7641b38..80f35df57 100644 --- a/client/src/components/bill-reexport-button/bill-reexport-button.component.jsx +++ b/client/src/components/bill-reexport-button/bill-reexport-button.component.jsx @@ -9,18 +9,20 @@ import { createStructuredSelector } from "reselect"; import { selectAuthLevel, selectBodyshop } from "../../redux/user/user.selectors"; import { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component"; import { useNotification } from "../../contexts/Notifications/notificationContext.jsx"; +import { insertAuditTrail } from "../../redux/application/application.actions.js"; +import AuditTrailMapping from "../../utils/AuditTrailMappings.js"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, authLevel: selectAuthLevel }); -const mapDispatchToProps = () => ({ - //setUserLanguage: language => dispatch(setUserLanguage(language)) +const mapDispatchToProps = (dispatch) => ({ + insertAuditTrail: ({ jobid, operation, type }) => dispatch(insertAuditTrail({ jobid, operation, type })) }); export default connect(mapStateToProps, mapDispatchToProps)(BillMarkForReexportButton); -export function BillMarkForReexportButton({ bodyshop, authLevel, bill }) { +export function BillMarkForReexportButton({ bodyshop, authLevel, bill, insertAuditTrail }) { const { t } = useTranslation(); const [loading, setLoading] = useState(false); const notification = useNotification(); @@ -47,6 +49,12 @@ export function BillMarkForReexportButton({ bodyshop, authLevel, bill }) { notification.success({ title: t("bills.successes.reexport") }); + insertAuditTrail({ + jobid: bill.jobid, + billid: bill.id, + operation: AuditTrailMapping.billmarkforreexport(bill.invoice_number), + type: "billmarkforreexport" + }); } else { notification.error({ title: t("bills.errors.saving", { diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 76e55c8f3..f0d1ebbff 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -120,6 +120,7 @@ "appointmentinsert": "Appointment created. Appointment Date: {{start}}.", "assignedlinehours": "Assigned job lines totaling {{hours}} units to {{team}}.", "billdeleted": "Bill with invoice number {{invoice_number}} deleted.", + "billmarkforreexport": "Bill with invoice number {{invoice_number}} marked for re-export.", "billposted": "Bill with invoice number {{invoice_number}} posted.", "billupdated": "Bill with invoice number {{invoice_number}} updated.", "failedpayment": "Failed payment attempt.", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 683e1d5b8..3f1d15ce6 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -121,6 +121,7 @@ "assignedlinehours": "", "billdeleted": "", "billposted": "", + "billmarkforreexport": "", "billupdated": "", "failedpayment": "", "jobassignmentchange": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 7ca765876..c1520a5e3 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -120,6 +120,7 @@ "appointmentinsert": "", "assignedlinehours": "", "billdeleted": "", + "billmarkforreexport": "", "billposted": "", "billupdated": "", "failedpayment": "", diff --git a/client/src/utils/AuditTrailMappings.js b/client/src/utils/AuditTrailMappings.js index ea1494fec..e33082c20 100644 --- a/client/src/utils/AuditTrailMappings.js +++ b/client/src/utils/AuditTrailMappings.js @@ -8,6 +8,7 @@ const AuditTrailMapping = { appointmentcancel: (lost_sale_reason) => i18n.t("audit_trail.messages.appointmentcancel", { lost_sale_reason }), appointmentinsert: (start) => i18n.t("audit_trail.messages.appointmentinsert", { start }), billdeleted: (invoice_number) => i18n.t("audit_trail.messages.billdeleted", { invoice_number }), + billmarkforreexport: (invoice_number) => i18n.t("audit_trail.messages.billmarkforreexport", { invoice_number }), billposted: (invoice_number) => i18n.t("audit_trail.messages.billposted", { invoice_number }), billupdated: (invoice_number) => i18n.t("audit_trail.messages.billupdated", { invoice_number }), jobassignmentchange: (operation, name) => i18n.t("audit_trail.messages.jobassignmentchange", { operation, name }), diff --git a/server/chatter/createLocation.js b/server/chatter/createLocation.js index 18c51305f..93d5e11db 100644 --- a/server/chatter/createLocation.js +++ b/server/chatter/createLocation.js @@ -33,8 +33,6 @@ const createLocation = async (req, res) => { const { logger } = req; const { bodyshopID, googlePlaceID } = req.body; - console.dir({ body: req.body }); - if (!DEFAULT_COMPANY_ID) { logger.log("chatter-create-location-no-default-company", "warn", null, null, { bodyshopID }); return res.json({ success: false, message: "No default company set" });