Merged in release/2022-01-28 (pull request #361)

release/2022-01-28

Approved-by: Patrick Fic
This commit is contained in:
Patrick Fic
2022-01-27 23:20:06 +00:00
6 changed files with 134 additions and 105 deletions

View File

@@ -58,7 +58,7 @@ export function BillEnterModalLinesComponent({
], ],
}; };
}, },
formInput: (record, index) => ( wrapper: (props) => (
<Form.Item <Form.Item
noStyle noStyle
shouldUpdate={(prev, cur) => shouldUpdate={(prev, cur) =>
@@ -66,7 +66,11 @@ export function BillEnterModalLinesComponent({
} }
> >
{() => { {() => {
return ( return props.children;
}}
</Form.Item>
),
formInput: (record, index) => (
<BillLineSearchSelect <BillLineSearchSelect
disabled={disabled} disabled={disabled}
options={lineData} options={lineData}
@@ -83,8 +87,7 @@ export function BillEnterModalLinesComponent({
quantity: opt.part_qty || 1, quantity: opt.part_qty || 1,
actual_price: opt.cost, actual_price: opt.cost,
cost_center: opt.part_type cost_center: opt.part_type
? bodyshop.pbs_serialnumber || ? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
bodyshop.cdk_dealerid
? opt.part_type !== "PAE" ? opt.part_type !== "PAE"
? opt.part_type ? opt.part_type
: null : null
@@ -102,9 +105,6 @@ export function BillEnterModalLinesComponent({
}); });
}} }}
/> />
);
}}
</Form.Item>
), ),
}, },
{ {
@@ -537,6 +537,7 @@ const EditableCell = ({
formInput, formInput,
formItemProps, formItemProps,
additional, additional,
wrapper,
...restProps ...restProps
}) => { }) => {
if (additional) if (additional)
@@ -554,7 +555,20 @@ const EditableCell = ({
</Space> </Space>
</td> </td>
); );
if (wrapper)
return (
<wrapper>
<td {...restProps}>
<Form.Item
labelCol={{ span: 0 }}
name={dataIndex}
{...(formItemProps && formItemProps(record))}
>
{(formInput && formInput(record, record.name)) || children}
</Form.Item>
</td>
</wrapper>
);
return ( return (
<td {...restProps}> <td {...restProps}>
<Form.Item <Form.Item

View File

@@ -9,7 +9,7 @@ const BillLineSearchSelect = (
ref ref
) => { ) => {
const { t } = useTranslation(); const { t } = useTranslation();
console.log(allowRemoved);
return ( return (
<Select <Select
disabled={disabled} disabled={disabled}
@@ -56,7 +56,7 @@ const BillLineSearchSelect = (
<span>{`${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${ <span>{`${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${
item.oem_partno ? ` - ${item.oem_partno}` : "" item.oem_partno ? ` - ${item.oem_partno}` : ""
}`}</span> }`}</span>
<span style={{ float: "right" }}> <span style={{ float: "right", paddingleft: "1rem" }}>
{item.act_price {item.act_price
? `$${item.act_price && item.act_price.toFixed(2)}` ? `$${item.act_price && item.act_price.toFixed(2)}`
: ``} : ``}

View File

@@ -58,7 +58,8 @@ export function BillsListTableComponent({
disabled={ disabled={
record.is_credit_memo || record.vendorid === bodyshop.inhousevendorid record.is_credit_memo || record.vendorid === bodyshop.inhousevendorid
} }
onClick={() => onClick={() => {
console.log(record);
setPartsOrderContext({ setPartsOrderContext({
actions: {}, actions: {},
context: { context: {
@@ -74,12 +75,13 @@ export function BillsListTableComponent({
cost: i.actual_cost, cost: i.actual_cost,
quantity: i.quantity, quantity: i.quantity,
joblineid: i.joblineid, joblineid: i.joblineid,
oem_partno: i.jobline && i.jobline.oem_partno,
}; };
}), }),
isReturn: true, isReturn: true,
}, },
}) });
} }}
> >
{t("bills.actions.return")} {t("bills.actions.return")}
</Button> </Button>

View File

@@ -91,7 +91,8 @@ export function PartsOrderModalComponent({
<div> <div>
{fields.map((field, index) => ( {fields.map((field, index) => (
<Form.Item required={false} key={field.key}> <Form.Item required={false} key={field.key}>
<LayoutFormRow grow noDivider> <div style={{ display: "flex" }}>
<LayoutFormRow grow noDivider style={{ flex: 1 }}>
<Form.Item <Form.Item
//span={8} //span={8}
label={t("parts_orders.fields.line_desc")} label={t("parts_orders.fields.line_desc")}
@@ -113,6 +114,13 @@ export function PartsOrderModalComponent({
> >
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item
label={t("parts_orders.fields.oem_partno")}
key={`${index}oem_partno`}
name={[field.name, "oem_partno"]}
>
<Input />
</Form.Item>
{ {
// <Form.Item // <Form.Item
// label={t("parts_orders.fields.db_price")} // label={t("parts_orders.fields.db_price")}
@@ -151,8 +159,8 @@ export function PartsOrderModalComponent({
<CurrencyInput /> <CurrencyInput />
</Form.Item> </Form.Item>
)} )}
</LayoutFormRow>
<Space wrap align="center"> <Space wrap size="small" align="center">
<div> <div>
<DeleteFilled <DeleteFilled
style={{ margin: "1rem" }} style={{ margin: "1rem" }}
@@ -167,7 +175,7 @@ export function PartsOrderModalComponent({
total={fields.length} total={fields.length}
/> />
</Space> </Space>
</LayoutFormRow> </div>
</Form.Item> </Form.Item>
))} ))}
</div> </div>

View File

@@ -181,7 +181,10 @@ export const UPDATE_JOB_LINE = gql`
export const GET_JOB_LINES_TO_ENTER_BILL = gql` export const GET_JOB_LINES_TO_ENTER_BILL = gql`
query GET_JOB_LINES_TO_ENTER_BILL($id: uuid!) { query GET_JOB_LINES_TO_ENTER_BILL($id: uuid!) {
joblines(where: { jobid: { _eq: $id } }, order_by: { act_price: desc }) { joblines(
where: { jobid: { _eq: $id } }
order_by: { act_price: desc_nulls_last }
) {
removed removed
id id
line_desc line_desc

View File

@@ -136,7 +136,9 @@ const generatePayment = (payment, isThreeTier, twoTierPref) => {
PaymentMethodRef: { PaymentMethodRef: {
FullName: payment.type, FullName: payment.type,
}, },
Memo: `RO ${payment.job.ro_number || ""} ${ Memo: `RO ${payment.job.ro_number || ""} OWNER ${
payment.job.ownr_fn || ""
} ${payment.job.ownr_ln || ""} ${payment.job.ownr_co_nm || ""} ${
payment.stripeid || "" payment.stripeid || ""
} ${payment.payer ? ` PAID BY ${payment.payer}` : ""}`, } ${payment.payer ? ` PAID BY ${payment.payer}` : ""}`,
IsAutoApply: true, IsAutoApply: true,