Compare commits

...

25 Commits

Author SHA1 Message Date
Patrick Fic
8a7a5f35c1 IO-1095 unrequire fields on vehicle create. 2021-05-26 10:34:32 -07:00
Patrick Fic
b24c5e7cf1 IO-1128 Change labor allocations table coloring. 2021-05-26 10:19:43 -07:00
Patrick Fic
3e59c60477 IO-1168 Resolve payments export all null error. 2021-05-25 16:31:09 -07:00
Patrick Fic
e89b4fe2a4 IO-1137 Download zip files with appropriate name. 2021-05-25 16:30:29 -07:00
Patrick Fic
73b0542b62 IO-1148 Prefill scheduled completion on intake if not present. 2021-05-25 14:58:50 -07:00
Patrick Fic
c9812c36c0 IO-1129 MIssing color on schedule modal. 2021-05-25 14:47:16 -07:00
Patrick Fic
d62a2c0aaf IO-1095 Remove required fields vehicle/owner. 2021-05-25 14:42:59 -07:00
Patrick Fic
ee15f063ce IO-1158 Change Ins Co Nm to select 2021-05-25 11:21:55 -07:00
Patrick Fic
5f0a683ec1 IO-1161 Line Modal Hours to precision 1. 2021-05-25 09:58:46 -07:00
Patrick Fic
6ae9de7df3 Merged in test (pull request #68)
Release Hotfix for 2021-05-21
2021-05-21 22:18:54 +00:00
Patrick Fic
19aa41ab5b Merged in hotfix/2021-05-21 (pull request #67)
IO-1156 Update order for temporary docs.
2021-05-21 21:04:39 +00:00
Patrick Fic
0494b3a9a6 IO-1156 Update order for temporary docs. 2021-05-21 14:02:25 -07:00
Patrick Fic
01d9dc9033 Added commit # to server api. 2021-05-21 13:47:11 -07:00
Patrick Fic
47b8d8d8b2 Merged in hotfix/2021-05-21 (pull request #66)
IO-1139 Adjust to 1 decimal.
2021-05-21 20:21:07 +00:00
Patrick Fic
6e3453cd90 IO-1139 Adjust to 1 decimal. 2021-05-21 13:18:57 -07:00
Patrick Fic
4e10451bea Merged in hotfix/2021-05-21 (pull request #65)
Hotfix/2021 05 21
2021-05-21 20:10:57 +00:00
Patrick Fic
81d5c8f449 IO-1139 Total hours to 2 decimals. 2021-05-21 13:08:59 -07:00
Patrick Fic
79fa71fc84 IO-1160 Target Touch Time Highlighting. 2021-05-21 12:44:08 -07:00
Patrick Fic
f6378daa89 IO-1151 IO-1159 Calculated Repair & Label Updates 2021-05-21 12:37:54 -07:00
Patrick Fic
f2a4eb1b65 IO-1101 Fix PAP marking of lines. 2021-05-21 09:38:30 -07:00
Patrick Fic
2d19c35177 IO-1147 Default tax rates on parts for manual jobs. 2021-05-21 09:31:55 -07:00
Patrick Fic
9787f7e377 Merged in feature/IOS-7-documents-should-upload-in-chronol (pull request #64)
IOS-7 Added takenat to documents and uploads.
2021-05-21 14:38:28 +00:00
Patrick Fic
3abac3e7ac Merged master into test 2021-05-20 14:58:05 +00:00
Patrick Fic
fddf75b40b IOS-7 Added takenat to documents and uploads. 2021-05-19 17:52:24 -07:00
Patrick Fic
a7878243ee Merged in test (pull request #62)
IO-1145 Remove force token refresh.
2021-05-19 23:31:57 +00:00
37 changed files with 493 additions and 109 deletions

View File

@@ -22,7 +22,7 @@ hooks.js:
module.exports = [ module.exports = [
{ {
path: "/pull", path: "/pull",
command: "git pull && npm i", command: "git pull && yarn && pm2 restart 0",
cwd: "/home/ubuntu/io/", cwd: "/home/ubuntu/io/",
method: "post", method: "post",
}, },

View File

@@ -1,4 +1,4 @@
<babeledit_project version="1.2" be_version="2.7.1"> <babeledit_project be_version="2.7.1" version="1.2">
<!-- <!--
BabelEdit project file BabelEdit project file
@@ -20437,6 +20437,48 @@
</translation> </translation>
</translations> </translations>
</concept_node> </concept_node>
<concept_node>
<name>calc_repair_days</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>calc_repair_days_tt</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<folder_node> <folder_node>
<name>cards</name> <name>cards</name>
<children> <children>

View File

@@ -20,6 +20,7 @@
"dinero.js": "^1.8.1", "dinero.js": "^1.8.1",
"dotenv": "^9.0.2", "dotenv": "^9.0.2",
"env-cmd": "^10.1.0", "env-cmd": "^10.1.0",
"exifr": "^7.0.0",
"firebase": "^8.6.0", "firebase": "^8.6.0",
"graphql": "^15.5.0", "graphql": "^15.5.0",
"i18next": "^20.2.2", "i18next": "^20.2.2",

View File

@@ -7,7 +7,7 @@ import CurrencyFormatter from "../../utils/CurrencyFormatter";
import { DateFormatter, DateTimeFormatter } from "../../utils/DateFormatter"; import { DateFormatter, DateTimeFormatter } from "../../utils/DateFormatter";
import { alphaSort } from "../../utils/sorters"; import { alphaSort } from "../../utils/sorters";
import PaymentExportButton from "../payment-export-button/payment-export-button.component"; import PaymentExportButton from "../payment-export-button/payment-export-button.component";
import { PaymentsExportAllButton } from "../payments-export-all-button/payments-export-all-button.component"; import PaymentsExportAllButton from "../payments-export-all-button/payments-export-all-button.component";
export default function AccountingPayablesTableComponent({ export default function AccountingPayablesTableComponent({
loading, loading,

View File

@@ -5,6 +5,8 @@ import { logImEXEvent } from "../../firebase/firebase.utils";
import { INSERT_NEW_DOCUMENT } from "../../graphql/documents.queries"; import { INSERT_NEW_DOCUMENT } from "../../graphql/documents.queries";
import { axiosAuthInterceptorId } from "../../utils/CleanAxios"; import { axiosAuthInterceptorId } from "../../utils/CleanAxios";
import client from "../../utils/GraphQLClient"; import client from "../../utils/GraphQLClient";
import exifr from "exifr";
//Context: currentUserEmail, bodyshop, jobid, invoiceid //Context: currentUserEmail, bodyshop, jobid, invoiceid
//Required to prevent headers from getting set and rejected from Cloudinary. //Required to prevent headers from getting set and rejected from Cloudinary.
@@ -85,6 +87,7 @@ export const uploadToCloudinary = async (
if (!!onProgress) onProgress({ percent: (e.loaded / e.total) * 100 }); if (!!onProgress) onProgress({ percent: (e.loaded / e.total) * 100 });
}, },
}; };
const formData = new FormData(); const formData = new FormData();
formData.append("file", file); formData.append("file", file);
@@ -122,6 +125,12 @@ export const uploadToCloudinary = async (
} }
//Insert the document with the matching key. //Insert the document with the matching key.
let takenat;
if (fileType.includes("image")) {
const exif = await exifr.parse(file);
console.log(`exif`, exif);
takenat = exif && exif.DateTimeOriginal;
}
const documentInsert = await client.mutate({ const documentInsert = await client.mutate({
mutation: INSERT_NEW_DOCUMENT, mutation: INSERT_NEW_DOCUMENT,
variables: { variables: {
@@ -135,6 +144,7 @@ export const uploadToCloudinary = async (
extension: extension, extension: extension,
bodyshopid: bodyshop.id, bodyshopid: bodyshop.id,
size: cloudinaryUploadResponse.data.bytes || file.size, size: cloudinaryUploadResponse.data.bytes || file.size,
takenat,
}, },
], ],
}, },

View File

@@ -15,6 +15,7 @@ import {
} from "../../../../redux/user/user.selectors"; } from "../../../../redux/user/user.selectors";
import ConfigFormComponents from "../../../config-form-components/config-form-components.component"; import ConfigFormComponents from "../../../config-form-components/config-form-components.component";
import DateTimePicker from "../../../form-date-time-picker/form-date-time-picker.component"; import DateTimePicker from "../../../form-date-time-picker/form-date-time-picker.component";
import moment from "moment-business-days";
const mapStateToProps = createStructuredSelector({ const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop, bodyshop: selectBodyshop,
@@ -133,7 +134,14 @@ export function JobChecklistForm({
initialValues={{ initialValues={{
...(type === "intake" && { ...(type === "intake" && {
addToProduction: true, addToProduction: true,
scheduled_completion: job && job.scheduled_completion, scheduled_completion:
(job && job.scheduled_completion) ||
moment().businessAdd(
(job.labhrs.aggregate.sum.mod_lb_hrs +
job.larhrs.aggregate.sum.mod_lb_hrs) /
bodyshop.target_touchtime,
"days"
),
scheduled_delivery: job && job.scheduled_delivery, scheduled_delivery: job && job.scheduled_delivery,
}), }),
...(type === "deliver" && { ...(type === "deliver" && {

View File

@@ -313,9 +313,12 @@ export function JobLinesComponent({
if (e.key === "clear") { if (e.key === "clear") {
setSelectedLines([]); setSelectedLines([]);
} else { } else {
const markedTypes = [e.key];
if (e.key === "PAN") markedTypes.push("PAP");
if (e.key === "PAS") markedTypes.push("PASL");
setSelectedLines([ setSelectedLines([
...selectedLines, ...selectedLines,
...jobLines.filter((item) => item.part_type === e.key), ...jobLines.filter((item) => markedTypes.includes(item.part_type)),
]); ]);
} }
}; };
@@ -378,7 +381,7 @@ export function JobLinesComponent({
setState({ setState({
...state, ...state,
filteredInfo: { filteredInfo: {
part_type: ["PAN,PAL,PAA,PAS,PASL"], part_type: ["PAN,PAL,PAA,PAP,PAS,PASL"],
}, },
}); });
}} }}

View File

@@ -123,7 +123,7 @@ export default function JobLinesUpsertModalComponent({
// }), // }),
// ]} // ]}
> >
<InputCurrency /> <InputNumber precision={1} />
</Form.Item> </Form.Item>
</LayoutFormRow> </LayoutFormRow>
<LayoutFormRow> <LayoutFormRow>

View File

@@ -26,12 +26,6 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
const { getFieldValue } = form; const { getFieldValue } = form;
return ( return (
<div> <div>
<JobsDetailRatesParts
jobRO={false}
expanded
required={selected && true}
form={form}
/>
<Collapse defaultActiveKey="insurance"> <Collapse defaultActiveKey="insurance">
<Collapse.Panel <Collapse.Panel
key="insurance" key="insurance"
@@ -57,7 +51,13 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
<FormDatePicker /> <FormDatePicker />
</Form.Item> </Form.Item>
<Form.Item label={t("jobs.fields.ins_co_nm")} name="ins_co_nm"> <Form.Item label={t("jobs.fields.ins_co_nm")} name="ins_co_nm">
<Input /> <Select>
{bodyshop.md_ins_cos.map((s) => (
<Select.Option key={s.name} value={s.name}>
{s.name}
</Select.Option>
))}
</Select>
</Form.Item> </Form.Item>
<Form.Item label={t("jobs.fields.ins_addr1")} name="ins_addr1"> <Form.Item label={t("jobs.fields.ins_addr1")} name="ins_addr1">
<Input /> <Input />
@@ -312,6 +312,12 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
</LayoutFormRow> </LayoutFormRow>
</Collapse.Panel> </Collapse.Panel>
</Collapse> </Collapse>
<JobsDetailRatesParts
jobRO={false}
expanded
required={selected && true}
form={form}
/>
</div> </div>
); );
} }

View File

@@ -83,24 +83,12 @@ export default function JobsCreateVehicleInfoNewComponent() {
<Form.Item <Form.Item
label={t("vehicles.fields.plate_st")} label={t("vehicles.fields.plate_st")}
name={["vehicle", "data", "plate_st"]} name={["vehicle", "data", "plate_st"]}
rules={[
{
required: state.vehicle.new,
//message: t("general.validation.required"),
},
]}
> >
<Input disabled={!state.vehicle.new} /> <Input disabled={!state.vehicle.new} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label={t("vehicles.fields.plate_no")} label={t("vehicles.fields.plate_no")}
name={["vehicle", "data", "plate_no"]} name={["vehicle", "data", "plate_no"]}
rules={[
{
required: state.vehicle.new,
//message: t("general.validation.required"),
},
]}
> >
<Input disabled={!state.vehicle.new} /> <Input disabled={!state.vehicle.new} />
</Form.Item> </Form.Item>

View File

@@ -1,4 +1,4 @@
import { DatePicker, Form, Tooltip } from "antd"; import { DatePicker, Form, Statistic, Tooltip } from "antd";
import React, { useMemo } from "react"; import React, { useMemo } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { connect } from "react-redux"; import { connect } from "react-redux";
@@ -23,6 +23,10 @@ export function JobsDetailDatesComponent({ jobRO, job, bodyshop }) {
); );
}, [job.status, bodyshop.md_ro_statuses.post_production_statuses]); }, [job.status, bodyshop.md_ro_statuses.post_production_statuses]);
const calcRepairDays =
job.joblines.reduce((acc, val) => acc + val.mod_lb_hrs, 0) /
(bodyshop.target_touchtime === 0 ? 1 : bodyshop.target_touchtime);
return ( return (
<div> <div>
<FormRow header={t("jobs.forms.estdates")}> <FormRow header={t("jobs.forms.estdates")}>
@@ -52,6 +56,17 @@ export function JobsDetailDatesComponent({ jobRO, job, bodyshop }) {
<Form.Item label={t("jobs.fields.actual_in")} name="actual_in"> <Form.Item label={t("jobs.fields.actual_in")} name="actual_in">
<DateTimePicker disabled={jobRO} /> <DateTimePicker disabled={jobRO} />
</Form.Item> </Form.Item>
<Tooltip
title={t("jobs.labels.calc_repair_days_tt", {
target_touchtime: bodyshop.target_touchtime,
})}
>
<Statistic
value={calcRepairDays}
precision={1}
title={t("jobs.labels.calc_repair_days")}
/>
</Tooltip>
</FormRow> </FormRow>
<FormRow header={t("jobs.forms.repairdates")}> <FormRow header={t("jobs.forms.repairdates")}>
<Form.Item <Form.Item

View File

@@ -54,7 +54,13 @@ export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) {
</Form.Item> </Form.Item>
<Form.Item label={t("jobs.fields.ins_co_nm")} name="ins_co_nm"> <Form.Item label={t("jobs.fields.ins_co_nm")} name="ins_co_nm">
<Input disabled={jobRO} /> <Select disabled={jobRO}>
{bodyshop.md_ins_cos.map((s) => (
<Select.Option key={s.name} value={s.name}>
{s.name}
</Select.Option>
))}
</Select>
</Form.Item> </Form.Item>
<Form.Item label={t("jobs.fields.ins_addr1")} name="ins_addr1"> <Form.Item label={t("jobs.fields.ins_addr1")} name="ins_addr1">
<Input disabled={jobRO} /> <Input disabled={jobRO} />

View File

@@ -1,11 +1,17 @@
import { Button } from "antd"; import { Button, Space } from "antd";
import axios from "axios"; import axios from "axios";
import React from "react"; import React, { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils"; import { logImEXEvent } from "../../firebase/firebase.utils";
import cleanAxios from "../../utils/CleanAxios";
import formatBytes from "../../utils/formatbytes";
export default function JobsDocumentsDownloadButton({ galleryImages }) { export default function JobsDocumentsDownloadButton({
galleryImages,
identifier,
}) {
const { t } = useTranslation(); const { t } = useTranslation();
const [download, setDownload] = useState(null);
const imagesToDownload = [ const imagesToDownload = [
...galleryImages.images.filter((image) => image.isSelected), ...galleryImages.images.filter((image) => image.isSelected),
...galleryImages.other.filter((image) => image.isSelected), ...galleryImages.other.filter((image) => image.isSelected),
@@ -18,13 +24,68 @@ export default function JobsDocumentsDownloadButton({ galleryImages }) {
ids: imagesToDownload.map((_) => _.key), ids: imagesToDownload.map((_) => _.key),
}) })
.then((r) => { .then((r) => {
window.open(r.data); // window.open(r.data);
downloadAs(
r.data,
`${identifier || "images"}.zip`,
(progressEvent) => {
const percentage = Math.round(
(progressEvent.loaded * 100) / progressEvent.total
);
console.log(progressEvent, percentage);
setDownload((currentDownloadState) => {
return {
downloaded: progressEvent.loaded || 0,
speed:
(progressEvent.loaded || 0) -
((currentDownloadState && currentDownloadState.downloaded) ||
0),
};
});
},
() => setDownload(null)
);
}); });
}; };
return ( return (
<Button disabled={imagesToDownload.length < 1} onClick={handleDownload}> <>
{t("documents.actions.download")} <Button
</Button> loading={!!download}
disabled={imagesToDownload.length < 1}
onClick={handleDownload}
>
<Space>
<span>{t("documents.actions.download")}</span>
{download && (
<span>{`(${formatBytes(download.downloaded)} @ ${formatBytes(
download.speed
)} / second)`}</span>
)}
</Space>
</Button>
</>
); );
} }
const downloadAs = (url, name, onDownloadProgress, onCompleted) => {
cleanAxios
.get(url, {
headers: {
"Content-Type": "application/octet-stream",
},
responseType: "blob",
onDownloadProgress: onDownloadProgress,
})
.then((response) => {
onCompleted && onCompleted();
const a = document.createElement("a");
const url = window.URL.createObjectURL(response.data);
a.href = url;
a.download = name;
a.click();
})
.catch((err) => {
console.log("error", err);
});
};

View File

@@ -17,7 +17,7 @@ function JobsDocumentsComponent({
billId, billId,
billsCallback, billsCallback,
totalSize, totalSize,
bodyshop, downloadIdentifier,
ignoreSizeLimit, ignoreSizeLimit,
}) { }) {
const [galleryImages, setgalleryImages] = useState({ images: [], other: [] }); const [galleryImages, setgalleryImages] = useState({ images: [], other: [] });
@@ -117,7 +117,10 @@ function JobsDocumentsComponent({
galleryImages={galleryImages} galleryImages={galleryImages}
setGalleryImages={setgalleryImages} setGalleryImages={setgalleryImages}
/> />
<JobsDocumentsDownloadButton galleryImages={galleryImages} /> <JobsDocumentsDownloadButton
galleryImages={galleryImages}
identifier={downloadIdentifier}
/>
<JobsDocumentsDeleteButton <JobsDocumentsDeleteButton
galleryImages={galleryImages} galleryImages={galleryImages}
deletionCallback={billsCallback || refetch} deletionCallback={billsCallback || refetch}
@@ -173,6 +176,7 @@ function JobsDocumentsComponent({
backgroundImage: <FileExcelFilled />, backgroundImage: <FileExcelFilled />,
height: "100%", height: "100%",
width: "100%", width: "100%",
cursor: "pointer",
}; };
}} }}
onClickThumbnail={(index) => { onClickThumbnail={(index) => {

View File

@@ -23,6 +23,7 @@ export default function JobsDocumentsContainer({
return ( return (
<JobDocuments <JobDocuments
data={(data && data.documents) || documentsList || []} data={(data && data.documents) || documentsList || []}
downloadIdentifier={data && data.jobs_by_pk.ro_number}
totalSize={data && data.documents_aggregate.aggregate.sum.size} totalSize={data && data.documents_aggregate.aggregate.sum.size}
billId={billId} billId={billId}
jobId={jobId} jobId={jobId}

View File

@@ -110,7 +110,7 @@ export function LaborAllocationsTable({
render: (text, record) => ( render: (text, record) => (
<strong <strong
style={{ style={{
color: record.difference > 0 ? "green" : "red", color: record.difference >= 0 ? "green" : "red",
}} }}
> >
{record.difference} {record.difference}

View File

@@ -31,55 +31,19 @@ export default function OwnerDetailFormComponent({ form, loading }) {
</LayoutFormRow> </LayoutFormRow>
<LayoutFormRow header={t("owners.forms.address")}> <LayoutFormRow header={t("owners.forms.address")}>
<Form.Item <Form.Item label={t("owners.fields.ownr_addr1")} name="ownr_addr1">
label={t("owners.fields.ownr_addr1")}
name="ownr_addr1"
rules={[
{
required: true,
//message: t("general.validation.required"),
},
]}
>
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item label={t("owners.fields.ownr_addr2")} name="ownr_addr2"> <Form.Item label={t("owners.fields.ownr_addr2")} name="ownr_addr2">
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item <Form.Item label={t("owners.fields.ownr_city")} name="ownr_city">
label={t("owners.fields.ownr_city")}
name="ownr_city"
rules={[
{
required: true,
//message: t("general.validation.required"),
},
]}
>
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item <Form.Item label={t("owners.fields.ownr_st")} name="ownr_st">
label={t("owners.fields.ownr_st")}
name="ownr_st"
rules={[
{
required: true,
//message: t("general.validation.required"),
},
]}
>
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item <Form.Item label={t("owners.fields.ownr_zip")} name="ownr_zip">
label={t("owners.fields.ownr_zip")}
name="ownr_zip"
rules={[
{
required: true,
//message: t("general.validation.required"),
},
]}
>
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item label={t("owners.fields.ownr_ctry")} name="ownr_ctry"> <Form.Item label={t("owners.fields.ownr_ctry")} name="ownr_ctry">

View File

@@ -225,8 +225,10 @@ const r = ({ technician, state }) => {
sortOrder: sortOrder:
state.sortedInfo.columnKey === "totalhours" && state.sortedInfo.order, state.sortedInfo.columnKey === "totalhours" && state.sortedInfo.order,
render: (text, record) => render: (text, record) =>
record.labhrs.aggregate.sum.mod_lb_hrs + (
record.larhrs.aggregate.sum.mod_lb_hrs, record.labhrs.aggregate.sum.mod_lb_hrs +
record.larhrs.aggregate.sum.mod_lb_hrs
).toFixed(1),
}, },
{ {
title: i18n.t("production.labels.alert"), title: i18n.t("production.labels.alert"),

View File

@@ -1,6 +1,20 @@
import moment from "moment"; import moment from "moment";
import React, { useMemo } from "react"; import React, { useMemo } from "react";
export default function ProductionlistColumnTouchTime({ job }) { import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
const mapDispatchToProps = (dispatch) => ({
//setUserLanguage: language => dispatch(setUserLanguage(language))
});
export default connect(
mapStateToProps,
mapDispatchToProps
)(ProductionlistColumnTouchTime);
export function ProductionlistColumnTouchTime({ bodyshop, job }) {
let ct = useMemo(() => { let ct = useMemo(() => {
if (!!job.actual_in) { if (!!job.actual_in) {
const totalHrs = const totalHrs =
@@ -18,5 +32,7 @@ export default function ProductionlistColumnTouchTime({ job }) {
return 0; return 0;
}, [job]); }, [job]);
return <span>{ct}</span>; const underTarget = ct < bodyshop.target_touchtime;
return <span style={{ color: underTarget && "tomato" }}>{ct}</span>;
} }

View File

@@ -76,28 +76,10 @@ export default function VehicleDetailFormComponent({ form, loading }) {
</LayoutFormRow> </LayoutFormRow>
<LayoutFormRow header={t("vehicles.forms.registration")}> <LayoutFormRow header={t("vehicles.forms.registration")}>
<Form.Item <Form.Item label={t("vehicles.fields.plate_st")} name="plate_st">
label={t("vehicles.fields.plate_st")}
name="plate_st"
rules={[
{
required: true,
//message: t("general.validation.required"),
},
]}
>
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item <Form.Item label={t("vehicles.fields.plate_no")} name="plate_no">
label={t("vehicles.fields.plate_no")}
name="plate_no"
rules={[
{
required: true,
//message: t("general.validation.required"),
},
]}
>
<Input /> <Input />
</Form.Item> </Form.Item>
</LayoutFormRow> </LayoutFormRow>

View File

@@ -39,7 +39,7 @@ function VehicleDetailFormContainer({ vehicle, refetch }) {
return ( return (
<> <>
<PageHeader <PageHeader
title={t("menus.header.owners")} title={t("menus.header.vehicles")}
extra={ extra={
<Button <Button
type="primary" type="primary"

View File

@@ -85,6 +85,7 @@ export const INSERT_APPOINTMENT = gql`
title title
isintake isintake
block block
color
} }
} }
update_jobs( update_jobs(
@@ -110,6 +111,7 @@ export const QUERY_APPOINTMENT_BY_DATE = gql`
title title
isintake isintake
block block
color
job { job {
alt_transport alt_transport
ro_number ro_number

View File

@@ -197,6 +197,28 @@ export const QUERY_INTAKE_CHECKLIST = gql`
scheduled_delivery scheduled_delivery
intakechecklist intakechecklist
status status
labhrs: joblines_aggregate(
where: {
_and: [{ mod_lbr_ty: { _neq: "LAR" } }, { removed: { _eq: false } }]
}
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(
where: {
_and: [{ mod_lbr_ty: { _eq: "LAR" } }, { removed: { _eq: false } }]
}
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
} }
} }
`; `;

View File

@@ -2,6 +2,10 @@ import { gql } from "@apollo/client";
export const GET_DOCUMENTS_BY_JOB = gql` export const GET_DOCUMENTS_BY_JOB = gql`
query GET_DOCUMENTS_BY_JOB($jobId: uuid!) { query GET_DOCUMENTS_BY_JOB($jobId: uuid!) {
jobs_by_pk(id: $jobId) {
id
ro_number
}
documents_aggregate(where: { jobid: { _eq: $jobId } }) { documents_aggregate(where: { jobid: { _eq: $jobId } }) {
aggregate { aggregate {
sum { sum {
@@ -9,15 +13,13 @@ export const GET_DOCUMENTS_BY_JOB = gql`
} }
} }
} }
documents( documents(order_by: { takenat: desc }, where: { jobid: { _eq: $jobId } }) {
order_by: { updated_at: desc }
where: { jobid: { _eq: $jobId } }
) {
id id
name name
key key
type type
size size
takenat
bill { bill {
id id
invoice_number invoice_number
@@ -51,6 +53,7 @@ export const INSERT_NEW_DOCUMENT = gql`
name name
key key
size size
takenat
} }
} }
} }
@@ -70,7 +73,7 @@ export const QUERY_TEMPORARY_DOCS = gql`
query QUERY_TEMPORARY_DOCS { query QUERY_TEMPORARY_DOCS {
documents( documents(
where: { jobid: { _is_null: true } } where: { jobid: { _is_null: true } }
order_by: { updated_at: desc } order_by: { takenat: desc }
) { ) {
id id
name name
@@ -78,6 +81,7 @@ export const QUERY_TEMPORARY_DOCS = gql`
type type
extension extension
size size
takenat
} }
} }
`; `;
@@ -94,6 +98,7 @@ export const UPDATE_DOCUMENT = gql`
type type
key key
size size
takenat
} }
} }
`; `;

View File

@@ -155,6 +155,13 @@ function JobsCreateContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) {
layout="vertical" layout="vertical"
autoComplete={"off"} autoComplete={"off"}
initialValues={{ initialValues={{
tax_tow_rt: bodyshop.bill_tax_rates.state_tax_rate / 100,
tax_str_rt: bodyshop.bill_tax_rates.state_tax_rate / 100,
tax_paint_mat_rt: bodyshop.bill_tax_rates.state_tax_rate / 100,
tax_shop_mat_rt: bodyshop.bill_tax_rates.state_tax_rate / 100,
tax_sub_rt: bodyshop.bill_tax_rates.state_tax_rate / 100,
tax_lbr_rt: bodyshop.bill_tax_rates.state_tax_rate / 100,
tax_levies_rt: bodyshop.bill_tax_rates.state_tax_rate / 100,
parts_tax_rates: { parts_tax_rates: {
PAA: { PAA: {
prt_type: "PAA", prt_type: "PAA",
@@ -220,6 +227,30 @@ function JobsCreateContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) {
prt_tax_in: true, prt_tax_in: true,
prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100, prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100,
}, },
PASL: {
prt_type: "PASL",
prt_discp: 0,
prt_mktyp: false,
prt_mkupp: 0,
prt_tax_in: true,
prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100,
},
PAP: {
prt_type: "PAP",
prt_discp: 0,
prt_mktyp: false,
prt_mkupp: 0,
prt_tax_in: true,
prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100,
},
PAO: {
prt_type: "PAO",
prt_discp: 0,
prt_mktyp: false,
prt_mkupp: 0,
prt_tax_in: true,
prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100,
},
}, },
}} }}
> >

View File

@@ -1226,6 +1226,8 @@
"rate": "PVRT Rate" "rate": "PVRT Rate"
}, },
"ca_gst_all_if_null": "If the job is marked as a \"GST Registrant\" and this value is set to $0, the customer will be responsible for paying all of the GST by default. ", "ca_gst_all_if_null": "If the job is marked as a \"GST Registrant\" and this value is set to $0, the customer will be responsible for paying all of the GST by default. ",
"calc_repair_days": "Calculated Repair Days",
"calc_repair_days_tt": "This is the approximate number of days required to complete the repair according to the target touch time in your shop configuration (current set to {{target_touchtime}}).",
"cards": { "cards": {
"customer": "Customer Information", "customer": "Customer Information",
"damage": "Area of Damage", "damage": "Area of Damage",

View File

@@ -1226,6 +1226,8 @@
"rate": "" "rate": ""
}, },
"ca_gst_all_if_null": "", "ca_gst_all_if_null": "",
"calc_repair_days": "",
"calc_repair_days_tt": "",
"cards": { "cards": {
"customer": "Información al cliente", "customer": "Información al cliente",
"damage": "Área de Daño", "damage": "Área de Daño",

View File

@@ -1226,6 +1226,8 @@
"rate": "" "rate": ""
}, },
"ca_gst_all_if_null": "", "ca_gst_all_if_null": "",
"calc_repair_days": "",
"calc_repair_days_tt": "",
"cards": { "cards": {
"customer": "Informations client", "customer": "Informations client",
"damage": "Zone de dommages", "damage": "Zone de dommages",

View File

@@ -5696,6 +5696,11 @@ exenv@^1.2.2:
resolved "https://registry.npmjs.org/exenv/-/exenv-1.2.2.tgz" resolved "https://registry.npmjs.org/exenv/-/exenv-1.2.2.tgz"
integrity sha1-KueOhdmJQVhnCwPUe+wfA72Ru50= integrity sha1-KueOhdmJQVhnCwPUe+wfA72Ru50=
exifr@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/exifr/-/exifr-7.0.0.tgz#065d54639f2999ac901dd8475db99b4d3f31f11e"
integrity sha512-5JRtopcolAfsX4YGcvTkldXyFDC+VPV40DxhSdRvrDr4OJQHtyccNoYl4aRzYBnVVpNueMmenS0KhzLiyNSfEQ==
exit@^0.1.2: exit@^0.1.2:
version "0.1.2" version "0.1.2"
resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz" resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz"

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."documents" DROP COLUMN "takenat";
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."documents" ADD COLUMN "takenat" timestamptz NULL;
type: run_sql

View File

@@ -0,0 +1,46 @@
- args:
role: user
table:
name: documents
schema: public
type: drop_insert_permission
- args:
permission:
check:
_or:
- job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
- bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- billid
- bodyshopid
- created_at
- extension
- id
- jobid
- key
- name
- size
- type
- updated_at
- uploaded_by
set: {}
role: user
table:
name: documents
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,47 @@
- args:
role: user
table:
name: documents
schema: public
type: drop_insert_permission
- args:
permission:
check:
_or:
- job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
- bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- billid
- bodyshopid
- created_at
- extension
- id
- jobid
- key
- name
- size
- takenat
- type
- updated_at
- uploaded_by
set: {}
role: user
table:
name: documents
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,47 @@
- args:
role: user
table:
name: documents
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: true
columns:
- billid
- bodyshopid
- created_at
- extension
- id
- jobid
- key
- name
- size
- type
- updated_at
- uploaded_by
computed_fields: []
filter:
_or:
- job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
- bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: documents
schema: public
type: create_select_permission

View File

@@ -0,0 +1,48 @@
- args:
role: user
table:
name: documents
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: true
columns:
- billid
- bodyshopid
- created_at
- extension
- id
- jobid
- key
- name
- size
- takenat
- type
- updated_at
- uploaded_by
computed_fields: []
filter:
_or:
- job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
- bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: documents
schema: public
type: create_select_permission

View File

@@ -1520,6 +1520,7 @@ tables:
- key - key
- name - name
- size - size
- takenat
- type - type
- updated_at - updated_at
- uploaded_by - uploaded_by
@@ -1536,6 +1537,7 @@ tables:
- key - key
- name - name
- size - size
- takenat
- type - type
- updated_at - updated_at
- uploaded_by - uploaded_by

View File

@@ -34,7 +34,11 @@ app.post("/sendemail", fb.validateFirebaseIdToken, sendEmail.sendEmail);
//Test route to ensure Express is responding. //Test route to ensure Express is responding.
app.get("/test", async function (req, res) { app.get("/test", async function (req, res) {
console.log("Incoming request verified.", req); console.log("Incoming request verified.", req);
res.status(200).send("OK"); const Commit = require("child_process").execSync(
"git rev-parse --short HEAD"
);
res.status(200).send(`OK - ${Commit}`);
}); });
const test = require("./server/_test/test.js"); const test = require("./server/_test/test.js");
app.post("/test", test.testResponse); app.post("/test", test.testResponse);