diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel
index 0b3b72468..b6274d250 100644
--- a/bodyshop_translations.babel
+++ b/bodyshop_translations.babel
@@ -3078,6 +3078,27 @@
+
+ generatepartslabel
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
iouexists
false
@@ -26210,6 +26231,27 @@
+
+ alreadyaddedtoscoreboard
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
alreadyclosed
false
diff --git a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx
index 2200809ee..ca94a70b3 100644
--- a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx
+++ b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx
@@ -1,5 +1,5 @@
import { useApolloClient, useMutation } from "@apollo/client";
-import { Button, Form, Modal, notification, Space } from "antd";
+import { Button, Checkbox, Form, Modal, notification, Space } from "antd";
import _ from "lodash";
import React, { useEffect, useState, useMemo } from "react";
import { useTranslation } from "react-i18next";
@@ -26,6 +26,9 @@ import BillFormContainer from "../bill-form/bill-form.container";
import { CalculateBillTotal } from "../bill-form/bill-form.totals.utility";
import { handleUpload } from "../documents-upload/documents-upload.utility";
import { handleUpload as handleLocalUpload } from "../documents-local-upload/documents-local-upload.utility";
+import useLocalStorage from "../../utils/useLocalStorage";
+import { GenerateDocument } from "../../utils/RenderTemplate";
+import { TemplateList } from "../../utils/TemplateConstants";
const mapStateToProps = createStructuredSelector({
billEnterModal: selectBillEnterModal,
@@ -38,6 +41,8 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(insertAuditTrail({ jobid, operation })),
});
+const Templates = TemplateList("job_special");
+
function BillEnterModalContainer({
billEnterModal,
toggleModalVisible,
@@ -54,7 +59,10 @@ function BillEnterModalContainer({
const [updateInventoryLines] = useMutation(UPDATE_INVENTORY_LINES);
const [loading, setLoading] = useState(false);
const client = useApolloClient();
-
+ const [generateLabel, setGenerateLabel] = useLocalStorage(
+ "enter_bill_generate_label",
+ false
+ );
const formValues = useMemo(() => {
return {
...billEnterModal.context.bill,
@@ -275,6 +283,20 @@ function BillEnterModalContainer({
notification["success"]({
message: t("bills.successes.created"),
});
+
+ if (generateLabel) {
+ GenerateDocument(
+ {
+ name: Templates.parts_invoice_label_single.key,
+ variables: {
+ id: billId,
+ },
+ },
+ {},
+ "p"
+ );
+ }
+
if (billEnterModal.actions.refetch) billEnterModal.actions.refetch();
insertAuditTrail({
@@ -330,6 +352,12 @@ function BillEnterModalContainer({
}}
footer={
+ setGenerateLabel(e.target.checked)}
+ >
+ {t("bills.labels.generatepartslabel")}
+