IO-1914 Add split tracking for inventory.

This commit is contained in:
Patrick Fic
2022-06-06 09:53:42 -07:00
parent 1258843f3d
commit 3feb1a3887

View File

@@ -19,6 +19,7 @@ import CiecaSelect from "../../utils/Ciecaselect";
import BillLineSearchSelect from "../bill-line-search-select/bill-line-search-select.component";
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
import BilllineAddInventory from "../billline-add-inventory/billline-add-inventory.component";
import { useTreatments } from "@splitsoftware/splitio-react";
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
@@ -40,7 +41,11 @@ export function BillEnterModalLinesComponent({
}) {
const { t } = useTranslation();
const { setFieldsValue, getFieldsValue, getFieldValue } = form;
const { Simple_Inventory } = useTreatments(
["Simple_Inventory"],
{},
bodyshop && bodyshop.imexshopid
);
const columns = (remove) => {
return [
{
@@ -485,13 +490,15 @@ export function BillEnterModalLinesComponent({
<DeleteFilled />
</Button>
<Form.Item shouldUpdate noStyle>
{() => (
<BilllineAddInventory
disabled={!billEdit || form.isFieldsTouched()}
billline={getFieldValue("billlines")[record.fieldKey]}
jobid={getFieldValue("jobid")}
/>
)}
{() =>
Simple_Inventory.treatment === "on" && (
<BilllineAddInventory
disabled={!billEdit || form.isFieldsTouched()}
billline={getFieldValue("billlines")[record.fieldKey]}
jobid={getFieldValue("jobid")}
/>
)
}
</Form.Item>
</Space>
),