Merged in release/2021-12-17 (pull request #301)

Release/2021 12 17
This commit is contained in:
Patrick Fic
2021-12-13 22:34:16 +00:00
11 changed files with 65 additions and 24 deletions

View File

@@ -20,7 +20,11 @@ const BillLineSearchSelect = ({ options, disabled, ...restProps }, ref) => {
.toLowerCase() .toLowerCase()
.includes(inputValue.toLowerCase())) || .includes(inputValue.toLowerCase())) ||
(option.oem_partno && (option.oem_partno &&
option.oem_partno.toLowerCase().includes(inputValue.toLowerCase())) option.oem_partno
.toLowerCase()
.includes(inputValue.toLowerCase())) ||
(option.act_price &&
option.act_price.toString().startsWith(inputValue.toString()))
); );
}} }}
notFoundContent={"Removed."} notFoundContent={"Removed."}
@@ -40,13 +44,14 @@ const BillLineSearchSelect = ({ options, disabled, ...restProps }, ref) => {
line_desc={item.line_desc} line_desc={item.line_desc}
part_qty={item.part_qty} part_qty={item.part_qty}
oem_partno={item.oem_partno} oem_partno={item.oem_partno}
act_price={item.act_price}
style={{ style={{
...(item.removed ? { textDecoration: "line-through" } : {}), ...(item.removed ? { textDecoration: "line-through" } : {}),
}} }}
> >
{`${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${ {`${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${
item.oem_partno ? ` - ${item.oem_partno}` : "" item.oem_partno ? ` - ${item.oem_partno}` : ""
}`} }${item.act_price ? ` - $${item.act_price}` : ``}`}
</Option> </Option>
)) ))
: null} : null}

View File

@@ -55,6 +55,7 @@ function ChatSendMessageComponent({
messagingServiceSid: bodyshop.messagingservicesid, messagingServiceSid: bodyshop.messagingservicesid,
conversationid: conversation.id, conversationid: conversation.id,
selectedMedia: selectedImages, selectedMedia: selectedImages,
imexshopid: bodyshop.imexshopid,
}); });
setSelectedMedia( setSelectedMedia(
selectedMedia.map((i) => { selectedMedia.map((i) => {

View File

@@ -53,7 +53,7 @@ export function ContractConvertToRo({
const billingLines = []; const billingLines = [];
if (contractLength > 0) if (contractLength > 0)
billingLines.push({ billingLines.push({
manual_line:true, manual_line: true,
unq_seq: 1, unq_seq: 1,
line_no: 1, line_no: 1,
line_ref: 1, line_ref: 1,
@@ -71,7 +71,7 @@ export function ContractConvertToRo({
contract.kmend - contract.kmstart - contract.dailyfreekm * contractLength; contract.kmend - contract.kmstart - contract.dailyfreekm * contractLength;
if (mileageDiff > 0) { if (mileageDiff > 0) {
billingLines.push({ billingLines.push({
manual_line:true, manual_line: true,
unq_seq: 2, unq_seq: 2,
line_no: 2, line_no: 2,
line_ref: 2, line_ref: 2,
@@ -88,7 +88,7 @@ export function ContractConvertToRo({
if (values.refuelqty > 0) { if (values.refuelqty > 0) {
billingLines.push({ billingLines.push({
manual_line:true, manual_line: true,
unq_seq: 3, unq_seq: 3,
line_no: 3, line_no: 3,
line_ref: 3, line_ref: 3,
@@ -104,7 +104,7 @@ export function ContractConvertToRo({
} }
if (values.applyCleanupCharge) { if (values.applyCleanupCharge) {
billingLines.push({ billingLines.push({
manual_line:true, manual_line: true,
unq_seq: 4, unq_seq: 4,
line_no: 4, line_no: 4,
line_ref: 4, line_ref: 4,
@@ -121,7 +121,7 @@ export function ContractConvertToRo({
if (contract.damagewaiver) { if (contract.damagewaiver) {
//Add for cleanup fee. //Add for cleanup fee.
billingLines.push({ billingLines.push({
manual_line:true, manual_line: true,
unq_seq: 5, unq_seq: 5,
line_no: 5, line_no: 5,
line_ref: 5, line_ref: 5,
@@ -153,10 +153,10 @@ export function ContractConvertToRo({
ownr_co_nm: contract.job.owner.ownr_co_nm, ownr_co_nm: contract.job.owner.ownr_co_nm,
ownr_ph1: contract.job.owner.ownr_ph1, ownr_ph1: contract.job.owner.ownr_ph1,
ownr_ea: contract.job.owner.ownr_ea, ownr_ea: contract.job.owner.ownr_ea,
v_model_desc: contract.job.vehicle.v_model_desc, v_model_desc: contract.job.vehicle && contract.job.vehicle.v_model_desc,
v_model_yr: contract.job.vehicle.v_model_yr, v_model_yr: contract.job.vehicle && contract.job.vehicle.v_model_yr,
v_make_desc: contract.job.vehicle.v_make_desc, v_make_desc: contract.job.vehicle && contract.job.vehicle.v_make_desc,
v_vin: contract.job.vehicle.v_vin, v_vin: contract.job.vehicle && contract.job.vehicle.v_vin,
status: bodyshop.md_ro_statuses.default_completed, status: bodyshop.md_ro_statuses.default_completed,
notes: { notes: {
data: [ data: [

View File

@@ -118,7 +118,7 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
}, },
]} ]}
> >
<InputNumber /> <InputNumber precision={0} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label={t("courtesycars.fields.fleetnumber")} label={t("courtesycars.fields.fleetnumber")}

View File

@@ -31,7 +31,7 @@ export default function CourtesyCarReturnModalComponent() {
}, },
]} ]}
> >
<InputNumber /> <InputNumber precision={0} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label={t("contracts.fields.fuelin")} label={t("contracts.fields.fuelin")}

View File

@@ -56,17 +56,23 @@ export default function JobLineNotePopup({ jobline, disabled }) {
</div> </div>
); );
return ( return (
<div <div>
style={{ width: "100%", minHeight: "2rem", cursor: "pointer" }}
onClick={() => !disabled && setEditing(true)}
>
{jobline.ioucreated && ( {jobline.ioucreated && (
<Space> <Space>
<FieldTimeOutlined /> <FieldTimeOutlined />
{t("joblines.labels.ioucreated")} {t("joblines.labels.ioucreated")}
</Space> </Space>
)} )}
{jobline.notes} <div
style={{
width: "100%",
minHeight: "2rem",
cursor: "pointer",
}}
onClick={() => !disabled && setEditing(true)}
>
{jobline.notes}
</div>
</div> </div>
); );
} }

View File

@@ -31,6 +31,7 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
<Collapse.Panel <Collapse.Panel
key="insurance" key="insurance"
header={t("menus.jobsdetail.insurance")} header={t("menus.jobsdetail.insurance")}
forceRender
> >
<LayoutFormRow> <LayoutFormRow>
<Form.Item label={t("jobs.fields.ins_co_id")} name="ins_co_id"> <Form.Item label={t("jobs.fields.ins_co_id")} name="ins_co_id">
@@ -145,7 +146,7 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
</Form.Item> </Form.Item>
</LayoutFormRow> </LayoutFormRow>
</Collapse.Panel> </Collapse.Panel>
<Collapse.Panel key="claim" header={t("menus.jobsdetail.claimdetail")}> <Collapse.Panel forceRender key="claim" header={t("menus.jobsdetail.claimdetail")}>
<LayoutFormRow> <LayoutFormRow>
<Form.Item label={t("jobs.fields.loss_desc")} name="loss_desc"> <Form.Item label={t("jobs.fields.loss_desc")} name="loss_desc">
<Input /> <Input />
@@ -192,7 +193,7 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
</Form.Item> </Form.Item>
</LayoutFormRow> </LayoutFormRow>
</Collapse.Panel> </Collapse.Panel>
<Collapse.Panel <Collapse.Panel forceRender
key="financial" key="financial"
header={t("menus.jobsdetail.financials")} header={t("menus.jobsdetail.financials")}
> >

View File

@@ -108,6 +108,8 @@ export async function CreateIouForJob(
_tempLines.forEach((line) => { _tempLines.forEach((line) => {
delete line.id; delete line.id;
delete line.__typename; delete line.__typename;
line.oem_partno = `line.oem_partno - IOU Price $${line.act_price}`
delete line.act_price;
line.manual_line = true; line.manual_line = true;
}); });

View File

@@ -14,6 +14,22 @@ export default async function FcmHandler({ client, payload }) {
}, },
}); });
break; break;
case "messaging-outbound":
client.cache.modify({
id: client.cache.identify({
__typename: "conversations",
id: payload.conversationid,
}),
fields: {
updated_at(oldupdated0) {
return new Date();
},
messages_aggregate(cached) {
return { aggregate: { count: cached.aggregate.count + 1 } };
},
},
});
break;
case "messaging-mark-conversation-read": case "messaging-mark-conversation-read":
client.cache.modify({ client.cache.modify({
id: client.cache.identify({ id: client.cache.identify({

View File

@@ -96,8 +96,6 @@ exports.receive = async (req, res) => {
type: "messaging-inbound", type: "messaging-inbound",
conversationid: message.conversationid || "", conversationid: message.conversationid || "",
text: message.text || "", text: message.text || "",
image_path: message.image_path || "",
image: (message.image && message.image.toString()) || "",
messageid: message.id || "", messageid: message.id || "",
phone_num: message.conversation.phone_num || "", phone_num: message.conversation.phone_num || "",
}; };

View File

@@ -13,11 +13,12 @@ const logger = require("../utils/logger");
const client = twilio( const client = twilio(
process.env.TWILIO_AUTH_TOKEN, process.env.TWILIO_AUTH_TOKEN,
process.env.TWILIO_AUTH_KEY process.env.TWILIO_AUTH_KEY
); );const { admin } = require("../firebase/firebase-handler");
const gqlClient = require("../graphql-client/graphql-client").client; const gqlClient = require("../graphql-client/graphql-client").client;
exports.send = (req, res) => { exports.send = (req, res) => {
const { to, messagingServiceSid, body, conversationid, selectedMedia } = const { to, messagingServiceSid, body, conversationid, selectedMedia, imexshopid } =
req.body; req.body;
logger.log("sms-outbound", "DEBUG", req.user.email, null, { logger.log("sms-outbound", "DEBUG", req.user.email, null, {
@@ -63,6 +64,17 @@ exports.send = (req, res) => {
conversationid, conversationid,
}); });
const data = {
type: "messaging-outbound",
conversationid: newMessage.conversationid || "",
};
admin.messaging().send({
topic: `${imexshopid}-messaging`,
data,
});
res.sendStatus(200); res.sendStatus(200);
}) })
.catch((e2) => { .catch((e2) => {