Further WIP in invoice enter screen.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<babeledit_project be_version="2.6.1" version="1.2">
|
<babeledit_project version="1.2" be_version="2.6.1">
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
BabelEdit project file
|
BabelEdit project file
|
||||||
@@ -1931,6 +1931,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>reconciled</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>unreconciled</name>
|
<name>unreconciled</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
@@ -18,15 +18,14 @@ export default function InvoiceEnterModalComponent({
|
|||||||
invoice,
|
invoice,
|
||||||
handleCancel,
|
handleCancel,
|
||||||
handleFinish,
|
handleFinish,
|
||||||
|
|
||||||
handleRoSelect,
|
handleRoSelect,
|
||||||
roAutoCompleteOptions,
|
roAutoCompleteOptions,
|
||||||
|
|
||||||
handleVendorSelect,
|
handleVendorSelect,
|
||||||
vendorAutoCompleteOptions,
|
vendorAutoCompleteOptions,
|
||||||
lineData,
|
lineData,
|
||||||
vendor,
|
vendor,
|
||||||
job
|
job,
|
||||||
|
responsibilityCenters
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
@@ -165,6 +164,7 @@ export default function InvoiceEnterModalComponent({
|
|||||||
lineData={lineData}
|
lineData={lineData}
|
||||||
discount={vendor && vendor.discount}
|
discount={vendor && vendor.discount}
|
||||||
form={form}
|
form={form}
|
||||||
|
responsibilityCenters={responsibilityCenters}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button onClick={() => console.log(form.getFieldsValue())}>
|
<Button onClick={() => console.log(form.getFieldsValue())}>
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ function InvoiceEnterModalContainer({
|
|||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
job={invoiceEnterModal.context.job || null}
|
job={invoiceEnterModal.context.job || null}
|
||||||
|
responsibilityCenters={bodyshop.md_responsibility_centers || null}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,13 +8,15 @@ import CurrencyInput from "../form-items-formatted/currency-form-item.component"
|
|||||||
export default function InvoiceEnterModalLinesComponent({
|
export default function InvoiceEnterModalLinesComponent({
|
||||||
lineData,
|
lineData,
|
||||||
discount,
|
discount,
|
||||||
form
|
form,
|
||||||
|
responsibilityCenters
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { setFieldsValue, getFieldsValue } = form;
|
const { setFieldsValue, getFieldsValue } = form;
|
||||||
|
|
||||||
const [amounts, setAmounts] = useState({ invoiceTotal: 0, enteredAmount: 0 });
|
const [amounts, setAmounts] = useState({ invoiceTotal: 0, enteredAmount: 0 });
|
||||||
|
|
||||||
|
console.log("costCenters", responsibilityCenters);
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Form.List name="invoicelines">
|
<Form.List name="invoicelines">
|
||||||
@@ -38,7 +40,7 @@ export default function InvoiceEnterModalLinesComponent({
|
|||||||
<Select
|
<Select
|
||||||
autoFocus
|
autoFocus
|
||||||
name={`le${index}`}
|
name={`le${index}`}
|
||||||
style={{ width: "300px" }}
|
style={{ width: "450px" }}
|
||||||
onSelect={(value, opt) => {
|
onSelect={(value, opt) => {
|
||||||
setFieldsValue({
|
setFieldsValue({
|
||||||
invoicelines: getFieldsValue([
|
invoicelines: getFieldsValue([
|
||||||
@@ -54,7 +56,12 @@ export default function InvoiceEnterModalLinesComponent({
|
|||||||
line_desc: opt.key.includes("noline")
|
line_desc: opt.key.includes("noline")
|
||||||
? ""
|
? ""
|
||||||
: opt.value,
|
: opt.value,
|
||||||
actual_price: opt.cost ? opt.cost : 0
|
actual_price: opt.cost ? opt.cost : 0,
|
||||||
|
cost_center: opt.mod_lbr_ty
|
||||||
|
? responsibilityCenters.defaults[
|
||||||
|
opt.mod_lbr_ty
|
||||||
|
] || null
|
||||||
|
: null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
@@ -76,8 +83,21 @@ export default function InvoiceEnterModalLinesComponent({
|
|||||||
key={item.id}
|
key={item.id}
|
||||||
value={item.line_desc}
|
value={item.line_desc}
|
||||||
cost={item.act_price ? item.act_price : 0}
|
cost={item.act_price ? item.act_price : 0}
|
||||||
|
mod_lbr_ty={item.mod_lbr_ty}
|
||||||
>
|
>
|
||||||
{item.line_desc}
|
<Row justify="center" align="middle">
|
||||||
|
<Col span={12}> {item.line_desc}</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<Tag color="blue">{item.oem_partno}</Tag>
|
||||||
|
</Col>
|
||||||
|
<Col span={4}>
|
||||||
|
<Tag color="green">
|
||||||
|
<CurrencyFormatter>
|
||||||
|
{item.act_price}
|
||||||
|
</CurrencyFormatter>
|
||||||
|
</Tag>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
</Select.Option>
|
</Select.Option>
|
||||||
))
|
))
|
||||||
: null}
|
: null}
|
||||||
@@ -170,7 +190,11 @@ export default function InvoiceEnterModalLinesComponent({
|
|||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Input />
|
<Select style={{ width: "150px" }}>
|
||||||
|
{responsibilityCenters.costs.map(item => (
|
||||||
|
<Select.Option key={item}>{item}</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<DeleteFilled
|
<DeleteFilled
|
||||||
@@ -187,7 +211,7 @@ export default function InvoiceEnterModalLinesComponent({
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
add();
|
add();
|
||||||
}}
|
}}
|
||||||
style={{ width: "60%" }}
|
style={{ width: "100%" }}
|
||||||
>
|
>
|
||||||
{t("invoicelines.actions.newline")}
|
{t("invoicelines.actions.newline")}
|
||||||
</Button>
|
</Button>
|
||||||
@@ -199,22 +223,20 @@ export default function InvoiceEnterModalLinesComponent({
|
|||||||
<Row>
|
<Row>
|
||||||
<Col span={4}>
|
<Col span={4}>
|
||||||
{t("invoicelines.labels.entered")}
|
{t("invoicelines.labels.entered")}
|
||||||
<CurrencyFormatter>{amounts.enteredTotal}</CurrencyFormatter>
|
<CurrencyFormatter>{amounts.enteredTotal || 0}</CurrencyFormatter>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
<Col span={4}>
|
<Col span={4}>
|
||||||
<Tag
|
{amounts.invoiceTotal - amounts.enteredTotal === 0 ? (
|
||||||
color={
|
<Tag color="green">{t("invoicelines.labels.reconciled")}</Tag>
|
||||||
amounts.invoiceTotal - amounts.enteredTotal === 0
|
) : (
|
||||||
? "green"
|
<Tag color="red">
|
||||||
: "red"
|
{t("invoicelines.labels.unreconciled")}:
|
||||||
}
|
<CurrencyFormatter>
|
||||||
>
|
{amounts.invoiceTotal - amounts.enteredTotal}
|
||||||
{t("invoicelines.labels.unreconciled")}:
|
</CurrencyFormatter>
|
||||||
<CurrencyFormatter>
|
</Tag>
|
||||||
{amounts.invoiceTotal - amounts.enteredTotal}
|
)}
|
||||||
</CurrencyFormatter>
|
|
||||||
</Tag>
|
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,13 +14,14 @@ export const QUERY_BODYSHOP = gql`
|
|||||||
insurance_vendor_id
|
insurance_vendor_id
|
||||||
logo_img_path
|
logo_img_path
|
||||||
md_ro_statuses
|
md_ro_statuses
|
||||||
md_order_statuses
|
md_order_statuses
|
||||||
shopname
|
shopname
|
||||||
state
|
state
|
||||||
state_tax_id
|
state_tax_id
|
||||||
updated_at
|
updated_at
|
||||||
zip_post
|
zip_post
|
||||||
region_config
|
region_config
|
||||||
|
md_responsibility_centers
|
||||||
employees {
|
employees {
|
||||||
id
|
id
|
||||||
first_name
|
first_name
|
||||||
|
|||||||
@@ -158,6 +158,7 @@
|
|||||||
"labels": {
|
"labels": {
|
||||||
"entered": "Entered",
|
"entered": "Entered",
|
||||||
"other": "--Not On Estimate--",
|
"other": "--Not On Estimate--",
|
||||||
|
"reconciled": "Reconciled!",
|
||||||
"unreconciled": "Unreconciled"
|
"unreconciled": "Unreconciled"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -158,6 +158,7 @@
|
|||||||
"labels": {
|
"labels": {
|
||||||
"entered": "",
|
"entered": "",
|
||||||
"other": "",
|
"other": "",
|
||||||
|
"reconciled": "",
|
||||||
"unreconciled": ""
|
"unreconciled": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -158,6 +158,7 @@
|
|||||||
"labels": {
|
"labels": {
|
||||||
"entered": "",
|
"entered": "",
|
||||||
"other": "",
|
"other": "",
|
||||||
|
"reconciled": "",
|
||||||
"unreconciled": ""
|
"unreconciled": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
- args:
|
||||||
|
cascade: false
|
||||||
|
read_only: false
|
||||||
|
sql: ALTER TABLE "public"."bodyshops" DROP COLUMN "md_responsibility_centers";
|
||||||
|
type: run_sql
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
- args:
|
||||||
|
cascade: false
|
||||||
|
read_only: false
|
||||||
|
sql: ALTER TABLE "public"."bodyshops" ADD COLUMN "md_responsibility_centers" jsonb
|
||||||
|
NULL;
|
||||||
|
type: run_sql
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
- args:
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: bodyshops
|
||||||
|
schema: public
|
||||||
|
type: drop_select_permission
|
||||||
|
- args:
|
||||||
|
permission:
|
||||||
|
allow_aggregations: false
|
||||||
|
columns:
|
||||||
|
- id
|
||||||
|
- shopname
|
||||||
|
- created_at
|
||||||
|
- updated_at
|
||||||
|
- address1
|
||||||
|
- address2
|
||||||
|
- city
|
||||||
|
- state
|
||||||
|
- zip_post
|
||||||
|
- country
|
||||||
|
- email
|
||||||
|
- federal_tax_id
|
||||||
|
- insurance_vendor_id
|
||||||
|
- state_tax_id
|
||||||
|
- logo_img_path
|
||||||
|
- md_ro_statuses
|
||||||
|
- region_config
|
||||||
|
- md_order_statuses
|
||||||
|
computed_fields: []
|
||||||
|
filter:
|
||||||
|
associations:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
user:
|
||||||
|
authid:
|
||||||
|
_eq: X-Hasura-User-Id
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: bodyshops
|
||||||
|
schema: public
|
||||||
|
type: create_select_permission
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
- args:
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: bodyshops
|
||||||
|
schema: public
|
||||||
|
type: drop_select_permission
|
||||||
|
- args:
|
||||||
|
permission:
|
||||||
|
allow_aggregations: false
|
||||||
|
columns:
|
||||||
|
- id
|
||||||
|
- shopname
|
||||||
|
- created_at
|
||||||
|
- updated_at
|
||||||
|
- address1
|
||||||
|
- address2
|
||||||
|
- city
|
||||||
|
- state
|
||||||
|
- zip_post
|
||||||
|
- country
|
||||||
|
- email
|
||||||
|
- federal_tax_id
|
||||||
|
- insurance_vendor_id
|
||||||
|
- state_tax_id
|
||||||
|
- logo_img_path
|
||||||
|
- md_ro_statuses
|
||||||
|
- region_config
|
||||||
|
- md_order_statuses
|
||||||
|
- md_responsibility_centers
|
||||||
|
computed_fields: []
|
||||||
|
filter:
|
||||||
|
associations:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
user:
|
||||||
|
authid:
|
||||||
|
_eq: X-Hasura-User-Id
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: bodyshops
|
||||||
|
schema: public
|
||||||
|
type: create_select_permission
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
- args:
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: bodyshops
|
||||||
|
schema: public
|
||||||
|
type: drop_update_permission
|
||||||
|
- args:
|
||||||
|
permission:
|
||||||
|
columns:
|
||||||
|
- md_order_statuses
|
||||||
|
- md_ro_statuses
|
||||||
|
- address1
|
||||||
|
- address2
|
||||||
|
- city
|
||||||
|
- country
|
||||||
|
- email
|
||||||
|
- federal_tax_id
|
||||||
|
- insurance_vendor_id
|
||||||
|
- logo_img_path
|
||||||
|
- region_config
|
||||||
|
- shopname
|
||||||
|
- state
|
||||||
|
- state_tax_id
|
||||||
|
- zip_post
|
||||||
|
- created_at
|
||||||
|
- updated_at
|
||||||
|
- id
|
||||||
|
filter:
|
||||||
|
associations:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
user:
|
||||||
|
authid:
|
||||||
|
_eq: X-Hasura-User-Id
|
||||||
|
localPresets:
|
||||||
|
- key: ""
|
||||||
|
value: ""
|
||||||
|
set: {}
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: bodyshops
|
||||||
|
schema: public
|
||||||
|
type: create_update_permission
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
- args:
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: bodyshops
|
||||||
|
schema: public
|
||||||
|
type: drop_update_permission
|
||||||
|
- args:
|
||||||
|
permission:
|
||||||
|
columns:
|
||||||
|
- md_order_statuses
|
||||||
|
- md_responsibility_centers
|
||||||
|
- md_ro_statuses
|
||||||
|
- address1
|
||||||
|
- address2
|
||||||
|
- city
|
||||||
|
- country
|
||||||
|
- email
|
||||||
|
- federal_tax_id
|
||||||
|
- insurance_vendor_id
|
||||||
|
- logo_img_path
|
||||||
|
- region_config
|
||||||
|
- shopname
|
||||||
|
- state
|
||||||
|
- state_tax_id
|
||||||
|
- zip_post
|
||||||
|
- created_at
|
||||||
|
- updated_at
|
||||||
|
- id
|
||||||
|
filter:
|
||||||
|
associations:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
user:
|
||||||
|
authid:
|
||||||
|
_eq: X-Hasura-User-Id
|
||||||
|
localPresets:
|
||||||
|
- key: ""
|
||||||
|
value: ""
|
||||||
|
set: {}
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: bodyshops
|
||||||
|
schema: public
|
||||||
|
type: create_update_permission
|
||||||
Reference in New Issue
Block a user