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
|
||||
@@ -1931,6 +1931,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</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>
|
||||
<name>unreconciled</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
|
||||
@@ -18,15 +18,14 @@ export default function InvoiceEnterModalComponent({
|
||||
invoice,
|
||||
handleCancel,
|
||||
handleFinish,
|
||||
|
||||
handleRoSelect,
|
||||
roAutoCompleteOptions,
|
||||
|
||||
handleVendorSelect,
|
||||
vendorAutoCompleteOptions,
|
||||
lineData,
|
||||
vendor,
|
||||
job
|
||||
job,
|
||||
responsibilityCenters
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const [form] = Form.useForm();
|
||||
@@ -165,6 +164,7 @@ export default function InvoiceEnterModalComponent({
|
||||
lineData={lineData}
|
||||
discount={vendor && vendor.discount}
|
||||
form={form}
|
||||
responsibilityCenters={responsibilityCenters}
|
||||
/>
|
||||
|
||||
<Button onClick={() => console.log(form.getFieldsValue())}>
|
||||
|
||||
@@ -142,6 +142,7 @@ function InvoiceEnterModalContainer({
|
||||
: 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({
|
||||
lineData,
|
||||
discount,
|
||||
form
|
||||
form,
|
||||
responsibilityCenters
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const { setFieldsValue, getFieldsValue } = form;
|
||||
|
||||
const [amounts, setAmounts] = useState({ invoiceTotal: 0, enteredAmount: 0 });
|
||||
|
||||
console.log("costCenters", responsibilityCenters);
|
||||
return (
|
||||
<div>
|
||||
<Form.List name="invoicelines">
|
||||
@@ -38,7 +40,7 @@ export default function InvoiceEnterModalLinesComponent({
|
||||
<Select
|
||||
autoFocus
|
||||
name={`le${index}`}
|
||||
style={{ width: "300px" }}
|
||||
style={{ width: "450px" }}
|
||||
onSelect={(value, opt) => {
|
||||
setFieldsValue({
|
||||
invoicelines: getFieldsValue([
|
||||
@@ -54,7 +56,12 @@ export default function InvoiceEnterModalLinesComponent({
|
||||
line_desc: opt.key.includes("noline")
|
||||
? ""
|
||||
: 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;
|
||||
@@ -76,8 +83,21 @@ export default function InvoiceEnterModalLinesComponent({
|
||||
key={item.id}
|
||||
value={item.line_desc}
|
||||
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>
|
||||
))
|
||||
: 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>
|
||||
|
||||
<DeleteFilled
|
||||
@@ -187,7 +211,7 @@ export default function InvoiceEnterModalLinesComponent({
|
||||
onClick={() => {
|
||||
add();
|
||||
}}
|
||||
style={{ width: "60%" }}
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
{t("invoicelines.actions.newline")}
|
||||
</Button>
|
||||
@@ -199,22 +223,20 @@ export default function InvoiceEnterModalLinesComponent({
|
||||
<Row>
|
||||
<Col span={4}>
|
||||
{t("invoicelines.labels.entered")}
|
||||
<CurrencyFormatter>{amounts.enteredTotal}</CurrencyFormatter>
|
||||
<CurrencyFormatter>{amounts.enteredTotal || 0}</CurrencyFormatter>
|
||||
</Col>
|
||||
|
||||
<Col span={4}>
|
||||
<Tag
|
||||
color={
|
||||
amounts.invoiceTotal - amounts.enteredTotal === 0
|
||||
? "green"
|
||||
: "red"
|
||||
}
|
||||
>
|
||||
{t("invoicelines.labels.unreconciled")}:
|
||||
<CurrencyFormatter>
|
||||
{amounts.invoiceTotal - amounts.enteredTotal}
|
||||
</CurrencyFormatter>
|
||||
</Tag>
|
||||
{amounts.invoiceTotal - amounts.enteredTotal === 0 ? (
|
||||
<Tag color="green">{t("invoicelines.labels.reconciled")}</Tag>
|
||||
) : (
|
||||
<Tag color="red">
|
||||
{t("invoicelines.labels.unreconciled")}:
|
||||
<CurrencyFormatter>
|
||||
{amounts.invoiceTotal - amounts.enteredTotal}
|
||||
</CurrencyFormatter>
|
||||
</Tag>
|
||||
)}
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
|
||||
@@ -14,13 +14,14 @@ export const QUERY_BODYSHOP = gql`
|
||||
insurance_vendor_id
|
||||
logo_img_path
|
||||
md_ro_statuses
|
||||
md_order_statuses
|
||||
md_order_statuses
|
||||
shopname
|
||||
state
|
||||
state_tax_id
|
||||
updated_at
|
||||
zip_post
|
||||
region_config
|
||||
md_responsibility_centers
|
||||
employees {
|
||||
id
|
||||
first_name
|
||||
|
||||
@@ -158,6 +158,7 @@
|
||||
"labels": {
|
||||
"entered": "Entered",
|
||||
"other": "--Not On Estimate--",
|
||||
"reconciled": "Reconciled!",
|
||||
"unreconciled": "Unreconciled"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -158,6 +158,7 @@
|
||||
"labels": {
|
||||
"entered": "",
|
||||
"other": "",
|
||||
"reconciled": "",
|
||||
"unreconciled": ""
|
||||
}
|
||||
},
|
||||
|
||||
@@ -158,6 +158,7 @@
|
||||
"labels": {
|
||||
"entered": "",
|
||||
"other": "",
|
||||
"reconciled": "",
|
||||
"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