Merged in release/2022-01-28 (pull request #361)
release/2022-01-28 Approved-by: Patrick Fic
This commit is contained in:
@@ -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,46 +66,46 @@ export function BillEnterModalLinesComponent({
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
{() => {
|
{() => {
|
||||||
return (
|
return props.children;
|
||||||
<BillLineSearchSelect
|
|
||||||
disabled={disabled}
|
|
||||||
options={lineData}
|
|
||||||
style={{ width: "100%", minWidth: "10rem" }}
|
|
||||||
allowRemoved={form.getFieldValue("is_credit_memo") || false}
|
|
||||||
onSelect={(value, opt) => {
|
|
||||||
setFieldsValue({
|
|
||||||
billlines: getFieldsValue(["billlines"]).billlines.map(
|
|
||||||
(item, idx) => {
|
|
||||||
if (idx === index) {
|
|
||||||
return {
|
|
||||||
...item,
|
|
||||||
line_desc: opt.line_desc,
|
|
||||||
quantity: opt.part_qty || 1,
|
|
||||||
actual_price: opt.cost,
|
|
||||||
cost_center: opt.part_type
|
|
||||||
? bodyshop.pbs_serialnumber ||
|
|
||||||
bodyshop.cdk_dealerid
|
|
||||||
? opt.part_type !== "PAE"
|
|
||||||
? opt.part_type
|
|
||||||
: null
|
|
||||||
: responsibilityCenters.defaults &&
|
|
||||||
(responsibilityCenters.defaults.costs[
|
|
||||||
opt.part_type
|
|
||||||
] ||
|
|
||||||
null)
|
|
||||||
: null,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
),
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
),
|
),
|
||||||
|
formInput: (record, index) => (
|
||||||
|
<BillLineSearchSelect
|
||||||
|
disabled={disabled}
|
||||||
|
options={lineData}
|
||||||
|
style={{ width: "100%", minWidth: "10rem" }}
|
||||||
|
allowRemoved={form.getFieldValue("is_credit_memo") || false}
|
||||||
|
onSelect={(value, opt) => {
|
||||||
|
setFieldsValue({
|
||||||
|
billlines: getFieldsValue(["billlines"]).billlines.map(
|
||||||
|
(item, idx) => {
|
||||||
|
if (idx === index) {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
line_desc: opt.line_desc,
|
||||||
|
quantity: opt.part_qty || 1,
|
||||||
|
actual_price: opt.cost,
|
||||||
|
cost_center: opt.part_type
|
||||||
|
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
|
||||||
|
? opt.part_type !== "PAE"
|
||||||
|
? opt.part_type
|
||||||
|
: null
|
||||||
|
: responsibilityCenters.defaults &&
|
||||||
|
(responsibilityCenters.defaults.costs[
|
||||||
|
opt.part_type
|
||||||
|
] ||
|
||||||
|
null)
|
||||||
|
: null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("billlines.fields.line_desc"),
|
title: t("billlines.fields.line_desc"),
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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)}`
|
||||||
: ``}
|
: ``}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -91,68 +91,76 @@ 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" }}>
|
||||||
<Form.Item
|
<LayoutFormRow grow noDivider style={{ flex: 1 }}>
|
||||||
//span={8}
|
|
||||||
label={t("parts_orders.fields.line_desc")}
|
|
||||||
key={`${index}line_desc`}
|
|
||||||
name={[field.name, "line_desc"]}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
//message: t("general.validation.required"),
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
label={t("parts_orders.fields.line_remarks")}
|
|
||||||
key={`${index}line_remarks`}
|
|
||||||
name={[field.name, "line_remarks"]}
|
|
||||||
>
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
{
|
|
||||||
// <Form.Item
|
|
||||||
// label={t("parts_orders.fields.db_price")}
|
|
||||||
// key={`${index}db_price`}
|
|
||||||
// name={[field.name, "db_price"]}
|
|
||||||
// >
|
|
||||||
// <CurrencyInput />
|
|
||||||
// </Form.Item>
|
|
||||||
}
|
|
||||||
<Form.Item
|
|
||||||
label={t("parts_orders.fields.quantity")}
|
|
||||||
key={`${index}quantity`}
|
|
||||||
name={[field.name, "quantity"]}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
//message: t("general.validation.required"),
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<InputNumber />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
label={t("parts_orders.fields.act_price")}
|
|
||||||
key={`${index}act_price`}
|
|
||||||
name={[field.name, "act_price"]}
|
|
||||||
>
|
|
||||||
<CurrencyInput />
|
|
||||||
</Form.Item>
|
|
||||||
{isReturn && (
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("parts_orders.fields.cost")}
|
//span={8}
|
||||||
key={`${index}cost`}
|
label={t("parts_orders.fields.line_desc")}
|
||||||
name={[field.name, "cost"]}
|
key={`${index}line_desc`}
|
||||||
|
name={[field.name, "line_desc"]}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("parts_orders.fields.line_remarks")}
|
||||||
|
key={`${index}line_remarks`}
|
||||||
|
name={[field.name, "line_remarks"]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</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
|
||||||
|
// label={t("parts_orders.fields.db_price")}
|
||||||
|
// key={`${index}db_price`}
|
||||||
|
// name={[field.name, "db_price"]}
|
||||||
|
// >
|
||||||
|
// <CurrencyInput />
|
||||||
|
// </Form.Item>
|
||||||
|
}
|
||||||
|
<Form.Item
|
||||||
|
label={t("parts_orders.fields.quantity")}
|
||||||
|
key={`${index}quantity`}
|
||||||
|
name={[field.name, "quantity"]}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<InputNumber />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("parts_orders.fields.act_price")}
|
||||||
|
key={`${index}act_price`}
|
||||||
|
name={[field.name, "act_price"]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
{isReturn && (
|
||||||
|
<Form.Item
|
||||||
<Space wrap align="center">
|
label={t("parts_orders.fields.cost")}
|
||||||
|
key={`${index}cost`}
|
||||||
|
name={[field.name, "cost"]}
|
||||||
|
>
|
||||||
|
<CurrencyInput />
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
|
</LayoutFormRow>
|
||||||
|
<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>
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user