feature/IO-3357-Reynolds-and-Reynolds-DMS-API-Integration - Checking in verified

This commit is contained in:
Dave
2025-11-17 15:00:36 -05:00
parent 6162e7f18d
commit cfd5aaff87
4 changed files with 79 additions and 3 deletions

View File

@@ -54,9 +54,14 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
[])
]);
const getCenterNames = (path) => {
const centers = form.getFieldValue(path) || [];
return centers.map((i) => i && i.name).filter(Boolean);
};
const handleBlur = () => {
setCostOptions([...(form.getFieldValue(["md_responsibility_centers", "costs"]).map((i) => i && i.name) || [])]);
setProfitOptions([...(form.getFieldValue(["md_responsibility_centers", "profits"]).map((i) => i && i.name) || [])]);
setCostOptions(getCenterNames(["md_responsibility_centers", "costs"]));
setProfitOptions(getCenterNames(["md_responsibility_centers", "profits"]));
};
return (
@@ -430,6 +435,53 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
<Input onBlur={handleBlur} />
</Form.Item>
)}
{bodyshop.rr_dealerid && (
<>
<Form.Item
label={t("bodyshop.fields.responsibilitycenters.gogcode")}
key={`${index}rr_gogcode`}
name={[field.name, "rr_gogcode"]}
rules={[{ required: true }]}
>
<Input onBlur={handleBlur} />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.responsibilitycenters.item_type")}
key={`${index}rr_item_type`}
name={[field.name, "rr_item_type"]}
rules={[{ required: true }]}
>
<Select>
<Select.Option value="G">
{t("bodyshop.fields.responsibilitycenters.item_type_gog")}
</Select.Option>
<Select.Option value="P">
{t("bodyshop.fields.responsibilitycenters.item_type_paint")}
</Select.Option>
<Select.Option value="F">
{t("bodyshop.fields.responsibilitycenters.item_type_freight")}
</Select.Option>
</Select>
</Form.Item>
<Form.Item
label={t("bodyshop.fields.responsibilitycenters.taxable_flag")}
key={`${index}rr_cust_txbl_flag`}
name={[field.name, "rr_cust_txbl_flag"]}
rules={[{ required: true }]}
>
<Select>
<Select.Option value="T">
{t("bodyshop.fields.responsibilitycenters.taxable")}
</Select.Option>
<Select.Option value="N">
{t("bodyshop.fields.responsibilitycenters.nontaxable")}
</Select.Option>
</Select>
</Form.Item>
</>
)}
<Space align="center">
<DeleteFilled
onClick={() => {
@@ -2369,7 +2421,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
<Form.Item
label={t("bodyshop.fields.responsibilitycenters.pan")}
rules={[
{ equired: true },
{ required: true },
() => ({
validator(rule, value) {
if (costOptions.includes(value)) {

View File

@@ -558,6 +558,14 @@
"responsibilitycenter_tax_tier": "Tax {{typeNum}} Tier {{typeNumIterator}}",
"responsibilitycenter_tax_type": "Tax {{typeNum}} Type",
"responsibilitycenters": {
"gogcode": "GOG Code (BreakOut)",
"item_type": "Item Type",
"item_type_gog": "GOG",
"item_type_paint": "Paint Materials",
"item_type_freight": "Freight",
"taxable_flag": "Taxable?",
"taxable": "Taxable",
"nontaxable": "Non-taxable",
"ap": "Accounts Payable",
"ar": "Accounts Receivable",
"ats": "ATS",

View File

@@ -558,6 +558,14 @@
"responsibilitycenter_tax_tier": "",
"responsibilitycenter_tax_type": "",
"responsibilitycenters": {
"gogcode": "",
"item_type": "Item Type",
"item_type_gog": "",
"item_type_paint": "",
"item_type_freight": "",
"taxable_flag": "",
"taxable": "",
"nontaxable": "",
"ap": "",
"ar": "",
"ats": "",

View File

@@ -558,6 +558,14 @@
"responsibilitycenter_tax_tier": "",
"responsibilitycenter_tax_type": "",
"responsibilitycenters": {
"gogcode": "",
"item_type": "Item Type",
"item_type_gog": "",
"item_type_paint": "",
"item_type_freight": "",
"taxable_flag": "",
"taxable": "",
"nontaxable": "",
"ap": "",
"ar": "",
"ats": "",