IO-1979 Resolve various employee vacation bugs.

This commit is contained in:
Patrick Fic
2022-07-19 13:41:14 -07:00
parent 179147dc4e
commit d5f55c5873
8 changed files with 100 additions and 71 deletions

View File

@@ -14777,6 +14777,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>vacationadded</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
</children>
</folder_node>
<folder_node>

View File

@@ -37,9 +37,12 @@ export function ScheduleCalendarHeaderComponent({
...otherProps
}) {
const ATSToday = useMemo(() => {
console.log("eeee", events);
if (!events) return [];
return _.groupBy(
events.filter((e) => moment(date).isSame(moment(e.start), "day")),
events.filter(
(e) => !e.vacation && moment(date).isSame(moment(e.start), "day")
),
"job.alt_transport"
);
}, [events, date]);

View File

@@ -43,7 +43,7 @@ export default function ShopEmployeeAddVacation({ employee }) {
});
} else {
notification["success"]({
message: t("employees.successes.added"),
message: t("employees.successes.vacationadded"),
});
}
setLoading(false);

View File

@@ -1494,7 +1494,7 @@ export default function ShopInfoGeneral({ form }) {
}
const ReceivableCustomFieldSelect = (
<Select>
<Select allowClear>
<Select.Option value="v_vin">VIN</Select.Option>
<Select.Option value="clm_no">Claim No.</Select.Option>
<Select.Option value="ded_amt">Deductible Amount</Select.Option>

View File

@@ -1,75 +1,77 @@
import { gql } from "@apollo/client";
export const QUERY_ALL_ACTIVE_APPOINTMENTS = gql`
query QUERY_ALL_ACTIVE_APPOINTMENTS(
$start: timestamptz!
$end: timestamptz!
$startd: date!
$endd: date!
query QUERY_ALL_ACTIVE_APPOINTMENTS(
$start: timestamptz!
$end: timestamptz!
$startd: date!
$endd: date!
) {
employee_vacation(
where: { _or: [{ start: { _gte: $startd } },
{ end: { _lte: $endd } },
{_and:[{start:{_lte: $startd}},{end:{_gte:$endd}}]}] }
) {
employee_vacation(
where: { _or: [{ start: { _gte: $startd } }, { end: { _lte: $endd } }] }
) {
id
start
end
employee {
id
start
end
employee {
id
last_name
first_name
last_name
first_name
}
}
appointments(
where: {
canceled: { _eq: false }
end: { _lte: $end }
start: { _gte: $start }
}
) {
start
id
end
arrived
title
isintake
block
color
note
job {
alt_transport
ro_number
ownr_ln
ownr_co_nm
ownr_fn
ownr_ph1
ownr_ph2
ownr_ea
clm_total
id
clm_no
ins_co_nm
v_model_yr
v_make_desc
v_model_desc
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
}
appointments(
where: {
canceled: { _eq: false }
end: { _lte: $end }
start: { _gte: $start }
}
) {
start
id
end
arrived
title
isintake
block
color
note
job {
alt_transport
ro_number
ownr_ln
ownr_co_nm
ownr_fn
ownr_ph1
ownr_ph2
ownr_ea
clm_total
id
clm_no
ins_co_nm
v_model_yr
v_make_desc
v_model_desc
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
}
}
}
`;

View File

@@ -922,7 +922,8 @@
},
"successes": {
"delete": "Employee deleted successfully.",
"save": "Employee saved successfully."
"save": "Employee saved successfully.",
"vacationadded": "Employee vacation added."
},
"validation": {
"unique_employee_number": "You must enter a unique employee number."

View File

@@ -922,7 +922,8 @@
},
"successes": {
"delete": "Empleado eliminado con éxito.",
"save": "Empleado guardado con éxito."
"save": "Empleado guardado con éxito.",
"vacationadded": ""
},
"validation": {
"unique_employee_number": ""

View File

@@ -922,7 +922,8 @@
},
"successes": {
"delete": "L'employé a bien été supprimé.",
"save": "L'employé a enregistré avec succès."
"save": "L'employé a enregistré avec succès.",
"vacationadded": ""
},
"validation": {
"unique_employee_number": ""