IO-1038 Negative time tickets to reduce hours.
This commit is contained in:
@@ -265,6 +265,7 @@ export function TimeTicketList({
|
||||
</Table.Summary.Cell>
|
||||
<Table.Summary.Cell />
|
||||
<Table.Summary.Cell />
|
||||
<Table.Summary.Cell />
|
||||
<Table.Summary.Cell>{totals.productivehrs}</Table.Summary.Cell>
|
||||
<Table.Summary.Cell>{totals.actualhrs}</Table.Summary.Cell>
|
||||
<Table.Summary.Cell>
|
||||
|
||||
@@ -152,11 +152,33 @@ export function TimeTicketModalComponent({
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber min={0} precision={1} />
|
||||
<InputNumber precision={1} />
|
||||
</Form.Item>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item label={t("timetickets.fields.actualhrs")} name="actualhrs">
|
||||
<Form.Item
|
||||
dependencies={["productivehrs"]}
|
||||
label={t("timetickets.fields.actualhrs")}
|
||||
name="actualhrs"
|
||||
rules={[
|
||||
({ getFieldValue }) => ({
|
||||
async validator(rule, value) {
|
||||
if (value) {
|
||||
const prodHrs = getFieldValue("productivehrs");
|
||||
if (prodHrs < 0 && value !== 0)
|
||||
return Promise.reject(
|
||||
t("timetickets.labels.zeroactualnegativeprod")
|
||||
);
|
||||
else {
|
||||
return Promise.resolve();
|
||||
}
|
||||
} else {
|
||||
return Promise.resolve();
|
||||
}
|
||||
},
|
||||
}),
|
||||
]}
|
||||
>
|
||||
<InputNumber min={0} precision={1} />
|
||||
</Form.Item>
|
||||
{isEdit && (
|
||||
|
||||
Reference in New Issue
Block a user