IO-1912 Resolve date for tech clock in.
This commit is contained in:
@@ -10,6 +10,7 @@ import { selectTechnician } from "../../redux/tech/tech.selectors";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import TechClockInComponent from "./tech-job-clock-in-form.component";
|
||||
import TechJobPrintTickets from "../tech-job-print-tickets/tech-job-print-tickets.component";
|
||||
import moment from "moment";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
technician: selectTechnician,
|
||||
@@ -23,18 +24,19 @@ export function TechClockInContainer({ technician, bodyshop }) {
|
||||
refetchQueries: ["QUERY_ACTIVE_TIME_TICKETS"],
|
||||
});
|
||||
const { t } = useTranslation();
|
||||
|
||||
console.log(moment("2022-05-28T01:43:52.508Z").format("YYYY-MM-DD"));
|
||||
const handleFinish = async (values) => {
|
||||
setLoading(true);
|
||||
const theTime = (await axios.post("/utils/time")).data;
|
||||
|
||||
const result = await insertTimeTicket({
|
||||
variables: {
|
||||
timeTicketInput: [
|
||||
{
|
||||
bodyshopid: bodyshop.id,
|
||||
employeeid: technician.id,
|
||||
date: theTime,
|
||||
clockon: theTime,
|
||||
date: moment(theTime).format("YYYY-MM-DD"),
|
||||
clockon: moment(theTime),
|
||||
jobid: values.jobid,
|
||||
cost_center: values.cost_center,
|
||||
ciecacode:
|
||||
|
||||
@@ -47,7 +47,7 @@ export function TechClockOffButton({
|
||||
|
||||
const handleFinish = async (values) => {
|
||||
logImEXEvent("tech_clock_out_job");
|
||||
|
||||
console.log(values);
|
||||
setLoading(true);
|
||||
const result = await updateTimeticket({
|
||||
variables: {
|
||||
@@ -55,9 +55,10 @@ export function TechClockOffButton({
|
||||
timeticket: {
|
||||
clockoff: (await axios.post("/utils/time")).data,
|
||||
...values,
|
||||
rate: emps && emps.rates.filter(
|
||||
(r) => r.cost_center === values.cost_center
|
||||
)[0]?.rate,
|
||||
rate:
|
||||
emps &&
|
||||
emps.rates.filter((r) => r.cost_center === values.cost_center)[0]
|
||||
?.rate,
|
||||
ciecacode:
|
||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
|
||||
? values.cost_center
|
||||
|
||||
Reference in New Issue
Block a user