Compare commits
168 Commits
release/20
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44f2287b07 | ||
|
|
8f91416623 | ||
|
|
a18dbbb6c4 | ||
|
|
57d8ca5829 | ||
|
|
4c6a2d6d63 | ||
|
|
5861d0e9b6 | ||
|
|
e36904794b | ||
|
|
1c89d12034 | ||
|
|
5e36a4ae89 | ||
|
|
f553307587 | ||
|
|
2c80c81197 | ||
|
|
9d865cf130 | ||
|
|
8e119ce0dd | ||
|
|
fe49161718 | ||
|
|
040e366335 | ||
|
|
4655663dd8 | ||
|
|
6e1fbda79b | ||
|
|
b2f616f1eb | ||
|
|
76eec7bebc | ||
|
|
aa5f405e1b | ||
|
|
ca9752d119 | ||
|
|
45b4af5225 | ||
|
|
d2d310cf57 | ||
|
|
5d1a7657a9 | ||
|
|
5cb17994cd | ||
|
|
dab78e3dc9 | ||
|
|
1232f28b3d | ||
|
|
8e8d40d4b0 | ||
|
|
7fae408454 | ||
|
|
1cdafaa2cc | ||
|
|
b9ca7ef2e3 | ||
|
|
60867ae4dc | ||
|
|
b0ddb62ac0 | ||
|
|
39a4646339 | ||
|
|
584322819f | ||
|
|
051ee347a9 | ||
|
|
acf1b387de | ||
|
|
d350515c90 | ||
|
|
121e579388 | ||
|
|
cf5ebb8130 | ||
|
|
2dabf3c811 | ||
|
|
04509fa587 | ||
|
|
56fef0f43c | ||
|
|
42702ef015 | ||
|
|
25bee3cfdf | ||
|
|
baf06fee6c | ||
|
|
a3557bbc86 | ||
|
|
3e00e7981d | ||
|
|
12fa270a1a | ||
|
|
de250b152a | ||
|
|
c45741257f | ||
|
|
3988386c79 | ||
|
|
492032c1e2 | ||
|
|
8222e56485 | ||
|
|
49a61e1564 | ||
|
|
eed18aa1c5 | ||
|
|
2de3f8b022 | ||
|
|
91476c7ad3 | ||
|
|
00eb7926f9 | ||
|
|
854ad21b20 | ||
|
|
3c3f9521f6 | ||
|
|
561bcf10d9 | ||
|
|
75d9faa05b | ||
|
|
ac72177fbb | ||
|
|
088faf152c | ||
|
|
90cba9ed24 | ||
|
|
a0702785c5 | ||
|
|
6898d609fe | ||
|
|
d70893e2ba | ||
|
|
6155b8bf24 | ||
|
|
239dc5c62d | ||
|
|
2586855f11 | ||
|
|
b3b3c4c737 | ||
|
|
abe5fadeea | ||
|
|
08e5543536 | ||
|
|
f1a10e0df4 | ||
|
|
7dc3c00628 | ||
|
|
1c5c403d65 | ||
|
|
7594f53e88 | ||
|
|
b861957342 | ||
|
|
2bf24ff5a1 | ||
|
|
6e5fcbfdbd | ||
|
|
759a8ac58c | ||
|
|
833baca9cc | ||
|
|
889ef61185 | ||
|
|
add1eddbc1 | ||
|
|
1c63aa39c4 | ||
|
|
0cabd80b94 | ||
|
|
7f756bab88 | ||
|
|
99b847822f | ||
|
|
f66d9b8c09 | ||
|
|
5660de42af | ||
|
|
ccbe92c275 | ||
|
|
b0ea8a71fb | ||
|
|
060871306f | ||
|
|
2eb4e142ff | ||
|
|
adf8cf9e8d | ||
|
|
852fd9c388 | ||
|
|
e921f28105 | ||
|
|
6db68b76db | ||
|
|
79a90bb9ee | ||
|
|
1664f9c935 | ||
|
|
23fcdd6375 | ||
|
|
10ffb33ec9 | ||
|
|
c7832bdd82 | ||
|
|
329bdbe22d | ||
|
|
66b3fb6988 | ||
|
|
3d26c2e94e | ||
|
|
ad42dd1295 | ||
|
|
2938b9c94c | ||
|
|
bde17446ad | ||
|
|
fe60538acf | ||
|
|
7461e58000 | ||
|
|
1afda01d34 | ||
|
|
175692559c | ||
|
|
59f71d53cd | ||
|
|
0cad64ff6d | ||
|
|
3a83160b33 | ||
|
|
701c532e48 | ||
|
|
c0d9bacf1d | ||
|
|
357f40bdc2 | ||
|
|
30689a8ca6 | ||
|
|
554ec37ace | ||
|
|
3fc7af9780 | ||
|
|
a1b6ccc23d | ||
|
|
dde6f17029 | ||
|
|
1aceef9153 | ||
|
|
678892d134 | ||
|
|
dc187bbf24 | ||
|
|
09aae78715 | ||
|
|
c42276ab3a | ||
|
|
41d25cbc52 | ||
|
|
085c27ad20 | ||
|
|
38e6b5010e | ||
|
|
242c275e7d | ||
|
|
1dc6130fdf | ||
|
|
910afbf48d | ||
|
|
9d9edfd674 | ||
|
|
62a5b49836 | ||
|
|
e93e138f78 | ||
|
|
4639e31e55 | ||
|
|
e8fde14f9b | ||
|
|
90e87adc34 | ||
|
|
81053b3cbf | ||
|
|
f4290bf20c | ||
|
|
5371657aa4 | ||
|
|
599f4e143c | ||
|
|
94440e5c48 | ||
|
|
aa5d6f2090 | ||
|
|
6bde1b1baf | ||
|
|
fc404b1f3b | ||
|
|
c6ba3fd8f0 | ||
|
|
119904ca2b | ||
|
|
f7e1b023df | ||
|
|
5855569194 | ||
|
|
4f852e7493 | ||
|
|
deec40a89c | ||
|
|
145dd9bec6 | ||
|
|
b8e5d4412f | ||
|
|
277fb8f839 | ||
|
|
d3d5485846 | ||
|
|
55091d61d6 | ||
|
|
5b5df8a3a1 | ||
|
|
ccf48cfcf1 | ||
|
|
c89342b6ef | ||
|
|
e97ceb7cbe | ||
|
|
de34cbd937 | ||
|
|
cf7a1b0168 |
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
||||
GENERATE_SOURCEMAP=false
|
||||
REACT_APP_GRAPHQL_ENDPOINT=https://db.imex.online/v1/graphql
|
||||
REACT_APP_GRAPHQL_ENDPOINT_WS=wss://db.imex.online/v1/graphql
|
||||
REACT_APP_GA_CODE=231103507
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { DELETE_BILL } from "../../graphql/bills.queries";
|
||||
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
||||
|
||||
export default function BillDeleteButton({ bill }) {
|
||||
export default function BillDeleteButton({ bill, callback }) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const { t } = useTranslation();
|
||||
const [deleteBill] = useMutation(DELETE_BILL);
|
||||
@@ -36,6 +36,8 @@ export default function BillDeleteButton({ bill }) {
|
||||
|
||||
if (!!!result.errors) {
|
||||
notification["success"]({ message: t("bills.successes.deleted") });
|
||||
|
||||
if (callback && typeof callback === "function") callback(bill.id);
|
||||
} else {
|
||||
//Check if it's an fkey violation.
|
||||
const error = JSON.stringify(result.errors);
|
||||
|
||||
@@ -109,8 +109,8 @@ export function JobsConvertButton({
|
||||
]}
|
||||
>
|
||||
<Select>
|
||||
{bodyshop.md_ins_cos.map((s) => (
|
||||
<Select.Option key={s.name} value={s.name}>
|
||||
{bodyshop.md_ins_cos.map((s, i) => (
|
||||
<Select.Option key={i} value={s.name}>
|
||||
{s.name}
|
||||
</Select.Option>
|
||||
))}
|
||||
@@ -219,13 +219,15 @@ export function JobsConvertButton({
|
||||
</Select>
|
||||
</Form.Item>
|
||||
)}
|
||||
<Form.Item
|
||||
label={t("jobs.fields.ca_gst_registrant")}
|
||||
name="ca_gst_registrant"
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
{bodyshop.region_config.toLowerCase().startsWith("ca") && (
|
||||
<Form.Item
|
||||
label={t("jobs.fields.ca_gst_registrant")}
|
||||
name="ca_gst_registrant"
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
)}
|
||||
<Form.Item
|
||||
label={t("jobs.fields.driveable")}
|
||||
name="driveable"
|
||||
|
||||
@@ -224,13 +224,15 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
|
||||
>
|
||||
<CurrencyInput />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("jobs.fields.ca_gst_registrant")}
|
||||
name="ca_gst_registrant"
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
{bodyshop.region_config.toLowerCase().startsWith("ca") && (
|
||||
<Form.Item
|
||||
label={t("jobs.fields.ca_gst_registrant")}
|
||||
name="ca_gst_registrant"
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
)}
|
||||
<Form.Item
|
||||
label={t("jobs.fields.other_amount_payable")}
|
||||
name="other_amount_payable"
|
||||
|
||||
@@ -40,24 +40,26 @@ export function JobsDetailRates({ jobRO, form, job, bodyshop }) {
|
||||
>
|
||||
<CurrencyInput disabled={jobRO} min={0} />
|
||||
</Form.Item>
|
||||
<Tooltip title={t("jobs.labels.ca_gst_all_if_null")}>
|
||||
<Form.Item
|
||||
label={t("jobs.fields.ca_customer_gst")}
|
||||
name="ca_customer_gst"
|
||||
>
|
||||
<CurrencyInput
|
||||
disabled={jobRO}
|
||||
min={0}
|
||||
max={
|
||||
Math.round(
|
||||
(job.job_totals &&
|
||||
job.job_totals.totals.federal_tax.amount) ||
|
||||
0
|
||||
) / 100
|
||||
}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Tooltip>
|
||||
{bodyshop.region_config.toLowerCase().startsWith("ca") && (
|
||||
<Tooltip title={t("jobs.labels.ca_gst_all_if_null")}>
|
||||
<Form.Item
|
||||
label={t("jobs.fields.ca_customer_gst")}
|
||||
name="ca_customer_gst"
|
||||
>
|
||||
<CurrencyInput
|
||||
disabled={jobRO}
|
||||
min={0}
|
||||
max={
|
||||
Math.round(
|
||||
(job.job_totals &&
|
||||
job.job_totals.totals.federal_tax.amount) ||
|
||||
0
|
||||
) / 100
|
||||
}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Tooltip>
|
||||
)}
|
||||
<Form.Item
|
||||
label={t("jobs.fields.other_amount_payable")}
|
||||
name="other_amount_payable"
|
||||
@@ -82,12 +84,14 @@ export function JobsDetailRates({ jobRO, form, job, bodyshop }) {
|
||||
>
|
||||
<CurrencyInput disabled={jobRO || bodyshop.cdk_dealerid} />
|
||||
</Form.Item>
|
||||
<Space align="center">
|
||||
<Form.Item label={t("jobs.fields.ca_bc_pvrt")} name="ca_bc_pvrt">
|
||||
<CurrencyInput disabled={jobRO} min={0} />
|
||||
</Form.Item>
|
||||
<CABCpvrtCalculator form={form} disabled={jobRO} />
|
||||
</Space>
|
||||
{bodyshop.region_config === "CA_BC" && (
|
||||
<Space align="center">
|
||||
<Form.Item label={t("jobs.fields.ca_bc_pvrt")} name="ca_bc_pvrt">
|
||||
<CurrencyInput disabled={jobRO} min={0} />
|
||||
</Form.Item>
|
||||
<CABCpvrtCalculator form={form} disabled={jobRO} />
|
||||
</Space>
|
||||
)}
|
||||
<Form.Item
|
||||
label={t("jobs.fields.auto_add_ats")}
|
||||
name="auto_add_ats"
|
||||
@@ -141,13 +145,15 @@ export function JobsDetailRates({ jobRO, form, job, bodyshop }) {
|
||||
>
|
||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("jobs.fields.ca_gst_registrant")}
|
||||
name="ca_gst_registrant"
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch disabled={jobRO} />
|
||||
</Form.Item>
|
||||
{bodyshop.region_config.toLowerCase().startsWith("ca") && (
|
||||
<Form.Item
|
||||
label={t("jobs.fields.ca_gst_registrant")}
|
||||
name="ca_gst_registrant"
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch disabled={jobRO} />
|
||||
</Form.Item>
|
||||
)}
|
||||
</FormRow>
|
||||
<Divider
|
||||
orientation="left"
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { SyncOutlined } from "@ant-design/icons";
|
||||
import { Button, Card, Input, Space, Table, Typography } from "antd";
|
||||
import axios from "axios";
|
||||
import _ from "lodash";
|
||||
import queryString from "query-string";
|
||||
import React from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { Link, useHistory, useLocation } from "react-router-dom";
|
||||
@@ -21,6 +22,8 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
|
||||
export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
||||
const search = queryString.parse(useLocation().search);
|
||||
const [openSearchResults, setOpenSearchResults] = useState([]);
|
||||
const [searchLoading, setSearchLoading] = useState(false);
|
||||
const { page, sortcolumn, sortorder } = search;
|
||||
const history = useHistory();
|
||||
|
||||
@@ -193,6 +196,28 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
||||
history.push({ search: queryString.stringify(search) });
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (search.search && search.search.trim() !== "") {
|
||||
searchJobs();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
async function searchJobs(value) {
|
||||
try {
|
||||
setSearchLoading(true);
|
||||
const searchData = await axios.post("/search", {
|
||||
search: value || search.search,
|
||||
index: "jobs",
|
||||
});
|
||||
setOpenSearchResults(searchData.data.hits.hits.map((s) => s._source));
|
||||
} catch (error) {
|
||||
console.log("Error while fetching search results", error);
|
||||
} finally {
|
||||
setSearchLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Card
|
||||
extra={
|
||||
@@ -205,6 +230,7 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
||||
<Button
|
||||
onClick={() => {
|
||||
delete search.search;
|
||||
delete search.page;
|
||||
history.push({ search: queryString.stringify(search) });
|
||||
}}
|
||||
>
|
||||
@@ -220,24 +246,32 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
||||
onSearch={(value) => {
|
||||
search.search = value;
|
||||
history.push({ search: queryString.stringify(search) });
|
||||
searchJobs(value);
|
||||
}}
|
||||
loading={loading || searchLoading}
|
||||
enterButton
|
||||
/>
|
||||
</Space>
|
||||
}
|
||||
>
|
||||
<Table
|
||||
loading={loading}
|
||||
pagination={{
|
||||
position: "top",
|
||||
pageSize: 25,
|
||||
current: parseInt(page || 1),
|
||||
total: total,
|
||||
showSizeChanger: false,
|
||||
}}
|
||||
loading={loading || searchLoading}
|
||||
pagination={
|
||||
search?.search
|
||||
? {
|
||||
pageSize: 25,
|
||||
showSizeChanger: false,
|
||||
}
|
||||
: {
|
||||
pageSize: 25,
|
||||
current: parseInt(page || 1),
|
||||
total: total,
|
||||
showSizeChanger: false,
|
||||
}
|
||||
}
|
||||
columns={columns}
|
||||
rowKey="id"
|
||||
dataSource={jobs}
|
||||
dataSource={search?.search ? openSearchResults : jobs}
|
||||
onChange={handleTableChange}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
@@ -75,6 +75,27 @@ export function JobNotesComponent({
|
||||
</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: t("notes.fields.type"),
|
||||
dataIndex: "type",
|
||||
key: "type",
|
||||
width: 120,
|
||||
filteredValue: filter?.type || null,
|
||||
filters: [
|
||||
{ value: "general", text: t("notes.fields.types.general") },
|
||||
{ value: "customer", text: t("notes.fields.types.customer") },
|
||||
{ value: "shop", text: t("notes.fields.types.shop") },
|
||||
{ value: "office", text: t("notes.fields.types.office") },
|
||||
{ value: "parts", text: t("notes.fields.types.parts") },
|
||||
{ value: "paint", text: t("notes.fields.types.paint") },
|
||||
{
|
||||
value: "supplement",
|
||||
text: t("notes.fields.types.supplement"),
|
||||
},
|
||||
],
|
||||
onFilter: (value, record) => value.includes(record.type),
|
||||
render: (text, record) => t(`notes.fields.types.${record.type}`),
|
||||
},
|
||||
{
|
||||
title: t("notes.fields.text"),
|
||||
dataIndex: "text",
|
||||
@@ -106,7 +127,7 @@ export function JobNotesComponent({
|
||||
title: t("notes.actions.actions"),
|
||||
dataIndex: "actions",
|
||||
key: "actions",
|
||||
width: 150,
|
||||
width: 200,
|
||||
render: (text, record) => (
|
||||
<Space wrap>
|
||||
<Button
|
||||
|
||||
@@ -207,7 +207,7 @@ export function LaborAllocationsTable({
|
||||
<Card title={t("jobs.labels.laborallocations")}>
|
||||
<Table
|
||||
columns={columns}
|
||||
rowKey="cost_center"
|
||||
rowKey={(record) => `${record.cost_center} ${record.mod_lbr_ty}`}
|
||||
pagination={false}
|
||||
onChange={handleTableChange}
|
||||
dataSource={totals}
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
import { Checkbox, Col, Form, Input, Row, Space, Switch, Tag } from "antd";
|
||||
import {
|
||||
Checkbox,
|
||||
Col,
|
||||
Form,
|
||||
Input,
|
||||
Row,
|
||||
Select,
|
||||
Space,
|
||||
Switch,
|
||||
Tag,
|
||||
} from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
@@ -46,6 +56,28 @@ export function NoteUpsertModalComponent({ form, noteUpsertModal }) {
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label={t("notes.fields.type")}
|
||||
name="type"
|
||||
initialValue="general"
|
||||
>
|
||||
<Select
|
||||
options={[
|
||||
{ value: "general", label: t("notes.fields.types.general") },
|
||||
{ value: "customer", label: t("notes.fields.types.customer") },
|
||||
{ value: "shop", label: t("notes.fields.types.shop") },
|
||||
{ value: "office", label: t("notes.fields.types.office") },
|
||||
{ value: "parts", label: t("notes.fields.types.parts") },
|
||||
{ value: "paint", label: t("notes.fields.types.paint") },
|
||||
{
|
||||
value: "supplement",
|
||||
label: t("notes.fields.types.supplement"),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<NotesPresetButton form={form} />
|
||||
</Col>
|
||||
|
||||
@@ -52,7 +52,7 @@ function PaymentModalContainer({
|
||||
const { useStripe, sendby, ...paymentObj } = values;
|
||||
|
||||
setLoading(true);
|
||||
|
||||
let updatedPayment; //Moved up from if statement for greater scope.
|
||||
try {
|
||||
if (!context || (context && !context.id)) {
|
||||
const newPayment = await insertPayment({
|
||||
@@ -87,7 +87,7 @@ function PaymentModalContainer({
|
||||
);
|
||||
}
|
||||
} else {
|
||||
const updatedPayment = await updatePayment({
|
||||
updatedPayment = await updatePayment({
|
||||
variables: {
|
||||
paymentId: context.id,
|
||||
payment: paymentObj,
|
||||
@@ -101,7 +101,11 @@ function PaymentModalContainer({
|
||||
}
|
||||
}
|
||||
|
||||
if (actions.refetch) actions.refetch();
|
||||
if (actions.refetch)
|
||||
actions.refetch(
|
||||
updatedPayment && updatedPayment.data.update_payments.returning[0]
|
||||
);
|
||||
|
||||
if (enterAgain) {
|
||||
const prev = form.getFieldsValue(["date"]);
|
||||
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
import { EditFilled, SyncOutlined } from "@ant-design/icons";
|
||||
import { useApolloClient } from "@apollo/client";
|
||||
import { Button, Card, Input, Space, Table, Typography } from "antd";
|
||||
import axios from "axios";
|
||||
import queryString from "query-string";
|
||||
import React, { useState } from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { Link, useHistory, useLocation } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { QUERY_PAYMENT_BY_ID } from "../../graphql/payments.queries";
|
||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||
import { DateFormatter, DateTimeFormatter } from "../../utils/DateFormatter";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
import { TemplateList } from "../../utils/TemplateConstants";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
import CaBcEtfTableModalContainer from "../ca-bc-etf-table-modal/ca-bc-etf-table-modal.container";
|
||||
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
|
||||
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
@@ -39,7 +42,10 @@ export function PaymentsListPaginated({
|
||||
bodyshop,
|
||||
}) {
|
||||
const search = queryString.parse(useLocation().search);
|
||||
const [openSearchResults, setOpenSearchResults] = useState([]);
|
||||
const [searchLoading, setSearchLoading] = useState(false);
|
||||
const { page, sortcolumn, sortorder } = search;
|
||||
const client = useApolloClient();
|
||||
const history = useHistory();
|
||||
const [state, setState] = useState({
|
||||
sortedInfo: {},
|
||||
@@ -52,13 +58,17 @@ export function PaymentsListPaginated({
|
||||
title: t("jobs.fields.ro_number"),
|
||||
dataIndex: "ro_number",
|
||||
key: "ro_number",
|
||||
sorter: (a, b) => alphaSort(a.job.ro_number, b.job.ro_number),
|
||||
sortOrder: sortcolumn === "ro_number" && sortorder,
|
||||
render: (text, record) => (
|
||||
<Link to={"/manage/jobs/" + record.job.id}>
|
||||
{record.job.ro_number || t("general.labels.na")}
|
||||
</Link>
|
||||
),
|
||||
// sorter: (a, b) => alphaSort(a.job.ro_number, b.job.ro_number),
|
||||
// sortOrder: sortcolumn === "ro_number" && sortorder,
|
||||
render: (text, record) => {
|
||||
return record.job ? (
|
||||
<Link to={"/manage/jobs/" + record.job.id}>
|
||||
{record.job.ro_number || t("general.labels.na")}
|
||||
</Link>
|
||||
) : (
|
||||
<span>{t("general.labels.na")}</span>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: t("payments.fields.paymentnum"),
|
||||
@@ -72,16 +82,16 @@ export function PaymentsListPaginated({
|
||||
dataIndex: "owner",
|
||||
key: "owner",
|
||||
ellipsis: true,
|
||||
sorter: (a, b) => alphaSort(a.job.ownr_ln, b.job.ownr_ln),
|
||||
sortOrder: sortcolumn === "owner" && sortorder,
|
||||
// sorter: (a, b) => alphaSort(a.job.ownr_ln, b.job.ownr_ln),
|
||||
// sortOrder: sortcolumn === "owner" && sortorder,
|
||||
render: (text, record) => {
|
||||
return record.job.owner ? (
|
||||
<Link to={"/manage/owners/" + record.job.owner.id}>
|
||||
<OwnerNameDisplay ownerObject={record} />
|
||||
return record.job?.owner ? (
|
||||
<Link to={"/manage/owners/" + record.job?.owner?.id}>
|
||||
<OwnerNameDisplay ownerObject={record.job} />
|
||||
</Link>
|
||||
) : (
|
||||
<span>
|
||||
<OwnerNameDisplay ownerObject={record} />
|
||||
<OwnerNameDisplay ownerObject={record.job} />
|
||||
</span>
|
||||
);
|
||||
},
|
||||
@@ -147,10 +157,33 @@ export function PaymentsListPaginated({
|
||||
<Space>
|
||||
<Button
|
||||
disabled={record.exportedat}
|
||||
onClick={() => {
|
||||
onClick={async () => {
|
||||
let apolloResults;
|
||||
if (search.search) {
|
||||
const { data } = await client.query({
|
||||
query: QUERY_PAYMENT_BY_ID,
|
||||
variables: {
|
||||
paymentId: record.id,
|
||||
},
|
||||
});
|
||||
apolloResults = data.payments_by_pk;
|
||||
}
|
||||
setPaymentContext({
|
||||
actions: { refetch: refetch },
|
||||
context: record,
|
||||
actions: {
|
||||
refetch: apolloResults
|
||||
? (updatedRecord) => {
|
||||
setOpenSearchResults((results) =>
|
||||
results.map((result) => {
|
||||
if (result.id !== record.id) {
|
||||
return result;
|
||||
}
|
||||
return updatedRecord;
|
||||
})
|
||||
);
|
||||
}
|
||||
: refetch,
|
||||
},
|
||||
context: apolloResults ? apolloResults : record,
|
||||
});
|
||||
}}
|
||||
>
|
||||
@@ -177,6 +210,28 @@ export function PaymentsListPaginated({
|
||||
history.push({ search: queryString.stringify(search) });
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (search.search && search.search.trim() !== "") {
|
||||
searchPayments();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
async function searchPayments(value) {
|
||||
try {
|
||||
setSearchLoading(true);
|
||||
const searchData = await axios.post("/search", {
|
||||
search: value || search.search,
|
||||
index: "payments",
|
||||
});
|
||||
setOpenSearchResults(searchData.data.hits.hits.map((s) => s._source));
|
||||
} catch (error) {
|
||||
console.log("Error while fetching search results", error);
|
||||
} finally {
|
||||
setSearchLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Card
|
||||
extra={
|
||||
@@ -189,6 +244,7 @@ export function PaymentsListPaginated({
|
||||
<Button
|
||||
onClick={() => {
|
||||
delete search.search;
|
||||
delete search.page;
|
||||
history.push({ search: queryString.stringify(search) });
|
||||
}}
|
||||
>
|
||||
@@ -212,24 +268,33 @@ export function PaymentsListPaginated({
|
||||
onSearch={(value) => {
|
||||
search.search = value;
|
||||
history.push({ search: queryString.stringify(search) });
|
||||
searchPayments(value);
|
||||
}}
|
||||
loading={loading || searchLoading}
|
||||
enterButton
|
||||
/>
|
||||
</Space>
|
||||
}
|
||||
>
|
||||
<Table
|
||||
loading={loading}
|
||||
loading={loading || searchLoading}
|
||||
scroll={{ x: true }}
|
||||
pagination={{
|
||||
position: "top",
|
||||
pageSize: 25,
|
||||
current: parseInt(page || 1),
|
||||
total: total,
|
||||
}}
|
||||
pagination={
|
||||
search?.search
|
||||
? {
|
||||
pageSize: 25,
|
||||
showSizeChanger: false,
|
||||
}
|
||||
: {
|
||||
pageSize: 25,
|
||||
current: parseInt(page || 1),
|
||||
total: total,
|
||||
showSizeChanger: false,
|
||||
}
|
||||
}
|
||||
columns={columns}
|
||||
rowKey="id"
|
||||
dataSource={payments}
|
||||
dataSource={search?.search ? openSearchResults : payments}
|
||||
onChange={handleTableChange}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
@@ -29,7 +29,10 @@ export function PrintCenterJobsComponent({ printCenterModal, bodyshop }) {
|
||||
})
|
||||
.filter(
|
||||
(temp) =>
|
||||
!temp.regions || (temp.regions && temp.regions[bodyshop.region_config])
|
||||
!temp.regions ||
|
||||
(temp.regions && temp.regions[bodyshop.region_config]) ||
|
||||
(temp.regions &&
|
||||
bodyshop.region_config.includes(Object.keys(temp.regions)) === true)
|
||||
);
|
||||
|
||||
const filteredJobsReportsList =
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
import { Col, List, Space, Typography } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const CardColorLegend = ({ bodyshop }) => {
|
||||
const { t } = useTranslation();
|
||||
const data = bodyshop.ssbuckets.map((bucket) => {
|
||||
let color = { r: 255, g: 255, b: 255 };
|
||||
|
||||
if (bucket.color) {
|
||||
color = bucket.color;
|
||||
|
||||
if (bucket.color.rgb) {
|
||||
color = bucket.color.rgb;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
label: bucket.label,
|
||||
color,
|
||||
};
|
||||
});
|
||||
|
||||
return (
|
||||
<Col>
|
||||
<Typography>{t("production.labels.legend")}</Typography>
|
||||
<List
|
||||
grid={{
|
||||
gutter: 16,
|
||||
}}
|
||||
dataSource={data}
|
||||
renderItem={(item) => (
|
||||
<List.Item>
|
||||
<Space>
|
||||
<div
|
||||
style={{
|
||||
width: "1.5rem",
|
||||
aspectRatio: "1/1",
|
||||
backgroundColor: `rgba(${item.color.r},${item.color.g},${item.color.b},${item.color.a})`,
|
||||
}}
|
||||
></div>
|
||||
<div>{item.label}</div>
|
||||
</Space>
|
||||
</List.Item>
|
||||
)}
|
||||
/>
|
||||
</Col>
|
||||
);
|
||||
};
|
||||
|
||||
export default CardColorLegend;
|
||||
@@ -18,6 +18,31 @@ import moment from "moment";
|
||||
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||
import JobPartsQueueCount from "../job-parts-queue-count/job-parts-queue-count.component";
|
||||
|
||||
const cardColor = (ssbuckets, totalHrs) => {
|
||||
const bucket = ssbuckets.filter(
|
||||
(bucket) =>
|
||||
bucket.gte <= totalHrs && (!!bucket.lt ? bucket.lt > totalHrs : true)
|
||||
)[0];
|
||||
|
||||
let color = { r: 255, g: 255, b: 255 };
|
||||
|
||||
if (bucket && bucket.color) {
|
||||
color = bucket.color;
|
||||
|
||||
if (bucket.color.rgb) {
|
||||
color = bucket.color.rgb;
|
||||
}
|
||||
}
|
||||
|
||||
return color;
|
||||
};
|
||||
|
||||
function getContrastYIQ(bgColor) {
|
||||
const yiq = (bgColor.r * 299 + bgColor.g * 587 + bgColor.b * 114) / 1000;
|
||||
|
||||
return yiq >= 128 ? "black" : "white";
|
||||
}
|
||||
|
||||
export default function ProductionBoardCard(
|
||||
technician,
|
||||
card,
|
||||
@@ -54,10 +79,22 @@ export default function ProductionBoardCard(
|
||||
.isSame(moment(card.scheduled_completion), "day") &&
|
||||
"production-completion-soon"));
|
||||
|
||||
const totalHrs =
|
||||
card.labhrs.aggregate.sum.mod_lb_hrs + card.larhrs.aggregate.sum.mod_lb_hrs;
|
||||
const bgColor = cardColor(bodyshop.ssbuckets, totalHrs);
|
||||
|
||||
return (
|
||||
<Card
|
||||
className="react-kanban-card imex-kanban-card"
|
||||
size="small"
|
||||
style={{
|
||||
backgroundColor:
|
||||
cardSettings &&
|
||||
cardSettings.cardcolor &&
|
||||
`rgba(${bgColor.r},${bgColor.g},${bgColor.b},${bgColor.a})`,
|
||||
color:
|
||||
cardSettings && cardSettings.cardcolor && getContrastYIQ(bgColor),
|
||||
}}
|
||||
title={
|
||||
<Space>
|
||||
<ProductionAlert record={card} key="alert" />
|
||||
|
||||
@@ -104,6 +104,13 @@ export default function ProductionBoardKanbanCardSettings({
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
valuePropName="checked"
|
||||
label={t("production.labels.cardcolor")}
|
||||
name="cardcolor"
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
@@ -166,7 +173,7 @@ export default function ProductionBoardKanbanCardSettings({
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<Popover content={overlay} visible={visible}>
|
||||
<Popover content={overlay} visible={visible} placement="topRight">
|
||||
<Button loading={loading} onClick={() => setVisible(true)}>
|
||||
{t("production.labels.cardsettings")}
|
||||
</Button>
|
||||
|
||||
@@ -22,6 +22,7 @@ import ProductionBoardKanbanCardSettings from "./production-board-kanban.card-se
|
||||
//import "@asseinfo/react-kanban/dist/styles.css";
|
||||
import "./production-board-kanban.styles.scss";
|
||||
import { createBoardData } from "./production-board-kanban.utils.js";
|
||||
import CardColorLegend from "../production-board-kanban-card/production-board-kanban-card-color-legend.component";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
technician: selectTechnician,
|
||||
@@ -221,6 +222,7 @@ export function ProductionBoardKanbanComponent({
|
||||
employeeassignments: true,
|
||||
scheduled_completion: true,
|
||||
stickyheader: false,
|
||||
cardcolor: false,
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -256,6 +258,11 @@ export function ProductionBoardKanbanComponent({
|
||||
</Space>
|
||||
}
|
||||
/>
|
||||
|
||||
{cardSettings.cardcolor && (
|
||||
<CardColorLegend cardSettings={cardSettings} bodyshop={bodyshop} />
|
||||
)}
|
||||
|
||||
<ProductionListDetailComponent jobs={data} />
|
||||
<StickyContainer>
|
||||
<Board
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Dinero from "dinero.js";
|
||||
import { Card } from "antd";
|
||||
import Dinero from "dinero.js";
|
||||
import _ from "lodash";
|
||||
import moment from "moment";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
@@ -18,7 +19,6 @@ import {
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import * as Utils from "../scoreboard-targets-table/scoreboard-targets-table.util";
|
||||
import _ from "lodash";
|
||||
import CustomTooltip from "./chart-custom-tooltip";
|
||||
|
||||
const graphProps = {
|
||||
@@ -71,7 +71,9 @@ export function ScoreboardChart({ sbEntriesByDate, bodyshop }) {
|
||||
bodyshop.scoreboard_target.dailyBodyTarget +
|
||||
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||
val
|
||||
),
|
||||
) +
|
||||
bodyshop.scoreboard_target.dailyBodyTarget +
|
||||
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||
1
|
||||
),
|
||||
accHrs: _.round(
|
||||
|
||||
@@ -396,7 +396,7 @@ export function ShopInfoROStatusComponent({ bodyshop, form }) {
|
||||
);
|
||||
}
|
||||
|
||||
const ColorPicker = ({ value, onChange, style, ...restProps }) => {
|
||||
export const ColorPicker = ({ value, onChange, style, ...restProps }) => {
|
||||
const handleChange = (color) => {
|
||||
if (onChange) onChange(color.rgb);
|
||||
};
|
||||
|
||||
@@ -15,6 +15,7 @@ import { useTranslation } from "react-i18next";
|
||||
import ColorpickerFormItemComponent from "../form-items-formatted/colorpicker-form-item.component";
|
||||
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
|
||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||
import { ColorPicker } from "./shop-info.rostatus.component";
|
||||
|
||||
export default function ShopInfoSchedulingComponent({ form }) {
|
||||
const { t } = useTranslation();
|
||||
@@ -277,17 +278,50 @@ export default function ShopInfoSchedulingComponent({ form }) {
|
||||
>
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
<Space wrap>
|
||||
<DeleteFilled
|
||||
onClick={() => {
|
||||
remove(field.name);
|
||||
}}
|
||||
/>
|
||||
<FormListMoveArrows
|
||||
move={move}
|
||||
index={index}
|
||||
total={fields.length}
|
||||
/>
|
||||
|
||||
<Space direction="horizontal">
|
||||
<Form.Item
|
||||
label={
|
||||
<Space>
|
||||
{t("bodyshop.fields.ssbuckets.color")}
|
||||
<Button
|
||||
size="small"
|
||||
onClick={() => {
|
||||
form.setFieldValue([
|
||||
"ssbuckets",
|
||||
field.name,
|
||||
"color",
|
||||
]);
|
||||
|
||||
form.setFields([
|
||||
{
|
||||
name: ["ssbuckets", field.name, "color"],
|
||||
touched: true,
|
||||
},
|
||||
]);
|
||||
}}
|
||||
>
|
||||
Reset
|
||||
</Button>
|
||||
</Space>
|
||||
}
|
||||
key={`${index}color`}
|
||||
name={[field.name, "color"]}
|
||||
>
|
||||
<ColorPicker />
|
||||
</Form.Item>
|
||||
<Space wrap>
|
||||
<DeleteFilled
|
||||
onClick={() => {
|
||||
remove(field.name);
|
||||
}}
|
||||
/>
|
||||
<FormListMoveArrows
|
||||
move={move}
|
||||
index={index}
|
||||
total={fields.length}
|
||||
/>
|
||||
</Space>
|
||||
</Space>
|
||||
</LayoutFormRow>
|
||||
</Form.Item>
|
||||
|
||||
@@ -20,13 +20,11 @@ export const DELETE_BILL = gql`
|
||||
|
||||
export const QUERY_ALL_BILLS_PAGINATED = gql`
|
||||
query QUERY_ALL_BILLS_PAGINATED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [bills_order_by!]!
|
||||
) {
|
||||
search_bills(
|
||||
args: { search: $search }
|
||||
bills(
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
@@ -51,7 +49,7 @@ export const QUERY_ALL_BILLS_PAGINATED = gql`
|
||||
ro_number
|
||||
}
|
||||
}
|
||||
search_bills_aggregate(args: { search: $search }) {
|
||||
bills_aggregate {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
|
||||
@@ -1781,14 +1781,12 @@ export const QUERY_ALL_JOB_FIELDS = gql`
|
||||
|
||||
export const QUERY_ALL_JOBS_PAGINATED_STATUS_FILTERED = gql`
|
||||
query QUERY_ALL_JOBS_PAGINATED_STATUS_FILTERED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [jobs_order_by!]
|
||||
$statusList: [String!]
|
||||
) {
|
||||
search_jobs(
|
||||
args: { search: $search }
|
||||
jobs(
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
@@ -1819,10 +1817,7 @@ export const QUERY_ALL_JOBS_PAGINATED_STATUS_FILTERED = gql`
|
||||
updated_at
|
||||
ded_amt
|
||||
}
|
||||
search_jobs_aggregate(
|
||||
args: { search: $search }
|
||||
where: { status: { _in: $statusList } }
|
||||
) {
|
||||
jobs_aggregate(where: { status: { _in: $statusList } }) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ export const INSERT_NEW_NOTE = gql`
|
||||
text
|
||||
updated_at
|
||||
audit
|
||||
type
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,6 +42,7 @@ export const QUERY_NOTES_BY_JOB_PK = gql`
|
||||
text
|
||||
updated_at
|
||||
audit
|
||||
type
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,6 +62,7 @@ export const UPDATE_NOTE = gql`
|
||||
text
|
||||
updated_at
|
||||
audit
|
||||
type
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,39 +12,39 @@ export const INSERT_NEW_PAYMENT = gql`
|
||||
|
||||
export const QUERY_ALL_PAYMENTS_PAGINATED = gql`
|
||||
query QUERY_ALL_PAYMENTS_PAGINATED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [payments_order_by!]!
|
||||
) {
|
||||
search_payments(
|
||||
args: { search: $search }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
) {
|
||||
payments(offset: $offset, limit: $limit, order_by: $order) {
|
||||
id
|
||||
amount
|
||||
created_at
|
||||
jobid
|
||||
paymentnum
|
||||
date
|
||||
exportedat
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
ownerid
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
owner {
|
||||
id
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
}
|
||||
ro_number
|
||||
}
|
||||
transactionid
|
||||
memo
|
||||
type
|
||||
amount
|
||||
stripeid
|
||||
exportedat
|
||||
stripeid
|
||||
payer
|
||||
paymentnum
|
||||
stripeid
|
||||
transactionid
|
||||
type
|
||||
}
|
||||
search_payments_aggregate(args: { search: $search }) {
|
||||
payments_aggregate {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
@@ -57,16 +57,31 @@ export const UPDATE_PAYMENT = gql`
|
||||
update_payments(where: { id: { _eq: $paymentId } }, _set: $payment) {
|
||||
returning {
|
||||
id
|
||||
transactionid
|
||||
memo
|
||||
type
|
||||
amount
|
||||
stripeid
|
||||
created_at
|
||||
date
|
||||
exportedat
|
||||
stripeid
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ownerid
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
owner {
|
||||
id
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
}
|
||||
ro_number
|
||||
}
|
||||
memo
|
||||
payer
|
||||
paymentnum
|
||||
date
|
||||
stripeid
|
||||
transactionid
|
||||
type
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,17 +95,31 @@ export const UPDATE_PAYMENTS = gql`
|
||||
update_payments(where: { id: { _in: $paymentIdList } }, _set: $payment) {
|
||||
returning {
|
||||
id
|
||||
exportedat
|
||||
transactionid
|
||||
memo
|
||||
type
|
||||
amount
|
||||
stripeid
|
||||
created_at
|
||||
date
|
||||
exportedat
|
||||
stripeid
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ownerid
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
owner {
|
||||
id
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
}
|
||||
ro_number
|
||||
}
|
||||
memo
|
||||
payer
|
||||
paymentnum
|
||||
date
|
||||
stripeid
|
||||
transactionid
|
||||
type
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,3 +138,36 @@ export const QUERY_JOB_PAYMENT_TOTALS = gql`
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_PAYMENT_BY_ID = gql`
|
||||
query QUERY_PAYMENT_BY_ID($paymentId: uuid!) {
|
||||
payments_by_pk(id: $paymentId) {
|
||||
id
|
||||
amount
|
||||
created_at
|
||||
exportedat
|
||||
date
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ownerid
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
owner {
|
||||
id
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
}
|
||||
ro_number
|
||||
}
|
||||
memo
|
||||
payer
|
||||
paymentnum
|
||||
stripeid
|
||||
transactionid
|
||||
type
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { SyncOutlined, EditFilled } from "@ant-design/icons";
|
||||
import { EditFilled, SyncOutlined } from "@ant-design/icons";
|
||||
import { Button, Card, Checkbox, Input, Space, Table, Typography } from "antd";
|
||||
import axios from "axios";
|
||||
import queryString from "query-string";
|
||||
import React, { useState } from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { Link, useHistory, useLocation } from "react-router-dom";
|
||||
@@ -11,8 +12,8 @@ import PrintWrapperComponent from "../../components/print-wrapper/print-wrapper.
|
||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||
import { DateFormatter } from "../../utils/DateFormatter";
|
||||
import { alphaSort, dateSort } from "../../utils/sorters";
|
||||
import { TemplateList } from "../../utils/TemplateConstants";
|
||||
import { alphaSort, dateSort } from "../../utils/sorters";
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setPartsOrderContext: (context) =>
|
||||
@@ -29,34 +30,36 @@ export function BillsListPage({
|
||||
setPartsOrderContext,
|
||||
setBillEnterContext,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const search = queryString.parse(useLocation().search);
|
||||
const [openSearchResults, setOpenSearchResults] = useState([]);
|
||||
const [searchLoading, setSearchLoading] = useState(false);
|
||||
const { page } = search;
|
||||
const history = useHistory();
|
||||
const [state, setState] = useState({
|
||||
sortedInfo: {},
|
||||
filteredInfo: { text: "" },
|
||||
});
|
||||
const history = useHistory();
|
||||
const search = queryString.parse(useLocation().search);
|
||||
const { page } = search;
|
||||
const Templates = TemplateList("bill");
|
||||
|
||||
const { t } = useTranslation();
|
||||
const columns = [
|
||||
{
|
||||
title: t("bills.fields.vendorname"),
|
||||
dataIndex: "vendorname",
|
||||
key: "vendorname",
|
||||
sortObject: (direction) => {
|
||||
return {
|
||||
vendor: {
|
||||
name: direction
|
||||
? direction === "descend"
|
||||
? "desc"
|
||||
: "asc"
|
||||
: "desc",
|
||||
},
|
||||
};
|
||||
},
|
||||
sorter: (a, b) => alphaSort(a.vendor.name, b.vendor.name),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "vendorname" && state.sortedInfo.order,
|
||||
// sortObject: (direction) => {
|
||||
// return {
|
||||
// vendor: {
|
||||
// name: direction
|
||||
// ? direction === "descend"
|
||||
// ? "desc"
|
||||
// : "asc"
|
||||
// : "desc",
|
||||
// },
|
||||
// };
|
||||
// },
|
||||
// sorter: (a, b) => alphaSort(a.vendor.name, b.vendor.name),
|
||||
// sortOrder:
|
||||
// state.sortedInfo.columnKey === "vendorname" && state.sortedInfo.order,
|
||||
render: (text, record) => <span>{record.vendor.name}</span>,
|
||||
},
|
||||
{
|
||||
@@ -72,20 +75,20 @@ export function BillsListPage({
|
||||
title: t("jobs.fields.ro_number"),
|
||||
dataIndex: "ro_number",
|
||||
key: "ro_number",
|
||||
sortObject: (direction) => {
|
||||
return {
|
||||
job: {
|
||||
ro_number: direction
|
||||
? direction === "descend"
|
||||
? "desc"
|
||||
: "asc"
|
||||
: "desc",
|
||||
},
|
||||
};
|
||||
},
|
||||
sorter: (a, b) => alphaSort(a.job.ro_number, b.job.ro_number),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order,
|
||||
// sortObject: (direction) => {
|
||||
// return {
|
||||
// job: {
|
||||
// ro_number: direction
|
||||
// ? direction === "descend"
|
||||
// ? "desc"
|
||||
// : "asc"
|
||||
// : "desc",
|
||||
// },
|
||||
// };
|
||||
// },
|
||||
// sorter: (a, b) => alphaSort(a.job.ro_number, b.job.ro_number),
|
||||
// sortOrder:
|
||||
// state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order,
|
||||
render: (text, record) =>
|
||||
record.job && (
|
||||
<Link to={`/manage/jobs/${record.job.id}`}>
|
||||
@@ -174,7 +177,15 @@ export function BillsListPage({
|
||||
// {t("bills.actions.return")}
|
||||
// </Button>
|
||||
}
|
||||
<BillDeleteButton bill={record} />
|
||||
<BillDeleteButton
|
||||
bill={record}
|
||||
callback={(deletedBillid) => {
|
||||
//Filter out the state and set it again.
|
||||
setOpenSearchResults((currentResults) =>
|
||||
currentResults.filter((bill) => bill.id !== deletedBillid)
|
||||
);
|
||||
}}
|
||||
/>
|
||||
{record.isinhouse && (
|
||||
<PrintWrapperComponent
|
||||
templateObject={{
|
||||
@@ -199,11 +210,32 @@ export function BillsListPage({
|
||||
search.sortcolumn = sorter.order ? sorter.columnKey : null;
|
||||
search.sortorder = sorter.order;
|
||||
}
|
||||
|
||||
search.sort = JSON.stringify({ [sorter.columnKey]: sorter.order });
|
||||
history.push({ search: queryString.stringify(search) });
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (search.search && search.search.trim() !== "") {
|
||||
searchBills();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
async function searchBills(value) {
|
||||
try {
|
||||
setSearchLoading(true);
|
||||
const searchData = await axios.post("/search", {
|
||||
search: value || search.search,
|
||||
index: "bills",
|
||||
});
|
||||
setOpenSearchResults(searchData.data.hits.hits.map((s) => s._source));
|
||||
} catch (error) {
|
||||
console.log("Error while fetching search results", error);
|
||||
} finally {
|
||||
setSearchLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={t("bills.labels.bills")}
|
||||
@@ -217,6 +249,7 @@ export function BillsListPage({
|
||||
<Button
|
||||
onClick={() => {
|
||||
delete search.search;
|
||||
delete search.page;
|
||||
history.push({ search: queryString.stringify(search) });
|
||||
}}
|
||||
>
|
||||
@@ -243,7 +276,10 @@ export function BillsListPage({
|
||||
onSearch={(value) => {
|
||||
search.search = value;
|
||||
history.push({ search: queryString.stringify(search) });
|
||||
searchBills(value);
|
||||
}}
|
||||
loading={loading || searchLoading}
|
||||
enterButton
|
||||
/>
|
||||
</Space>
|
||||
}
|
||||
@@ -251,19 +287,27 @@ export function BillsListPage({
|
||||
<PartsOrderModalContainer />
|
||||
|
||||
<Table
|
||||
loading={loading}
|
||||
scroll={{
|
||||
x: "50%", // y: "40rem"
|
||||
}}
|
||||
pagination={{
|
||||
position: "top",
|
||||
pageSize: 25,
|
||||
current: parseInt(page || 1),
|
||||
total: total,
|
||||
}}
|
||||
loading={loading || searchLoading}
|
||||
// scroll={{
|
||||
// x: "50%", // y: "40rem"
|
||||
// }}
|
||||
scroll={{ x: true }}
|
||||
pagination={
|
||||
search?.search
|
||||
? {
|
||||
pageSize: 25,
|
||||
showSizeChanger: false,
|
||||
}
|
||||
: {
|
||||
pageSize: 25,
|
||||
current: parseInt(page || 1),
|
||||
total: total,
|
||||
showSizeChanger: false,
|
||||
}
|
||||
}
|
||||
columns={columns}
|
||||
rowKey="id"
|
||||
dataSource={data}
|
||||
dataSource={search?.search ? openSearchResults : data}
|
||||
onChange={handleTableChange}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useQuery } from "@apollo/client";
|
||||
import queryString from "query-string";
|
||||
import React, { useEffect } from "react";
|
||||
import { useQuery } from "@apollo/client";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { useLocation } from "react-router-dom";
|
||||
@@ -22,7 +22,7 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
export function BillsPageContainer({ setBreadcrumbs, setSelectedHeader }) {
|
||||
const { t } = useTranslation();
|
||||
const searchParams = queryString.parse(useLocation().search);
|
||||
const { page, sortcolumn, sortorder, search, searchObj } = searchParams;
|
||||
const { page, sortcolumn, sortorder, searchObj } = searchParams;
|
||||
|
||||
useEffect(() => {
|
||||
document.title = t("titles.bills-list");
|
||||
@@ -38,7 +38,6 @@ export function BillsPageContainer({ setBreadcrumbs, setSelectedHeader }) {
|
||||
fetchPolicy: "network-only",
|
||||
nextFetchPolicy: "network-only",
|
||||
variables: {
|
||||
search: search || "",
|
||||
offset: page ? (page - 1) * 25 : 0,
|
||||
limit: 25,
|
||||
order: [
|
||||
@@ -61,10 +60,10 @@ export function BillsPageContainer({ setBreadcrumbs, setSelectedHeader }) {
|
||||
<RbacWrapper action="bills:list">
|
||||
<div>
|
||||
<BillsPageComponent
|
||||
data={data ? data.search_bills : []}
|
||||
data={data ? data.bills : []}
|
||||
loading={loading}
|
||||
refetch={refetch}
|
||||
total={data ? data.search_bills_aggregate.aggregate.count : 0}
|
||||
total={data ? data.bills_aggregate.aggregate.count : 0}
|
||||
/>
|
||||
|
||||
<BillDetailEditContainer />
|
||||
|
||||
@@ -25,7 +25,7 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
|
||||
export function AllJobs({ setBreadcrumbs, setSelectedHeader }) {
|
||||
const searchParams = queryString.parse(useLocation().search);
|
||||
const { page, sortcolumn, sortorder, search, statusFilters } = searchParams;
|
||||
const { page, sortcolumn, sortorder, statusFilters } = searchParams;
|
||||
|
||||
const { loading, error, data, refetch } = useQuery(
|
||||
QUERY_ALL_JOBS_PAGINATED_STATUS_FILTERED,
|
||||
@@ -33,7 +33,6 @@ export function AllJobs({ setBreadcrumbs, setSelectedHeader }) {
|
||||
fetchPolicy: "network-only",
|
||||
nextFetchPolicy: "network-only",
|
||||
variables: {
|
||||
search: search || "",
|
||||
offset: page ? (page - 1) * 25 : 0,
|
||||
limit: 25,
|
||||
...(statusFilters ? { statusList: JSON.parse(statusFilters) } : {}),
|
||||
@@ -67,8 +66,8 @@ export function AllJobs({ setBreadcrumbs, setSelectedHeader }) {
|
||||
refetch={refetch}
|
||||
loading={loading}
|
||||
searchParams={searchParams}
|
||||
total={data ? data.search_jobs_aggregate.aggregate.count : 0}
|
||||
jobs={data ? data.search_jobs : []}
|
||||
total={data ? data.jobs_aggregate.aggregate.count : 0}
|
||||
jobs={data ? data.jobs : []}
|
||||
/>
|
||||
</RbacWrapper>
|
||||
);
|
||||
|
||||
@@ -26,7 +26,7 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
|
||||
export function AllJobs({ bodyshop, setBreadcrumbs, setSelectedHeader }) {
|
||||
const searchParams = queryString.parse(useLocation().search);
|
||||
const { page, sortcolumn, sortorder, search } = searchParams;
|
||||
const { page, sortcolumn, sortorder, searchObj } = searchParams;
|
||||
|
||||
const { loading, error, data, refetch } = useQuery(
|
||||
QUERY_ALL_PAYMENTS_PAGINATED,
|
||||
@@ -34,11 +34,12 @@ export function AllJobs({ bodyshop, setBreadcrumbs, setSelectedHeader }) {
|
||||
fetchPolicy: "network-only",
|
||||
nextFetchPolicy: "network-only",
|
||||
variables: {
|
||||
search: search || "",
|
||||
offset: page ? (page - 1) * 25 : 0,
|
||||
limit: 25,
|
||||
order: [
|
||||
{
|
||||
searchObj
|
||||
? JSON.parse(searchObj)
|
||||
: {
|
||||
[sortcolumn || "date"]: sortorder
|
||||
? sortorder === "descend"
|
||||
? "desc"
|
||||
@@ -66,8 +67,8 @@ export function AllJobs({ bodyshop, setBreadcrumbs, setSelectedHeader }) {
|
||||
refetch={refetch}
|
||||
loading={loading}
|
||||
searchParams={searchParams}
|
||||
total={data ? data.search_payments_aggregate.aggregate.count : 0}
|
||||
payments={data ? data.search_payments : []}
|
||||
total={data ? data.payments_aggregate.aggregate.count : 0}
|
||||
payments={data ? data.payments : []}
|
||||
/>
|
||||
</RbacWrapper>
|
||||
);
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
"scheduledfor": "Scheduled appointment for: ",
|
||||
"severalerrorsfound": "Several jobs have issues which may prevent accurate smart scheduling. Click to expand.",
|
||||
"smartscheduling": "Smart Scheduling",
|
||||
"smspaymentreminder": "",
|
||||
"suggesteddates": "Suggested Dates"
|
||||
},
|
||||
"successes": {
|
||||
@@ -103,6 +104,7 @@
|
||||
"admin_jobunvoid": "ADMIN: Job has been unvoided.",
|
||||
"billposted": "Bill with invoice number {{invoice_number}} posted.",
|
||||
"billupdated": "Bill with invoice number {{invoice_number}} updated.",
|
||||
"failedpayment": "",
|
||||
"jobassignmentchange": "Employee {{name}} assigned to {{operation}}",
|
||||
"jobassignmentremoved": "Employee assignment removed for {{operation}}",
|
||||
"jobchecklist": "Checklist type \"{{type}}\" completed. In production set to {{inproduction}}. Status set to {{status}}.",
|
||||
@@ -227,6 +229,7 @@
|
||||
},
|
||||
"bodyshop": {
|
||||
"actions": {
|
||||
"add_task_preset": "",
|
||||
"addapptcolor": "Add Appointment Color",
|
||||
"addbucket": "Add Definition",
|
||||
"addpartslocation": "Add Parts Location",
|
||||
@@ -339,6 +342,12 @@
|
||||
},
|
||||
"md_payment_types": "Payment Types",
|
||||
"md_referral_sources": "Referral Sources",
|
||||
"md_tasks_presets": {
|
||||
"hourstype": "",
|
||||
"memo": "",
|
||||
"name": "",
|
||||
"percent": ""
|
||||
},
|
||||
"messaginglabel": "Messaging Preset Label",
|
||||
"messagingtext": "Messaging Preset Text",
|
||||
"noteslabel": "Note Label",
|
||||
@@ -374,6 +383,9 @@
|
||||
"export": "CSI -> Export",
|
||||
"page": "CSI -> Page"
|
||||
},
|
||||
"employee_teams": {
|
||||
"page": ""
|
||||
},
|
||||
"employees": {
|
||||
"page": "Employees -> List"
|
||||
},
|
||||
@@ -432,10 +444,15 @@
|
||||
},
|
||||
"timetickets": {
|
||||
"edit": "Time Tickets -> Edit",
|
||||
"editcommitted": "",
|
||||
"enter": "Time Tickets -> Enter",
|
||||
"list": "Time Tickets -> List",
|
||||
"shiftedit": "Time Tickets -> Shift Edit"
|
||||
},
|
||||
"ttapprovals": {
|
||||
"approve": "",
|
||||
"view": ""
|
||||
},
|
||||
"users": {
|
||||
"editaccess": "Users -> Edit access"
|
||||
}
|
||||
@@ -453,6 +470,8 @@
|
||||
"federal_tax": "Federal Tax",
|
||||
"federal_tax_itc": "Federal Tax Credit",
|
||||
"gst_override": "GST Override Account #",
|
||||
"invoiceexemptcode": "",
|
||||
"itemexemptcode": "",
|
||||
"la1": "LA1",
|
||||
"la2": "LA2",
|
||||
"la3": "LA3",
|
||||
@@ -504,6 +523,7 @@
|
||||
"dailyhrslimit": "Daily Incoming Hours Limit"
|
||||
},
|
||||
"ssbuckets": {
|
||||
"color": "Job Color",
|
||||
"gte": "Greater Than/Equal to (hrs)",
|
||||
"id": "ID",
|
||||
"label": "Label",
|
||||
@@ -574,6 +594,7 @@
|
||||
"title": "DMS"
|
||||
},
|
||||
"emaillater": "Email Later",
|
||||
"employee_teams": "",
|
||||
"employees": "Employees",
|
||||
"estimators": "Estimators",
|
||||
"filehandlers": "File Handlers",
|
||||
@@ -582,6 +603,7 @@
|
||||
"jobstatuses": "Job Statuses",
|
||||
"laborrates": "Labor Rates",
|
||||
"licensing": "Licensing",
|
||||
"md_tasks_presets": "",
|
||||
"md_to_emails": "Preset To Emails",
|
||||
"md_to_emails_emails": "Emails",
|
||||
"messagingpresets": "Messaging Presets",
|
||||
@@ -608,6 +630,7 @@
|
||||
"speedprint": "Speed Print Configuration",
|
||||
"ssbuckets": "Job Size Definitions",
|
||||
"systemsettings": "System Settings",
|
||||
"task-presets": "",
|
||||
"workingdays": "Working Days"
|
||||
},
|
||||
"successes": {
|
||||
@@ -907,6 +930,18 @@
|
||||
"sent": "Email sent successfully."
|
||||
}
|
||||
},
|
||||
"employee_teams": {
|
||||
"actions": {
|
||||
"new": "",
|
||||
"newmember": ""
|
||||
},
|
||||
"fields": {
|
||||
"active": "",
|
||||
"employeeid": "",
|
||||
"name": "",
|
||||
"percentage": ""
|
||||
}
|
||||
},
|
||||
"employees": {
|
||||
"actions": {
|
||||
"addvacation": "Add Vacation",
|
||||
@@ -1146,6 +1181,30 @@
|
||||
"updated": "Inventory line updated."
|
||||
}
|
||||
},
|
||||
"job_payments": {
|
||||
"buttons": {
|
||||
"goback": "",
|
||||
"proceedtopayment": "",
|
||||
"refundpayment": ""
|
||||
},
|
||||
"notifications": {
|
||||
"error": {
|
||||
"description": "",
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"titles": {
|
||||
"amount": "",
|
||||
"dateOfPayment": "",
|
||||
"descriptions": "",
|
||||
"payer": "",
|
||||
"payername": "",
|
||||
"paymentid": "",
|
||||
"paymenttype": "",
|
||||
"refundamount": "",
|
||||
"transactionid": ""
|
||||
}
|
||||
},
|
||||
"joblines": {
|
||||
"actions": {
|
||||
"converttolabor": "Convert amount to Labor.",
|
||||
@@ -1378,7 +1437,7 @@
|
||||
"ded_amt": "Deductible",
|
||||
"ded_note": "Deductible Note",
|
||||
"ded_status": "Deductible Status",
|
||||
"depreciation_taxes": "Depreciation/Taxes",
|
||||
"depreciation_taxes": "Betterment/Depreciation/Taxes",
|
||||
"dms": {
|
||||
"address": "Customer Address",
|
||||
"amount": "Amount",
|
||||
@@ -1578,6 +1637,7 @@
|
||||
"scheddates": "Schedule Dates"
|
||||
},
|
||||
"labels": {
|
||||
"act_price_ppc": "",
|
||||
"actual_completion_inferred": "$t(jobs.fields.actual_completion) inferred using $t(jobs.fields.scheduled_completion).",
|
||||
"actual_delivery_inferred": "$t(jobs.fields.actual_delivery) inferred using $t(jobs.fields.scheduled_delivery).",
|
||||
"actual_in_inferred": "$t(jobs.fields.actual_in) inferred using $t(jobs.fields.scheduled_in).",
|
||||
@@ -1714,6 +1774,7 @@
|
||||
"partstotal": "This is the total of all parts and sublet amounts on the vehicle (some of these may require an in-house invoice).<br/>\nItems such as shop and paint materials, labor online lines, etc. are not included in this total.",
|
||||
"totalreturns": "The total <b>retail</b> amount of returns created for this job."
|
||||
},
|
||||
"ppc": "",
|
||||
"profileadjustments": "",
|
||||
"prt_dsmk_total": "Line Item Adjustment",
|
||||
"rates": "Rates",
|
||||
@@ -1854,6 +1915,7 @@
|
||||
"customers": "Customers",
|
||||
"dashboard": "Dashboard",
|
||||
"enterbills": "Enter Bills",
|
||||
"entercardpayment": "",
|
||||
"enterpayment": "Enter Payments",
|
||||
"entertimeticket": "Enter Time Tickets",
|
||||
"export": "Export",
|
||||
@@ -1865,6 +1927,7 @@
|
||||
"newjob": "Create New Job",
|
||||
"owners": "Owners",
|
||||
"parts-queue": "Parts Queue",
|
||||
"paymentremindersms": "",
|
||||
"phonebook": "Phonebook",
|
||||
"productionboard": "Production Board - Visual",
|
||||
"productionlist": "Production Board - List",
|
||||
@@ -1890,6 +1953,7 @@
|
||||
"shop_vendors": "Vendors",
|
||||
"temporarydocs": "Temporary Documents",
|
||||
"timetickets": "Time Tickets",
|
||||
"ttapprovals": "",
|
||||
"vehicles": "Vehicles"
|
||||
},
|
||||
"jobsactions": {
|
||||
@@ -1973,6 +2037,16 @@
|
||||
"critical": "Critical",
|
||||
"private": "Private",
|
||||
"text": "Contents",
|
||||
"type": "Type",
|
||||
"types": {
|
||||
"customer": "Customer",
|
||||
"general": "General",
|
||||
"office": "Office",
|
||||
"paint": "Paint",
|
||||
"parts": "Parts",
|
||||
"shop": "Shop",
|
||||
"supplement": "Supplement"
|
||||
},
|
||||
"updatedat": "Updated At"
|
||||
},
|
||||
"labels": {
|
||||
@@ -2242,7 +2316,7 @@
|
||||
"folder_label_multiple": "Folder Label - Multi",
|
||||
"glass_express_checklist": "Glass Express Checklist",
|
||||
"guarantee": "Repair Guarantee",
|
||||
"individual_job_note": "Job Note RO # {{ro_number}}",
|
||||
"individual_job_note": "RO Job Note",
|
||||
"invoice_customer_payable": "Invoice (Customer Payable)",
|
||||
"invoice_total_payable": "Invoice (Total Payable)",
|
||||
"iou_form": "IOU Form",
|
||||
@@ -2320,6 +2394,7 @@
|
||||
},
|
||||
"subjects": {
|
||||
"jobs": {
|
||||
"individual_job_note": "Job Note RO: {{ro_number}}",
|
||||
"parts_order": "Parts Order PO: {{ro_number}} - {{name}}",
|
||||
"sublet_order": "Sublet Order PO: {{ro_number}} - {{name}}"
|
||||
}
|
||||
@@ -2363,6 +2438,7 @@
|
||||
"qbo_usa": "QBO USA"
|
||||
}
|
||||
},
|
||||
"cardcolor": "Card Colors",
|
||||
"cardsettings": "Card Settings",
|
||||
"clm_no": "Claim Number",
|
||||
"comment": "Comment",
|
||||
@@ -2373,6 +2449,7 @@
|
||||
"ins_co_nm": "Insurance Company Name",
|
||||
"jobdetail": "Job Details",
|
||||
"laborhrs": "Labor Hours",
|
||||
"legend": "Legend:",
|
||||
"note": "Production Note",
|
||||
"ownr_nm": "Owner Name",
|
||||
"paintpriority": "P/P",
|
||||
@@ -2611,6 +2688,7 @@
|
||||
},
|
||||
"timetickets": {
|
||||
"actions": {
|
||||
"claimtasks": "",
|
||||
"clockin": "Clock In",
|
||||
"clockout": "Clock Out",
|
||||
"enter": "Enter New Time Ticket",
|
||||
@@ -2631,10 +2709,12 @@
|
||||
"clockhours": "Clock Hours",
|
||||
"clockoff": "Clock Off",
|
||||
"clockon": "Clocked In",
|
||||
"committed": "",
|
||||
"cost_center": "Cost Center",
|
||||
"date": "Ticket Date",
|
||||
"efficiency": "Efficiency",
|
||||
"employee": "Employee",
|
||||
"employee_team": "",
|
||||
"flat_rate": "Flat Rate?",
|
||||
"memo": "Memo",
|
||||
"productivehrs": "Productive Hours",
|
||||
@@ -2721,6 +2801,7 @@
|
||||
"shop-vendors": "Vendors",
|
||||
"temporarydocs": "Temporary Documents",
|
||||
"timetickets": "Time Tickets",
|
||||
"ttapprovals": "",
|
||||
"vehicle-details": "Vehicle: {{vehicle}}",
|
||||
"vehicles": "Vehicles"
|
||||
},
|
||||
@@ -2766,9 +2847,15 @@
|
||||
"shop_vendors": "Vendors | $t(titles.app)",
|
||||
"temporarydocs": "Temporary Documents | $t(titles.app)",
|
||||
"timetickets": "Time Tickets | $t(titles.app)",
|
||||
"ttapprovals": "",
|
||||
"vehicledetail": "Vehicle Details {{vehicle}} | $t(titles.app)",
|
||||
"vehicles": "All Vehicles | $t(titles.app)"
|
||||
},
|
||||
"tt_approvals": {
|
||||
"actions": {
|
||||
"approveselected": ""
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"actions": {
|
||||
"changepassword": "Change Password",
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
"scheduledfor": "Cita programada para:",
|
||||
"severalerrorsfound": "",
|
||||
"smartscheduling": "",
|
||||
"smspaymentreminder": "",
|
||||
"suggesteddates": ""
|
||||
},
|
||||
"successes": {
|
||||
@@ -103,6 +104,7 @@
|
||||
"admin_jobunvoid": "",
|
||||
"billposted": "",
|
||||
"billupdated": "",
|
||||
"failedpayment": "",
|
||||
"jobassignmentchange": "",
|
||||
"jobassignmentremoved": "",
|
||||
"jobchecklist": "",
|
||||
@@ -227,6 +229,7 @@
|
||||
},
|
||||
"bodyshop": {
|
||||
"actions": {
|
||||
"add_task_preset": "",
|
||||
"addapptcolor": "",
|
||||
"addbucket": "",
|
||||
"addpartslocation": "",
|
||||
@@ -339,6 +342,12 @@
|
||||
},
|
||||
"md_payment_types": "",
|
||||
"md_referral_sources": "",
|
||||
"md_tasks_presets": {
|
||||
"hourstype": "",
|
||||
"memo": "",
|
||||
"name": "",
|
||||
"percent": ""
|
||||
},
|
||||
"messaginglabel": "",
|
||||
"messagingtext": "",
|
||||
"noteslabel": "",
|
||||
@@ -374,6 +383,9 @@
|
||||
"export": "",
|
||||
"page": ""
|
||||
},
|
||||
"employee_teams": {
|
||||
"page": ""
|
||||
},
|
||||
"employees": {
|
||||
"page": ""
|
||||
},
|
||||
@@ -432,10 +444,15 @@
|
||||
},
|
||||
"timetickets": {
|
||||
"edit": "",
|
||||
"editcommitted": "",
|
||||
"enter": "",
|
||||
"list": "",
|
||||
"shiftedit": ""
|
||||
},
|
||||
"ttapprovals": {
|
||||
"approve": "",
|
||||
"view": ""
|
||||
},
|
||||
"users": {
|
||||
"editaccess": ""
|
||||
}
|
||||
@@ -453,6 +470,8 @@
|
||||
"federal_tax": "",
|
||||
"federal_tax_itc": "",
|
||||
"gst_override": "",
|
||||
"invoiceexemptcode": "",
|
||||
"itemexemptcode": "",
|
||||
"la1": "",
|
||||
"la2": "",
|
||||
"la3": "",
|
||||
@@ -504,6 +523,7 @@
|
||||
"dailyhrslimit": ""
|
||||
},
|
||||
"ssbuckets": {
|
||||
"color": "",
|
||||
"gte": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
@@ -574,6 +594,7 @@
|
||||
"title": ""
|
||||
},
|
||||
"emaillater": "",
|
||||
"employee_teams": "",
|
||||
"employees": "",
|
||||
"estimators": "",
|
||||
"filehandlers": "",
|
||||
@@ -582,6 +603,7 @@
|
||||
"jobstatuses": "",
|
||||
"laborrates": "",
|
||||
"licensing": "",
|
||||
"md_tasks_presets": "",
|
||||
"md_to_emails": "",
|
||||
"md_to_emails_emails": "",
|
||||
"messagingpresets": "",
|
||||
@@ -608,6 +630,7 @@
|
||||
"speedprint": "",
|
||||
"ssbuckets": "",
|
||||
"systemsettings": "",
|
||||
"task-presets": "",
|
||||
"workingdays": ""
|
||||
},
|
||||
"successes": {
|
||||
@@ -907,6 +930,18 @@
|
||||
"sent": "Correo electrónico enviado con éxito."
|
||||
}
|
||||
},
|
||||
"employee_teams": {
|
||||
"actions": {
|
||||
"new": "",
|
||||
"newmember": ""
|
||||
},
|
||||
"fields": {
|
||||
"active": "",
|
||||
"employeeid": "",
|
||||
"name": "",
|
||||
"percentage": ""
|
||||
}
|
||||
},
|
||||
"employees": {
|
||||
"actions": {
|
||||
"addvacation": "",
|
||||
@@ -1146,6 +1181,30 @@
|
||||
"updated": ""
|
||||
}
|
||||
},
|
||||
"job_payments": {
|
||||
"buttons": {
|
||||
"goback": "",
|
||||
"proceedtopayment": "",
|
||||
"refundpayment": ""
|
||||
},
|
||||
"notifications": {
|
||||
"error": {
|
||||
"description": "",
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"titles": {
|
||||
"amount": "",
|
||||
"dateOfPayment": "",
|
||||
"descriptions": "",
|
||||
"payer": "",
|
||||
"payername": "",
|
||||
"paymentid": "",
|
||||
"paymenttype": "",
|
||||
"refundamount": "",
|
||||
"transactionid": ""
|
||||
}
|
||||
},
|
||||
"joblines": {
|
||||
"actions": {
|
||||
"converttolabor": "",
|
||||
@@ -1578,6 +1637,7 @@
|
||||
"scheddates": ""
|
||||
},
|
||||
"labels": {
|
||||
"act_price_ppc": "",
|
||||
"actual_completion_inferred": "",
|
||||
"actual_delivery_inferred": "",
|
||||
"actual_in_inferred": "",
|
||||
@@ -1714,6 +1774,7 @@
|
||||
"partstotal": "",
|
||||
"totalreturns": ""
|
||||
},
|
||||
"ppc": "",
|
||||
"profileadjustments": "",
|
||||
"prt_dsmk_total": "",
|
||||
"rates": "Tarifas",
|
||||
@@ -1854,6 +1915,7 @@
|
||||
"customers": "Clientes",
|
||||
"dashboard": "",
|
||||
"enterbills": "",
|
||||
"entercardpayment": "",
|
||||
"enterpayment": "",
|
||||
"entertimeticket": "",
|
||||
"export": "",
|
||||
@@ -1865,6 +1927,7 @@
|
||||
"newjob": "",
|
||||
"owners": "propietarios",
|
||||
"parts-queue": "",
|
||||
"paymentremindersms": "",
|
||||
"phonebook": "",
|
||||
"productionboard": "",
|
||||
"productionlist": "",
|
||||
@@ -1890,6 +1953,7 @@
|
||||
"shop_vendors": "Vendedores",
|
||||
"temporarydocs": "",
|
||||
"timetickets": "",
|
||||
"ttapprovals": "",
|
||||
"vehicles": "Vehículos"
|
||||
},
|
||||
"jobsactions": {
|
||||
@@ -1973,6 +2037,16 @@
|
||||
"critical": "Crítico",
|
||||
"private": "Privado",
|
||||
"text": "Contenido",
|
||||
"type": "",
|
||||
"types": {
|
||||
"customer": "",
|
||||
"general": "",
|
||||
"office": "",
|
||||
"paint": "",
|
||||
"parts": "",
|
||||
"shop": "",
|
||||
"supplement": ""
|
||||
},
|
||||
"updatedat": "Actualizado en"
|
||||
},
|
||||
"labels": {
|
||||
@@ -2320,6 +2394,7 @@
|
||||
},
|
||||
"subjects": {
|
||||
"jobs": {
|
||||
"individual_job_note": "",
|
||||
"parts_order": "",
|
||||
"sublet_order": ""
|
||||
}
|
||||
@@ -2363,6 +2438,7 @@
|
||||
"qbo_usa": ""
|
||||
}
|
||||
},
|
||||
"cardcolor": "",
|
||||
"cardsettings": "",
|
||||
"clm_no": "",
|
||||
"comment": "",
|
||||
@@ -2373,6 +2449,7 @@
|
||||
"ins_co_nm": "",
|
||||
"jobdetail": "",
|
||||
"laborhrs": "",
|
||||
"legend": "",
|
||||
"note": "",
|
||||
"ownr_nm": "",
|
||||
"paintpriority": "",
|
||||
@@ -2611,6 +2688,7 @@
|
||||
},
|
||||
"timetickets": {
|
||||
"actions": {
|
||||
"claimtasks": "",
|
||||
"clockin": "",
|
||||
"clockout": "",
|
||||
"enter": "",
|
||||
@@ -2631,10 +2709,12 @@
|
||||
"clockhours": "",
|
||||
"clockoff": "",
|
||||
"clockon": "",
|
||||
"committed": "",
|
||||
"cost_center": "",
|
||||
"date": "",
|
||||
"efficiency": "",
|
||||
"employee": "",
|
||||
"employee_team": "",
|
||||
"flat_rate": "",
|
||||
"memo": "",
|
||||
"productivehrs": "",
|
||||
@@ -2721,6 +2801,7 @@
|
||||
"shop-vendors": "",
|
||||
"temporarydocs": "",
|
||||
"timetickets": "",
|
||||
"ttapprovals": "",
|
||||
"vehicle-details": "",
|
||||
"vehicles": ""
|
||||
},
|
||||
@@ -2766,9 +2847,15 @@
|
||||
"shop_vendors": "Vendedores | $t(titles.app)",
|
||||
"temporarydocs": "",
|
||||
"timetickets": "",
|
||||
"ttapprovals": "",
|
||||
"vehicledetail": "Detalles del vehículo {{vehicle}} | $t(titles.app)",
|
||||
"vehicles": "Todos los vehiculos | $t(titles.app)"
|
||||
},
|
||||
"tt_approvals": {
|
||||
"actions": {
|
||||
"approveselected": ""
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"actions": {
|
||||
"changepassword": "",
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
"scheduledfor": "Rendez-vous prévu pour:",
|
||||
"severalerrorsfound": "",
|
||||
"smartscheduling": "",
|
||||
"smspaymentreminder": "",
|
||||
"suggesteddates": ""
|
||||
},
|
||||
"successes": {
|
||||
@@ -103,6 +104,7 @@
|
||||
"admin_jobunvoid": "",
|
||||
"billposted": "",
|
||||
"billupdated": "",
|
||||
"failedpayment": "",
|
||||
"jobassignmentchange": "",
|
||||
"jobassignmentremoved": "",
|
||||
"jobchecklist": "",
|
||||
@@ -227,6 +229,7 @@
|
||||
},
|
||||
"bodyshop": {
|
||||
"actions": {
|
||||
"add_task_preset": "",
|
||||
"addapptcolor": "",
|
||||
"addbucket": "",
|
||||
"addpartslocation": "",
|
||||
@@ -339,6 +342,12 @@
|
||||
},
|
||||
"md_payment_types": "",
|
||||
"md_referral_sources": "",
|
||||
"md_tasks_presets": {
|
||||
"hourstype": "",
|
||||
"memo": "",
|
||||
"name": "",
|
||||
"percent": ""
|
||||
},
|
||||
"messaginglabel": "",
|
||||
"messagingtext": "",
|
||||
"noteslabel": "",
|
||||
@@ -374,6 +383,9 @@
|
||||
"export": "",
|
||||
"page": ""
|
||||
},
|
||||
"employee_teams": {
|
||||
"page": ""
|
||||
},
|
||||
"employees": {
|
||||
"page": ""
|
||||
},
|
||||
@@ -432,10 +444,15 @@
|
||||
},
|
||||
"timetickets": {
|
||||
"edit": "",
|
||||
"editcommitted": "",
|
||||
"enter": "",
|
||||
"list": "",
|
||||
"shiftedit": ""
|
||||
},
|
||||
"ttapprovals": {
|
||||
"approve": "",
|
||||
"view": ""
|
||||
},
|
||||
"users": {
|
||||
"editaccess": ""
|
||||
}
|
||||
@@ -453,6 +470,8 @@
|
||||
"federal_tax": "",
|
||||
"federal_tax_itc": "",
|
||||
"gst_override": "",
|
||||
"invoiceexemptcode": "",
|
||||
"itemexemptcode": "",
|
||||
"la1": "",
|
||||
"la2": "",
|
||||
"la3": "",
|
||||
@@ -504,6 +523,7 @@
|
||||
"dailyhrslimit": ""
|
||||
},
|
||||
"ssbuckets": {
|
||||
"color": "",
|
||||
"gte": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
@@ -574,6 +594,7 @@
|
||||
"title": ""
|
||||
},
|
||||
"emaillater": "",
|
||||
"employee_teams": "",
|
||||
"employees": "",
|
||||
"estimators": "",
|
||||
"filehandlers": "",
|
||||
@@ -582,6 +603,7 @@
|
||||
"jobstatuses": "",
|
||||
"laborrates": "",
|
||||
"licensing": "",
|
||||
"md_tasks_presets": "",
|
||||
"md_to_emails": "",
|
||||
"md_to_emails_emails": "",
|
||||
"messagingpresets": "",
|
||||
@@ -608,6 +630,7 @@
|
||||
"speedprint": "",
|
||||
"ssbuckets": "",
|
||||
"systemsettings": "",
|
||||
"task-presets": "",
|
||||
"workingdays": ""
|
||||
},
|
||||
"successes": {
|
||||
@@ -907,6 +930,18 @@
|
||||
"sent": "E-mail envoyé avec succès."
|
||||
}
|
||||
},
|
||||
"employee_teams": {
|
||||
"actions": {
|
||||
"new": "",
|
||||
"newmember": ""
|
||||
},
|
||||
"fields": {
|
||||
"active": "",
|
||||
"employeeid": "",
|
||||
"name": "",
|
||||
"percentage": ""
|
||||
}
|
||||
},
|
||||
"employees": {
|
||||
"actions": {
|
||||
"addvacation": "",
|
||||
@@ -1146,6 +1181,30 @@
|
||||
"updated": ""
|
||||
}
|
||||
},
|
||||
"job_payments": {
|
||||
"buttons": {
|
||||
"goback": "",
|
||||
"proceedtopayment": "",
|
||||
"refundpayment": ""
|
||||
},
|
||||
"notifications": {
|
||||
"error": {
|
||||
"description": "",
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"titles": {
|
||||
"amount": "",
|
||||
"dateOfPayment": "",
|
||||
"descriptions": "",
|
||||
"payer": "",
|
||||
"payername": "",
|
||||
"paymentid": "",
|
||||
"paymenttype": "",
|
||||
"refundamount": "",
|
||||
"transactionid": ""
|
||||
}
|
||||
},
|
||||
"joblines": {
|
||||
"actions": {
|
||||
"converttolabor": "",
|
||||
@@ -1578,6 +1637,7 @@
|
||||
"scheddates": ""
|
||||
},
|
||||
"labels": {
|
||||
"act_price_ppc": "",
|
||||
"actual_completion_inferred": "",
|
||||
"actual_delivery_inferred": "",
|
||||
"actual_in_inferred": "",
|
||||
@@ -1714,6 +1774,7 @@
|
||||
"partstotal": "",
|
||||
"totalreturns": ""
|
||||
},
|
||||
"ppc": "",
|
||||
"profileadjustments": "",
|
||||
"prt_dsmk_total": "",
|
||||
"rates": "Les taux",
|
||||
@@ -1854,6 +1915,7 @@
|
||||
"customers": "Les clients",
|
||||
"dashboard": "",
|
||||
"enterbills": "",
|
||||
"entercardpayment": "",
|
||||
"enterpayment": "",
|
||||
"entertimeticket": "",
|
||||
"export": "",
|
||||
@@ -1865,6 +1927,7 @@
|
||||
"newjob": "",
|
||||
"owners": "Propriétaires",
|
||||
"parts-queue": "",
|
||||
"paymentremindersms": "",
|
||||
"phonebook": "",
|
||||
"productionboard": "",
|
||||
"productionlist": "",
|
||||
@@ -1890,6 +1953,7 @@
|
||||
"shop_vendors": "Vendeurs",
|
||||
"temporarydocs": "",
|
||||
"timetickets": "",
|
||||
"ttapprovals": "",
|
||||
"vehicles": "Véhicules"
|
||||
},
|
||||
"jobsactions": {
|
||||
@@ -1973,6 +2037,16 @@
|
||||
"critical": "Critique",
|
||||
"private": "privé",
|
||||
"text": "Contenu",
|
||||
"type": "",
|
||||
"types": {
|
||||
"customer": "",
|
||||
"general": "",
|
||||
"office": "",
|
||||
"paint": "",
|
||||
"parts": "",
|
||||
"shop": "",
|
||||
"supplement": ""
|
||||
},
|
||||
"updatedat": "Mis à jour à"
|
||||
},
|
||||
"labels": {
|
||||
@@ -2320,6 +2394,7 @@
|
||||
},
|
||||
"subjects": {
|
||||
"jobs": {
|
||||
"individual_job_note": "",
|
||||
"parts_order": "",
|
||||
"sublet_order": ""
|
||||
}
|
||||
@@ -2363,6 +2438,7 @@
|
||||
"qbo_usa": ""
|
||||
}
|
||||
},
|
||||
"cardcolor": "",
|
||||
"cardsettings": "",
|
||||
"clm_no": "",
|
||||
"comment": "",
|
||||
@@ -2373,6 +2449,7 @@
|
||||
"ins_co_nm": "",
|
||||
"jobdetail": "",
|
||||
"laborhrs": "",
|
||||
"legend": "",
|
||||
"note": "",
|
||||
"ownr_nm": "",
|
||||
"paintpriority": "",
|
||||
@@ -2611,6 +2688,7 @@
|
||||
},
|
||||
"timetickets": {
|
||||
"actions": {
|
||||
"claimtasks": "",
|
||||
"clockin": "",
|
||||
"clockout": "",
|
||||
"enter": "",
|
||||
@@ -2631,10 +2709,12 @@
|
||||
"clockhours": "",
|
||||
"clockoff": "",
|
||||
"clockon": "",
|
||||
"committed": "",
|
||||
"cost_center": "",
|
||||
"date": "",
|
||||
"efficiency": "",
|
||||
"employee": "",
|
||||
"employee_team": "",
|
||||
"flat_rate": "",
|
||||
"memo": "",
|
||||
"productivehrs": "",
|
||||
@@ -2721,6 +2801,7 @@
|
||||
"shop-vendors": "",
|
||||
"temporarydocs": "",
|
||||
"timetickets": "",
|
||||
"ttapprovals": "",
|
||||
"vehicle-details": "",
|
||||
"vehicles": ""
|
||||
},
|
||||
@@ -2766,9 +2847,15 @@
|
||||
"shop_vendors": "Vendeurs | $t(titles.app)",
|
||||
"temporarydocs": "",
|
||||
"timetickets": "",
|
||||
"ttapprovals": "",
|
||||
"vehicledetail": "Détails du véhicule {{vehicle} | $t(titles.app)",
|
||||
"vehicles": "Tous les véhicules | $t(titles.app)"
|
||||
},
|
||||
"tt_approvals": {
|
||||
"actions": {
|
||||
"approveselected": ""
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"actions": {
|
||||
"changepassword": "",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import { notification } from "antd";
|
||||
import axios from "axios";
|
||||
import jsreport from "@jsreport/browser-client";
|
||||
import _ from "lodash";
|
||||
import moment from "moment";
|
||||
@@ -9,7 +8,8 @@ import { setEmailOptions } from "../redux/email/email.actions";
|
||||
import { store } from "../redux/store";
|
||||
import client from "../utils/GraphQLClient";
|
||||
import { TemplateList } from "./TemplateConstants";
|
||||
|
||||
import cleanAxios from "./CleanAxios";
|
||||
import axios from "axios";
|
||||
const server = process.env.REACT_APP_REPORTS_SERVER_URL;
|
||||
|
||||
jsreport.serverUrl = server;
|
||||
@@ -26,10 +26,14 @@ export default async function RenderTemplate(
|
||||
if (window.jsr3) {
|
||||
jsreport.serverUrl = "https://reports3.test.imex.online/";
|
||||
}
|
||||
const jsrAuth = (await axios.post("/utils/jsr")).data;
|
||||
|
||||
jsreport.headers["Authorization"] = jsrAuth;
|
||||
|
||||
//Query assets that match the template name. Must be in format <<templateName>>.query
|
||||
let { contextData, useShopSpecificTemplate } = await fetchContextData(
|
||||
templateObject
|
||||
templateObject,
|
||||
jsrAuth
|
||||
);
|
||||
|
||||
const { ignoreCustomMargins } = Templates[templateObject.name];
|
||||
@@ -137,11 +141,15 @@ export async function RenderTemplates(
|
||||
//Query assets that match the template name. Must be in format <<templateName>>.query
|
||||
let unsortedTemplatesAndData = [];
|
||||
let proms = [];
|
||||
const jsrAuth = (await axios.post("/utils/jsr")).data;
|
||||
jsreport.headers["Authorization"] = jsrAuth;
|
||||
|
||||
templateObjects.forEach((template) => {
|
||||
proms.push(
|
||||
(async () => {
|
||||
let { contextData, useShopSpecificTemplate } = await fetchContextData(
|
||||
template
|
||||
template,
|
||||
jsrAuth
|
||||
);
|
||||
unsortedTemplatesAndData.push({
|
||||
templateObject: template,
|
||||
@@ -298,19 +306,22 @@ export const GenerateDocuments = async (templates) => {
|
||||
await RenderTemplates(templates, bodyshop);
|
||||
};
|
||||
|
||||
const fetchContextData = async (templateObject) => {
|
||||
const fetchContextData = async (templateObject, jsrAuth) => {
|
||||
const bodyshop = store.getState().user.bodyshop;
|
||||
|
||||
jsreport.headers["Authorization"] =
|
||||
jsreport.headers["FirebaseAuthorization"] =
|
||||
"Bearer " + (await auth.currentUser.getIdToken());
|
||||
|
||||
const folders = await axios.get(`${server}/odata/folders`);
|
||||
const folders = await cleanAxios.get(`${server}/odata/folders`, {
|
||||
headers: { Authorization: jsrAuth },
|
||||
});
|
||||
const shopSpecificFolder = folders.data.value.find(
|
||||
(f) => f.name === bodyshop.imexshopid
|
||||
);
|
||||
|
||||
const jsReportQueries = await axios.get(
|
||||
`${server}/odata/assets?$filter=name eq '${templateObject.name}.query'`
|
||||
const jsReportQueries = await cleanAxios.get(
|
||||
`${server}/odata/assets?$filter=name eq '${templateObject.name}.query'`,
|
||||
{ headers: { Authorization: jsrAuth } }
|
||||
);
|
||||
|
||||
let templateQueryToExecute;
|
||||
|
||||
@@ -7,22 +7,24 @@ export const EmailSettings = {
|
||||
|
||||
export const TemplateList = (type, context) => {
|
||||
//const { bodyshop } = store.getState().user;
|
||||
|
||||
return {
|
||||
//If there's no type or the type is job, send it back.
|
||||
...(!type || type === "job"
|
||||
? {
|
||||
casl_authorization: {
|
||||
title: i18n.t("printcenter.jobs.casl_authorization"),
|
||||
description: "CASL Authorization",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.casl_authorization"),
|
||||
key: "casl_authorization",
|
||||
disabled: false,
|
||||
group: "authorization",
|
||||
regions: {
|
||||
CA: true,
|
||||
},
|
||||
},
|
||||
fippa_authorization: {
|
||||
title: i18n.t("printcenter.jobs.fippa_authorization"),
|
||||
description: "CASL Authorization",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.fippa_authorization"),
|
||||
key: "fippa_authorization",
|
||||
disabled: false,
|
||||
@@ -30,7 +32,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
diagnostic_authorization: {
|
||||
title: i18n.t("printcenter.jobs.diagnostic_authorization"),
|
||||
description: "Diagnostic Authorization",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.diagnostic_authorization"),
|
||||
key: "diagnostic_authorization",
|
||||
disabled: false,
|
||||
@@ -38,7 +40,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
mechanical_authorization: {
|
||||
title: i18n.t("printcenter.jobs.mechanical_authorization"),
|
||||
description: "Diagnostic Authorization",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.mechanical_authorization"),
|
||||
key: "mechanical_authorization",
|
||||
disabled: false,
|
||||
@@ -46,7 +48,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
appointment_reminder: {
|
||||
title: i18n.t("printcenter.jobs.appointment_reminder"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.appointment_reminder"),
|
||||
key: "appointment_reminder",
|
||||
disabled: false,
|
||||
@@ -54,7 +56,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
estimate_followup: {
|
||||
title: i18n.t("printcenter.jobs.estimate_followup"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.estimate_followup"),
|
||||
key: "estimate_followup",
|
||||
disabled: false,
|
||||
@@ -62,7 +64,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
express_repair_checklist: {
|
||||
title: i18n.t("printcenter.jobs.express_repair_checklist"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.express_repair_checklist"),
|
||||
key: "express_repair_checklist",
|
||||
disabled: false,
|
||||
@@ -70,7 +72,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
glass_express_checklist: {
|
||||
title: i18n.t("printcenter.jobs.glass_express_checklist"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.glass_express_checklist"),
|
||||
key: "glass_express_checklist",
|
||||
disabled: false,
|
||||
@@ -78,7 +80,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
stolen_recovery_checklist: {
|
||||
title: i18n.t("printcenter.jobs.stolen_recovery_checklist"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.stolen_recovery_checklist"),
|
||||
key: "stolen_recovery_checklist",
|
||||
disabled: false,
|
||||
@@ -86,7 +88,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
vehicle_check_in: {
|
||||
title: i18n.t("printcenter.jobs.vehicle_check_in"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.vehicle_check_in"),
|
||||
key: "vehicle_check_in",
|
||||
disabled: false,
|
||||
@@ -94,7 +96,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
parts_order_history: {
|
||||
title: i18n.t("printcenter.jobs.parts_order_history"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.parts_order_history"),
|
||||
key: "parts_order_history",
|
||||
disabled: false,
|
||||
@@ -102,7 +104,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
job_notes: {
|
||||
title: i18n.t("printcenter.jobs.job_notes"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.job_notes"),
|
||||
key: "job_notes",
|
||||
disabled: false,
|
||||
@@ -110,7 +112,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
ro_with_description: {
|
||||
title: i18n.t("printcenter.jobs.ro_with_description"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.ro_with_description"),
|
||||
key: "ro_with_description",
|
||||
disabled: false,
|
||||
@@ -118,7 +120,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
window_tag: {
|
||||
title: i18n.t("printcenter.jobs.window_tag"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.window_tag"),
|
||||
key: "window_tag",
|
||||
disabled: false,
|
||||
@@ -126,7 +128,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
supplement_request: {
|
||||
title: i18n.t("printcenter.jobs.supplement_request"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.supplement_request"),
|
||||
key: "supplement_request",
|
||||
disabled: false,
|
||||
@@ -134,7 +136,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
estimate: {
|
||||
title: i18n.t("printcenter.jobs.estimate"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.estimate"),
|
||||
key: "estimate",
|
||||
disabled: false,
|
||||
@@ -142,7 +144,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
parts_list: {
|
||||
title: i18n.t("printcenter.jobs.parts_list"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.parts_list"),
|
||||
key: "parts_list",
|
||||
disabled: false,
|
||||
@@ -150,7 +152,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
coversheet_portrait: {
|
||||
title: i18n.t("printcenter.jobs.coversheet_portrait"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.coversheet_portrait"),
|
||||
key: "coversheet_portrait",
|
||||
disabled: false,
|
||||
@@ -158,7 +160,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
coversheet_landscape: {
|
||||
title: i18n.t("printcenter.jobs.coversheet_landscape"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.coversheet_landscape"),
|
||||
key: "coversheet_landscape",
|
||||
disabled: false,
|
||||
@@ -166,7 +168,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
key_tag: {
|
||||
title: i18n.t("printcenter.jobs.key_tag"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.key_tag"),
|
||||
key: "key_tag",
|
||||
disabled: false,
|
||||
@@ -174,7 +176,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
paint_grid: {
|
||||
title: i18n.t("printcenter.jobs.paint_grid"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.paint_grid"),
|
||||
key: "paint_grid",
|
||||
disabled: false,
|
||||
@@ -182,7 +184,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
worksheet_by_line_number: {
|
||||
title: i18n.t("printcenter.jobs.worksheet_by_line_number"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.worksheet_by_line_number"),
|
||||
key: "worksheet_by_line_number",
|
||||
disabled: false,
|
||||
@@ -192,7 +194,7 @@ export const TemplateList = (type, context) => {
|
||||
title: i18n.t(
|
||||
"printcenter.jobs.worksheet_sorted_by_operation_type"
|
||||
),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t(
|
||||
"printcenter.jobs.worksheet_sorted_by_operation_type"
|
||||
),
|
||||
@@ -202,7 +204,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
worksheet_sorted_by_operation: {
|
||||
title: i18n.t("printcenter.jobs.worksheet_sorted_by_operation"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.worksheet_sorted_by_operation"),
|
||||
key: "worksheet_sorted_by_operation",
|
||||
disabled: false,
|
||||
@@ -212,7 +214,7 @@ export const TemplateList = (type, context) => {
|
||||
title: i18n.t(
|
||||
"printcenter.jobs.worksheet_sorted_by_operation_no_hours"
|
||||
),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t(
|
||||
"printcenter.jobs.worksheet_sorted_by_operation_no_hours"
|
||||
),
|
||||
@@ -224,7 +226,7 @@ export const TemplateList = (type, context) => {
|
||||
title: i18n.t(
|
||||
"printcenter.jobs.worksheet_sorted_by_operation_part_type"
|
||||
),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t(
|
||||
"printcenter.jobs.worksheet_sorted_by_operation_part_type"
|
||||
),
|
||||
@@ -234,7 +236,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
payments_by_job: {
|
||||
title: i18n.t("printcenter.jobs.payments_by_job"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.payments_by_job"),
|
||||
key: "payments_by_job",
|
||||
disabled: false,
|
||||
@@ -242,7 +244,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
final_invoice: {
|
||||
title: i18n.t("printcenter.jobs.final_invoice"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.final_invoice"),
|
||||
key: "final_invoice",
|
||||
disabled: false,
|
||||
@@ -250,7 +252,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
payment_request: {
|
||||
title: i18n.t("printcenter.jobs.payment_request"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.payment_request"),
|
||||
key: "payment_request",
|
||||
disabled: false,
|
||||
@@ -258,7 +260,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
invoice_total_payable: {
|
||||
title: i18n.t("printcenter.jobs.invoice_total_payable"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.invoice_total_payable"),
|
||||
key: "invoice_total_payable",
|
||||
disabled: false,
|
||||
@@ -266,7 +268,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
invoice_customer_payable: {
|
||||
title: i18n.t("printcenter.jobs.invoice_customer_payable"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.invoice_customer_payable"),
|
||||
key: "invoice_customer_payable",
|
||||
disabled: false,
|
||||
@@ -274,7 +276,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
ro_totals: {
|
||||
title: i18n.t("printcenter.jobs.ro_totals"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.ro_totals"),
|
||||
key: "ro_totals",
|
||||
disabled: false,
|
||||
@@ -282,7 +284,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
job_costing_ro: {
|
||||
title: i18n.t("printcenter.jobs.job_costing_ro"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.job_costing_ro"),
|
||||
key: "job_costing_ro",
|
||||
disabled: false,
|
||||
@@ -290,7 +292,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
purchases_by_ro_detail: {
|
||||
title: i18n.t("printcenter.jobs.purchases_by_ro_detail"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.purchases_by_ro_detail"),
|
||||
key: "purchases_by_ro_detail",
|
||||
disabled: false,
|
||||
@@ -298,7 +300,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
purchases_by_ro_summary: {
|
||||
title: i18n.t("printcenter.jobs.purchases_by_ro_summary"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.purchases_by_ro_summary"),
|
||||
key: "purchases_by_ro_summary",
|
||||
disabled: false,
|
||||
@@ -306,7 +308,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
filing_coversheet_portrait: {
|
||||
title: i18n.t("printcenter.jobs.filing_coversheet_portrait"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.filing_coversheet_portrait"),
|
||||
key: "filing_coversheet_portrait",
|
||||
disabled: false,
|
||||
@@ -314,7 +316,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
filing_coversheet_landscape: {
|
||||
title: i18n.t("printcenter.jobs.filing_coversheet_landscape"),
|
||||
description: "CASL Authorization",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.filing_coversheet_landscape"),
|
||||
key: "filing_coversheet_landscape",
|
||||
disabled: false,
|
||||
@@ -322,7 +324,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
qc_sheet: {
|
||||
title: i18n.t("printcenter.jobs.qc_sheet"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.qc_sheet"),
|
||||
key: "qc_sheet",
|
||||
disabled: false,
|
||||
@@ -330,7 +332,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
vehicle_delivery_check: {
|
||||
title: i18n.t("printcenter.jobs.vehicle_delivery_check"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.vehicle_delivery_check"),
|
||||
key: "vehicle_delivery_check",
|
||||
disabled: false,
|
||||
@@ -338,7 +340,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
guarantee: {
|
||||
title: i18n.t("printcenter.jobs.guarantee"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.guarantee"),
|
||||
key: "guarantee",
|
||||
disabled: false,
|
||||
@@ -346,7 +348,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
csi_invitation: {
|
||||
title: i18n.t("printcenter.jobs.csi_invitation"),
|
||||
description: "CSI invite",
|
||||
description: "",
|
||||
key: "csi_invitation",
|
||||
subject: i18n.t("printcenter.jobs.csi_invitation"),
|
||||
disabled: false,
|
||||
@@ -354,7 +356,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
window_tag_sublet: {
|
||||
title: i18n.t("printcenter.jobs.window_tag_sublet"),
|
||||
description: "Window Tag Sublet",
|
||||
description: "",
|
||||
key: "window_tag_sublet",
|
||||
subject: i18n.t("printcenter.jobs.window_tag_sublet"),
|
||||
disabled: false,
|
||||
@@ -362,7 +364,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
thank_you_ro: {
|
||||
title: i18n.t("printcenter.jobs.thank_you_ro"),
|
||||
description: "Thank You Letter by RO",
|
||||
description: "",
|
||||
key: "thank_you_ro",
|
||||
subject: i18n.t("printcenter.jobs.thank_you_ro"),
|
||||
disabled: false,
|
||||
@@ -370,7 +372,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
parts_label_single: {
|
||||
title: i18n.t("printcenter.jobs.parts_label_single"),
|
||||
description: "Thank You Letter by RO",
|
||||
description: "",
|
||||
key: "parts_label_single",
|
||||
subject: i18n.t("printcenter.jobs.parts_label_single"),
|
||||
disabled: false,
|
||||
@@ -379,7 +381,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
envelope_return_address: {
|
||||
title: i18n.t("printcenter.jobs.envelope_return_address"),
|
||||
description: "All Jobs Notes",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.envelope_return_address"),
|
||||
key: "envelope_return_address",
|
||||
disabled: false,
|
||||
@@ -388,7 +390,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
sgi_certificate_of_repairs: {
|
||||
title: i18n.t("printcenter.jobs.sgi_certificate_of_repairs"),
|
||||
description: "Thank You Letter by RO",
|
||||
description: "",
|
||||
key: "sgi_certificate_of_repairs",
|
||||
subject: i18n.t("printcenter.jobs.sgi_certificate_of_repairs"),
|
||||
disabled: false,
|
||||
@@ -399,7 +401,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
sgi_windshield_auth: {
|
||||
title: i18n.t("printcenter.jobs.sgi_windshield_auth"),
|
||||
description: "Thank You Letter by RO",
|
||||
description: "",
|
||||
key: "sgi_windshield_auth",
|
||||
subject: i18n.t("printcenter.jobs.sgi_windshield_auth"),
|
||||
disabled: false,
|
||||
@@ -410,7 +412,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
mpi_final_acct_sheet: {
|
||||
title: i18n.t("printcenter.jobs.mpi_final_acct_sheet"),
|
||||
description: "Thank You Letter by RO",
|
||||
description: "",
|
||||
key: "mpi_final_acct_sheet",
|
||||
subject: i18n.t("printcenter.jobs.mpi_final_acct_sheet"),
|
||||
disabled: false,
|
||||
@@ -421,7 +423,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
mpi_eglass_auth: {
|
||||
title: i18n.t("printcenter.jobs.mpi_eglass_auth"),
|
||||
description: "Thank You Letter by RO",
|
||||
description: "",
|
||||
key: "mpi_eglass_auth",
|
||||
subject: i18n.t("printcenter.jobs.mpi_eglass_auth"),
|
||||
disabled: false,
|
||||
@@ -432,7 +434,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
mpi_animal_checklist: {
|
||||
title: i18n.t("printcenter.jobs.mpi_animal_checklist"),
|
||||
description: "Thank You Letter by RO",
|
||||
description: "",
|
||||
key: "mpi_animal_checklist",
|
||||
subject: i18n.t("printcenter.jobs.mpi_animal_checklist"),
|
||||
disabled: false,
|
||||
@@ -443,7 +445,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
ab_proof_of_loss: {
|
||||
title: i18n.t("printcenter.jobs.ab_proof_of_loss"),
|
||||
description: "Thank You Letter by RO",
|
||||
description: "",
|
||||
key: "ab_proof_of_loss",
|
||||
subject: i18n.t("printcenter.jobs.ab_proof_of_loss"),
|
||||
disabled: false,
|
||||
@@ -454,7 +456,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
// parts_label_multi: {
|
||||
// title: i18n.t("printcenter.jobs.parts_label_multi"),
|
||||
// description: "Thank You Letter by RO",
|
||||
// description: "",
|
||||
// key: "parts_label_multi",
|
||||
// subject: i18n.t("printcenter.jobs.parts_label_multi"),
|
||||
// disabled: false,
|
||||
@@ -462,7 +464,7 @@ export const TemplateList = (type, context) => {
|
||||
// },
|
||||
iou_form: {
|
||||
title: i18n.t("printcenter.jobs.iou_form"),
|
||||
description: "CASL Authorization",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.iou_form"),
|
||||
key: "iou_form",
|
||||
disabled: false,
|
||||
@@ -470,7 +472,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
lag_time_ro: {
|
||||
title: i18n.t("printcenter.jobs.lag_time_ro"),
|
||||
description: "CASL Authorization",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.lag_time_ro"),
|
||||
key: "lag_time_ro",
|
||||
disabled: false,
|
||||
@@ -478,7 +480,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
rental_reservation: {
|
||||
title: i18n.t("printcenter.jobs.rental_reservation"),
|
||||
description: "CASL Authorization",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.rental_reservation"),
|
||||
key: "rental_reservation",
|
||||
disabled: false,
|
||||
@@ -486,7 +488,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
timetickets_ro: {
|
||||
title: i18n.t("printcenter.jobs.timetickets_ro"),
|
||||
description: "CASL Authorization",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.timetickets_ro"),
|
||||
key: "timetickets_ro",
|
||||
disabled: false,
|
||||
@@ -494,7 +496,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
dms_posting_sheet: {
|
||||
title: i18n.t("printcenter.jobs.dms_posting_sheet"),
|
||||
description: "DMS Posting Sheet",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.dms_posting_sheet"),
|
||||
key: "dms_posting_sheet",
|
||||
disabled: false,
|
||||
@@ -506,41 +508,41 @@ export const TemplateList = (type, context) => {
|
||||
? {
|
||||
special_thirdpartypayer: {
|
||||
title: i18n.t("printcenter.jobs.thirdpartypayer"),
|
||||
description: "CSI invite",
|
||||
description: "",
|
||||
key: "special_thirdpartypayer",
|
||||
disabled: false,
|
||||
},
|
||||
folder_label_multiple: {
|
||||
title: i18n.t("printcenter.jobs.folder_label_multiple"),
|
||||
description: "Folder Label Multiple",
|
||||
description: "",
|
||||
key: "folder_label_multiple",
|
||||
disabled: false,
|
||||
},
|
||||
parts_label_multiple: {
|
||||
title: i18n.t("printcenter.jobs.parts_label_multiple"),
|
||||
description: "Parts Label Multiple",
|
||||
description: "",
|
||||
key: "parts_label_multiple",
|
||||
disabled: false,
|
||||
},
|
||||
parts_invoice_label_single: {
|
||||
title: i18n.t("printcenter.jobs.parts_invoice_label_single"),
|
||||
description: "Parts Label Multiple",
|
||||
description: "",
|
||||
key: "parts_invoice_label_single",
|
||||
disabled: false,
|
||||
ignoreCustomMargins: true,
|
||||
},
|
||||
csi_invitation_action: {
|
||||
title: i18n.t("printcenter.jobs.csi_invitation_action"),
|
||||
description: "CSI invite",
|
||||
description: "",
|
||||
key: "csi_invitation_action",
|
||||
subject: i18n.t("printcenter.jobs.csi_invitation_action"),
|
||||
disabled: false,
|
||||
},
|
||||
individual_job_note: {
|
||||
title: i18n.t("printcenter.jobs.individual_job_note"),
|
||||
description: "CSI invite",
|
||||
description: "",
|
||||
key: "individual_job_note",
|
||||
subject: i18n.t("printcenter.jobs.individual_job_note", {
|
||||
subject: i18n.t("printcenter.subjects.jobs.individual_job_note", {
|
||||
ro_number: (context && context.ro_number) || "",
|
||||
}),
|
||||
disabled: false,
|
||||
@@ -551,7 +553,7 @@ export const TemplateList = (type, context) => {
|
||||
? {
|
||||
appointment_confirmation: {
|
||||
title: i18n.t("printcenter.appointments.appointment_confirmation"),
|
||||
description: "Appointment Confirmation",
|
||||
description: "",
|
||||
subject: i18n.t(
|
||||
"printcenter.appointments.appointment_confirmation"
|
||||
),
|
||||
@@ -564,7 +566,7 @@ export const TemplateList = (type, context) => {
|
||||
? {
|
||||
parts_order: {
|
||||
title: i18n.t("printcenter.jobs.parts_order"),
|
||||
description: "Parts Order",
|
||||
description: "",
|
||||
key: "parts_order",
|
||||
subject: i18n.t("printcenter.subjects.jobs.parts_order", {
|
||||
ro_number: context && context.job && context.job.ro_number,
|
||||
@@ -578,7 +580,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
sublet_order: {
|
||||
title: i18n.t("printcenter.jobs.sublet_order"),
|
||||
description: "Parts Order",
|
||||
description: "",
|
||||
key: "sublet_order",
|
||||
subject: i18n.t("printcenter.subjects.jobs.sublet_order", {
|
||||
ro_number: context && context.job && context.job.ro_number,
|
||||
@@ -593,7 +595,7 @@ export const TemplateList = (type, context) => {
|
||||
parts_return_slip: {
|
||||
title: i18n.t("printcenter.jobs.parts_return_slip"),
|
||||
subject: i18n.t("printcenter.jobs.parts_return_slip"),
|
||||
description: "Parts Return",
|
||||
description: "",
|
||||
key: "parts_return_slip",
|
||||
disabled: false,
|
||||
},
|
||||
@@ -603,7 +605,7 @@ export const TemplateList = (type, context) => {
|
||||
? {
|
||||
payment_receipt: {
|
||||
title: i18n.t("printcenter.jobs.payment_receipt"),
|
||||
description: "Payment Receipt",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.payment_receipt"),
|
||||
key: "payment_receipt",
|
||||
disabled: false,
|
||||
@@ -1891,7 +1893,7 @@ export const TemplateList = (type, context) => {
|
||||
title: i18n.t(
|
||||
"printcenter.courtesycarcontract.courtesy_car_contract"
|
||||
),
|
||||
description: "Est Detail",
|
||||
description: "",
|
||||
subject: i18n.t(
|
||||
"printcenter.courtesycarcontract.courtesy_car_contract"
|
||||
),
|
||||
@@ -1900,7 +1902,7 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
courtesy_car_terms: {
|
||||
title: i18n.t("printcenter.courtesycarcontract.courtesy_car_terms"),
|
||||
description: "Est Detail",
|
||||
description: "",
|
||||
subject: i18n.t(
|
||||
"printcenter.courtesycarcontract.courtesy_car_terms"
|
||||
),
|
||||
@@ -1911,7 +1913,7 @@ export const TemplateList = (type, context) => {
|
||||
title: i18n.t(
|
||||
"printcenter.courtesycarcontract.courtesy_car_impound"
|
||||
),
|
||||
description: "Est Detail",
|
||||
description: "",
|
||||
subject: i18n.t(
|
||||
"printcenter.courtesycarcontract.courtesy_car_impound"
|
||||
),
|
||||
@@ -1926,7 +1928,7 @@ export const TemplateList = (type, context) => {
|
||||
title: i18n.t(
|
||||
"printcenter.courtesycarcontract.courtesy_car_inventory"
|
||||
),
|
||||
description: "Est Detail",
|
||||
description: "",
|
||||
subject: i18n.t(
|
||||
"printcenter.courtesycarcontract.courtesy_car_inventory"
|
||||
),
|
||||
@@ -1939,7 +1941,7 @@ export const TemplateList = (type, context) => {
|
||||
? {
|
||||
inhouse_invoice: {
|
||||
title: i18n.t("printcenter.bills.inhouse_invoice"),
|
||||
description: "Est Detail",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.bills.inhouse_invoice"),
|
||||
key: "inhouse_invoice",
|
||||
disabled: false,
|
||||
@@ -1950,7 +1952,7 @@ export const TemplateList = (type, context) => {
|
||||
? {
|
||||
// timetickets: {
|
||||
// title: i18n.t("printcenter.timetickets.timetickets"),
|
||||
// description: "Est Detail",
|
||||
// description: "",
|
||||
// subject: `${i18n.t("printcenter.timetickets.timetickets")} - ${
|
||||
// context && context.job && context.job.ro_number
|
||||
// }`,
|
||||
@@ -1963,14 +1965,14 @@ export const TemplateList = (type, context) => {
|
||||
? {
|
||||
purchases_by_vendor_detailed: {
|
||||
title: i18n.t("printcenter.vendors.purchases_by_vendor_detailed"),
|
||||
description: "Est Detail",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.vendors.purchases_by_vendor_detailed"),
|
||||
key: "purchases_by_vendor_detailed",
|
||||
disabled: false,
|
||||
},
|
||||
purchases_by_vendor_summary: {
|
||||
title: i18n.t("printcenter.vendors.purchases_by_vendor_summary"),
|
||||
description: "Est Detail",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.vendors.purchases_by_vendor_summary"),
|
||||
key: "purchases_by_vendor_summary",
|
||||
disabled: false,
|
||||
@@ -2043,21 +2045,21 @@ export const TemplateList = (type, context) => {
|
||||
? {
|
||||
ca_bc_etf_table: {
|
||||
title: i18n.t("printcenter.payments.ca_bc_etf_table"),
|
||||
description: "Est Detail",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.payments.ca_bc_etf_table"),
|
||||
key: "ca_bc_etf_table",
|
||||
disabled: false,
|
||||
},
|
||||
exported_payroll: {
|
||||
title: i18n.t("printcenter.payments.exported_payroll"),
|
||||
description: "Est Detail",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.payments.exported_payroll"),
|
||||
key: "exported_payroll",
|
||||
disabled: false,
|
||||
},
|
||||
attendance_detail_csv: {
|
||||
title: i18n.t("printcenter.special.attendance_detail_csv"),
|
||||
description: "Est Detail",
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.special.attendance_detail_csv"),
|
||||
key: "attendance_detail_csv",
|
||||
disabled: false,
|
||||
|
||||
@@ -682,18 +682,15 @@
|
||||
insert:
|
||||
columns: '*'
|
||||
update:
|
||||
columns:
|
||||
- jobid
|
||||
- invoice_number
|
||||
- due_date
|
||||
- vendorid
|
||||
- id
|
||||
- date
|
||||
columns: '*'
|
||||
retry_conf:
|
||||
interval_sec: 10
|
||||
num_retries: 3
|
||||
timeout_sec: 60
|
||||
webhook_from_env: HASURA_API_URL
|
||||
headers:
|
||||
- name: event-secret
|
||||
value_from_env: EVENT_SECRET
|
||||
request_transform:
|
||||
method: POST
|
||||
query_params: {}
|
||||
@@ -944,6 +941,7 @@
|
||||
- md_referral_sources
|
||||
- md_responsibility_centers
|
||||
- md_ro_statuses
|
||||
- md_tasks_presets
|
||||
- md_to_emails
|
||||
- messagingservicesid
|
||||
- pbs_configuration
|
||||
@@ -1041,6 +1039,7 @@
|
||||
- md_referral_sources
|
||||
- md_responsibility_centers
|
||||
- md_ro_statuses
|
||||
- md_tasks_presets
|
||||
- md_to_emails
|
||||
- pbs_configuration
|
||||
- phone
|
||||
@@ -4091,27 +4090,15 @@
|
||||
insert:
|
||||
columns: '*'
|
||||
update:
|
||||
columns:
|
||||
- v_color
|
||||
- ownerid
|
||||
- ownr_fn
|
||||
- v_model_desc
|
||||
- ownr_ln
|
||||
- id
|
||||
- v_make_desc
|
||||
- ownr_st
|
||||
- clm_no
|
||||
- voided
|
||||
- status
|
||||
- ownr_co_nm
|
||||
- v_model_yr
|
||||
- v_vin
|
||||
- converted
|
||||
columns: '*'
|
||||
retry_conf:
|
||||
interval_sec: 10
|
||||
num_retries: 3
|
||||
timeout_sec: 60
|
||||
webhook_from_env: HASURA_API_URL
|
||||
headers:
|
||||
- name: event-secret
|
||||
value_from_env: EVENT_SECRET
|
||||
request_transform:
|
||||
method: POST
|
||||
query_params: {}
|
||||
@@ -4346,6 +4333,7 @@
|
||||
- jobid
|
||||
- private
|
||||
- text
|
||||
- type
|
||||
- updated_at
|
||||
select_permissions:
|
||||
- role: user
|
||||
@@ -4359,6 +4347,7 @@
|
||||
- jobid
|
||||
- private
|
||||
- text
|
||||
- type
|
||||
- updated_at
|
||||
filter:
|
||||
job:
|
||||
@@ -4382,6 +4371,7 @@
|
||||
- jobid
|
||||
- private
|
||||
- text
|
||||
- type
|
||||
- updated_at
|
||||
filter:
|
||||
job:
|
||||
@@ -4551,17 +4541,15 @@
|
||||
insert:
|
||||
columns: '*'
|
||||
update:
|
||||
columns:
|
||||
- shopid
|
||||
- ownr_fn
|
||||
- id
|
||||
- ownr_co_nm
|
||||
- ownr_ln
|
||||
columns: '*'
|
||||
retry_conf:
|
||||
interval_sec: 10
|
||||
num_retries: 3
|
||||
timeout_sec: 60
|
||||
webhook_from_env: HASURA_API_URL
|
||||
headers:
|
||||
- name: event-secret
|
||||
value_from_env: EVENT_SECRET
|
||||
request_transform:
|
||||
method: POST
|
||||
query_params: {}
|
||||
@@ -5000,21 +4988,15 @@
|
||||
insert:
|
||||
columns: '*'
|
||||
update:
|
||||
columns:
|
||||
- paymentnum
|
||||
- type
|
||||
- amount
|
||||
- date
|
||||
- transactionid
|
||||
- memo
|
||||
- payer
|
||||
- id
|
||||
- jobid
|
||||
columns: '*'
|
||||
retry_conf:
|
||||
interval_sec: 10
|
||||
num_retries: 3
|
||||
timeout_sec: 60
|
||||
webhook_from_env: HASURA_API_URL
|
||||
headers:
|
||||
- name: event-secret
|
||||
value_from_env: EVENT_SECRET
|
||||
request_transform:
|
||||
method: POST
|
||||
query_params: {}
|
||||
@@ -5944,19 +5926,15 @@
|
||||
insert:
|
||||
columns: '*'
|
||||
update:
|
||||
columns:
|
||||
- v_model_yr
|
||||
- plate_no
|
||||
- id
|
||||
- v_vin
|
||||
- v_model_desc
|
||||
- plate_st
|
||||
- shopid
|
||||
columns: '*'
|
||||
retry_conf:
|
||||
interval_sec: 10
|
||||
num_retries: 3
|
||||
timeout_sec: 60
|
||||
webhook_from_env: HASURA_API_URL
|
||||
headers:
|
||||
- name: event-secret
|
||||
value_from_env: EVENT_SECRET
|
||||
request_transform:
|
||||
method: POST
|
||||
query_params: {}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
-- Could not auto-generate a down migration.
|
||||
-- Please write an appropriate down migration for the SQL below:
|
||||
-- CREATE INDEX idx_associations_active_true ON associations(active) WHERE active = true;
|
||||
1
hasura/migrations/1682703406197_run_sql_migration/up.sql
Normal file
1
hasura/migrations/1682703406197_run_sql_migration/up.sql
Normal file
@@ -0,0 +1 @@
|
||||
CREATE INDEX idx_associations_active_true ON associations(active) WHERE active = true;
|
||||
@@ -0,0 +1 @@
|
||||
DROP INDEX IF EXISTS "public"."idx_associations_shopid_user";
|
||||
@@ -0,0 +1,2 @@
|
||||
CREATE INDEX "idx_associations_shopid_user" on
|
||||
"public"."associations" using btree ("shopid", "useremail", "active");
|
||||
@@ -0,0 +1,4 @@
|
||||
-- Could not auto-generate a down migration.
|
||||
-- Please write an appropriate down migration for the SQL below:
|
||||
-- alter table "public"."bodyshops" add column "md_tasks_presets" jsonb
|
||||
-- not null default jsonb_build_object();
|
||||
@@ -0,0 +1,2 @@
|
||||
alter table "public"."bodyshops" add column "md_tasks_presets" jsonb
|
||||
not null default jsonb_build_object();
|
||||
@@ -0,0 +1,4 @@
|
||||
-- Could not auto-generate a down migration.
|
||||
-- Please write an appropriate down migration for the SQL below:
|
||||
-- alter table "public"."notes" add column "type" text
|
||||
-- not null default 'general';
|
||||
@@ -0,0 +1,2 @@
|
||||
alter table "public"."notes" add column "type" text
|
||||
not null default 'general';
|
||||
53
os-loader.js
53
os-loader.js
@@ -50,7 +50,7 @@ const getClient = async () => {
|
||||
|
||||
async function OpenSearchUpdateHandler(req, res) {
|
||||
try {
|
||||
var osClient = await getClient();
|
||||
var osClient = await getClient();
|
||||
// const osClient = new Client({
|
||||
// node: `https://imex:password@search-imexonline-search-ixp2stfvwp6qocjsowzjzyreoy.ca-central-1.es.amazonaws.com`,
|
||||
// });
|
||||
@@ -74,12 +74,19 @@ async function OpenSearchUpdateHandler(req, res) {
|
||||
const jobsData = await gqlclient.request(`query{jobs{
|
||||
id
|
||||
bodyshopid:shopid
|
||||
ro_number
|
||||
clm_no
|
||||
clm_total
|
||||
comment
|
||||
ins_co_nm
|
||||
owner_owing
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_ph1
|
||||
ownr_ph2
|
||||
plate_no
|
||||
ro_number
|
||||
status
|
||||
ownr_co_nm
|
||||
v_model_yr
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
@@ -128,12 +135,12 @@ async function OpenSearchUpdateHandler(req, res) {
|
||||
vehicles {
|
||||
id
|
||||
bodyshopid: shopid
|
||||
v_model_yr
|
||||
v_model_desc
|
||||
v_make_desc
|
||||
v_color
|
||||
v_vin
|
||||
plate_no
|
||||
plate_no
|
||||
v_model_yr
|
||||
v_model_desc
|
||||
v_make_desc
|
||||
v_color
|
||||
v_vin
|
||||
}
|
||||
}
|
||||
`);
|
||||
@@ -155,11 +162,26 @@ plate_no
|
||||
payments {
|
||||
id
|
||||
amount
|
||||
paymentnum
|
||||
created_at
|
||||
date
|
||||
exportedat
|
||||
memo
|
||||
payer
|
||||
paymentnum
|
||||
transactionid
|
||||
type
|
||||
job {
|
||||
id
|
||||
ownerid
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
owner {
|
||||
id
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
}
|
||||
ro_number
|
||||
bodyshopid: shopid
|
||||
}
|
||||
@@ -187,9 +209,12 @@ plate_no
|
||||
const billsData = await gqlclient.request(`{
|
||||
bills {
|
||||
id
|
||||
total
|
||||
invoice_number
|
||||
date
|
||||
exported
|
||||
exported_at
|
||||
invoice_number
|
||||
is_credit_memo
|
||||
total
|
||||
vendor {
|
||||
name
|
||||
id
|
||||
@@ -200,9 +225,7 @@ plate_no
|
||||
bodyshopid: shopid
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
`);
|
||||
}`);
|
||||
for (let i = 0; i <= billsData.bills.length / batchSize; i++) {
|
||||
const slicedArray = billsData.bills.slice(
|
||||
i * batchSize,
|
||||
|
||||
40
server.js
40
server.js
@@ -123,7 +123,11 @@ app.post(
|
||||
twilio.webhook({ validate: process.env.NODE_ENV === "PRODUCTION" }),
|
||||
smsStatus.status
|
||||
);
|
||||
app.post("/sms/markConversationRead", smsStatus.markConversationRead);
|
||||
app.post(
|
||||
"/sms/markConversationRead",
|
||||
fb.validateFirebaseIdToken,
|
||||
smsStatus.markConversationRead
|
||||
);
|
||||
|
||||
var job = require("./server/job/job");
|
||||
app.post("/job/totals", fb.validateFirebaseIdToken, job.totals);
|
||||
@@ -147,11 +151,11 @@ app.post("/scheduling/job", fb.validateFirebaseIdToken, scheduling.job);
|
||||
var inlineCss = require("./server/render/inlinecss");
|
||||
app.post("/render/inlinecss", fb.validateFirebaseIdToken, inlineCss.inlinecss);
|
||||
|
||||
app.post(
|
||||
"/notifications/send",
|
||||
// app.post(
|
||||
// "/notifications/send",
|
||||
|
||||
fb.sendNotification
|
||||
);
|
||||
// fb.sendNotification
|
||||
// );
|
||||
app.post("/notifications/subscribe", fb.validateFirebaseIdToken, fb.subscribe);
|
||||
app.post(
|
||||
"/notifications/unsubscribe",
|
||||
@@ -188,13 +192,13 @@ app.post(
|
||||
);
|
||||
|
||||
//Stripe Processing
|
||||
var stripe = require("./server/stripe/payment");
|
||||
app.post("/stripe/payment", fb.validateFirebaseIdToken, stripe.payment);
|
||||
app.post(
|
||||
"/stripe/mobilepayment",
|
||||
fb.validateFirebaseIdToken,
|
||||
stripe.mobile_payment
|
||||
);
|
||||
// var stripe = require("./server/stripe/payment");
|
||||
// app.post("/stripe/payment", fb.validateFirebaseIdToken, stripe.payment);
|
||||
// app.post(
|
||||
// "/stripe/mobilepayment",
|
||||
// fb.validateFirebaseIdToken,
|
||||
// stripe.mobile_payment
|
||||
// );
|
||||
|
||||
//Tech Console
|
||||
var tech = require("./server/tech/tech");
|
||||
@@ -202,7 +206,7 @@ app.post("/tech/login", fb.validateFirebaseIdToken, tech.techLogin);
|
||||
|
||||
var utils = require("./server/utils/utils");
|
||||
app.post("/utils/time", utils.servertime);
|
||||
|
||||
app.post("/utils/jsr", fb.validateFirebaseIdToken, utils.jsrAuth);
|
||||
var qbo = require("./server/accounting/qbo/qbo");
|
||||
app.post("/qbo/authorize", fb.validateFirebaseIdToken, qbo.authorize);
|
||||
app.get("/qbo/callback", qbo.callback);
|
||||
@@ -215,7 +219,7 @@ app.post("/data/ah", data.autohouse);
|
||||
app.post("/record-handler/arms", data.arms);
|
||||
|
||||
var taskHandler = require("./server/tasks/tasks");
|
||||
app.post("/taskHandler", taskHandler.taskHandler);
|
||||
app.post("/taskHandler", fb.validateFirebaseIdToken, taskHandler.taskHandler);
|
||||
|
||||
var mixdataUpload = require("./server/mixdata/mixdata");
|
||||
|
||||
@@ -228,10 +232,10 @@ app.post(
|
||||
|
||||
var ioevent = require("./server/ioevent/ioevent");
|
||||
app.post("/ioevent", ioevent.default);
|
||||
app.post("/newlog", (req, res) => {
|
||||
const { message, type, user, record, object } = req.body;
|
||||
logger.log(message, type, user, record, object);
|
||||
});
|
||||
// app.post("/newlog", (req, res) => {
|
||||
// const { message, type, user, record, object } = req.body;
|
||||
// logger.log(message, type, user, record, object);
|
||||
// });
|
||||
|
||||
var os = require("./server/opensearch/os-handler");
|
||||
app.post(
|
||||
|
||||
@@ -164,7 +164,7 @@ async function PbsCalculateAllocationsAp(socket, billids) {
|
||||
|
||||
let APAmount = Dinero();
|
||||
Object.keys(billHash).map((key) => {
|
||||
if (billHash[key].Amount.getAmount() > 0) {
|
||||
if (billHash[key].Amount.getAmount() > 0 || billHash[key].Amount.getAmount() < 0) {
|
||||
transactionObject.Posting.Lines.push({
|
||||
...billHash[key],
|
||||
Amount: billHash[key].Amount.toFormat("0.00"),
|
||||
|
||||
@@ -50,7 +50,7 @@ async function getEntegralShopData() {
|
||||
}
|
||||
|
||||
exports.default = async (req, res) => {
|
||||
res.sendStatus(200);
|
||||
res.sendStatus(401);
|
||||
return;
|
||||
//Query for the List of Bodyshop Clients.
|
||||
const job = req.body.event.data.new;
|
||||
|
||||
@@ -40,6 +40,10 @@ exports.default = async (req, res) => {
|
||||
|
||||
const specificShopIds = req.body.bodyshopIds; // ['uuid]
|
||||
const { start, end, skipUpload } = req.body; //YYYY-MM-DD
|
||||
if (req.headers["x-imex-auth"] !== process.env.AUTOHOUSE_AUTH_TOKEN) {
|
||||
res.sendStatus(401);
|
||||
return;
|
||||
}
|
||||
const allxmlsToUpload = [];
|
||||
const allErrors = [];
|
||||
try {
|
||||
@@ -261,20 +265,20 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
||||
}${job.est_ct_fn ? job.est_ct_fn : ""}`,
|
||||
},
|
||||
CustomerInformation: {
|
||||
FirstName: job.ownr_fn || "",
|
||||
LastName: job.ownr_ln || "",
|
||||
Street: job.ownr_addr1 || "",
|
||||
City: job.ownr_city || "",
|
||||
State: job.ownr_st || "",
|
||||
FirstName: "",
|
||||
LastName: "",
|
||||
Street: "",
|
||||
City: "",
|
||||
State: "",
|
||||
Zip: (job.ownr_zip && job.ownr_zip.substring(0, 3)) || "",
|
||||
Phone1: job.ownr_ph1 || "",
|
||||
Phone1: "",
|
||||
Phone2: null,
|
||||
Phone2Extension: null,
|
||||
Phone3: null,
|
||||
Phone3Extension: null,
|
||||
FileComments: null,
|
||||
Source: null,
|
||||
Email: job.ownr_ea || "",
|
||||
Email: "",
|
||||
RetWhsl: null,
|
||||
Cat: null,
|
||||
InsuredorClaimantFlag: null,
|
||||
@@ -758,7 +762,12 @@ const CreateCosts = (job) => {
|
||||
}, {});
|
||||
|
||||
//If the hourly rates for job costing are set, add them in.
|
||||
if (job.bodyshop.jc_hourly_rates && job.bodyshop.jc_hourly_rates.mapa) {
|
||||
if (
|
||||
job.bodyshop.jc_hourly_rates &&
|
||||
(job.bodyshop.jc_hourly_rates.mapa ||
|
||||
typeof job.bodyshop.jc_hourly_rates.mapa === "number" ||
|
||||
isNaN(job.bodyshop.jc_hourly_rates.mapa) === false)
|
||||
) {
|
||||
if (
|
||||
!billTotalsByCostCenters[
|
||||
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
|
||||
@@ -772,7 +781,9 @@ const CreateCosts = (job) => {
|
||||
billTotalsByCostCenters[
|
||||
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
|
||||
] = Dinero({
|
||||
amount: (job.mixdata[0] && job.mixdata[0].totalliquidcost * 100) || 0,
|
||||
amount: Math.round(
|
||||
((job.mixdata[0] && job.mixdata[0].totalliquidcost) || 0) * 100
|
||||
),
|
||||
});
|
||||
} else {
|
||||
billTotalsByCostCenters[
|
||||
@@ -781,10 +792,11 @@ const CreateCosts = (job) => {
|
||||
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
|
||||
].add(
|
||||
Dinero({
|
||||
amount:
|
||||
amount: Math.round(
|
||||
(job.bodyshop.jc_hourly_rates &&
|
||||
job.bodyshop.jc_hourly_rates.mapa * 100) ||
|
||||
0,
|
||||
0
|
||||
),
|
||||
}).multiply(job.job_totals.rates.mapa.hours)
|
||||
);
|
||||
}
|
||||
@@ -795,11 +807,12 @@ const CreateCosts = (job) => {
|
||||
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
|
||||
].add(
|
||||
Dinero({
|
||||
amount:
|
||||
amount: Math.round(
|
||||
(job.bodyshop.jc_hourly_rates &&
|
||||
job.bodyshop.jc_hourly_rates.mapa * 100) ||
|
||||
0,
|
||||
}).multiply(materialsHours.mapaHrs)
|
||||
0
|
||||
),
|
||||
}).multiply(job.job_totals.rates.mapa.hours)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -818,10 +831,11 @@ const CreateCosts = (job) => {
|
||||
job.bodyshop.md_responsibility_centers.defaults.costs.MASH
|
||||
].add(
|
||||
Dinero({
|
||||
amount:
|
||||
amount: Math.round(
|
||||
(job.bodyshop.jc_hourly_rates &&
|
||||
job.bodyshop.jc_hourly_rates.mash * 100) ||
|
||||
0,
|
||||
0
|
||||
),
|
||||
}).multiply(job.job_totals.rates.mash.hours)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ exports.sendServerEmail = async function ({ subject, text }) {
|
||||
transporter.sendMail(
|
||||
{
|
||||
from: `ImEX Online API - ${process.env.NODE_ENV} <noreply@imex.online>`,
|
||||
to: ["patrick@imexsystems.ca"],
|
||||
to: ["patrick@imexsystems.ca", "support@thinkimex.com"],
|
||||
subject: subject,
|
||||
text: text,
|
||||
ses: {
|
||||
|
||||
@@ -612,7 +612,12 @@ function GenerateCostingData(job) {
|
||||
|
||||
//If the hourly rates for job costing are set, add them in.
|
||||
|
||||
if (job.bodyshop.jc_hourly_rates && job.bodyshop.jc_hourly_rates.mapa) {
|
||||
if (
|
||||
job.bodyshop.jc_hourly_rates &&
|
||||
(job.bodyshop.jc_hourly_rates.mapa ||
|
||||
typeof job.bodyshop.jc_hourly_rates.mapa === "number" ||
|
||||
isNaN(job.bodyshop.jc_hourly_rates.mapa) === false)
|
||||
) {
|
||||
if (
|
||||
!billTotalsByCostCenters.additionalCosts[
|
||||
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
|
||||
@@ -626,7 +631,9 @@ function GenerateCostingData(job) {
|
||||
billTotalsByCostCenters.additionalCosts[
|
||||
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
|
||||
] = Dinero({
|
||||
amount: (job.mixdata[0] && job.mixdata[0].totalliquidcost * 100) || 0,
|
||||
amount: Math.round(
|
||||
((job.mixdata[0] && job.mixdata[0].totalliquidcost) || 0) * 100
|
||||
),
|
||||
});
|
||||
} else {
|
||||
billTotalsByCostCenters.additionalCosts[
|
||||
@@ -635,10 +642,11 @@ function GenerateCostingData(job) {
|
||||
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
|
||||
].add(
|
||||
Dinero({
|
||||
amount:
|
||||
amount: Math.round(
|
||||
(job.bodyshop.jc_hourly_rates &&
|
||||
job.bodyshop.jc_hourly_rates.mapa * 100) ||
|
||||
0,
|
||||
0
|
||||
),
|
||||
}).multiply(materialsHours.mapaHrs)
|
||||
);
|
||||
}
|
||||
@@ -649,10 +657,11 @@ function GenerateCostingData(job) {
|
||||
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
|
||||
].add(
|
||||
Dinero({
|
||||
amount:
|
||||
amount: Math.round(
|
||||
(job.bodyshop.jc_hourly_rates &&
|
||||
job.bodyshop.jc_hourly_rates.mapa * 100) ||
|
||||
0,
|
||||
0
|
||||
),
|
||||
}).multiply(materialsHours.mapaHrs)
|
||||
);
|
||||
}
|
||||
@@ -673,10 +682,11 @@ function GenerateCostingData(job) {
|
||||
job.bodyshop.md_responsibility_centers.defaults.costs.MASH
|
||||
].add(
|
||||
Dinero({
|
||||
amount:
|
||||
amount: Math.round(
|
||||
(job.bodyshop.jc_hourly_rates &&
|
||||
job.bodyshop.jc_hourly_rates.mash * 100) ||
|
||||
0,
|
||||
0
|
||||
),
|
||||
}).multiply(materialsHours.mashHrs)
|
||||
);
|
||||
}
|
||||
@@ -833,7 +843,9 @@ function GenerateCostingData(job) {
|
||||
//Push adjustments to bottom line.
|
||||
if (job.adjustment_bottom_line) {
|
||||
//Add to totals.
|
||||
const Adjustment = Dinero({ amount: job.adjustment_bottom_line * 100 }); //Need to invert, since this is being assigned as a cost.
|
||||
const Adjustment = Dinero({
|
||||
amount: Math.round(job.adjustment_bottom_line * 100),
|
||||
}); //Need to invert, since this is being assigned as a cost.
|
||||
summaryData.totalLaborSales = summaryData.totalLaborSales.add(Adjustment);
|
||||
summaryData.totalSales = summaryData.totalSales.add(Adjustment);
|
||||
//Add to lines.
|
||||
|
||||
@@ -17,7 +17,7 @@ require("dotenv").config({
|
||||
});
|
||||
async function StatusTransition(req, res) {
|
||||
if (req.headers["event-secret"] !== process.env.EVENT_SECRET) {
|
||||
res.status(403).send("Unauthorized");
|
||||
res.status(401).send("Unauthorized");
|
||||
return;
|
||||
}
|
||||
res.sendStatus(200);
|
||||
|
||||
@@ -45,6 +45,10 @@ const getClient = async () => {
|
||||
};
|
||||
|
||||
async function OpenSearchUpdateHandler(req, res) {
|
||||
if (req.headers["event-secret"] !== process.env.EVENT_SECRET) {
|
||||
res.status(401).send("Unauthorized");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
var osClient = await getClient();
|
||||
// const osClient = new Client({
|
||||
@@ -66,12 +70,19 @@ async function OpenSearchUpdateHandler(req, res) {
|
||||
document = _.pick(req.body.event.data.new, [
|
||||
"id",
|
||||
"bodyshopid",
|
||||
"ro_number",
|
||||
"clm_no",
|
||||
"clm_total",
|
||||
"comment",
|
||||
"ins_co_nm",
|
||||
"owner_owing",
|
||||
"ownr_co_nm",
|
||||
"ownr_fn",
|
||||
"ownr_ln",
|
||||
"ownr_ph1",
|
||||
"ownr_ph2",
|
||||
"plate_no",
|
||||
"ro_number",
|
||||
"status",
|
||||
"ownr_co_nm",
|
||||
"v_model_yr",
|
||||
"v_make_desc",
|
||||
"v_model_desc",
|
||||
@@ -120,17 +131,19 @@ async function OpenSearchUpdateHandler(req, res) {
|
||||
`,
|
||||
{ billId: req.body.event.data.new.id }
|
||||
);
|
||||
|
||||
document = {
|
||||
..._.pick(req.body.event.data.new, [
|
||||
"id",
|
||||
"invoice_number",
|
||||
"date",
|
||||
"exported",
|
||||
"exported_at",
|
||||
"invoice_number",
|
||||
"is_credit_memo",
|
||||
"total"
|
||||
]),
|
||||
...bill.bills_by_pk,
|
||||
bodyshopid: bill.bills_by_pk.job.shopid,
|
||||
};
|
||||
|
||||
break;
|
||||
case "payments":
|
||||
//Query to get the job and RO number
|
||||
@@ -142,21 +155,40 @@ async function OpenSearchUpdateHandler(req, res) {
|
||||
id
|
||||
ro_number
|
||||
shopid
|
||||
ownerid
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
owner {
|
||||
id
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
`,
|
||||
}
|
||||
`,
|
||||
{ paymentId: req.body.event.data.new.id }
|
||||
);
|
||||
document = {
|
||||
..._.pick(req.body.event.data.new, ["id", "invoice_number"]),
|
||||
..._.pick(req.body.event.data.new, [
|
||||
"id",
|
||||
"amount",
|
||||
"created_at",
|
||||
"date",
|
||||
"exportedat",
|
||||
"memo",
|
||||
"payer",
|
||||
"paymentnum",
|
||||
"transactionid",
|
||||
"type",
|
||||
]),
|
||||
...payment.payments_by_pk,
|
||||
bodyshopid: bill.payments_by_pk.job.shopid,
|
||||
bodyshopid: payment.payments_by_pk.job.shopid,
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
const payload = {
|
||||
id: req.body.event.data.new.id,
|
||||
index: req.body.table.name,
|
||||
@@ -176,7 +208,7 @@ async function OpenSearchUpdateHandler(req, res) {
|
||||
|
||||
async function OpensearchSearchHandler(req, res) {
|
||||
try {
|
||||
const { search, bodyshopid } = req.body;
|
||||
const { search, bodyshopid, index } = req.body;
|
||||
if (!req.user) {
|
||||
res.sendStatus(401);
|
||||
return;
|
||||
@@ -205,6 +237,7 @@ async function OpensearchSearchHandler(req, res) {
|
||||
var osClient = await getClient();
|
||||
|
||||
const { body } = await osClient.search({
|
||||
...(index ? { index } : {}),
|
||||
body: {
|
||||
size: 100,
|
||||
query: {
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
exports.servertime = (req, res) => {
|
||||
res.status(200).send(new Date());
|
||||
};
|
||||
|
||||
exports.jsrAuth = async (req, res) => {
|
||||
res.send(
|
||||
"Basic " +
|
||||
Buffer.from(
|
||||
`${process.env.JSR_USER}:${process.env.JSR_PASSWORD}`
|
||||
).toString("base64")
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user