Allow negative job line split.
This commit is contained in:
@@ -4,7 +4,24 @@ import { useTranslation } from "react-i18next";
|
||||
import InputCurrency from "../form-items-formatted/currency-form-item.component";
|
||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||
import JoblinesPreset from "../job-lines-preset-button/job-lines-preset-button.component";
|
||||
export default function JobLinesUpsertModalComponent({
|
||||
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(JobLinesUpsertModalComponent);
|
||||
|
||||
export function JobLinesUpsertModalComponent({
|
||||
bodyshop,
|
||||
visible,
|
||||
jobLine,
|
||||
handleCancel,
|
||||
@@ -18,6 +35,12 @@ export default function JobLinesUpsertModalComponent({
|
||||
form.resetFields();
|
||||
}, [visible, form]);
|
||||
|
||||
const { Allow_Negative_Jobline_Price } = useTreatments(
|
||||
["Allow_Negative_Jobline_Price"],
|
||||
{},
|
||||
bodyshop.imexshopid
|
||||
);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title={
|
||||
@@ -213,7 +236,10 @@ export default function JobLinesUpsertModalComponent({
|
||||
}),
|
||||
]}
|
||||
>
|
||||
<InputCurrency precision={2} min={0} />
|
||||
<InputCurrency
|
||||
precision={2}
|
||||
min={Allow_Negative_Jobline_Price.treatment === "on" ? null : 0}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("joblines.fields.prt_dsmk_p")}
|
||||
|
||||
Reference in New Issue
Block a user