IO-1912 Resolve date for tech clock in.

This commit is contained in:
Patrick Fic
2022-05-27 14:34:02 -07:00
parent 885a861f1e
commit 595ec72edd
3 changed files with 11 additions and 10 deletions

View File

@@ -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:

View File

@@ -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

View File

@@ -800,7 +800,7 @@ const CreateCosts = (job) => {
};
const StatusMapping = (status, md_ro_statuses) => {
//EST, SCH, ARR, IPR, RDY, DEL, CLO, CAN, UNDEFINED.
//Possible return statuses EST, SCH, ARR, IPR, RDY, DEL, CLO, CAN, UNDEFINED.
const {
default_imported,
default_open,
@@ -823,8 +823,6 @@ const StatusMapping = (status, md_ro_statuses) => {
else if (status === default_void) return "VOID";
else if (md_ro_statuses.production_statuses.includes(status)) return "IPR";
else return "UNDEFINED";
// default: return "UNDEFINED"
};
const GenerateDetailLines = (job, line, statuses) => {