Merged in feature/IO-3398-bill-line-select-display (pull request #2638)

IO-3398 Bill line search select will now show price in select value.
This commit is contained in:
Patrick Fic
2025-10-23 18:49:29 +00:00
2 changed files with 32 additions and 29 deletions

View File

@@ -45,7 +45,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.jobline"), title: t("billlines.fields.jobline"),
dataIndex: "joblineid", dataIndex: "joblineid",
editable: true, editable: true,
width: "20rem", minWidth: "10rem",
formItemProps: (field) => { formItemProps: (field) => {
return { return {
key: `${field.index}joblinename`, key: `${field.index}joblinename`,
@@ -71,9 +71,9 @@ export function BillEnterModalLinesComponent({
disabled={disabled} disabled={disabled}
options={lineData} options={lineData}
style={{ style={{
width: "20rem", //width: "10rem",
maxWidth: "20rem", // maxWidth: "20rem",
minWidth: "10rem", minWidth: "20rem",
whiteSpace: "normal", whiteSpace: "normal",
height: "auto", height: "auto",
minHeight: "32px" // default height of Ant Design inputs minHeight: "32px" // default height of Ant Design inputs
@@ -110,7 +110,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.line_desc"), title: t("billlines.fields.line_desc"),
dataIndex: "line_desc", dataIndex: "line_desc",
editable: true, editable: true,
width: "20rem", minWidth: "10rem",
formItemProps: (field) => { formItemProps: (field) => {
return { return {
key: `${field.index}line_desc`, key: `${field.index}line_desc`,
@@ -232,7 +232,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.actual_cost"), title: t("billlines.fields.actual_cost"),
dataIndex: "actual_cost", dataIndex: "actual_cost",
editable: true, editable: true,
width: "8rem", width: "10rem",
formItemProps: (field) => { formItemProps: (field) => {
return { return {
@@ -357,6 +357,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.labels.deductedfromlbr"), title: t("billlines.labels.deductedfromlbr"),
dataIndex: "deductedfromlbr", dataIndex: "deductedfromlbr",
editable: true, editable: true,
width: "40px",
formItemProps: (field) => { formItemProps: (field) => {
return { return {
valuePropName: "checked", valuePropName: "checked",
@@ -464,7 +465,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.federal_tax_applicable"), title: t("billlines.fields.federal_tax_applicable"),
dataIndex: "applicable_taxes.federal", dataIndex: "applicable_taxes.federal",
editable: true, editable: true,
width: "40px",
formItemProps: (field) => { formItemProps: (field) => {
return { return {
key: `${field.index}fedtax`, key: `${field.index}fedtax`,
@@ -485,7 +486,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.state_tax_applicable"), title: t("billlines.fields.state_tax_applicable"),
dataIndex: "applicable_taxes.state", dataIndex: "applicable_taxes.state",
editable: true, editable: true,
width: "40px",
formItemProps: (field) => { formItemProps: (field) => {
return { return {
key: `${field.index}statetax`, key: `${field.index}statetax`,
@@ -503,7 +504,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.local_tax_applicable"), title: t("billlines.fields.local_tax_applicable"),
dataIndex: "applicable_taxes.local", dataIndex: "applicable_taxes.local",
editable: true, editable: true,
width: "40px",
formItemProps: (field) => { formItemProps: (field) => {
return { return {
key: `${field.index}localtax`, key: `${field.index}localtax`,

View File

@@ -39,30 +39,32 @@ const BillLineSearchSelect = ({ options, disabled, allowRemoved, ...restProps },
style: { style: {
...(item.removed ? { textDecoration: "line-through" } : {}) ...(item.removed ? { textDecoration: "line-through" } : {})
}, },
name: `${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${ name: generateLineName(item),
item.oem_partno ? ` - ${item.oem_partno}` : "" label: generateLineName(item)
}${item.alt_partno ? ` (${item.alt_partno})` : ""}`.trim(),
label: (
<div style={{ whiteSpace: "normal", wordBreak: "break-word" }}>
<span>
{`${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${
item.oem_partno ? ` - ${item.oem_partno}` : ""
}${item.alt_partno ? ` (${item.alt_partno})` : ""}`.trim()}
</span>
{InstanceRenderMgr({
rome: item.act_price === 0 && item.mod_lb_hrs > 0 && (
<span style={{ float: "right", paddingleft: "1rem" }}>{`${item.mod_lb_hrs} units`}</span>
)
})}
<span style={{ float: "right", paddingleft: "1rem" }}>
{item.act_price ? `$${item.act_price && item.act_price.toFixed(2)}` : ``}
</span>
</div>
)
})) }))
]} ]}
{...restProps} {...restProps}
></Select> ></Select>
); );
}; };
function generateLineName(item) {
return (
<div style={{ whiteSpace: "normal", wordBreak: "break-word" }}>
<span>
{`${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${
item.oem_partno ? ` - ${item.oem_partno}` : ""
}${item.alt_partno ? ` (${item.alt_partno})` : ""}`.trim()}
</span>
{InstanceRenderMgr({
rome: item.act_price === 0 && item.mod_lb_hrs > 0 && (
<span style={{ float: "right", paddingleft: "1rem" }}>{`${item.mod_lb_hrs} units`}</span>
)
})}
<span style={{ float: "right", paddingleft: "1rem" }}>
{item.act_price ? `$${item.act_price && item.act_price.toFixed(2)}` : ``}
</span>
</div>
);
}
export default forwardRef(BillLineSearchSelect); export default forwardRef(BillLineSearchSelect);