IO-1038 Negative time tickets to reduce hours.

This commit is contained in:
Patrick Fic
2021-05-07 16:06:26 -07:00
parent 4bf392b2fb
commit 19a781c5ee
6 changed files with 53 additions and 6 deletions

View File

@@ -32479,6 +32479,27 @@
</translation> </translation>
</translations> </translations>
</concept_node> </concept_node>
<concept_node>
<name>zeroactualnegativeprod</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> </children>
</folder_node> </folder_node>
<folder_node> <folder_node>

View File

@@ -265,6 +265,7 @@ export function TimeTicketList({
</Table.Summary.Cell> </Table.Summary.Cell>
<Table.Summary.Cell /> <Table.Summary.Cell />
<Table.Summary.Cell /> <Table.Summary.Cell />
<Table.Summary.Cell />
<Table.Summary.Cell>{totals.productivehrs}</Table.Summary.Cell> <Table.Summary.Cell>{totals.productivehrs}</Table.Summary.Cell>
<Table.Summary.Cell>{totals.actualhrs}</Table.Summary.Cell> <Table.Summary.Cell>{totals.actualhrs}</Table.Summary.Cell>
<Table.Summary.Cell> <Table.Summary.Cell>

View File

@@ -152,11 +152,33 @@ export function TimeTicketModalComponent({
}, },
]} ]}
> >
<InputNumber min={0} precision={1} /> <InputNumber precision={1} />
</Form.Item> </Form.Item>
)} )}
</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} /> <InputNumber min={0} precision={1} />
</Form.Item> </Form.Item>
{isEdit && ( {isEdit && (

View File

@@ -1793,7 +1793,7 @@
"refinishhours": "R", "refinishhours": "R",
"selectview": "Select a View", "selectview": "Select a View",
"sublets": "Sublets", "sublets": "Sublets",
"totalhours": "Total Hrs", "totalhours": "Total Hrs ",
"touchtime": "T/T", "touchtime": "T/T",
"viewname": "View Name" "viewname": "View Name"
}, },
@@ -1957,7 +1957,8 @@
"shift": "Shift", "shift": "Shift",
"shiftalreadyclockedon": "Active Shift Time Tickets", "shiftalreadyclockedon": "Active Shift Time Tickets",
"straight_time": "Straight Time", "straight_time": "Straight Time",
"timetickets": "Time Tickets" "timetickets": "Time Tickets",
"zeroactualnegativeprod": "Actual hours must be 0 if entering negative productive hours."
}, },
"successes": { "successes": {
"clockedin": "Clocked in successfully.", "clockedin": "Clocked in successfully.",

View File

@@ -1957,7 +1957,8 @@
"shift": "", "shift": "",
"shiftalreadyclockedon": "", "shiftalreadyclockedon": "",
"straight_time": "", "straight_time": "",
"timetickets": "" "timetickets": "",
"zeroactualnegativeprod": ""
}, },
"successes": { "successes": {
"clockedin": "", "clockedin": "",

View File

@@ -1957,7 +1957,8 @@
"shift": "", "shift": "",
"shiftalreadyclockedon": "", "shiftalreadyclockedon": "",
"straight_time": "", "straight_time": "",
"timetickets": "" "timetickets": "",
"zeroactualnegativeprod": ""
}, },
"successes": { "successes": {
"clockedin": "", "clockedin": "",