Added multiple labor rates to employees

IO-548
This commit is contained in:
Patrick Fic
2021-01-21 10:45:59 -08:00
parent 4b75f2eccd
commit 6d1dbe5f63
21 changed files with 429 additions and 70 deletions

View File

@@ -13,7 +13,6 @@ export default function TimeTicketModalComponent({
employeeAutoCompleteOptions,
loadLineTicketData,
lineTicketData,
responsibilityCenters,
}) {
const { t } = useTranslation();
@@ -92,21 +91,38 @@ export default function TimeTicketModalComponent({
>
<InputNumber min={0} precision={1} />
</Form.Item>
<Form.Item
name="cost_center"
label={t("timetickets.fields.cost_center")}
rules={[
{
required: true,
message: t("general.validation.required"),
},
]}
shouldUpdate={(prev, cur) => prev.employeeid !== cur.employeeid}
>
<Select>
{responsibilityCenters.costs.map((item) => (
<Select.Option key={item.name}>{item.name}</Select.Option>
))}
</Select>
{() => {
const employeeId = form.getFieldValue("employeeid");
const emps =
employeeAutoCompleteOptions &&
employeeAutoCompleteOptions.filter((e) => e.id === employeeId)[0];
return (
<Form.Item
name="cost_center"
label={t("timetickets.fields.cost_center")}
rules={[
{
required: true,
message: t("general.validation.required"),
},
]}
>
<Select>
{emps &&
emps.rates.map((item) => (
<Select.Option key={item.cost_center}>
{item.cost_center}
</Select.Option>
))}
</Select>
</Form.Item>
);
}}
</Form.Item>
<Form.Item
name="ciecacode"