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 {
|
||||
Button,
|
||||
@@ -12,7 +12,6 @@ import {
|
||||
import queryString from "query-string";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { FaTasks } from "react-icons/fa";
|
||||
import { connect } from "react-redux";
|
||||
import { useLocation } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -55,8 +54,6 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
modal: "partsReceive",
|
||||
})
|
||||
),
|
||||
setTaskUpsertContext: (context) =>
|
||||
dispatch(setModalContext({ context, modal: "taskUpsert" })),
|
||||
});
|
||||
|
||||
export function PartsOrderListTableDrawerComponent({
|
||||
@@ -67,7 +64,6 @@ export function PartsOrderListTableDrawerComponent({
|
||||
billsQuery,
|
||||
handleOnRowClick,
|
||||
setPartsReceiveContext,
|
||||
setTaskUpsertContext,
|
||||
}) {
|
||||
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
|
||||
.filter((screen) => !!screen[1])
|
||||
@@ -92,8 +88,7 @@ export function PartsOrderListTableDrawerComponent({
|
||||
sortedInfo: {},
|
||||
});
|
||||
|
||||
const [returnfrombill, setReturnFromBill] = useState();
|
||||
const [billData, setBillData] = useState();
|
||||
const [billData, setBillData] = useState(null);
|
||||
const search = queryString.parse(useLocation().search);
|
||||
const selectedpartsorder = search.partsorderid;
|
||||
|
||||
@@ -102,37 +97,28 @@ export function PartsOrderListTableDrawerComponent({
|
||||
const parts_orders = billsQuery.data ? billsQuery.data.parts_orders : [];
|
||||
const { refetch } = billsQuery;
|
||||
|
||||
const selectedPartsOrderRecord = parts_orders.find(
|
||||
(r) => r.id === selectedpartsorder
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (returnfrombill === null) {
|
||||
setBillData(null);
|
||||
} else {
|
||||
const fetchData = async () => {
|
||||
const result = await billQuery({
|
||||
variables: { billid: returnfrombill },
|
||||
});
|
||||
setBillData(result.data);
|
||||
};
|
||||
fetchData();
|
||||
}
|
||||
}, [returnfrombill, billQuery]);
|
||||
const fetchData = async () => {
|
||||
if (selectedPartsOrderRecord?.returnfrombill) {
|
||||
try {
|
||||
const { data } = await billQuery({
|
||||
variables: { billid: selectedPartsOrderRecord.returnfrombill },
|
||||
});
|
||||
setBillData(data);
|
||||
} catch (error) {
|
||||
console.error("Error fetching bill data:", error);
|
||||
}
|
||||
} else setBillData(null);
|
||||
};
|
||||
fetchData();
|
||||
}, [selectedPartsOrderRecord, billQuery]);
|
||||
|
||||
const recordActions = (record, showView = false) => (
|
||||
const recordActions = (record) => (
|
||||
<Space direction="horizontal" wrap>
|
||||
{showView && (
|
||||
<Button
|
||||
onClick={() => {
|
||||
if (record.returnfrombill) {
|
||||
setReturnFromBill(record.returnfrombill);
|
||||
} else {
|
||||
setReturnFromBill(null);
|
||||
}
|
||||
handleOnRowClick(record);
|
||||
}}
|
||||
>
|
||||
<EyeFilled />
|
||||
</Button>
|
||||
)}
|
||||
|
||||
<Button
|
||||
disabled={
|
||||
jobRO ||
|
||||
@@ -146,41 +132,25 @@ export function PartsOrderListTableDrawerComponent({
|
||||
context: {
|
||||
jobId: job.id,
|
||||
job: job,
|
||||
partsorderlines: record.parts_order_lines.map((pol) => {
|
||||
return {
|
||||
joblineid: pol.job_line_id,
|
||||
id: pol.id,
|
||||
line_desc: pol.line_desc,
|
||||
quantity: pol.quantity,
|
||||
act_price: pol.act_price,
|
||||
oem_partno: pol.oem_partno,
|
||||
};
|
||||
}),
|
||||
partsorderlines: record.parts_order_lines.map((pol) => ({
|
||||
joblineid: pol.job_line_id,
|
||||
id: pol.id,
|
||||
line_desc: pol.line_desc,
|
||||
quantity: pol.quantity,
|
||||
act_price: pol.act_price,
|
||||
oem_partno: pol.oem_partno,
|
||||
})),
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("parts_orders.actions.receive")}
|
||||
</Button>
|
||||
<Button
|
||||
title={t("tasks.buttons.create")}
|
||||
onClick={() => {
|
||||
setTaskUpsertContext({
|
||||
context: {
|
||||
jobid: job.id,
|
||||
partsorderid: record.id,
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
<FaTasks />
|
||||
</Button>
|
||||
<Popconfirm
|
||||
title={t("parts_orders.labels.confirmdelete")}
|
||||
disabled={jobRO}
|
||||
onConfirm={async () => {
|
||||
//Delete the parts return.!
|
||||
|
||||
await deletePartsOrder({
|
||||
variables: { partsOrderId: record.id },
|
||||
update(cache) {
|
||||
@@ -209,7 +179,6 @@ export function PartsOrderListTableDrawerComponent({
|
||||
}
|
||||
onClick={() => {
|
||||
logImEXEvent("parts_order_receive_bill");
|
||||
|
||||
setBillEnterContext({
|
||||
actions: { refetch: refetch },
|
||||
context: {
|
||||
@@ -217,27 +186,23 @@ export function PartsOrderListTableDrawerComponent({
|
||||
bill: {
|
||||
vendorid: record.vendor.id,
|
||||
is_credit_memo: record.return,
|
||||
billlines: record.parts_order_lines.map((pol) => {
|
||||
return {
|
||||
joblineid: pol.job_line_id || "noline",
|
||||
line_desc: pol.line_desc,
|
||||
quantity: pol.quantity,
|
||||
|
||||
actual_price: pol.act_price,
|
||||
|
||||
cost_center: pol.jobline?.part_type
|
||||
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
|
||||
? pol.jobline.part_type !== "PAE"
|
||||
? pol.jobline.part_type
|
||||
: null
|
||||
: responsibilityCenters.defaults &&
|
||||
(responsibilityCenters.defaults.costs[
|
||||
pol.jobline.part_type
|
||||
] ||
|
||||
null)
|
||||
: null,
|
||||
};
|
||||
}),
|
||||
billlines: record.parts_order_lines.map((pol) => ({
|
||||
joblineid: pol.job_line_id || "noline",
|
||||
line_desc: pol.line_desc,
|
||||
quantity: pol.quantity,
|
||||
actual_price: pol.act_price,
|
||||
cost_center: pol.jobline?.part_type
|
||||
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
|
||||
? pol.jobline.part_type !== "PAE"
|
||||
? pol.jobline.part_type
|
||||
: null
|
||||
: responsibilityCenters.defaults &&
|
||||
(responsibilityCenters.defaults.costs[
|
||||
pol.jobline.part_type
|
||||
] ||
|
||||
null)
|
||||
: null,
|
||||
})),
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -268,10 +233,6 @@ export function PartsOrderListTableDrawerComponent({
|
||||
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
||||
};
|
||||
|
||||
const selectedPartsOrderRecord = parts_orders.find(
|
||||
(r) => r.id === selectedpartsorder
|
||||
);
|
||||
|
||||
const rowExpander = (record) => {
|
||||
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:
|
||||
_eq: true
|
||||
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:
|
||||
name: timetickets
|
||||
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