Compare commits

..

1 Commits

Author SHA1 Message Date
Patrick Fic
92103df2a9 IO-2348 add http auth for media. 2023-07-11 15:46:58 -07:00
40 changed files with 117 additions and 378 deletions

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
@@ -4318,27 +4318,6 @@
<folder_node>
<name>dms</name>
<children>
<concept_node>
<name>apcontrol</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>appostingaccount</name>
<definition_loaded>false</definition_loaded>

View File

@@ -1,6 +1,6 @@
import Icon, { UploadOutlined } from "@ant-design/icons";
import { useApolloClient } from "@apollo/client";
import { useTreatments } from "@splitsoftware/splitio-react";
import { MdOpenInNew } from "react-icons/md";
import {
Alert,
Divider,
@@ -12,17 +12,14 @@ import {
Switch,
Upload,
} from "antd";
import moment from "moment";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { MdOpenInNew } from "react-icons/md";
import { connect } from "react-redux";
import { Link } from "react-router-dom";
import { createStructuredSelector } from "reselect";
import { CHECK_BILL_INVOICE_NUMBER } from "../../graphql/bills.queries";
import { selectBodyshop } from "../../redux/user/user.selectors";
import AlertComponent from "../alert/alert.component";
import BillFormLinesExtended from "../bill-form-lines-extended/bill-form-lines-extended.component";
import FormDatePicker from "../form-date-picker/form-date-picker.component";
import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component";
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
@@ -31,6 +28,8 @@ import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import VendorSearchSelect from "../vendor-search-select/vendor-search-select.component";
import BillFormLines from "./bill-form.lines.component";
import { CalculateBillTotal } from "./bill-form.totals.utility";
import { useTreatments } from "@splitsoftware/splitio-react";
import BillFormLinesExtended from "../bill-form-lines-extended/bill-form-lines-extended.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -59,11 +58,6 @@ export function BillFormComponent({
{},
bodyshop.imexshopid
);
const { ClosingPeriod } = useTreatments(
["ClosingPeriod"],
{},
bodyshop.imexshopid
);
const handleVendorSelect = (props, opt) => {
setDiscount(opt.discount);
@@ -265,37 +259,6 @@ export function BillFormComponent({
required: true,
//message: t("general.validation.required"),
},
({ getFieldValue }) => ({
validator(rule, value) {
if (
ClosingPeriod.treatment === "on" &&
bodyshop.accountingconfig.ClosingPeriod
) {
if (
moment(value)
.startOf("day")
.isSameOrAfter(
moment(
bodyshop.accountingconfig.ClosingPeriod[0]
).startOf("day")
) &&
moment(value)
.startOf("day")
.isSameOrBefore(
moment(
bodyshop.accountingconfig.ClosingPeriod[1]
).endOf("day")
)
) {
return Promise.resolve();
} else {
return Promise.reject(t("bills.validation.closingperiod"));
}
} else {
return Promise.resolve();
}
},
}),
]}
>
<FormDatePicker disabled={disabled} />

View File

@@ -1,5 +1,5 @@
import Icon from "@ant-design/icons";
import { Tooltip } from "antd";
import { Spin, Tooltip } from "antd";
import i18n from "i18next";
import moment from "moment";
import React, { useEffect, useRef } from "react";
@@ -12,6 +12,8 @@ import {
} from "react-virtualized";
import { DateTimeFormatter } from "../../utils/DateFormatter";
import "./chat-message-list.styles.scss";
import { useState } from "react";
import axios from "axios";
export default function ChatMessageListComponent({ messages }) {
const virtualizedListRef = useRef(null);
@@ -95,9 +97,7 @@ const MessageRender = (message) => {
key={idx}
style={{ display: "flex", justifyContent: "center" }}
>
<a href={i} target="__blank">
<img alt="Received" className="message-img" src={i} />
</a>
<ImageDisplay src={i} />
</div>
))}
<div>{message.text}</div>
@@ -116,3 +116,21 @@ const StatusRender = (status) => {
return null;
}
};
const ImageDisplay = ({ src }) => {
const [state, setstate] = useState({ loading: true, url: null });
useEffect(() => {
axios
.post("/sms/fetchmedia", { mediaUrl: src })
.then(({ data }) => setstate({ loading: false, url: data }));
}, [src]);
if (state.loading === true) return <Spin />;
return (
<a href={i} target="__blank">
<img alt="Received" className="message-img" src={state.url} />
</a>
);
};

View File

@@ -59,14 +59,6 @@ export default function ContractsCarsComponent({
sortOrder:
state.sortedInfo.columnKey === "model" && state.sortedInfo.order,
},
{
title: t("courtesycars.fields.color"),
dataIndex: "color",
key: "color",
sorter: (a, b) => alphaSort(a.color, b.color),
sortOrder:
state.sortedInfo.columnKey === "color" && state.sortedInfo.order,
},
{
title: t("courtesycars.fields.plate"),
dataIndex: "plate",
@@ -101,9 +93,6 @@ export default function ContractsCarsComponent({
(cc.model || "")
.toLowerCase()
.includes(state.search.toLowerCase()) ||
(cc.color || "")
.toLowerCase()
.includes(state.search.toLowerCase()) ||
(cc.plate || "").toLowerCase().includes(state.search.toLowerCase())
);

View File

@@ -1,14 +1,14 @@
import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component";
import { useMutation } from "@apollo/client";
import { Button, Form, notification } from "antd";
import moment from "moment";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import AuditTrailMapping from "../../utils/AuditTrailMappings";
import FormDatePicker from "../form-date-picker/form-date-picker.component";
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import moment from "moment";
import FormDatePicker from "../form-date-picker/form-date-picker.component";
import AuditTrailMapping from "../../utils/AuditTrailMappings";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -38,8 +38,8 @@ export function JobsAdminDatesChange({ insertAuditTrail, job }) {
setLoading(true);
const result = await updateJob({
variables: { jobId: job.id, job: values },
refetchQueries: ["GET_JOB_BY_PK"],
awaitRefetchQueries: true,
refetchQueries: ['GET_JOB_BY_PK'],
awaitRefetchQueries:true
});
const changedAuditFields = form.getFieldsValue(
@@ -126,10 +126,7 @@ export function JobsAdminDatesChange({ insertAuditTrail, job }) {
<Form.Item label={t("jobs.fields.actual_in")} name="actual_in">
<DateTimePicker />
</Form.Item>
<Form.Item
label={t("jobs.fields.date_repairstarted")}
name="date_repairstarted"
>
<Form.Item label={t("jobs.fields.date_repairstarted")} name="date_repairstarted">
<DateTimePicker />
</Form.Item>
<Form.Item
@@ -176,9 +173,6 @@ export function JobsAdminDatesChange({ insertAuditTrail, job }) {
>
<DateTimePicker />
</Form.Item>
<Form.Item label={t("jobs.fields.date_void")} name="date_void">
<DateTimePicker />
</Form.Item>
</LayoutFormRow>
</Form>

View File

@@ -1,18 +1,19 @@
import { gql, useMutation } from "@apollo/client";
import { useMutation } from "@apollo/client";
import { Button, notification } from "antd";
import { gql } from "@apollo/client";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import moment from "moment";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
import { insertAuditTrail } from "../../redux/application/application.actions";
import {
selectBodyshop,
selectCurrentUser,
} from "../../redux/user/user.selectors";
import moment from "moment";
import AuditTrailMapping from "../../utils/AuditTrailMappings";
import { insertAuditTrail } from "../../redux/application/application.actions";
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
currentUser: selectCurrentUser,
@@ -149,10 +150,6 @@ export function JobAdminMarkReexport({
if (!result.errors) {
notification["success"]({ message: t("jobs.successes.save") });
insertAuditTrail({
jobid: job.id,
operation: AuditTrailMapping.admin_jobuninvoice(),
});
} else {
notification["error"]({
message: t("jobs.errors.saving", {

View File

@@ -33,9 +33,8 @@ export function JobsAdminUnvoid({
mutation UNVOID_JOB($jobId: uuid!) {
update_jobs_by_pk(pk_columns: {id: $jobId}, _set: {voided: false, status: "${
bodyshop.md_ro_statuses.default_imported
}", date_void: null}) {
}"}) {
id
date_void
voided
status
}

View File

@@ -141,10 +141,6 @@ export function JobsDetailDatesComponent({ jobRO, job, bodyshop }) {
<Form.Item label={t("jobs.fields.date_exported")} name="date_exported">
<DateTimePicker disabled={true || jobRO} />
</Form.Item>
<Form.Item label={t("jobs.fields.date_void")} name="date_void">
<DateTimePicker disabled={true || jobRO} />
</Form.Item>
</FormRow>
</div>
);

View File

@@ -5,10 +5,10 @@ import {
Dropdown,
Form,
Menu,
notification,
Popconfirm,
Popover,
Select,
notification,
} from "antd";
import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
@@ -24,12 +24,12 @@ import {
selectBodyshop,
selectCurrentUser,
} from "../../redux/user/user.selectors";
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
import JobsDetailHeaderActionsAddevent from "./jobs-detail-header-actions.addevent";
import AddToProduction from "./jobs-detail-header-actions.addtoproduction.util";
import JobsDetaiLheaderCsi from "./jobs-detail-header-actions.csi.component";
import DuplicateJob from "./jobs-detail-header-actions.duplicate.util";
import JobsDetailHeaderActionsExportcustdataComponent from "./jobs-detail-header-actions.exportcustdata.component";
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -480,7 +480,6 @@ export function JobsDetailHeaderActions({
scheduled_in: null,
scheduled_completion: null,
inproduction: false,
date_void: new Date(),
},
note: [
{

View File

@@ -47,7 +47,9 @@ export function ScoreboardChart({ sbEntriesByDate, bodyshop }) {
bodyhrs: dayAcc.bodyhrs + dayVal.bodyhrs,
painthrs: dayAcc.painthrs + dayVal.painthrs,
sales:
dayAcc.sales + dayVal.job.job_totals.totals.subtotal.amount / 100,
dayAcc.painthrs +
dayVal.job.job_totals.totals.subtotal.amount / 100 +
2500,
};
},
{ bodyhrs: 0, painthrs: 0, sales: 0 }

View File

@@ -1,14 +1,14 @@
import { useMutation, useQuery } from "@apollo/client";
import { Form, notification } from "antd";
import moment from "moment";
import React, { useEffect, useState } from "react";
import ShopInfoComponent from "./shop-info.component";
import { Form, notification } from "antd";
import { useQuery, useMutation } from "@apollo/client";
import { QUERY_BODYSHOP, UPDATE_SHOP } from "../../graphql/bodyshop.queries";
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
import AlertComponent from "../alert/alert.component";
import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
import { QUERY_BODYSHOP, UPDATE_SHOP } from "../../graphql/bodyshop.queries";
import AlertComponent from "../alert/alert.component";
import FormsFieldChanged from "../form-fields-changed-alert/form-fields-changed-alert.component";
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
import ShopInfoComponent from "./shop-info.component";
import moment from "moment";
export default function ShopInfoContainer() {
const [form] = Form.useForm();
const { t } = useTranslation();
@@ -52,28 +52,13 @@ export default function ShopInfoContainer() {
onFinish={handleFinish}
initialValues={
data
? data.bodyshops[0].accountingconfig.ClosingPeriod
? {
...data.bodyshops[0],
accountingconfig: {
...data.bodyshops[0].accountingconfig,
ClosingPeriod: [
moment(data.bodyshops[0].accountingconfig.ClosingPeriod[0]),
moment(data.bodyshops[0].accountingconfig.ClosingPeriod[1]),
],
},
schedule_start_time: moment(
data.bodyshops[0].schedule_start_time
),
schedule_end_time: moment(data.bodyshops[0].schedule_end_time),
}
: {
...data.bodyshops[0],
schedule_start_time: moment(
data.bodyshops[0].schedule_start_time
),
schedule_end_time: moment(data.bodyshops[0].schedule_end_time),
}
? {
...data.bodyshops[0],
schedule_start_time: moment(
data.bodyshops[0].schedule_start_time
),
schedule_end_time: moment(data.bodyshops[0].schedule_end_time),
}
: null
}
>

View File

@@ -1,8 +1,6 @@
import { DeleteFilled } from "@ant-design/icons";
import { useTreatments } from "@splitsoftware/splitio-react";
import {
Button,
DatePicker,
Form,
Input,
InputNumber,
@@ -11,13 +9,8 @@ import {
Space,
Switch,
} from "antd";
import momentTZ from "moment-timezone";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import DatePickerRanges from "../../utils/DatePickerRanges";
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
import FormItemEmail from "../form-items-formatted/email-form-item.component";
import PhoneFormItem, {
@@ -25,22 +18,12 @@ import PhoneFormItem, {
} from "../form-items-formatted/phone-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";
const timeZonesList = momentTZ.tz.names();
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
const mapDispatchToProps = (dispatch) => ({
//setUserLanguage: language => dispatch(setUserLanguage(language))
});
export default connect(mapStateToProps, mapDispatchToProps)(ShopInfoGeneral);
export function ShopInfoGeneral({ form, bodyshop }) {
import momentTZ from "moment-timezone";
const timeZonesList = momentTZ.tz.names();
export default function ShopInfoGeneral({ form }) {
const { t } = useTranslation();
const { ClosingPeriod } = useTreatments(
["ClosingPeriod"],
{},
bodyshop && bodyshop.imexshopid
);
return (
<div>
@@ -409,20 +392,6 @@ export function ShopInfoGeneral({ form, bodyshop }) {
>
<Select mode="tags" />
</Form.Item>
{ClosingPeriod.treatment === "on" && (
<>
<Form.Item
allowClear
name={["accountingconfig", "ClosingPeriod"]}
label={t("bodyshop.fields.closingperiod")} //{t("reportcenter.labels.dates")}
>
<DatePicker.RangePicker
format="MM/DD/YYYY"
ranges={DatePickerRanges}
/>
</Form.Item>
</>
)}
</LayoutFormRow>
<LayoutFormRow
header={t("bodyshop.labels.scoreboardsetup")}
@@ -633,20 +602,6 @@ export function ShopInfoGeneral({ form, bodyshop }) {
>
<Select mode="tags" />
</Form.Item>
<Form.Item
name={["md_email_cc", "parts_return_slip"]}
label={t("bodyshop.fields.md_email_cc", {
template: "parts_return_slip",
})}
rules={[
{
//message: t("general.validation.required"),
type: "array",
},
]}
>
<Select mode="tags" />
</Form.Item>
<Form.Item
name={["tt_allow_post_to_invoiced"]}
label={t("bodyshop.fields.tt_allow_post_to_invoiced")}

View File

@@ -175,19 +175,6 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
/>
</Form.Item>
)}
{bodyshop.pbs_serialnumber && (
<Form.Item
label={t("bodyshop.fields.dms.apcontrol")}
name={["pbs_configuration", "apcontrol"]}
>
<Select
options={[
{ value: "ro", label: "RO Number" },
{ value: "vendordmsid", label: "Vendor DMS ID" },
]}
/>
</Form.Item>
)}
</LayoutFormRow>
<LayoutFormRow header={t("bodyshop.labels.dms.cdk.payers")}>
<Form.List name={["cdk_configuration", "payers"]}>

View File

@@ -5,10 +5,10 @@ import {
Col,
Form,
InputNumber,
notification,
Popover,
Row,
Select,
notification,
} from "antd";
import axios from "axios";
import React, { useState } from "react";
@@ -16,14 +16,13 @@ import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { logImEXEvent } from "../../firebase/firebase.utils";
import { GET_LINE_TICKET_BY_PK } from "../../graphql/jobs-lines.queries";
import { UPDATE_JOB_STATUS } from "../../graphql/jobs.queries";
import { UPDATE_TIME_TICKET } from "../../graphql/timetickets.queries";
import { selectTechnician } from "../../redux/tech/tech.selectors";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { CalculateAllocationsTotals } from "../labor-allocations-table/labor-allocations-table.utility";
import TechJobClockoutDelete from "../tech-job-clock-out-delete/tech-job-clock-out-delete.component";
import { LaborAllocationContainer } from "../time-ticket-modal/time-ticket-modal.component";
import { GET_LINE_TICKET_BY_PK } from "../../graphql/jobs-lines.queries";
import { CalculateAllocationsTotals } from "../labor-allocations-table/labor-allocations-table.utility";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -41,7 +40,6 @@ export function TechClockOffButton({
}) {
const [loading, setLoading] = useState(false);
const [updateTimeticket] = useMutation(UPDATE_TIME_TICKET);
const [updateJobStatus] = useMutation(UPDATE_JOB_STATUS);
const [form] = Form.useForm();
const { queryLoading, data: lineTicketData } = useQuery(
GET_LINE_TICKET_BY_PK,
@@ -61,8 +59,7 @@ export function TechClockOffButton({
const handleFinish = async (values) => {
logImEXEvent("tech_clock_out_job");
const status = values.status;
delete values.status;
setLoading(true);
const result = await updateTimeticket({
variables: {
@@ -101,26 +98,6 @@ export function TechClockOffButton({
message: t("timetickets.successes.clockedout"),
});
}
if (!isShiftTicket) {
const job_update_result = await updateJobStatus({
variables: {
jobId: jobId,
status: status,
},
});
if (!!job_update_result.errors) {
notification["error"]({
message: t("jobs.errors.updating", {
message: JSON.stringify(result.errors),
}),
});
} else {
notification["success"]({
message: t("jobs.successes.updated"),
});
}
}
setLoading(false);
if (completedCallback) completedCallback();
};
@@ -218,6 +195,7 @@ export function TechClockOffButton({
</Form.Item>
</div>
) : null}
<Form.Item
name="cost_center"
label={t("timetickets.fields.cost_center")}
@@ -250,29 +228,6 @@ export function TechClockOffButton({
</Select>
</Form.Item>
{isShiftTicket ? (
<div></div>
) : (
<Form.Item
name="status"
label={t("jobs.fields.status")}
initialValue={
lineTicketData && lineTicketData.jobs_by_pk.status
}
rules={[
{
required: true,
//message: t("general.validation.required"),
},
]}
>
<Select>
{bodyshop.md_ro_statuses.production_statuses.map((item) => (
<Select.Option key={item}></Select.Option>
))}
</Select>
</Form.Item>
)}
<Button type="primary" htmlType="submit" loading={loading}>
{t("general.actions.save")}
</Button>

View File

@@ -34,7 +34,6 @@ export const GET_LINE_TICKET_BY_PK = gql`
id
lbr_adjustments
converted
status
}
joblines(where: { jobid: { _eq: $id }, removed: { _eq: false } }) {
id

View File

@@ -682,7 +682,6 @@ export const GET_JOB_BY_PK = gql`
date_rentalresp
date_exported
date_repairstarted
date_void
status
owner_owing
tax_registration_number
@@ -1079,7 +1078,6 @@ export const UPDATE_JOB = gql`
scheduled_completion
actual_in
date_repairstarted
date_void
}
}
}
@@ -1127,7 +1125,6 @@ export const VOID_JOB = gql`
update_jobs_by_pk(_set: $job, pk_columns: { id: $jobId }) {
id
date_exported
date_void
status
alt_transport
ro_number

View File

@@ -8,6 +8,7 @@ import {
Form,
Input,
InputNumber,
notification,
PageHeader,
Popconfirm,
Row,
@@ -16,14 +17,12 @@ import {
Statistic,
Switch,
Typography,
notification,
} from "antd";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
//import { useHistory } from "react-router-dom";
import { useTreatments } from "@splitsoftware/splitio-react";
import Dinero from "dinero.js";
import moment from "moment";
import { Link } from "react-router-dom";
import { createStructuredSelector } from "reselect";
@@ -38,6 +37,7 @@ import { generateJobLinesUpdatesForInvoicing } from "../../graphql/jobs-lines.qu
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import { selectJobReadOnly } from "../../redux/application/application.selectors";
import { selectBodyshop } from "../../redux/user/user.selectors";
import Dinero from "dinero.js";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
jobRO: selectJobReadOnly,
@@ -55,11 +55,6 @@ export function JobsCloseComponent({ job, bodyshop, jobRO }) {
{},
bodyshop && bodyshop.imexshopid
);
const { ClosingPeriod } = useTreatments(
["ClosingPeriod"],
{},
bodyshop && bodyshop.imexshopid
);
const handleFinish = async ({ removefromproduction, ...values }) => {
setLoading(true);
@@ -259,40 +254,12 @@ export function JobsCloseComponent({ job, bodyshop, jobRO }) {
if (!value || moment(value).isSameOrAfter(moment(), "day")) {
return Promise.resolve();
}
return Promise.reject(
new Error(t("jobs.labels.dms.invoicedatefuture"))
);
},
}),
({ getFieldValue }) => ({
validator(_, value) {
if (
ClosingPeriod.treatment === "on" &&
bodyshop.accountingconfig.ClosingPeriod
) {
if (
moment(value).isSameOrAfter(
moment(
bodyshop.accountingconfig.ClosingPeriod[0]
).startOf("day")
) &&
moment(value).isSameOrBefore(
moment(
bodyshop.accountingconfig.ClosingPeriod[1]
).endOf("day")
)
) {
return Promise.resolve();
} else {
return Promise.reject(
new Error(t("jobs.labels.closingperiod"))
);
}
} else {
return Promise.resolve();
}
},
}),
]}
>
<DateTimePicker

View File

@@ -101,7 +101,6 @@
"messages": {
"admin_jobmarkexported": "ADMIN: Job marked as exported.",
"admin_jobmarkforreexport": "ADMIN: Job marked for re-export.",
"admin_jobuninvoice": "ADMIN: Job has been uninvoiced.",
"admin_jobunvoid": "ADMIN: Job has been unvoided.",
"billposted": "Bill with invoice number {{invoice_number}} posted.",
"billupdated": "Bill with invoice number {{invoice_number}} updated.",
@@ -223,7 +222,6 @@
"reexport": "Bill marked for re-export."
},
"validation": {
"closingperiod": "This Bill Date is outside of the Closing Period.",
"inventoryquantity": "Quantity must be greater than or equal to what has been added to inventory ({{number}}).",
"manualinhouse": "Manual posting to the in house vendor is restricted. ",
"unique_invoice_number": "This invoice number has already been entered for this vendor."
@@ -263,7 +261,6 @@
"bill_local_tax_rate": "Bill - Provincial/State Tax Rate %",
"bill_state_tax_rate": "Bill - Provincial/State Tax Rate %",
"city": "City",
"closingperiod": "Closing Period",
"country": "Country",
"dailybodytarget": "Scoreboard - Daily Body Target",
"dailypainttarget": "Scoreboard - Daily Paint Target",
@@ -272,7 +269,6 @@
"templates": "Delivery Templates"
},
"dms": {
"apcontrol": "AP Control Number",
"appostingaccount": "AP Posting Account",
"cashierid": "Cashier ID",
"default_journal": "Default Journal",
@@ -1442,7 +1438,6 @@
"date_repairstarted": "Repairs Started",
"date_scheduled": "Scheduled",
"date_towin": "Towed In",
"date_void": "Void",
"ded_amt": "Deductible",
"ded_note": "Deductible Note",
"ded_status": "Deductible Status",
@@ -1690,7 +1685,6 @@
"checklists": "Checklists",
"closeconfirm": "Are you sure you want to close this job? This cannot be easily undone.",
"closejob": "Close Job {{ro_number}}",
"closingperiod": "This Invoice Date is outside of the Closing Period.",
"contracts": "CC Contracts",
"convertedtolabor": "Lines Converted to Labor",
"cost": "Cost",
@@ -2411,7 +2405,6 @@
"jobs": {
"individual_job_note": "Job Note RO: {{ro_number}}",
"parts_order": "Parts Order PO: {{ro_number}} - {{name}}",
"parts_return_slip":"Parts Return PO: {{ro_number}} - {{name}}",
"sublet_order": "Sublet Order PO: {{ro_number}} - {{name}}"
}
},
@@ -2628,7 +2621,6 @@
"timetickets_summary": "Time Tickets Summary",
"unclaimed_hrs": "Unclaimed Hours",
"void_ros": "Void ROs",
"work_in_progress_jobs": "Work in Progress - Jobs",
"work_in_progress_labour": "Work in Progress - Labor",
"work_in_progress_payables": "Work in Progress - Payables"
}

View File

@@ -101,7 +101,6 @@
"messages": {
"admin_jobmarkexported": "",
"admin_jobmarkforreexport": "",
"admin_jobuninvoice": "",
"admin_jobunvoid": "",
"billposted": "",
"billupdated": "",
@@ -223,7 +222,6 @@
"reexport": ""
},
"validation": {
"closingperiod": "",
"inventoryquantity": "",
"manualinhouse": "",
"unique_invoice_number": ""
@@ -263,7 +261,6 @@
"bill_local_tax_rate": "",
"bill_state_tax_rate": "",
"city": "",
"closingperiod": "",
"country": "",
"dailybodytarget": "",
"dailypainttarget": "",
@@ -272,7 +269,6 @@
"templates": ""
},
"dms": {
"apcontrol": "",
"appostingaccount": "",
"cashierid": "",
"default_journal": "",
@@ -1442,7 +1438,6 @@
"date_repairstarted": "",
"date_scheduled": "Programado",
"date_towin": "",
"date_void": "",
"ded_amt": "Deducible",
"ded_note": "",
"ded_status": "Estado deducible",
@@ -1690,7 +1685,6 @@
"checklists": "",
"closeconfirm": "",
"closejob": "",
"closingperiod": "",
"contracts": "",
"convertedtolabor": "",
"cost": "",
@@ -2411,7 +2405,6 @@
"jobs": {
"individual_job_note": "",
"parts_order": "",
"parts_return_slip": "",
"sublet_order": ""
}
},
@@ -2628,7 +2621,6 @@
"timetickets_summary": "",
"unclaimed_hrs": "",
"void_ros": "",
"work_in_progress_jobs": "",
"work_in_progress_labour": "",
"work_in_progress_payables": ""
}

View File

@@ -101,7 +101,6 @@
"messages": {
"admin_jobmarkexported": "",
"admin_jobmarkforreexport": "",
"admin_jobuninvoice": "",
"admin_jobunvoid": "",
"billposted": "",
"billupdated": "",
@@ -223,7 +222,6 @@
"reexport": ""
},
"validation": {
"closingperiod": "",
"inventoryquantity": "",
"manualinhouse": "",
"unique_invoice_number": ""
@@ -263,7 +261,6 @@
"bill_local_tax_rate": "",
"bill_state_tax_rate": "",
"city": "",
"closingperiod": "",
"country": "",
"dailybodytarget": "",
"dailypainttarget": "",
@@ -272,7 +269,6 @@
"templates": ""
},
"dms": {
"apcontrol": "",
"appostingaccount": "",
"cashierid": "",
"default_journal": "",
@@ -1442,7 +1438,6 @@
"date_repairstarted": "",
"date_scheduled": "Prévu",
"date_towin": "",
"date_void": "",
"ded_amt": "Déductible",
"ded_note": "",
"ded_status": "Statut de franchise",
@@ -1690,7 +1685,6 @@
"checklists": "",
"closeconfirm": "",
"closejob": "",
"closingperiod": "",
"contracts": "",
"convertedtolabor": "",
"cost": "",
@@ -2411,7 +2405,6 @@
"jobs": {
"individual_job_note": "",
"parts_order": "",
"parts_return_slip": "",
"sublet_order": ""
}
},
@@ -2628,7 +2621,6 @@
"timetickets_summary": "",
"unclaimed_hrs": "",
"void_ros": "",
"work_in_progress_jobs": "",
"work_in_progress_labour": "",
"work_in_progress_payables": ""
}

View File

@@ -36,7 +36,6 @@ const AuditTrailMapping = {
jobnoteupdated: () => i18n.t("audit_trail.messages.jobnoteupdated"),
jobnotedeleted: () => i18n.t("audit_trail.messages.jobnotedeleted"),
admin_jobunvoid: () => i18n.t("audit_trail.messages.admin_jobunvoid"),
admin_jobuninvoice: () => i18n.t("audit_trail.messages.admin_jobuninvoice"),
admin_jobmarkforreexport: () =>
i18n.t("audit_trail.messages.admin_jobmarkforreexport"),
admin_jobmarkexported: () =>

View File

@@ -606,14 +606,7 @@ export const TemplateList = (type, context) => {
},
parts_return_slip: {
title: i18n.t("printcenter.jobs.parts_return_slip"),
subject: i18n.t("printcenter.subjects.jobs.parts_return_slip", {
ro_number: context && context.job && context.job.ro_number,
name: (
(context && context.job && context.job.ownr_ln) ||
(context && context.job && context.job.ownr_co_nm) ||
""
).trim(),
}),
subject: i18n.t("printcenter.jobs.parts_return_slip"),
description: "",
key: "parts_return_slip",
disabled: false,
@@ -1244,7 +1237,7 @@ export const TemplateList = (type, context) => {
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.date_void"),
field: i18n.t("jobs.fields.date_open"),
},
group: "sales",
},
@@ -1547,19 +1540,6 @@ export const TemplateList = (type, context) => {
},
group: "payroll",
},
work_in_progress_jobs_excel: {
title: i18n.t("reportcenter.templates.work_in_progress_jobs"),
subject: i18n.t("reportcenter.templates.work_in_progress_jobs"),
key: "work_in_progress_jobs_excel",
//idtype: "vendor",
reporttype: "excel",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.date_open"),
},
group: "jobs",
},
work_in_progress_labour: {
title: i18n.t("reportcenter.templates.work_in_progress_labour"),
description: "",

View File

@@ -3300,7 +3300,6 @@
- clm_total
- clm_zip
- comment
- completed_tasks
- converted
- created_at
- cust_pr
@@ -3495,7 +3494,6 @@
- v_model_yr
- v_vin
- vehicleid
- date_void
- voided
select_permissions:
- role: user
@@ -3566,7 +3564,6 @@
- clm_total
- clm_zip
- comment
- completed_tasks
- converted
- created_at
- cust_pr
@@ -3762,7 +3759,6 @@
- v_model_yr
- v_vin
- vehicleid
- date_void
- voided
filter:
bodyshop:
@@ -3843,7 +3839,6 @@
- clm_total
- clm_zip
- comment
- completed_tasks
- converted
- created_at
- cust_pr
@@ -4039,7 +4034,6 @@
- v_model_yr
- v_vin
- vehicleid
- date_void
- voided
filter:
bodyshop:
@@ -5562,7 +5556,6 @@
- memo
- productivehrs
- rate
- task_name
- ttapprovalqueueid
- updated_at
select_permissions:
@@ -5586,7 +5579,6 @@
- memo
- productivehrs
- rate
- task_name
- ttapprovalqueueid
- updated_at
filter:
@@ -5619,7 +5611,6 @@
- memo
- productivehrs
- rate
- task_name
- ttapprovalqueueid
- updated_at
filter:

View File

@@ -1,4 +0,0 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."jobs" add column "completed_tasks" jsonb
-- null default jsonb_build_array();

View File

@@ -1,2 +0,0 @@
alter table "public"."jobs" add column "completed_tasks" jsonb
null default jsonb_build_array();

View File

@@ -1,4 +0,0 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."jobs" add column "void_date" Timestamp
-- null;

View File

@@ -1,2 +0,0 @@
alter table "public"."jobs" add column "void_date" Timestamp
null;

View File

@@ -1 +0,0 @@
ALTER TABLE "public"."jobs" ALTER COLUMN "void_date" TYPE timestamp without time zone;

View File

@@ -1 +0,0 @@
ALTER TABLE "public"."jobs" ALTER COLUMN "void_date" TYPE timestamptz;

View File

@@ -1 +0,0 @@
alter table "public"."jobs" rename column "date_void" to "void_date";

View File

@@ -1 +0,0 @@
alter table "public"."jobs" rename column "void_date" to "date_void";

View File

@@ -1,4 +0,0 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."timetickets" add column "task_name" text
-- null;

View File

@@ -1,2 +0,0 @@
alter table "public"."timetickets" add column "task_name" text
null;

View File

@@ -53,7 +53,7 @@
"socket.io": "^4.6.1",
"ssh2-sftp-client": "^9.0.4",
"stripe": "^9.15.0",
"twilio": "^4.8.0",
"twilio": "^4.13.0",
"uuid": "^9.0.0",
"xml2js": "^0.4.23",
"xmlbuilder2": "^3.0.2"

View File

@@ -123,6 +123,13 @@ app.post(
twilio.webhook({ validate: process.env.NODE_ENV === "PRODUCTION" }),
smsStatus.status
);
const smsFetchMedia = require("./server/sms/fetch-media");
app.post(
"/sms/fetchmedia",
fb.validateFirebaseIdToken,
smsFetchMedia.fetchmedia
);
app.post(
"/sms/markConversationRead",
fb.validateFirebaseIdToken,

View File

@@ -127,10 +127,7 @@ async function PbsCalculateAllocationsAp(socket, billids) {
bodyshop.pbs_configuration.appostingaccount === "wip"
? cc.dms_wip_acctnumber
: cc.dms_acctnumber,
ControlNumber:
bodyshop.pbs_configuration.apcontrol === "ro"
? bill.job.ro_number
: bill.vendor.dmsid,
ControlNumber: bill.vendor.dmsid,
Amount: Dinero(),
// Comment: "String",
AdditionalInfo: bill.vendor.name,

View File

@@ -620,7 +620,6 @@ exports.QUERY_EMPLOYEE_PIN = `query QUERY_EMPLOYEE_PIN($shopId: uuid!, $employee
employee_number
id
pin
active
}
}`;

31
server/sms/fetch-media.js Normal file
View File

@@ -0,0 +1,31 @@
const path = require("path");
require("dotenv").config({
path: path.resolve(
process.cwd(),
`.env.${process.env.NODE_ENV || "development"}`
),
});
const twilio = require("twilio");
const client = twilio(
process.env.TWILIO_AUTH_TOKEN,
process.env.TWILIO_AUTH_KEY
);
const logger = require("../utils/logger");
exports.fetchmedia = async (req, res) => {
try {
const r = await client.request({
method: "get",
uri: req.body.mediaUrl, //|| "https://api.twilio.com/2010-04-01/Accounts/AC59171266556bbd507234b5fc6a23e4ee/Messages/MMa287a6e411c873e9177953e630f21df0/Media/ME18357bbec8c0092bfbc805aa8e6c6185",
});
res.send(r.headers.location);
} catch (error) {
console.log(error);
logger.log("sms-fetch-media-error", "ERROR", req.user?.email, null, {
// conversationid,
error: error.message,
});
res.sendStatus(500);
}
};

View File

@@ -23,7 +23,7 @@ exports.techLogin = async (req, res) => {
let technician;
if (result.employees && result.employees[0]) {
const dbRecord = result.employees[0];
if (dbRecord.pin === pin && dbRecord.active === true) {
if (dbRecord.pin === pin) {
valid = true;
delete dbRecord.pin;
technician = dbRecord;

View File

@@ -4338,10 +4338,10 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0:
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==
twilio@^4.8.0:
version "4.10.0"
resolved "https://registry.yarnpkg.com/twilio/-/twilio-4.10.0.tgz#4a0e744045e54934c5cf69033df8e3c5193268a3"
integrity sha512-j6reVBUqwrGHBKnCIoL1hUDPl/Yw6EYVvkYLmFBpVQ74AGf/9BCKXnvlkAgIkwFXzZikpNuo0mqIY/k9oMiFsA==
twilio@^4.13.0:
version "4.13.0"
resolved "https://registry.yarnpkg.com/twilio/-/twilio-4.13.0.tgz#6b8f9f14d4def821ca02abb2c561ed3e4dde7a4d"
integrity sha512-fecPGy2lXnULwle4iXcCH3rP5z4fgkirzp+rRIXsFi45+y3qjkY5DBZSzmYr5T4vUOzZ2djmODZJ2jpRfgIBSw==
dependencies:
axios "^0.26.1"
dayjs "^1.8.29"