Compare commits
77 Commits
release/20
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b667524a04 | ||
|
|
011cb1b349 | ||
|
|
9b2cdddb88 | ||
|
|
5a4c0e4f65 | ||
|
|
c71db5133d | ||
|
|
ee733434e6 | ||
|
|
c2050e7e26 | ||
|
|
5f9c756172 | ||
|
|
6528509288 | ||
|
|
a18e40a63c | ||
|
|
c171847555 | ||
|
|
7e60e2c699 | ||
|
|
e685ca5ad8 | ||
|
|
0fa110cc51 | ||
|
|
76441e49e1 | ||
|
|
524385af7d | ||
|
|
ded7393aec | ||
|
|
b269d54f2c | ||
|
|
069d508528 | ||
|
|
d213c382c9 | ||
|
|
878e81dc8f | ||
|
|
deab90b326 | ||
|
|
a1f7e7b755 | ||
|
|
c8f8a86a98 | ||
|
|
8c74276b98 | ||
|
|
ac1ad12ac4 | ||
|
|
dedc594b58 | ||
|
|
02747f4144 | ||
|
|
05b1078e27 | ||
|
|
cc57eb40cf | ||
|
|
33518e5c25 | ||
|
|
b34909b7f3 | ||
|
|
bd599cfea4 | ||
|
|
e8917f5736 | ||
|
|
b7ee95059d | ||
|
|
f59d369529 | ||
|
|
eefac38d9c | ||
|
|
249b74a597 | ||
|
|
4fb491697c | ||
|
|
09da3f349b | ||
|
|
e8f4f30cc4 | ||
|
|
8c4f395ff9 | ||
|
|
acbf75ff4d | ||
|
|
36e3828e2d | ||
|
|
281c9bbc2a | ||
|
|
455e79a6f7 | ||
|
|
bc73e75217 | ||
|
|
7b3f71701e | ||
|
|
383a383a9f | ||
|
|
7ee853ae15 | ||
|
|
3510d081cd | ||
|
|
471105828c | ||
|
|
1ec1f5d3a8 | ||
|
|
355de9efd0 | ||
|
|
2c14731ebd | ||
|
|
065d2d5688 | ||
|
|
879dea9fa7 | ||
|
|
3ceada30a3 | ||
|
|
d26eb81339 | ||
|
|
fcdcdbbf7f | ||
|
|
d482447dc9 | ||
|
|
647dfbfa06 | ||
|
|
f17899285f | ||
|
|
47f5641518 | ||
|
|
6e41a282ca | ||
|
|
abbd2263ee | ||
|
|
4b70c89e54 | ||
|
|
5e2c1aae4f | ||
|
|
fda06bb298 | ||
|
|
3dfd45ca0f | ||
|
|
86e748502c | ||
|
|
0f85250d40 | ||
|
|
f04bc59966 | ||
|
|
e6e24dae4b | ||
|
|
4ad32117c3 | ||
|
|
befb8009e0 | ||
|
|
41bec72390 |
@@ -1,4 +1,4 @@
|
|||||||
import { DeleteFilled, EyeFilled } from "@ant-design/icons";
|
import { DeleteFilled } from "@ant-design/icons";
|
||||||
import { useLazyQuery, useMutation } from "@apollo/client";
|
import { useLazyQuery, useMutation } from "@apollo/client";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -12,7 +12,6 @@ import {
|
|||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { FaTasks } from "react-icons/fa";
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
@@ -55,8 +54,6 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
modal: "partsReceive",
|
modal: "partsReceive",
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
setTaskUpsertContext: (context) =>
|
|
||||||
dispatch(setModalContext({ context, modal: "taskUpsert" })),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export function PartsOrderListTableDrawerComponent({
|
export function PartsOrderListTableDrawerComponent({
|
||||||
@@ -67,7 +64,6 @@ export function PartsOrderListTableDrawerComponent({
|
|||||||
billsQuery,
|
billsQuery,
|
||||||
handleOnRowClick,
|
handleOnRowClick,
|
||||||
setPartsReceiveContext,
|
setPartsReceiveContext,
|
||||||
setTaskUpsertContext,
|
|
||||||
}) {
|
}) {
|
||||||
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
|
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
|
||||||
.filter((screen) => !!screen[1])
|
.filter((screen) => !!screen[1])
|
||||||
@@ -92,8 +88,7 @@ export function PartsOrderListTableDrawerComponent({
|
|||||||
sortedInfo: {},
|
sortedInfo: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
const [returnfrombill, setReturnFromBill] = useState();
|
const [billData, setBillData] = useState(null);
|
||||||
const [billData, setBillData] = useState();
|
|
||||||
const search = queryString.parse(useLocation().search);
|
const search = queryString.parse(useLocation().search);
|
||||||
const selectedpartsorder = search.partsorderid;
|
const selectedpartsorder = search.partsorderid;
|
||||||
|
|
||||||
@@ -102,37 +97,28 @@ export function PartsOrderListTableDrawerComponent({
|
|||||||
const parts_orders = billsQuery.data ? billsQuery.data.parts_orders : [];
|
const parts_orders = billsQuery.data ? billsQuery.data.parts_orders : [];
|
||||||
const { refetch } = billsQuery;
|
const { refetch } = billsQuery;
|
||||||
|
|
||||||
|
const selectedPartsOrderRecord = parts_orders.find(
|
||||||
|
(r) => r.id === selectedpartsorder
|
||||||
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (returnfrombill === null) {
|
const fetchData = async () => {
|
||||||
setBillData(null);
|
if (selectedPartsOrderRecord?.returnfrombill) {
|
||||||
} else {
|
try {
|
||||||
const fetchData = async () => {
|
const { data } = await billQuery({
|
||||||
const result = await billQuery({
|
variables: { billid: selectedPartsOrderRecord.returnfrombill },
|
||||||
variables: { billid: returnfrombill },
|
});
|
||||||
});
|
setBillData(data);
|
||||||
setBillData(result.data);
|
} catch (error) {
|
||||||
};
|
console.error("Error fetching bill data:", error);
|
||||||
fetchData();
|
}
|
||||||
}
|
} else setBillData(null);
|
||||||
}, [returnfrombill, billQuery]);
|
};
|
||||||
|
fetchData();
|
||||||
|
}, [selectedPartsOrderRecord, billQuery]);
|
||||||
|
|
||||||
const recordActions = (record, showView = false) => (
|
const recordActions = (record) => (
|
||||||
<Space direction="horizontal" wrap>
|
<Space direction="horizontal" wrap>
|
||||||
{showView && (
|
|
||||||
<Button
|
|
||||||
onClick={() => {
|
|
||||||
if (record.returnfrombill) {
|
|
||||||
setReturnFromBill(record.returnfrombill);
|
|
||||||
} else {
|
|
||||||
setReturnFromBill(null);
|
|
||||||
}
|
|
||||||
handleOnRowClick(record);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<EyeFilled />
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
disabled={
|
disabled={
|
||||||
jobRO ||
|
jobRO ||
|
||||||
@@ -146,41 +132,25 @@ export function PartsOrderListTableDrawerComponent({
|
|||||||
context: {
|
context: {
|
||||||
jobId: job.id,
|
jobId: job.id,
|
||||||
job: job,
|
job: job,
|
||||||
partsorderlines: record.parts_order_lines.map((pol) => {
|
partsorderlines: record.parts_order_lines.map((pol) => ({
|
||||||
return {
|
joblineid: pol.job_line_id,
|
||||||
joblineid: pol.job_line_id,
|
id: pol.id,
|
||||||
id: pol.id,
|
line_desc: pol.line_desc,
|
||||||
line_desc: pol.line_desc,
|
quantity: pol.quantity,
|
||||||
quantity: pol.quantity,
|
act_price: pol.act_price,
|
||||||
act_price: pol.act_price,
|
oem_partno: pol.oem_partno,
|
||||||
oem_partno: pol.oem_partno,
|
})),
|
||||||
};
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("parts_orders.actions.receive")}
|
{t("parts_orders.actions.receive")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
|
||||||
title={t("tasks.buttons.create")}
|
|
||||||
onClick={() => {
|
|
||||||
setTaskUpsertContext({
|
|
||||||
context: {
|
|
||||||
jobid: job.id,
|
|
||||||
partsorderid: record.id,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<FaTasks />
|
|
||||||
</Button>
|
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title={t("parts_orders.labels.confirmdelete")}
|
title={t("parts_orders.labels.confirmdelete")}
|
||||||
disabled={jobRO}
|
disabled={jobRO}
|
||||||
onConfirm={async () => {
|
onConfirm={async () => {
|
||||||
//Delete the parts return.!
|
//Delete the parts return.!
|
||||||
|
|
||||||
await deletePartsOrder({
|
await deletePartsOrder({
|
||||||
variables: { partsOrderId: record.id },
|
variables: { partsOrderId: record.id },
|
||||||
update(cache) {
|
update(cache) {
|
||||||
@@ -209,7 +179,6 @@ export function PartsOrderListTableDrawerComponent({
|
|||||||
}
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
logImEXEvent("parts_order_receive_bill");
|
logImEXEvent("parts_order_receive_bill");
|
||||||
|
|
||||||
setBillEnterContext({
|
setBillEnterContext({
|
||||||
actions: { refetch: refetch },
|
actions: { refetch: refetch },
|
||||||
context: {
|
context: {
|
||||||
@@ -217,27 +186,23 @@ export function PartsOrderListTableDrawerComponent({
|
|||||||
bill: {
|
bill: {
|
||||||
vendorid: record.vendor.id,
|
vendorid: record.vendor.id,
|
||||||
is_credit_memo: record.return,
|
is_credit_memo: record.return,
|
||||||
billlines: record.parts_order_lines.map((pol) => {
|
billlines: record.parts_order_lines.map((pol) => ({
|
||||||
return {
|
joblineid: pol.job_line_id || "noline",
|
||||||
joblineid: pol.job_line_id || "noline",
|
line_desc: pol.line_desc,
|
||||||
line_desc: pol.line_desc,
|
quantity: pol.quantity,
|
||||||
quantity: pol.quantity,
|
actual_price: pol.act_price,
|
||||||
|
cost_center: pol.jobline?.part_type
|
||||||
actual_price: pol.act_price,
|
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
|
||||||
|
? pol.jobline.part_type !== "PAE"
|
||||||
cost_center: pol.jobline?.part_type
|
? pol.jobline.part_type
|
||||||
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
|
: null
|
||||||
? pol.jobline.part_type !== "PAE"
|
: responsibilityCenters.defaults &&
|
||||||
? pol.jobline.part_type
|
(responsibilityCenters.defaults.costs[
|
||||||
: null
|
pol.jobline.part_type
|
||||||
: responsibilityCenters.defaults &&
|
] ||
|
||||||
(responsibilityCenters.defaults.costs[
|
null)
|
||||||
pol.jobline.part_type
|
: null,
|
||||||
] ||
|
})),
|
||||||
null)
|
|
||||||
: null,
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -268,10 +233,6 @@ export function PartsOrderListTableDrawerComponent({
|
|||||||
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectedPartsOrderRecord = parts_orders.find(
|
|
||||||
(r) => r.id === selectedpartsorder
|
|
||||||
);
|
|
||||||
|
|
||||||
const rowExpander = (record) => {
|
const rowExpander = (record) => {
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1 +1,8 @@
|
|||||||
[]
|
- name: Task Reminders
|
||||||
|
webhook: '{{HASURA_API_URL}}/tasks-remind-handler'
|
||||||
|
schedule: '*/15 * * * *'
|
||||||
|
include_in_metadata: true
|
||||||
|
payload: {}
|
||||||
|
headers:
|
||||||
|
- name: event-secret
|
||||||
|
value_from_env: EVENT_SECRET
|
||||||
|
|||||||
@@ -5797,6 +5797,29 @@
|
|||||||
- active:
|
- active:
|
||||||
_eq: true
|
_eq: true
|
||||||
check: null
|
check: null
|
||||||
|
event_triggers:
|
||||||
|
- name: tasks_assigned_changed
|
||||||
|
definition:
|
||||||
|
enable_manual: false
|
||||||
|
insert:
|
||||||
|
columns: '*'
|
||||||
|
update:
|
||||||
|
columns:
|
||||||
|
- assigned_to
|
||||||
|
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: {}
|
||||||
|
template_engine: Kriti
|
||||||
|
url: '{{$base_url}}/tasks-assigned-handler'
|
||||||
|
version: 2
|
||||||
- table:
|
- table:
|
||||||
name: timetickets
|
name: timetickets
|
||||||
schema: public
|
schema: public
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."tasks" add column "remind_at_sent" timestamptz
|
||||||
|
-- null;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."tasks" add column "remind_at_sent" timestamptz
|
||||||
|
null;
|
||||||
Reference in New Issue
Block a user