IO-2072 add parts label to bill posting screen.
This commit is contained in:
@@ -3078,6 +3078,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>generatepartslabel</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>iouexists</name>
|
<name>iouexists</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -26210,6 +26231,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>alreadyaddedtoscoreboard</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>alreadyclosed</name>
|
<name>alreadyclosed</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useApolloClient, useMutation } from "@apollo/client";
|
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 _ from "lodash";
|
||||||
import React, { useEffect, useState, useMemo } from "react";
|
import React, { useEffect, useState, useMemo } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
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 { CalculateBillTotal } from "../bill-form/bill-form.totals.utility";
|
||||||
import { handleUpload } from "../documents-upload/documents-upload.utility";
|
import { handleUpload } from "../documents-upload/documents-upload.utility";
|
||||||
import { handleUpload as handleLocalUpload } from "../documents-local-upload/documents-local-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({
|
const mapStateToProps = createStructuredSelector({
|
||||||
billEnterModal: selectBillEnterModal,
|
billEnterModal: selectBillEnterModal,
|
||||||
@@ -38,6 +41,8 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
dispatch(insertAuditTrail({ jobid, operation })),
|
dispatch(insertAuditTrail({ jobid, operation })),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const Templates = TemplateList("job_special");
|
||||||
|
|
||||||
function BillEnterModalContainer({
|
function BillEnterModalContainer({
|
||||||
billEnterModal,
|
billEnterModal,
|
||||||
toggleModalVisible,
|
toggleModalVisible,
|
||||||
@@ -54,7 +59,10 @@ function BillEnterModalContainer({
|
|||||||
const [updateInventoryLines] = useMutation(UPDATE_INVENTORY_LINES);
|
const [updateInventoryLines] = useMutation(UPDATE_INVENTORY_LINES);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const client = useApolloClient();
|
const client = useApolloClient();
|
||||||
|
const [generateLabel, setGenerateLabel] = useLocalStorage(
|
||||||
|
"enter_bill_generate_label",
|
||||||
|
false
|
||||||
|
);
|
||||||
const formValues = useMemo(() => {
|
const formValues = useMemo(() => {
|
||||||
return {
|
return {
|
||||||
...billEnterModal.context.bill,
|
...billEnterModal.context.bill,
|
||||||
@@ -275,6 +283,20 @@ function BillEnterModalContainer({
|
|||||||
notification["success"]({
|
notification["success"]({
|
||||||
message: t("bills.successes.created"),
|
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();
|
if (billEnterModal.actions.refetch) billEnterModal.actions.refetch();
|
||||||
|
|
||||||
insertAuditTrail({
|
insertAuditTrail({
|
||||||
@@ -330,6 +352,12 @@ function BillEnterModalContainer({
|
|||||||
}}
|
}}
|
||||||
footer={
|
footer={
|
||||||
<Space>
|
<Space>
|
||||||
|
<Checkbox
|
||||||
|
checked={generateLabel}
|
||||||
|
onChange={(e) => setGenerateLabel(e.target.checked)}
|
||||||
|
>
|
||||||
|
{t("bills.labels.generatepartslabel")}
|
||||||
|
</Checkbox>
|
||||||
<Button onClick={handleCancel}>{t("general.actions.cancel")}</Button>
|
<Button onClick={handleCancel}>{t("general.actions.cancel")}</Button>
|
||||||
<Button loading={loading} onClick={() => form.submit()}>
|
<Button loading={loading} onClick={() => form.submit()}>
|
||||||
{t("general.actions.save")}
|
{t("general.actions.save")}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { useMutation, useLazyQuery } from "@apollo/client";
|
import { useMutation, useLazyQuery } from "@apollo/client";
|
||||||
|
import { CheckCircleOutlined } from "@ant-design/icons";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
@@ -141,6 +142,12 @@ export default function ScoreboardAddButton({
|
|||||||
</Form>
|
</Form>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
{entryData && entryData.scoreboard && entryData.scoreboard[0] && (
|
||||||
|
<Space>
|
||||||
|
<CheckCircleOutlined style={{ color: "green" }} />
|
||||||
|
<span>{t("jobs.labels.alreadyaddedtoscoreboard")}</span>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -195,6 +195,7 @@
|
|||||||
"entered_total": "Total of Entered Lines",
|
"entered_total": "Total of Entered Lines",
|
||||||
"enteringcreditmemo": "You are entering a credit memo. Please ensure you are also entering positive values.",
|
"enteringcreditmemo": "You are entering a credit memo. Please ensure you are also entering positive values.",
|
||||||
"federal_tax": "Federal Tax",
|
"federal_tax": "Federal Tax",
|
||||||
|
"generatepartslabel": "Generate Parts Labels after Saving?",
|
||||||
"iouexists": "An IOU exists that is associated to this RO.",
|
"iouexists": "An IOU exists that is associated to this RO.",
|
||||||
"local_tax": "Local Tax",
|
"local_tax": "Local Tax",
|
||||||
"markexported": "Mark Exported",
|
"markexported": "Mark Exported",
|
||||||
@@ -1552,6 +1553,7 @@
|
|||||||
"adjustments": "Adjustments",
|
"adjustments": "Adjustments",
|
||||||
"adminwarning": "Use the functionality on this page at your own risk. You are responsible for any and all changes to your data.",
|
"adminwarning": "Use the functionality on this page at your own risk. You are responsible for any and all changes to your data.",
|
||||||
"allocations": "Allocations",
|
"allocations": "Allocations",
|
||||||
|
"alreadyaddedtoscoreboard": "Job has already been added to scoreboard. Saving will update the previous entry.",
|
||||||
"alreadyclosed": "This job has already been closed.",
|
"alreadyclosed": "This job has already been closed.",
|
||||||
"appointmentconfirmation": "Send confirmation to customer?",
|
"appointmentconfirmation": "Send confirmation to customer?",
|
||||||
"associationwarning": "Any changes to associations will require updating the data from the new parent record to the job.",
|
"associationwarning": "Any changes to associations will require updating the data from the new parent record to the job.",
|
||||||
|
|||||||
@@ -195,6 +195,7 @@
|
|||||||
"entered_total": "",
|
"entered_total": "",
|
||||||
"enteringcreditmemo": "",
|
"enteringcreditmemo": "",
|
||||||
"federal_tax": "",
|
"federal_tax": "",
|
||||||
|
"generatepartslabel": "",
|
||||||
"iouexists": "",
|
"iouexists": "",
|
||||||
"local_tax": "",
|
"local_tax": "",
|
||||||
"markexported": "",
|
"markexported": "",
|
||||||
@@ -1552,6 +1553,7 @@
|
|||||||
"adjustments": "",
|
"adjustments": "",
|
||||||
"adminwarning": "",
|
"adminwarning": "",
|
||||||
"allocations": "",
|
"allocations": "",
|
||||||
|
"alreadyaddedtoscoreboard": "",
|
||||||
"alreadyclosed": "",
|
"alreadyclosed": "",
|
||||||
"appointmentconfirmation": "¿Enviar confirmación al cliente?",
|
"appointmentconfirmation": "¿Enviar confirmación al cliente?",
|
||||||
"associationwarning": "",
|
"associationwarning": "",
|
||||||
|
|||||||
@@ -195,6 +195,7 @@
|
|||||||
"entered_total": "",
|
"entered_total": "",
|
||||||
"enteringcreditmemo": "",
|
"enteringcreditmemo": "",
|
||||||
"federal_tax": "",
|
"federal_tax": "",
|
||||||
|
"generatepartslabel": "",
|
||||||
"iouexists": "",
|
"iouexists": "",
|
||||||
"local_tax": "",
|
"local_tax": "",
|
||||||
"markexported": "",
|
"markexported": "",
|
||||||
@@ -1552,6 +1553,7 @@
|
|||||||
"adjustments": "",
|
"adjustments": "",
|
||||||
"adminwarning": "",
|
"adminwarning": "",
|
||||||
"allocations": "",
|
"allocations": "",
|
||||||
|
"alreadyaddedtoscoreboard": "",
|
||||||
"alreadyclosed": "",
|
"alreadyclosed": "",
|
||||||
"appointmentconfirmation": "Envoyer une confirmation au client?",
|
"appointmentconfirmation": "Envoyer une confirmation au client?",
|
||||||
"associationwarning": "",
|
"associationwarning": "",
|
||||||
|
|||||||
@@ -510,6 +510,12 @@ export const TemplateList = (type, context) => {
|
|||||||
key: "parts_label_multiple",
|
key: "parts_label_multiple",
|
||||||
disabled: false,
|
disabled: false,
|
||||||
},
|
},
|
||||||
|
parts_invoice_label_single: {
|
||||||
|
title: i18n.t("printcenter.jobs.parts_invoice_label_single"),
|
||||||
|
description: "Parts Label Multiple",
|
||||||
|
key: "parts_invoice_label_single",
|
||||||
|
disabled: false,
|
||||||
|
},
|
||||||
csi_invitation_action: {
|
csi_invitation_action: {
|
||||||
title: i18n.t("printcenter.jobs.csi_invitation_action"),
|
title: i18n.t("printcenter.jobs.csi_invitation_action"),
|
||||||
description: "CSI invite",
|
description: "CSI invite",
|
||||||
|
|||||||
Reference in New Issue
Block a user