IO-233 CDK updates.

This commit is contained in:
Patrick Fic
2021-12-02 10:50:11 -08:00
parent a77e664ab1
commit 39ec9d92ec
23 changed files with 688 additions and 201 deletions

View File

@@ -14,6 +14,7 @@ import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import CiecaSelect, { GetPartTypeName } 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";
@@ -72,11 +73,13 @@ export function BillEnterModalLinesComponent({
quantity: opt.part_qty || 1,
actual_price: opt.cost,
cost_center: opt.part_type
? responsibilityCenters.defaults &&
(responsibilityCenters.defaults.costs[
opt.part_type
] ||
null)
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
? GetPartTypeName(opt.part_type)
: responsibilityCenters.defaults &&
(responsibilityCenters.defaults.costs[
opt.part_type
] ||
null)
: null,
};
}
@@ -224,6 +227,7 @@ export function BillEnterModalLinesComponent({
key: `${field.index}cost_center`,
name: [field.name, "cost_center"],
label: t("billlines.fields.cost_center"),
valuePropName: "value",
rules: [
{
required: true,
@@ -233,10 +237,12 @@ export function BillEnterModalLinesComponent({
};
},
formInput: (record, index) => (
<Select style={{ minWidth: "3rem" }} disabled={disabled}>
{responsibilityCenters.costs.map((item) => (
<Select.Option key={item.name}>{item.name}</Select.Option>
))}
<Select showSearch style={{ minWidth: "3rem" }} disabled={disabled}>
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
? CiecaSelect(true, false)
: responsibilityCenters.costs.map((item) => (
<Select.Option key={item.name}>{item.name}</Select.Option>
))}
</Select>
),
},