IO-1680 Order as In House from Job View
This commit is contained in:
@@ -32395,6 +32395,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>orderinhouse</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>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
</children>
|
</children>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
EditFilled,
|
EditFilled,
|
||||||
PlusCircleTwoTone,
|
PlusCircleTwoTone,
|
||||||
MinusCircleTwoTone,
|
MinusCircleTwoTone,
|
||||||
|
HomeOutlined,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import {
|
import {
|
||||||
@@ -42,6 +43,7 @@ import _ from "lodash";
|
|||||||
import JobCreateIOU from "../job-create-iou/job-create-iou.component";
|
import JobCreateIOU from "../job-create-iou/job-create-iou.component";
|
||||||
import JobLinesExpander from "./job-lines-expander.component";
|
import JobLinesExpander from "./job-lines-expander.component";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import moment from "moment";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -54,6 +56,8 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
dispatch(setModalContext({ context: context, modal: "jobLineEdit" })),
|
dispatch(setModalContext({ context: context, modal: "jobLineEdit" })),
|
||||||
setPartsOrderContext: (context) =>
|
setPartsOrderContext: (context) =>
|
||||||
dispatch(setModalContext({ context: context, modal: "partsOrder" })),
|
dispatch(setModalContext({ context: context, modal: "partsOrder" })),
|
||||||
|
setBillEnterContext: (context) =>
|
||||||
|
dispatch(setModalContext({ context: context, modal: "billEnter" })),
|
||||||
});
|
});
|
||||||
|
|
||||||
export function JobLinesComponent({
|
export function JobLinesComponent({
|
||||||
@@ -68,6 +72,7 @@ export function JobLinesComponent({
|
|||||||
job,
|
job,
|
||||||
setJobLineEditContext,
|
setJobLineEditContext,
|
||||||
form,
|
form,
|
||||||
|
setBillEnterContext,
|
||||||
}) {
|
}) {
|
||||||
const [deleteJobLine] = useMutation(DELETE_JOB_LINE_BY_PK);
|
const [deleteJobLine] = useMutation(DELETE_JOB_LINE_BY_PK);
|
||||||
|
|
||||||
@@ -386,6 +391,62 @@ export function JobLinesComponent({
|
|||||||
</Space>
|
</Space>
|
||||||
</Tag>
|
</Tag>
|
||||||
)}
|
)}
|
||||||
|
<Button
|
||||||
|
disabled={
|
||||||
|
(job && !job.converted) ||
|
||||||
|
(selectedLines.length > 0 ? false : true) ||
|
||||||
|
jobRO ||
|
||||||
|
technician
|
||||||
|
}
|
||||||
|
onClick={() => {
|
||||||
|
// setPartsOrderContext({
|
||||||
|
// actions: { refetch: refetch },
|
||||||
|
// context: {
|
||||||
|
// jobId: job.id,
|
||||||
|
// job: job,
|
||||||
|
// linesToOrder: selectedLines,
|
||||||
|
// },
|
||||||
|
// });
|
||||||
|
|
||||||
|
setBillEnterContext({
|
||||||
|
actions: { refetch: refetch },
|
||||||
|
context: {
|
||||||
|
disableInvNumber: true,
|
||||||
|
job: { id: job.id },
|
||||||
|
bill: {
|
||||||
|
vendorid: bodyshop.inhousevendorid,
|
||||||
|
invoice_number: "ih",
|
||||||
|
isinhouse: true,
|
||||||
|
date: new moment(),
|
||||||
|
total: 0,
|
||||||
|
billlines: selectedLines.map((p) => {
|
||||||
|
return {
|
||||||
|
joblineid: p.id,
|
||||||
|
actual_price: p.act_price,
|
||||||
|
actual_cost: 0, //p.act_price,
|
||||||
|
line_desc: p.line_desc,
|
||||||
|
line_remarks: p.line_remarks,
|
||||||
|
part_type: p.part_type,
|
||||||
|
quantity: p.quantity || 1,
|
||||||
|
applicable_taxes: {
|
||||||
|
local: false,
|
||||||
|
state: false,
|
||||||
|
federal: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
//Clear out the selected lines. IO-785
|
||||||
|
setSelectedLines([]);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<HomeOutlined />
|
||||||
|
{t("parts.actions.orderinhouse")}
|
||||||
|
{selectedLines.length > 0 && ` (${selectedLines.length})`}
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
disabled={
|
disabled={
|
||||||
(job && !job.converted) ||
|
(job && !job.converted) ||
|
||||||
|
|||||||
@@ -1916,7 +1916,8 @@
|
|||||||
},
|
},
|
||||||
"parts": {
|
"parts": {
|
||||||
"actions": {
|
"actions": {
|
||||||
"order": "Order Parts"
|
"order": "Order Parts",
|
||||||
|
"orderinhouse": "Order as In House"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"parts_orders": {
|
"parts_orders": {
|
||||||
|
|||||||
@@ -1916,7 +1916,8 @@
|
|||||||
},
|
},
|
||||||
"parts": {
|
"parts": {
|
||||||
"actions": {
|
"actions": {
|
||||||
"order": "Pedido de piezas"
|
"order": "Pedido de piezas",
|
||||||
|
"orderinhouse": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"parts_orders": {
|
"parts_orders": {
|
||||||
|
|||||||
@@ -1916,7 +1916,8 @@
|
|||||||
},
|
},
|
||||||
"parts": {
|
"parts": {
|
||||||
"actions": {
|
"actions": {
|
||||||
"order": "Commander des pièces"
|
"order": "Commander des pièces",
|
||||||
|
"orderinhouse": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"parts_orders": {
|
"parts_orders": {
|
||||||
|
|||||||
Reference in New Issue
Block a user