Compare commits
3 Commits
feature/IO
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7ddbf7e8d | ||
|
|
ace16ba873 | ||
|
|
4940b10910 |
@@ -1,8 +1,7 @@
|
|||||||
VITE_APP_GRAPHQL_ENDPOINT=https://db.dev.bodyshop.app/v1/graphql
|
VITE_APP_GRAPHQL_ENDPOINT=https://db.dev.bodyshop.app/v1/graphql
|
||||||
VITE_APP_GRAPHQL_ENDPOINT_WS=wss://db.dev.bodyshop.app/v1/graphql
|
VITE_APP_GRAPHQL_ENDPOINT_WS=wss://db.dev.bodyshop.app/v1/graphql
|
||||||
VITE_APP_GA_CODE=231099835
|
VITE_APP_GA_CODE=231099835
|
||||||
# VITE_APP_FIREBASE_CONFIG={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "authDomain": "rome-prod-1.firebaseapp.com", "projectId": "rome-prod-1", "storageBucket": "rome-prod-1.appspot.com", "messagingSenderId": "147786367145", "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", "measurementId": "G-G8Z9DRHTZS"}
|
VITE_APP_FIREBASE_CONFIG={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "authDomain": "rome-prod-1.firebaseapp.com", "projectId": "rome-prod-1", "storageBucket": "rome-prod-1.appspot.com", "messagingSenderId": "147786367145", "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", "measurementId": "G-G8Z9DRHTZS"}
|
||||||
VITE_APP_FIREBASE_CONFIG={"apiKey":"AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc","authDomain":"imex-dev.firebaseapp.com","databaseURL":"https://imex-dev.firebaseio.com","projectId":"imex-dev","storageBucket":"imex-dev.appspot.com","messagingSenderId":"759548147434","appId":"1:759548147434:web:e8239868a48ceb36700993","measurementId":"G-K5XRBVVB4S"}
|
|
||||||
VITE_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/io-test
|
VITE_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/io-test
|
||||||
VITE_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/io-test
|
VITE_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/io-test
|
||||||
VITE_APP_CLOUDINARY_API_KEY=957865933348715
|
VITE_APP_CLOUDINARY_API_KEY=957865933348715
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
VITE_APP_GRAPHQL_ENDPOINT=https://db.dev.bodyshop.app/v1/graphql
|
VITE_APP_GRAPHQL_ENDPOINT=https://db.dev.bodyshop.app/v1/graphql
|
||||||
VITE_APP_GRAPHQL_ENDPOINT_WS=wss://db.dev.bodyshop.app/v1/graphql
|
VITE_APP_GRAPHQL_ENDPOINT_WS=wss://db.dev.bodyshop.app/v1/graphql
|
||||||
VITE_APP_GA_CODE=231099835
|
VITE_APP_GA_CODE=231099835
|
||||||
# VITE_APP_FIREBASE_CONFIG={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "authDomain": "rome-prod-1.firebaseapp.com", "projectId": "rome-prod-1", "storageBucket": "rome-prod-1.appspot.com", "messagingSenderId": "147786367145", "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", "measurementId": "G-G8Z9DRHTZS"}
|
VITE_APP_FIREBASE_CONFIG={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "authDomain": "rome-prod-1.firebaseapp.com", "projectId": "rome-prod-1", "storageBucket": "rome-prod-1.appspot.com", "messagingSenderId": "147786367145", "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", "measurementId": "G-G8Z9DRHTZS"}
|
||||||
VITE_APP_FIREBASE_CONFIG={"apiKey":"AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc","authDomain":"imex-dev.firebaseapp.com","databaseURL":"https://imex-dev.firebaseio.com","projectId":"imex-dev","storageBucket":"imex-dev.appspot.com","messagingSenderId":"759548147434","appId":"1:759548147434:web:e8239868a48ceb36700993","measurementId":"G-K5XRBVVB4S"}
|
|
||||||
VITE_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/io-test
|
VITE_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/io-test
|
||||||
VITE_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/io-test
|
VITE_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/io-test
|
||||||
VITE_APP_CLOUDINARY_API_KEY=957865933348715
|
VITE_APP_CLOUDINARY_API_KEY=957865933348715
|
||||||
|
|||||||
@@ -25,27 +25,31 @@ const BillLineSearchSelect = ({ options, disabled, allowRemoved, ...restProps },
|
|||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
notFoundContent={"Removed."}
|
notFoundContent={"Removed."}
|
||||||
options={[
|
{...restProps}
|
||||||
{ value: "noline", label: t("billlines.labels.other"), name: t("billlines.labels.other") },
|
>
|
||||||
...options.map((item) => ({
|
<Select.Option key={null} value={"noline"} cost={0} line_desc={""}>
|
||||||
disabled: allowRemoved ? false : item.removed,
|
{t("billlines.labels.other")}
|
||||||
key: item.id,
|
</Select.Option>
|
||||||
value: item.id,
|
{options
|
||||||
cost: item.act_price ? item.act_price : 0,
|
? options.map((item) => (
|
||||||
part_type: item.part_type,
|
<Option
|
||||||
line_desc: item.line_desc,
|
disabled={allowRemoved ? false : item.removed}
|
||||||
part_qty: item.part_qty,
|
key={item.id}
|
||||||
oem_partno: item.oem_partno,
|
value={item.id}
|
||||||
alt_partno: item.alt_partno,
|
cost={item.act_price ? item.act_price : 0}
|
||||||
act_price: item.act_price,
|
part_type={item.part_type}
|
||||||
style: {
|
line_desc={item.line_desc}
|
||||||
...(item.removed ? { textDecoration: "line-through" } : {})
|
part_qty={item.part_qty}
|
||||||
},
|
oem_partno={item.oem_partno}
|
||||||
name: `${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${
|
alt_partno={item.alt_partno}
|
||||||
item.oem_partno ? ` - ${item.oem_partno}` : ""
|
act_price={item.act_price}
|
||||||
}${item.alt_partno ? ` (${item.alt_partno})` : ""}`.trim(),
|
style={{
|
||||||
label: (
|
...(item.removed ? { textDecoration: "line-through" } : {})
|
||||||
<>
|
}}
|
||||||
|
name={`${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${
|
||||||
|
item.oem_partno ? ` - ${item.oem_partno}` : ""
|
||||||
|
}${item.alt_partno ? ` (${item.alt_partno})` : ""}`.trim()}
|
||||||
|
>
|
||||||
<span>
|
<span>
|
||||||
{`${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${
|
{`${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${
|
||||||
item.oem_partno ? ` - ${item.oem_partno}` : ""
|
item.oem_partno ? ` - ${item.oem_partno}` : ""
|
||||||
@@ -56,15 +60,14 @@ const BillLineSearchSelect = ({ options, disabled, allowRemoved, ...restProps },
|
|||||||
<span style={{ float: "right", paddingleft: "1rem" }}>{`${item.mod_lb_hrs} units`}</span>
|
<span style={{ float: "right", paddingleft: "1rem" }}>{`${item.mod_lb_hrs} units`}</span>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|
||||||
<span style={{ float: "right", paddingleft: "1rem" }}>
|
<span style={{ float: "right", paddingleft: "1rem" }}>
|
||||||
{item.act_price ? `$${item.act_price && item.act_price.toFixed(2)}` : ``}
|
{item.act_price ? `$${item.act_price && item.act_price.toFixed(2)}` : ``}
|
||||||
</span>
|
</span>
|
||||||
</>
|
</Option>
|
||||||
)
|
))
|
||||||
}))
|
: null}
|
||||||
]}
|
</Select>
|
||||||
{...restProps}
|
|
||||||
></Select>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export default forwardRef(BillLineSearchSelect);
|
export default forwardRef(BillLineSearchSelect);
|
||||||
|
|||||||
@@ -141,13 +141,11 @@ function Header({
|
|||||||
accountingChildren.push(
|
accountingChildren.push(
|
||||||
{
|
{
|
||||||
key: "bills",
|
key: "bills",
|
||||||
id: "header-accounting-bills",
|
|
||||||
icon: <Icon component={FaFileInvoiceDollar} />,
|
icon: <Icon component={FaFileInvoiceDollar} />,
|
||||||
label: <Link to="/manage/bills">{t("menus.header.bills")}</Link>
|
label: <Link to="/manage/bills">{t("menus.header.bills")}</Link>
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "enterbills",
|
key: "enterbills",
|
||||||
id: "header-accounting-enterbills",
|
|
||||||
icon: <Icon component={GiPayMoney} />,
|
icon: <Icon component={GiPayMoney} />,
|
||||||
label: t("menus.header.enterbills"),
|
label: t("menus.header.enterbills"),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@@ -167,7 +165,6 @@ function Header({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "inventory",
|
key: "inventory",
|
||||||
id: "header-accounting-inventory",
|
|
||||||
icon: <Icon component={FaFileInvoiceDollar} />,
|
icon: <Icon component={FaFileInvoiceDollar} />,
|
||||||
label: <Link to="/manage/inventory">{t("menus.header.inventory")}</Link>
|
label: <Link to="/manage/inventory">{t("menus.header.inventory")}</Link>
|
||||||
}
|
}
|
||||||
@@ -186,13 +183,11 @@ function Header({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "allpayments",
|
key: "allpayments",
|
||||||
id: "header-accounting-allpayments",
|
|
||||||
icon: <BankFilled />,
|
icon: <BankFilled />,
|
||||||
label: <Link to="/manage/payments">{t("menus.header.allpayments")}</Link>
|
label: <Link to="/manage/payments">{t("menus.header.allpayments")}</Link>
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "enterpayments",
|
key: "enterpayments",
|
||||||
id: "header-accounting-enterpayments",
|
|
||||||
icon: <Icon component={FaCreditCard} />,
|
icon: <Icon component={FaCreditCard} />,
|
||||||
label: t("menus.header.enterpayment"),
|
label: t("menus.header.enterpayment"),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@@ -208,7 +203,6 @@ function Header({
|
|||||||
if (ImEXPay.treatment === "on") {
|
if (ImEXPay.treatment === "on") {
|
||||||
accountingChildren.push({
|
accountingChildren.push({
|
||||||
key: "entercardpayments",
|
key: "entercardpayments",
|
||||||
id: "header-accounting-entercardpayments",
|
|
||||||
icon: <Icon component={FaCreditCard} />,
|
icon: <Icon component={FaCreditCard} />,
|
||||||
label: t("menus.header.entercardpayment"),
|
label: t("menus.header.entercardpayment"),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@@ -233,7 +227,6 @@ function Header({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "timetickets",
|
key: "timetickets",
|
||||||
id: "header-accounting-timetickets",
|
|
||||||
icon: <FieldTimeOutlined />,
|
icon: <FieldTimeOutlined />,
|
||||||
label: <Link to="/manage/timetickets">{t("menus.header.timetickets")}</Link>
|
label: <Link to="/manage/timetickets">{t("menus.header.timetickets")}</Link>
|
||||||
}
|
}
|
||||||
@@ -242,7 +235,6 @@ function Header({
|
|||||||
if (bodyshop?.md_tasks_presets?.use_approvals) {
|
if (bodyshop?.md_tasks_presets?.use_approvals) {
|
||||||
accountingChildren.push({
|
accountingChildren.push({
|
||||||
key: "ttapprovals",
|
key: "ttapprovals",
|
||||||
id: "header-accounting-ttapprovals",
|
|
||||||
icon: <FieldTimeOutlined />,
|
icon: <FieldTimeOutlined />,
|
||||||
label: <Link to="/manage/ttapprovals">{t("menus.header.ttapprovals")}</Link>
|
label: <Link to="/manage/ttapprovals">{t("menus.header.ttapprovals")}</Link>
|
||||||
});
|
});
|
||||||
@@ -252,7 +244,6 @@ function Header({
|
|||||||
key: "entertimetickets",
|
key: "entertimetickets",
|
||||||
icon: <Icon component={GiPlayerTime} />,
|
icon: <Icon component={GiPlayerTime} />,
|
||||||
label: t("menus.header.entertimeticket"),
|
label: t("menus.header.entertimeticket"),
|
||||||
id: "header-accounting-entertimetickets",
|
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setTimeTicketContext({
|
setTimeTicketContext({
|
||||||
actions: {},
|
actions: {},
|
||||||
@@ -273,7 +264,6 @@ function Header({
|
|||||||
const accountingExportChildren = [
|
const accountingExportChildren = [
|
||||||
{
|
{
|
||||||
key: "receivables",
|
key: "receivables",
|
||||||
id: "header-accounting-receivables",
|
|
||||||
label: <Link to="/manage/accounting/receivables">{t("menus.header.accounting-receivables")}</Link>
|
label: <Link to="/manage/accounting/receivables">{t("menus.header.accounting-receivables")}</Link>
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@@ -281,7 +271,6 @@ function Header({
|
|||||||
if (!((bodyshop && bodyshop.cdk_dealerid) || (bodyshop && bodyshop.pbs_serialnumber)) || DmsAp.treatment === "on") {
|
if (!((bodyshop && bodyshop.cdk_dealerid) || (bodyshop && bodyshop.pbs_serialnumber)) || DmsAp.treatment === "on") {
|
||||||
accountingExportChildren.push({
|
accountingExportChildren.push({
|
||||||
key: "payables",
|
key: "payables",
|
||||||
id: "header-accounting-payables",
|
|
||||||
label: <Link to="/manage/accounting/payables">{t("menus.header.accounting-payables")}</Link>
|
label: <Link to="/manage/accounting/payables">{t("menus.header.accounting-payables")}</Link>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -289,7 +278,6 @@ function Header({
|
|||||||
if (!((bodyshop && bodyshop.cdk_dealerid) || (bodyshop && bodyshop.pbs_serialnumber))) {
|
if (!((bodyshop && bodyshop.cdk_dealerid) || (bodyshop && bodyshop.pbs_serialnumber))) {
|
||||||
accountingExportChildren.push({
|
accountingExportChildren.push({
|
||||||
key: "payments",
|
key: "payments",
|
||||||
id: "header-accounting-payments",
|
|
||||||
label: <Link to="/manage/accounting/payments">{t("menus.header.accounting-payments")}</Link>
|
label: <Link to="/manage/accounting/payments">{t("menus.header.accounting-payments")}</Link>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -300,7 +288,6 @@ function Header({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "exportlogs",
|
key: "exportlogs",
|
||||||
id: "header-accounting-exportlogs",
|
|
||||||
label: <Link to="/manage/accounting/exportlogs">{t("menus.header.export-logs")}</Link>
|
label: <Link to="/manage/accounting/exportlogs">{t("menus.header.export-logs")}</Link>
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -314,7 +301,6 @@ function Header({
|
|||||||
) {
|
) {
|
||||||
accountingChildren.push({
|
accountingChildren.push({
|
||||||
key: "accountingexport",
|
key: "accountingexport",
|
||||||
id: "header-accounting-export",
|
|
||||||
icon: <ExportOutlined />,
|
icon: <ExportOutlined />,
|
||||||
label: t("menus.header.export"),
|
label: t("menus.header.export"),
|
||||||
children: accountingExportChildren
|
children: accountingExportChildren
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { DownCircleFilled } from "@ant-design/icons";
|
import { DownCircleFilled } from "@ant-design/icons";
|
||||||
import { useApolloClient, useMutation } from "@apollo/client";
|
import { useApolloClient, useMutation } from "@apollo/client";
|
||||||
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
||||||
import { Button, Card, Dropdown, Form, Input, Modal, notification, Popconfirm, Popover, Select, Space } from "antd";
|
import { Button, Card, Dropdown, Form, Input, Modal, Popconfirm, Popover, Select, Space, notification } from "antd";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import parsePhoneNumber from "libphonenumber-js";
|
import parsePhoneNumber from "libphonenumber-js";
|
||||||
import React, { useMemo, useState } from "react";
|
import React, { useMemo, useState } from "react";
|
||||||
@@ -641,7 +641,6 @@ export function JobsDetailHeaderActions({
|
|||||||
const menuItems = [
|
const menuItems = [
|
||||||
{
|
{
|
||||||
key: "schedule",
|
key: "schedule",
|
||||||
id: "job-actions-schedule",
|
|
||||||
disabled: !jobInPreProduction || !job.converted || jobRO,
|
disabled: !jobInPreProduction || !job.converted || jobRO,
|
||||||
label: t("jobs.actions.schedule"),
|
label: t("jobs.actions.schedule"),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@@ -658,7 +657,6 @@ export function JobsDetailHeaderActions({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "cancelallappointments",
|
key: "cancelallappointments",
|
||||||
id: "job-actions-cancelallappointments",
|
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
if (job.status !== bodyshop.md_ro_statuses.default_scheduled) {
|
if (job.status !== bodyshop.md_ro_statuses.default_scheduled) {
|
||||||
return;
|
return;
|
||||||
@@ -672,7 +670,6 @@ export function JobsDetailHeaderActions({
|
|||||||
imex: [
|
imex: [
|
||||||
{
|
{
|
||||||
key: "intake",
|
key: "intake",
|
||||||
id: "job-actions-intake",
|
|
||||||
disabled: !!job.intakechecklist || !jobInPreProduction || !job.converted || jobRO,
|
disabled: !!job.intakechecklist || !jobInPreProduction || !job.converted || jobRO,
|
||||||
label:
|
label:
|
||||||
!!job.intakechecklist || !jobInPreProduction || !job.converted || jobRO ? (
|
!!job.intakechecklist || !jobInPreProduction || !job.converted || jobRO ? (
|
||||||
@@ -683,7 +680,6 @@ export function JobsDetailHeaderActions({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "deliver",
|
key: "deliver",
|
||||||
id: "job-actions-deliver",
|
|
||||||
disabled: !jobInProduction || jobRO,
|
disabled: !jobInProduction || jobRO,
|
||||||
label: !jobInProduction ? (
|
label: !jobInProduction ? (
|
||||||
t("jobs.actions.deliver")
|
t("jobs.actions.deliver")
|
||||||
@@ -693,7 +689,6 @@ export function JobsDetailHeaderActions({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "checklist",
|
key: "checklist",
|
||||||
id: "job-actions-checklist",
|
|
||||||
disabled: !job.converted,
|
disabled: !job.converted,
|
||||||
label: <Link to={`/manage/jobs/${job.id}/checklist`}>{t("jobs.actions.viewchecklist")}</Link>
|
label: <Link to={`/manage/jobs/${job.id}/checklist`}>{t("jobs.actions.viewchecklist")}</Link>
|
||||||
}
|
}
|
||||||
@@ -702,7 +697,6 @@ export function JobsDetailHeaderActions({
|
|||||||
promanager: [
|
promanager: [
|
||||||
{
|
{
|
||||||
key: "toggleproduction",
|
key: "toggleproduction",
|
||||||
id: "job-actions-toggleproduction",
|
|
||||||
disabled: !job.converted || jobRO,
|
disabled: !job.converted || jobRO,
|
||||||
label: <JobsDetailHeaderActionsToggleProduction job={job} refetch={refetch} />
|
label: <JobsDetailHeaderActionsToggleProduction job={job} refetch={refetch} />
|
||||||
}
|
}
|
||||||
@@ -716,7 +710,6 @@ export function JobsDetailHeaderActions({
|
|||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
key: "entertimetickets",
|
key: "entertimetickets",
|
||||||
id: "job-actions-entertimetickets",
|
|
||||||
disabled: !job.converted || (!bodyshop.tt_allow_post_to_invoiced && job.date_invoiced),
|
disabled: !job.converted || (!bodyshop.tt_allow_post_to_invoiced && job.date_invoiced),
|
||||||
label: t("timetickets.actions.enter"),
|
label: t("timetickets.actions.enter"),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@@ -740,7 +733,6 @@ export function JobsDetailHeaderActions({
|
|||||||
if (bodyshop.md_tasks_presets.enable_tasks) {
|
if (bodyshop.md_tasks_presets.enable_tasks) {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
key: "claimtimetickettasks",
|
key: "claimtimetickettasks",
|
||||||
id: "job-actions-claimtimetickettasks",
|
|
||||||
disabled: !job.converted || (!bodyshop.tt_allow_post_to_invoiced && job.date_invoiced),
|
disabled: !job.converted || (!bodyshop.tt_allow_post_to_invoiced && job.date_invoiced),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setTimeTicketTaskContext({
|
setTimeTicketTaskContext({
|
||||||
@@ -754,7 +746,6 @@ export function JobsDetailHeaderActions({
|
|||||||
|
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
key: "enterpayments",
|
key: "enterpayments",
|
||||||
id: "job-actions-enterpayments",
|
|
||||||
disabled: !job.converted,
|
disabled: !job.converted,
|
||||||
label: t("menus.header.enterpayment"),
|
label: t("menus.header.enterpayment"),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@@ -770,7 +761,6 @@ export function JobsDetailHeaderActions({
|
|||||||
if (ImEXPay.treatment === "on") {
|
if (ImEXPay.treatment === "on") {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
key: "entercardpayments",
|
key: "entercardpayments",
|
||||||
id: "job-actions-entercardpayments",
|
|
||||||
disabled: !job.converted,
|
disabled: !job.converted,
|
||||||
label: t("menus.header.entercardpayment"),
|
label: t("menus.header.entercardpayment"),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@@ -787,7 +777,6 @@ export function JobsDetailHeaderActions({
|
|||||||
if (HasFeatureAccess({ featureName: "courtesycars", bodyshop })) {
|
if (HasFeatureAccess({ featureName: "courtesycars", bodyshop })) {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
key: "cccontract",
|
key: "cccontract",
|
||||||
id: "job-actions-cccontract",
|
|
||||||
disabled: jobRO || !job.converted,
|
disabled: jobRO || !job.converted,
|
||||||
label: (
|
label: (
|
||||||
<Link state={{ jobId: job.id }} to="/manage/courtesycars/contracts/new">
|
<Link state={{ jobId: job.id }} to="/manage/courtesycars/contracts/new">
|
||||||
@@ -799,7 +788,6 @@ export function JobsDetailHeaderActions({
|
|||||||
|
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
key: "createtask",
|
key: "createtask",
|
||||||
id: "job-actions-createtask",
|
|
||||||
label: t("menus.header.create_task"),
|
label: t("menus.header.create_task"),
|
||||||
onClick: () =>
|
onClick: () =>
|
||||||
setTaskUpsertContext({
|
setTaskUpsertContext({
|
||||||
@@ -812,14 +800,12 @@ export function JobsDetailHeaderActions({
|
|||||||
job.inproduction
|
job.inproduction
|
||||||
? {
|
? {
|
||||||
key: "removefromproduction",
|
key: "removefromproduction",
|
||||||
id: "job-actions-removefromproduction",
|
|
||||||
disabled: !job.converted,
|
disabled: !job.converted,
|
||||||
label: t("jobs.actions.removefromproduction"),
|
label: t("jobs.actions.removefromproduction"),
|
||||||
onClick: () => AddToProduction(client, job.id, refetch, true)
|
onClick: () => AddToProduction(client, job.id, refetch, true)
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
key: "addtoproduction",
|
key: "addtoproduction",
|
||||||
id: "job-actions-addtoproduction",
|
|
||||||
disabled: !job.converted,
|
disabled: !job.converted,
|
||||||
label: t("jobs.actions.addtoproduction"),
|
label: t("jobs.actions.addtoproduction"),
|
||||||
onClick: () => AddToProduction(client, job.id, refetch)
|
onClick: () => AddToProduction(client, job.id, refetch)
|
||||||
@@ -829,14 +815,12 @@ export function JobsDetailHeaderActions({
|
|||||||
menuItems.push(
|
menuItems.push(
|
||||||
{
|
{
|
||||||
key: "togglesuspend",
|
key: "togglesuspend",
|
||||||
id: "job-actions-togglesuspend",
|
|
||||||
onClick: handleSuspend,
|
onClick: handleSuspend,
|
||||||
label: job.suspended ? t("production.actions.unsuspend") : t("production.actions.suspend")
|
label: job.suspended ? t("production.actions.unsuspend") : t("production.actions.suspend")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "toggleAlert",
|
key: "toggleAlert",
|
||||||
onClick: handleAlertToggle,
|
onClick: handleAlertToggle,
|
||||||
id: "job-actions-togglealert",
|
|
||||||
label:
|
label:
|
||||||
job.production_vars && job.production_vars.alert
|
job.production_vars && job.production_vars.alert
|
||||||
? t("production.labels.alertoff")
|
? t("production.labels.alertoff")
|
||||||
@@ -848,7 +832,6 @@ export function JobsDetailHeaderActions({
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
key: "duplicate",
|
key: "duplicate",
|
||||||
id: "job-actions-duplicate",
|
|
||||||
label: (
|
label: (
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title={t("jobs.labels.duplicateconfirm")}
|
title={t("jobs.labels.duplicateconfirm")}
|
||||||
@@ -864,7 +847,6 @@ export function JobsDetailHeaderActions({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "duplicatenolines",
|
key: "duplicatenolines",
|
||||||
id: "job-actions-duplicatenolines",
|
|
||||||
label: (
|
label: (
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title={t("jobs.labels.duplicateconfirm")}
|
title={t("jobs.labels.duplicateconfirm")}
|
||||||
@@ -888,7 +870,6 @@ export function JobsDetailHeaderActions({
|
|||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
key: "postbills",
|
key: "postbills",
|
||||||
id: "job-actions-postbills",
|
|
||||||
disabled: !job.converted,
|
disabled: !job.converted,
|
||||||
label: t("jobs.actions.postbills"),
|
label: t("jobs.actions.postbills"),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@@ -907,7 +888,6 @@ export function JobsDetailHeaderActions({
|
|||||||
|
|
||||||
{
|
{
|
||||||
key: "addtopartsqueue",
|
key: "addtopartsqueue",
|
||||||
id: "job-actions-addtopartsqueue",
|
|
||||||
disabled: !job.converted || !jobInProduction || jobRO,
|
disabled: !job.converted || !jobInProduction || jobRO,
|
||||||
label: t("jobs.actions.addtopartsqueue"),
|
label: t("jobs.actions.addtopartsqueue"),
|
||||||
onClick: async () => {
|
onClick: async () => {
|
||||||
@@ -933,7 +913,6 @@ export function JobsDetailHeaderActions({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "closejob",
|
key: "closejob",
|
||||||
id: "job-actions-closejob",
|
|
||||||
disabled: !jobInPostProduction,
|
disabled: !jobInPostProduction,
|
||||||
label: !jobInPostProduction ? (
|
label: !jobInPostProduction ? (
|
||||||
t("menus.jobsactions.closejob")
|
t("menus.jobsactions.closejob")
|
||||||
@@ -949,7 +928,6 @@ export function JobsDetailHeaderActions({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "admin",
|
key: "admin",
|
||||||
id: "job-actions-admin",
|
|
||||||
label: (
|
label: (
|
||||||
<Link
|
<Link
|
||||||
to={{
|
to={{
|
||||||
@@ -971,7 +949,6 @@ export function JobsDetailHeaderActions({
|
|||||||
) {
|
) {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
key: "exportcustdata",
|
key: "exportcustdata",
|
||||||
id: "job-actions-exportcustdata",
|
|
||||||
disabled: !job.converted,
|
disabled: !job.converted,
|
||||||
label: t("jobs.actions.exportcustdata"),
|
label: t("jobs.actions.exportcustdata"),
|
||||||
onClick: handleExportCustData
|
onClick: handleExportCustData
|
||||||
@@ -982,21 +959,18 @@ export function JobsDetailHeaderActions({
|
|||||||
const children = [
|
const children = [
|
||||||
{
|
{
|
||||||
key: "email",
|
key: "email",
|
||||||
id: "job-actions-email",
|
|
||||||
disabled: !!!job.ownr_ea,
|
disabled: !!!job.ownr_ea,
|
||||||
label: t("general.labels.email"),
|
label: t("general.labels.email"),
|
||||||
onClick: handleCreateCsi
|
onClick: handleCreateCsi
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "text",
|
key: "text",
|
||||||
id: "job-actions-text",
|
|
||||||
disabled: !!!job.ownr_ph1,
|
disabled: !!!job.ownr_ph1,
|
||||||
label: t("general.labels.text"),
|
label: t("general.labels.text"),
|
||||||
onClick: handleCreateCsi
|
onClick: handleCreateCsi
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "generate",
|
key: "generate",
|
||||||
id: "job-actions-generate",
|
|
||||||
disabled: job.csiinvites && job.csiinvites.length > 0,
|
disabled: job.csiinvites && job.csiinvites.length > 0,
|
||||||
label: t("jobs.actions.generatecsi"),
|
label: t("jobs.actions.generatecsi"),
|
||||||
onClick: handleCreateCsi
|
onClick: handleCreateCsi
|
||||||
@@ -1030,7 +1004,6 @@ export function JobsDetailHeaderActions({
|
|||||||
}
|
}
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
key: "sendcsi",
|
key: "sendcsi",
|
||||||
id: "job-actions-sendcsi",
|
|
||||||
label: t("jobs.actions.sendcsi"),
|
label: t("jobs.actions.sendcsi"),
|
||||||
disabled: !job.converted,
|
disabled: !job.converted,
|
||||||
children
|
children
|
||||||
@@ -1039,7 +1012,6 @@ export function JobsDetailHeaderActions({
|
|||||||
|
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
key: "jobcosting",
|
key: "jobcosting",
|
||||||
id: "job-actions-jobcosting",
|
|
||||||
disabled: !job.converted,
|
disabled: !job.converted,
|
||||||
label: t("jobs.labels.jobcosting"),
|
label: t("jobs.labels.jobcosting"),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@@ -1057,7 +1029,6 @@ export function JobsDetailHeaderActions({
|
|||||||
if (job && !job.converted) {
|
if (job && !job.converted) {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
key: "deletejob",
|
key: "deletejob",
|
||||||
id: "job-actions-deletejob",
|
|
||||||
label: (
|
label: (
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title={t("jobs.labels.deleteconfirm")}
|
title={t("jobs.labels.deleteconfirm")}
|
||||||
@@ -1074,7 +1045,6 @@ export function JobsDetailHeaderActions({
|
|||||||
|
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
key: "manualevent",
|
key: "manualevent",
|
||||||
id: "job-actions-manualevent",
|
|
||||||
onClick: (e) => {
|
onClick: (e) => {
|
||||||
setVisibility(true);
|
setVisibility(true);
|
||||||
},
|
},
|
||||||
@@ -1084,7 +1054,6 @@ export function JobsDetailHeaderActions({
|
|||||||
if (!jobRO && job.converted) {
|
if (!jobRO && job.converted) {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
key: "voidjob",
|
key: "voidjob",
|
||||||
id: "job-actions-voidjob",
|
|
||||||
label: (
|
label: (
|
||||||
<RbacWrapper action="jobs:void" noauth>
|
<RbacWrapper action="jobs:void" noauth>
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export function PartsOrderListTableComponent({
|
|||||||
} else {
|
} else {
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
const result = await billQuery({
|
const result = await billQuery({
|
||||||
variables: { billid: returnfrombill }
|
variables: { billid: returnfrombill },
|
||||||
});
|
});
|
||||||
setBillData(result.data);
|
setBillData(result.data);
|
||||||
};
|
};
|
||||||
@@ -203,7 +203,7 @@ export function PartsOrderListTableComponent({
|
|||||||
is_credit_memo: record.return,
|
is_credit_memo: record.return,
|
||||||
billlines: record.parts_order_lines.map((pol) => {
|
billlines: record.parts_order_lines.map((pol) => {
|
||||||
return {
|
return {
|
||||||
joblineid: pol.job_line_id || "noline",
|
joblineid: pol.job_line_id,
|
||||||
line_desc: pol.line_desc,
|
line_desc: pol.line_desc,
|
||||||
quantity: pol.quantity,
|
quantity: pol.quantity,
|
||||||
|
|
||||||
|
|||||||
@@ -291,7 +291,6 @@ export function JobsDetailPage({
|
|||||||
{
|
{
|
||||||
key: "general",
|
key: "general",
|
||||||
icon: <Icon component={FaShieldAlt} />,
|
icon: <Icon component={FaShieldAlt} />,
|
||||||
id: "job-details-general",
|
|
||||||
label: t("menus.jobsdetail.general"),
|
label: t("menus.jobsdetail.general"),
|
||||||
forceRender: true,
|
forceRender: true,
|
||||||
children: <JobsDetailGeneral job={job} form={form} />
|
children: <JobsDetailGeneral job={job} form={form} />
|
||||||
@@ -299,7 +298,6 @@ export function JobsDetailPage({
|
|||||||
{
|
{
|
||||||
key: "repairdata",
|
key: "repairdata",
|
||||||
icon: <BarsOutlined />,
|
icon: <BarsOutlined />,
|
||||||
id: "job-details-repairdata",
|
|
||||||
label: t("menus.jobsdetail.repairdata"),
|
label: t("menus.jobsdetail.repairdata"),
|
||||||
forceRender: true,
|
forceRender: true,
|
||||||
children: <JobsLinesContainer job={job} joblines={job.joblines} refetch={refetch} form={form} />
|
children: <JobsLinesContainer job={job} joblines={job.joblines} refetch={refetch} form={form} />
|
||||||
@@ -307,21 +305,18 @@ export function JobsDetailPage({
|
|||||||
{
|
{
|
||||||
key: "rates",
|
key: "rates",
|
||||||
icon: <DollarCircleOutlined />,
|
icon: <DollarCircleOutlined />,
|
||||||
id: "job-details-rates",
|
|
||||||
label: t("menus.jobsdetail.rates"),
|
label: t("menus.jobsdetail.rates"),
|
||||||
forceRender: true,
|
forceRender: true,
|
||||||
children: <JobsDetailRates job={job} form={form} />
|
children: <JobsDetailRates job={job} form={form} />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "totals",
|
key: "totals",
|
||||||
id: "job-details-totals",
|
|
||||||
icon: <DollarCircleOutlined />,
|
icon: <DollarCircleOutlined />,
|
||||||
label: t("menus.jobsdetail.totals"),
|
label: t("menus.jobsdetail.totals"),
|
||||||
children: <JobsDetailTotals job={job} refetch={refetch} />
|
children: <JobsDetailTotals job={job} refetch={refetch} />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "partssublet",
|
key: "partssublet",
|
||||||
id: "job-details-partssublet",
|
|
||||||
icon: <ToolFilled />,
|
icon: <ToolFilled />,
|
||||||
label: HasFeatureAccess({ featureName: "bills", bodyshop })
|
label: HasFeatureAccess({ featureName: "bills", bodyshop })
|
||||||
? t("menus.jobsdetail.partssublet")
|
? t("menus.jobsdetail.partssublet")
|
||||||
@@ -336,7 +331,6 @@ export function JobsDetailPage({
|
|||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
key: "labor",
|
key: "labor",
|
||||||
id: "job-details-labor",
|
|
||||||
icon: <Icon component={FaHardHat} />,
|
icon: <Icon component={FaHardHat} />,
|
||||||
label: t("menus.jobsdetail.labor"),
|
label: t("menus.jobsdetail.labor"),
|
||||||
children: <JobsDetailLaborContainer job={job} jobId={job.id} />
|
children: <JobsDetailLaborContainer job={job} jobId={job.id} />
|
||||||
@@ -346,13 +340,11 @@ export function JobsDetailPage({
|
|||||||
{
|
{
|
||||||
key: "lifecycle",
|
key: "lifecycle",
|
||||||
icon: <BarsOutlined />,
|
icon: <BarsOutlined />,
|
||||||
id: "job-details-lifecycle",
|
|
||||||
label: t("menus.jobsdetail.lifecycle"),
|
label: t("menus.jobsdetail.lifecycle"),
|
||||||
children: <JobLifecycleComponent job={job} statuses={bodyshop.md_ro_statuses} />
|
children: <JobLifecycleComponent job={job} statuses={bodyshop.md_ro_statuses} />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "dates",
|
key: "dates",
|
||||||
id: "job-details-dates",
|
|
||||||
icon: <CalendarFilled />,
|
icon: <CalendarFilled />,
|
||||||
label: t("menus.jobsdetail.dates"),
|
label: t("menus.jobsdetail.dates"),
|
||||||
forceRender: true,
|
forceRender: true,
|
||||||
@@ -366,7 +358,6 @@ export function JobsDetailPage({
|
|||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
key: "documents",
|
key: "documents",
|
||||||
id: "job-details-documents",
|
|
||||||
icon: <FileImageFilled />,
|
icon: <FileImageFilled />,
|
||||||
label: t("jobs.labels.documents"),
|
label: t("jobs.labels.documents"),
|
||||||
children: bodyshop.uselocalmediaserver ? (
|
children: bodyshop.uselocalmediaserver ? (
|
||||||
@@ -379,7 +370,6 @@ export function JobsDetailPage({
|
|||||||
: []),
|
: []),
|
||||||
{
|
{
|
||||||
key: "notes",
|
key: "notes",
|
||||||
id: "job-details-notes",
|
|
||||||
icon: <Icon component={FaRegStickyNote} />,
|
icon: <Icon component={FaRegStickyNote} />,
|
||||||
label: t("jobs.labels.notes"),
|
label: t("jobs.labels.notes"),
|
||||||
children: <JobNotesContainer jobId={job.id} />
|
children: <JobNotesContainer jobId={job.id} />
|
||||||
@@ -387,14 +377,12 @@ export function JobsDetailPage({
|
|||||||
{
|
{
|
||||||
key: "audit",
|
key: "audit",
|
||||||
icon: <HistoryOutlined />,
|
icon: <HistoryOutlined />,
|
||||||
id: "job-details-audit",
|
|
||||||
label: t("jobs.labels.audit"),
|
label: t("jobs.labels.audit"),
|
||||||
children: <JobAuditTrail jobId={job.id} />
|
children: <JobAuditTrail jobId={job.id} />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "tasks",
|
key: "tasks",
|
||||||
icon: <FaTasks />,
|
icon: <FaTasks />,
|
||||||
id: "job-details-tasks",
|
|
||||||
label: (
|
label: (
|
||||||
<Space direction="horizontal">
|
<Space direction="horizontal">
|
||||||
{t("jobs.labels.tasks")}
|
{t("jobs.labels.tasks")}
|
||||||
|
|||||||
@@ -174,7 +174,10 @@ async function OpenSearchUpdateHandler(req, res) {
|
|||||||
const bulkOperation = [];
|
const bulkOperation = [];
|
||||||
slicedArray.forEach((bill) => {
|
slicedArray.forEach((bill) => {
|
||||||
bulkOperation.push({ index: { _index: "bills", _id: bill.id } });
|
bulkOperation.push({ index: { _index: "bills", _id: bill.id } });
|
||||||
bulkOperation.push({ ...bill, bodyshopid: bill.job.bodyshopid });
|
bulkOperation.push({
|
||||||
|
...omit(bill, ["job"]),
|
||||||
|
bodyshopid: bill.job.bodyshopid
|
||||||
|
});
|
||||||
});
|
});
|
||||||
promiseQueue.push(bulkOperation);
|
promiseQueue.push(bulkOperation);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,6 @@
|
|||||||
"admin": "cd admin && npm start",
|
"admin": "cd admin && npm start",
|
||||||
"client": "cd client && npm start",
|
"client": "cd client && npm start",
|
||||||
"server": "nodemon server.js",
|
"server": "nodemon server.js",
|
||||||
"server:imex": "nodemon server.js imex",
|
|
||||||
"server:rome": "nodemon server.js rome",
|
|
||||||
"server:promanager": "nodemon server.js promanager",
|
|
||||||
"build": "cd client && npm run build",
|
"build": "cd client && npm run build",
|
||||||
"dev": "concurrently --kill-others-on-fail \"npm run server\" \"npm run client\"",
|
"dev": "concurrently --kill-others-on-fail \"npm run server\" \"npm run client\"",
|
||||||
"deva": "concurrently --kill-others-on-fail \"npm run server\" \"npm run client\" \"npm run admin\"",
|
"deva": "concurrently --kill-others-on-fail \"npm run server\" \"npm run client\" \"npm run admin\"",
|
||||||
|
|||||||
@@ -8,11 +8,9 @@ const cookieParser = require("cookie-parser");
|
|||||||
const http = require("http");
|
const http = require("http");
|
||||||
const { Server } = require("socket.io");
|
const { Server } = require("socket.io");
|
||||||
|
|
||||||
const instanceName = process.argv[2];
|
|
||||||
|
|
||||||
// Load environment variables
|
// Load environment variables
|
||||||
require("dotenv").config({
|
require("dotenv").config({
|
||||||
path: path.resolve(process.cwd(), `.env.${process.env.NODE_ENV || "development"}${instanceName ? `.${instanceName}` : ''}`)
|
path: path.resolve(process.cwd(), `.env.${process.env.NODE_ENV || "development"}`)
|
||||||
});
|
});
|
||||||
|
|
||||||
// Import custom utilities and handlers
|
// Import custom utilities and handlers
|
||||||
|
|||||||
@@ -891,22 +891,19 @@ function checkStateTax(jobline, jobs_by_pk) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isAdditionalCost =
|
const isAdditionalCost =
|
||||||
(jobline.lbr_op === "OP13" || (jobline.db_ref && jobline.db_ref.startsWith("9360"))) && !isPaintOrShopMat;
|
(jobline.lbr_op === "OP13" ||
|
||||||
|
(jobline.lbr_op === "OP14" && jobline.act_price > 0 && jobline.mod_lb_hrs === 0) ||
|
||||||
|
(jobline.db_ref && jobline.db_ref.startsWith("9360")) ||
|
||||||
|
(jobline.db_ref && jobline.db_ref.startsWith("90051"))) &&
|
||||||
|
!isPaintOrShopMat;
|
||||||
|
|
||||||
if (!jobline.part_type && isAdditionalCost) {
|
if (!jobline.part_type && isAdditionalCost) {
|
||||||
if (jobs_by_pk.tax_lbr_rt === 0) {
|
if (jobs_by_pk.tax_lbr_rt === 0) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
jobline.db_ref === "900511" ||
|
|
||||||
jobline.db_ref === "900510" ||
|
|
||||||
(jobline.mod_lb_hrs === 0 && jobline.act_price > 0 && jobline.lbr_op === "OP14")
|
|
||||||
)
|
|
||||||
return true; //Extending IO-1375 as a part of IO-2023
|
|
||||||
|
|
||||||
if (jobline.tax_part === false) {
|
if (jobline.tax_part === false) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1539,7 +1539,6 @@ exports.QUERY_JOB_COSTING_DETAILS = ` query QUERY_JOB_COSTING_DETAILS($id: uuid!
|
|||||||
op_code_desc
|
op_code_desc
|
||||||
profitcenter_part
|
profitcenter_part
|
||||||
profitcenter_labor
|
profitcenter_labor
|
||||||
act_price_before_ppc
|
|
||||||
}
|
}
|
||||||
bills {
|
bills {
|
||||||
id
|
id
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ function GenerateCostingData(job) {
|
|||||||
job &&
|
job &&
|
||||||
job.joblines.reduce(
|
job.joblines.reduce(
|
||||||
(acc, val) => {
|
(acc, val) => {
|
||||||
//Shop or Paint Material Flags
|
//Parts Lines
|
||||||
if (val.db_ref === "936008") {
|
if (val.db_ref === "936008") {
|
||||||
//If either of these DB REFs change, they also need to change in job-totals/job-costing calculations.
|
//If either of these DB REFs change, they also need to change in job-totals/job-costing calculations.
|
||||||
hasMapaLine = true;
|
hasMapaLine = true;
|
||||||
@@ -277,8 +277,6 @@ function GenerateCostingData(job) {
|
|||||||
if (val.db_ref === "936007") {
|
if (val.db_ref === "936007") {
|
||||||
hasMashLine = true;
|
hasMashLine = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Labor Profit Center
|
|
||||||
if (val.mod_lbr_ty) {
|
if (val.mod_lbr_ty) {
|
||||||
const laborProfitCenter = val.profitcenter_labor || defaultProfits[val.mod_lbr_ty] || "Unknown";
|
const laborProfitCenter = val.profitcenter_labor || defaultProfits[val.mod_lbr_ty] || "Unknown";
|
||||||
|
|
||||||
@@ -309,7 +307,6 @@ function GenerateCostingData(job) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Part Profit Center
|
|
||||||
if (val.part_type && val.part_type !== "PAE" && val.part_type !== "PAS" && val.part_type !== "PASL") {
|
if (val.part_type && val.part_type !== "PAE" && val.part_type !== "PAS" && val.part_type !== "PASL") {
|
||||||
const partsProfitCenter = val.profitcenter_part || defaultProfits[val.part_type] || "Unknown";
|
const partsProfitCenter = val.profitcenter_part || defaultProfits[val.part_type] || "Unknown";
|
||||||
|
|
||||||
@@ -318,7 +315,7 @@ function GenerateCostingData(job) {
|
|||||||
if (!partsProfitCenter)
|
if (!partsProfitCenter)
|
||||||
console.log("Unknown cost/profit center mapping for parts.", val.line_desc, val.part_type);
|
console.log("Unknown cost/profit center mapping for parts.", val.line_desc, val.part_type);
|
||||||
const partsAmount = Dinero({
|
const partsAmount = Dinero({
|
||||||
amount: val.act_price_before_ppc ? Math.round(val.act_price_before_ppc * 100) : Math.round(val.act_price * 100)
|
amount: Math.round((val.act_price || 0) * 100)
|
||||||
})
|
})
|
||||||
.multiply(val.part_qty || 1)
|
.multiply(val.part_qty || 1)
|
||||||
.add(
|
.add(
|
||||||
@@ -327,7 +324,7 @@ function GenerateCostingData(job) {
|
|||||||
? val.prt_dsmk_m
|
? val.prt_dsmk_m
|
||||||
? Dinero({ amount: Math.round(val.prt_dsmk_m * 100) })
|
? Dinero({ amount: Math.round(val.prt_dsmk_m * 100) })
|
||||||
: Dinero({
|
: Dinero({
|
||||||
amount: val.act_price_before_ppc ? Math.round(val.act_price_before_ppc * 100) : Math.round(val.act_price * 100)
|
amount: Math.round(val.act_price * 100)
|
||||||
})
|
})
|
||||||
.multiply(val.part_qty || 0)
|
.multiply(val.part_qty || 0)
|
||||||
.percentage(Math.abs(val.prt_dsmk_p || 0))
|
.percentage(Math.abs(val.prt_dsmk_p || 0))
|
||||||
@@ -337,8 +334,6 @@ function GenerateCostingData(job) {
|
|||||||
if (!acc.parts[partsProfitCenter]) acc.parts[partsProfitCenter] = Dinero();
|
if (!acc.parts[partsProfitCenter]) acc.parts[partsProfitCenter] = Dinero();
|
||||||
acc.parts[partsProfitCenter] = acc.parts[partsProfitCenter].add(partsAmount);
|
acc.parts[partsProfitCenter] = acc.parts[partsProfitCenter].add(partsAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Sublet Profit Center
|
|
||||||
if (val.part_type && val.part_type !== "PAE" && (val.part_type === "PAS" || val.part_type === "PASL")) {
|
if (val.part_type && val.part_type !== "PAE" && (val.part_type === "PAS" || val.part_type === "PASL")) {
|
||||||
const partsProfitCenter = val.profitcenter_part || defaultProfits[val.part_type] || "Unknown";
|
const partsProfitCenter = val.profitcenter_part || defaultProfits[val.part_type] || "Unknown";
|
||||||
|
|
||||||
@@ -367,8 +362,8 @@ function GenerateCostingData(job) {
|
|||||||
acc.sublet[partsProfitCenter] = acc.sublet[partsProfitCenter].add(partsAmount);
|
acc.sublet[partsProfitCenter] = acc.sublet[partsProfitCenter].add(partsAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Additional Profit Center
|
//To deal with additional costs.
|
||||||
if ((!val.part_type && !val.mod_lbr_ty) || (!val.part_type && val.mod_lbr_ty)) {
|
if (!val.part_type && !val.mod_lbr_ty) {
|
||||||
//Does it already have a defined profit center?
|
//Does it already have a defined profit center?
|
||||||
//If so, use it, otherwise try to use the same from the auto-allocate logic in IO app jobs-close-auto-allocate.
|
//If so, use it, otherwise try to use the same from the auto-allocate logic in IO app jobs-close-auto-allocate.
|
||||||
const partsProfitCenter = val.profitcenter_part || getAdditionalCostCenter(val, defaultProfits) || "Unknown";
|
const partsProfitCenter = val.profitcenter_part || getAdditionalCostCenter(val, defaultProfits) || "Unknown";
|
||||||
|
|||||||
Reference in New Issue
Block a user