Added quantity to entering invoices BOD-182
This commit is contained in:
@@ -348,6 +348,27 @@
|
||||
<folder_node>
|
||||
<name>errors</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>blocking</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>canceling</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
@@ -7150,6 +7171,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>invoices</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>local_tax</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
@@ -14605,6 +14647,27 @@
|
||||
<folder_node>
|
||||
<name>errors</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>backordering</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>creating</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
@@ -14972,6 +15035,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>parts_orders</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>print</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
|
||||
@@ -16,7 +16,6 @@ export default function FormsFieldChanged({ form }) {
|
||||
return (
|
||||
<Form.Item shouldUpdate style={{ margin: 0, padding: 0 }}>
|
||||
{() => {
|
||||
console.log("Render", form.isFieldsTouched());
|
||||
if (form.isFieldsTouched())
|
||||
return (
|
||||
<div>
|
||||
@@ -29,7 +28,7 @@ export default function FormsFieldChanged({ form }) {
|
||||
}}
|
||||
/>
|
||||
<AlertComponent
|
||||
type="warning"
|
||||
type='warning'
|
||||
message={
|
||||
<div>
|
||||
<span>{t("general.messages.unsavedchanges")}</span>
|
||||
@@ -38,8 +37,7 @@ export default function FormsFieldChanged({ form }) {
|
||||
style={{
|
||||
cursor: "pointer",
|
||||
textDecoration: "underline",
|
||||
}}
|
||||
>
|
||||
}}>
|
||||
{t("general.actions.reset")}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -5,8 +5,8 @@ function FormItemCurrency(props, ref) {
|
||||
<InputNumber
|
||||
{...props}
|
||||
style={{ width: "initial" }}
|
||||
formatter={(value) => `$ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",")}
|
||||
parser={(value) => value.replace(/\$\s?|(,*)/g, "")}
|
||||
// formatter={(value) => `$ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",")}
|
||||
// parser={(value) => value.replace(/\$\s?|(,*)/g, "")}
|
||||
precision={2}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -33,7 +33,7 @@ export function InvoiceFormContainer({ bodyshop, form, invoiceEdit }) {
|
||||
VendorAutoCompleteData && VendorAutoCompleteData.vendors
|
||||
}
|
||||
loadLines={loadLines}
|
||||
lineData={lineData ? lineData.joblines : null}
|
||||
lineData={lineData ? lineData.joblines : []}
|
||||
responsibilityCenters={bodyshop.md_responsibility_centers || null}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { DeleteFilled } from "@ant-design/icons";
|
||||
import { Button, Form, Input, Select, Switch } from "antd";
|
||||
import { DeleteFilled, WarningOutlined } from "@ant-design/icons";
|
||||
import { Button, Form, Input, InputNumber, Select, Switch } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
||||
import InvoiceLineSearchSelect from "../invoice-line-search-select/invoice-line-search-select.component";
|
||||
import { WarningOutlined } from "@ant-design/icons";
|
||||
|
||||
export default function InvoiceEnterModalLinesComponent({
|
||||
lineData,
|
||||
@@ -35,16 +34,17 @@ export default function InvoiceEnterModalLinesComponent({
|
||||
]}>
|
||||
<InvoiceLineSearchSelect
|
||||
options={lineData}
|
||||
onBlur={null}
|
||||
onSelect={(value, opt) => {
|
||||
setFieldsValue({
|
||||
invoicelines: getFieldsValue([
|
||||
"invoicelines",
|
||||
]).invoicelines.map((item, idx) => {
|
||||
if (idx === index) {
|
||||
console.log("opt", opt);
|
||||
return {
|
||||
...item,
|
||||
line_desc: opt.line_desc,
|
||||
quantity: opt.part_qty || 1,
|
||||
actual_price: opt.cost,
|
||||
cost_center: opt.part_type
|
||||
? responsibilityCenters.defaults.costs[
|
||||
@@ -71,6 +71,18 @@ export default function InvoiceEnterModalLinesComponent({
|
||||
]}>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("invoicelines.fields.quantity")}
|
||||
key={`${index}quantity`}
|
||||
name={[field.name, "quantity"]}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}>
|
||||
<InputNumber precision={0} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("invoicelines.fields.actual")}
|
||||
key={`${index}actual_price`}
|
||||
@@ -118,15 +130,15 @@ export default function InvoiceEnterModalLinesComponent({
|
||||
const line = getFieldsValue(["invoicelines"])
|
||||
.invoicelines[index];
|
||||
if (!!!line) return null;
|
||||
const lineDiscount = +(
|
||||
const lineDiscount = (
|
||||
1 -
|
||||
Math.round(
|
||||
(line.actual_cost / line.actual_price) * 100
|
||||
) /
|
||||
100
|
||||
).toFixed(2);
|
||||
).toPrecision(2);
|
||||
|
||||
if (lineDiscount === discount) return null;
|
||||
if (lineDiscount - discount === 0) return null;
|
||||
return <WarningOutlined style={{ color: "red" }} />;
|
||||
}}
|
||||
</Form.Item>
|
||||
|
||||
@@ -30,10 +30,9 @@ const InvoiceLineSearchSelect = ({
|
||||
width: 300,
|
||||
}}
|
||||
onChange={setOption}
|
||||
optionFilterProp="line_desc"
|
||||
optionFilterProp='line_desc'
|
||||
onBlur={onBlur}
|
||||
onSelect={onSelect}
|
||||
>
|
||||
onSelect={onSelect}>
|
||||
<Select.Option key={null} value={"noline"} cost={0} line_desc={""}>
|
||||
{t("invoicelines.labels.other")}
|
||||
</Select.Option>
|
||||
@@ -45,14 +44,14 @@ const InvoiceLineSearchSelect = ({
|
||||
cost={item.act_price ? item.act_price : 0}
|
||||
part_type={item.part_type}
|
||||
line_desc={item.line_desc}
|
||||
>
|
||||
<Row justify="center" align="middle">
|
||||
part_qty={item.part_qty}>
|
||||
<Row justify='center' align='middle'>
|
||||
<Col span={12}>{item.line_desc}</Col>
|
||||
<Col span={8}>
|
||||
<Tag color="blue">{item.oem_partno}</Tag>
|
||||
<Tag color='blue'>{item.oem_partno}</Tag>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Tag color="green">
|
||||
<Tag color='green'>
|
||||
<CurrencyFormatter>{item.act_price || 0}</CurrencyFormatter>
|
||||
</Tag>
|
||||
</Col>
|
||||
|
||||
@@ -94,8 +94,7 @@ export function InvoicesListTableComponent({
|
||||
render: (text, record) => (
|
||||
<div>
|
||||
<Link
|
||||
to={`/manage/invoices?invoiceid=${record.id}&vendorid=${record.vendorid}`}
|
||||
>
|
||||
to={`/manage/invoices?invoiceid=${record.id}&vendorid=${record.vendorid}`}>
|
||||
<Button>{t("invoices.actions.edit")}</Button>
|
||||
</Link>
|
||||
<Button
|
||||
@@ -120,8 +119,7 @@ export function InvoicesListTableComponent({
|
||||
isReturn: true,
|
||||
},
|
||||
})
|
||||
}
|
||||
>
|
||||
}>
|
||||
{t("invoices.actions.return")}
|
||||
</Button>
|
||||
</div>
|
||||
@@ -167,6 +165,14 @@ export function InvoicesListTableComponent({
|
||||
<CurrencyFormatter>{record.actual_cost}</CurrencyFormatter>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: t("invoicelines.fields.quantity"),
|
||||
dataIndex: "quantity",
|
||||
key: "quantity",
|
||||
sorter: (a, b) => a.quantity - b.quantity,
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "quantity" && state.sortedInfo.order,
|
||||
},
|
||||
{
|
||||
title: t("invoicelines.fields.cost_center"),
|
||||
dataIndex: "cost_center",
|
||||
@@ -237,11 +243,11 @@ export function InvoicesListTableComponent({
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
<Table
|
||||
size="small"
|
||||
size='small'
|
||||
scroll={{ x: "50%", y: "40rem" }}
|
||||
pagination={{ position: "top", defaultPageSize: 25 }}
|
||||
columns={columns}
|
||||
rowKey="id"
|
||||
rowKey='id'
|
||||
dataSource={record.invoicelines}
|
||||
/>
|
||||
</div>
|
||||
@@ -249,82 +255,85 @@ export function InvoicesListTableComponent({
|
||||
};
|
||||
|
||||
return (
|
||||
<Table
|
||||
loading={loading}
|
||||
size="small"
|
||||
title={() => (
|
||||
<div className="imex-table-header">
|
||||
<Button onClick={() => refetch()}>
|
||||
<SyncOutlined />
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setInvoiceEnterContext({
|
||||
actions: { refetch: invoicesQuery.refetch },
|
||||
context: {
|
||||
job,
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("jobs.actions.postInvoices")}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setReconciliationContext({
|
||||
actions: { refetch: invoicesQuery.refetch },
|
||||
context: {
|
||||
job,
|
||||
invoices:
|
||||
(invoicesQuery.data && invoicesQuery.data.invoices) || [],
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("jobs.actions.reconcile")}
|
||||
</Button>{" "}
|
||||
<div className="imex-table-header__search">
|
||||
<Input.Search
|
||||
placeholder={t("general.labels.search")}
|
||||
onChange={(e) => {
|
||||
e.preventDefault();
|
||||
}}
|
||||
/>
|
||||
<div>
|
||||
<Typography.Title level={4}>
|
||||
{t("invoices.labels.invoices")}
|
||||
</Typography.Title>
|
||||
<Table
|
||||
loading={loading}
|
||||
size='small'
|
||||
title={() => (
|
||||
<div className='imex-table-header'>
|
||||
<Button onClick={() => refetch()}>
|
||||
<SyncOutlined />
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setInvoiceEnterContext({
|
||||
actions: { refetch: invoicesQuery.refetch },
|
||||
context: {
|
||||
job,
|
||||
},
|
||||
});
|
||||
}}>
|
||||
{t("jobs.actions.postInvoices")}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setReconciliationContext({
|
||||
actions: { refetch: invoicesQuery.refetch },
|
||||
context: {
|
||||
job,
|
||||
invoices:
|
||||
(invoicesQuery.data && invoicesQuery.data.invoices) || [],
|
||||
},
|
||||
});
|
||||
}}>
|
||||
{t("jobs.actions.reconcile")}
|
||||
</Button>{" "}
|
||||
<div className='imex-table-header__search'>
|
||||
<Input.Search
|
||||
placeholder={t("general.labels.search")}
|
||||
onChange={(e) => {
|
||||
e.preventDefault();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
scroll={{ x: "50%", y: "40rem" }}
|
||||
expandedRowRender={rowExpander}
|
||||
pagination={{ position: "top", defaultPageSize: 25 }}
|
||||
columns={columns}
|
||||
rowKey="id"
|
||||
dataSource={invoices}
|
||||
onChange={handleTableChange}
|
||||
expandable={{
|
||||
expandedRowKeys: [selectedInvoice],
|
||||
onExpand: (expanded, record) => {
|
||||
handleOnRowClick(expanded ? record : null);
|
||||
},
|
||||
}}
|
||||
rowSelection={{
|
||||
onSelect: (record) => {
|
||||
handleOnRowClick(record);
|
||||
},
|
||||
selectedRowKeys: [selectedInvoice],
|
||||
type: "radio",
|
||||
}}
|
||||
onRow={(record, rowIndex) => {
|
||||
return {
|
||||
onClick: (event) => {
|
||||
)}
|
||||
scroll={{ x: "50%", y: "40rem" }}
|
||||
expandedRowRender={rowExpander}
|
||||
pagination={{ position: "top", defaultPageSize: 25 }}
|
||||
columns={columns}
|
||||
rowKey='id'
|
||||
dataSource={invoices}
|
||||
onChange={handleTableChange}
|
||||
expandable={{
|
||||
expandedRowKeys: [selectedInvoice],
|
||||
onExpand: (expanded, record) => {
|
||||
handleOnRowClick(expanded ? record : null);
|
||||
},
|
||||
}}
|
||||
rowSelection={{
|
||||
onSelect: (record) => {
|
||||
handleOnRowClick(record);
|
||||
}, // click row
|
||||
onDoubleClick: (event) => {}, // double click row
|
||||
onContextMenu: (event) => {}, // right button click row
|
||||
onMouseEnter: (event) => {}, // mouse enter row
|
||||
onMouseLeave: (event) => {}, // mouse leave row
|
||||
};
|
||||
}}
|
||||
/>
|
||||
},
|
||||
selectedRowKeys: [selectedInvoice],
|
||||
type: "radio",
|
||||
}}
|
||||
onRow={(record, rowIndex) => {
|
||||
return {
|
||||
onClick: (event) => {
|
||||
handleOnRowClick(record);
|
||||
}, // click row
|
||||
onDoubleClick: (event) => {}, // double click row
|
||||
onContextMenu: (event) => {}, // right button click row
|
||||
onMouseEnter: (event) => {}, // mouse enter row
|
||||
onMouseLeave: (event) => {}, // mouse leave row
|
||||
};
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export default connect(null, mapDispatchToProps)(InvoicesListTableComponent);
|
||||
|
||||
@@ -12,8 +12,6 @@ import AllocationsAssignmentContainer from "../allocations-assignment/allocation
|
||||
import AllocationsBulkAssignmentContainer from "../allocations-bulk-assignment/allocations-bulk-assignment.container";
|
||||
import AllocationsEmployeeLabelContainer from "../allocations-employee-label/allocations-employee-label.container";
|
||||
import PartsOrderModalContainer from "../parts-order-modal/parts-order-modal.container";
|
||||
import queryString from "query-string";
|
||||
import { useHistory, useLocation } from "react-router-dom";
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setJobLineEditContext: (context) =>
|
||||
@@ -38,9 +36,6 @@ export function JobLinesComponent({
|
||||
});
|
||||
const { t } = useTranslation();
|
||||
|
||||
const search = queryString.parse(useLocation().search);
|
||||
const history = useHistory();
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: "#",
|
||||
@@ -219,8 +214,7 @@ export function JobLinesComponent({
|
||||
actions: { refetch: refetch },
|
||||
context: record,
|
||||
});
|
||||
}}
|
||||
>
|
||||
}}>
|
||||
{t("general.actions.edit")}
|
||||
</Button>
|
||||
<AllocationsAssignmentContainer
|
||||
@@ -244,9 +238,9 @@ export function JobLinesComponent({
|
||||
|
||||
const markMenu = (
|
||||
<Menu onClick={handleMark}>
|
||||
<Menu.Item key="PAA">PAA</Menu.Item>
|
||||
<Menu.Item key="PAN">PAN</Menu.Item>
|
||||
<Menu.Item key="PAL">PAL</Menu.Item>
|
||||
<Menu.Item key='PAA'>PAA</Menu.Item>
|
||||
<Menu.Item key='PAN'>PAN</Menu.Item>
|
||||
<Menu.Item key='PAL'>PAL</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
@@ -255,16 +249,16 @@ export function JobLinesComponent({
|
||||
<PartsOrderModalContainer />
|
||||
<Table
|
||||
columns={columns}
|
||||
rowKey="id"
|
||||
rowKey='id'
|
||||
loading={loading}
|
||||
size="small"
|
||||
size='small'
|
||||
pagination={{ position: "top", defaultPageSize: 50 }}
|
||||
dataSource={jobLines}
|
||||
onChange={handleTableChange}
|
||||
scroll={{ x: true, y: "40rem" }}
|
||||
title={() => {
|
||||
return (
|
||||
<div className="imex-table-header">
|
||||
<div className='imex-table-header'>
|
||||
<Button onClick={() => refetch()}>
|
||||
<SyncOutlined />
|
||||
</Button>
|
||||
@@ -278,8 +272,7 @@ export function JobLinesComponent({
|
||||
linesToOrder: selectedLines,
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
}}>
|
||||
{t("parts.actions.order")}
|
||||
</Button>
|
||||
<Dropdown overlay={markMenu} trigger={["click"]}>
|
||||
@@ -295,11 +288,10 @@ export function JobLinesComponent({
|
||||
actions: { refetch: refetch },
|
||||
context: { jobid: jobId },
|
||||
});
|
||||
}}
|
||||
>
|
||||
}}>
|
||||
{t("joblines.actions.new")}
|
||||
</Button>
|
||||
<div className="imex-table-header__search">
|
||||
<div className='imex-table-header__search'>
|
||||
<Input.Search
|
||||
placeholder={t("general.labels.search")}
|
||||
onChange={(e) => {
|
||||
@@ -317,8 +309,7 @@ export function JobLinesComponent({
|
||||
{record.parts_order_lines.map((item) => (
|
||||
<div key={item.id}>
|
||||
<Link
|
||||
to={`/manage/jobs/${jobId}?tab=partssublet&partsorderid=${item.parts_order.id}`}
|
||||
>
|
||||
to={`/manage/jobs/${jobId}?tab=partssublet&partsorderid=${item.parts_order.id}`}>
|
||||
{item.parts_order.order_number || ""}
|
||||
</Link>
|
||||
-
|
||||
|
||||
@@ -19,9 +19,10 @@ export default function JobInvoiceTotals({ loading, invoices, jobTotals }) {
|
||||
i.invoicelines.forEach((il) => {
|
||||
invoiceTotals = invoiceTotals.add(
|
||||
Dinero({
|
||||
amount:
|
||||
((il.actual_price || 0) * i.is_credit_memo ? -1 : 1 || 0) * 100,
|
||||
})
|
||||
amount: Math.round(
|
||||
(il.actual_cost || 0) * (i.is_credit_memo ? -1 : 1) * 100
|
||||
),
|
||||
}).multiply(il.quantity)
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -14,7 +14,7 @@ export const CalculateAllocationsTotals = (
|
||||
const r = allCodes.reduce((acc, value) => {
|
||||
acc.push({
|
||||
opcode: value,
|
||||
cost_center: responsibilitycenters.defaults[value],
|
||||
cost_center: responsibilitycenters.defaults.costs[value],
|
||||
total: joblines.reduce((acc2, val2) => {
|
||||
return val2.mod_lbr_ty === value ? acc2 + val2.mod_lb_hrs : acc2;
|
||||
}, 0),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Button } from "antd";
|
||||
import { Button, notification } from "antd";
|
||||
import { useMutation } from "@apollo/react-hooks";
|
||||
import { MUTATION_BACKORDER_PART_LINE } from "../../graphql/parts-orders.queries";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
@@ -37,6 +37,14 @@ export function PartsOrderLineBackorderButton({
|
||||
},
|
||||
});
|
||||
|
||||
if (!!result.errors) {
|
||||
notification["error"]({
|
||||
message: t("parts_orders.errors.backordering", {
|
||||
message: JSON.stringify(result.errors),
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { SyncOutlined } from "@ant-design/icons";
|
||||
import { Button, Input, Table } from "antd";
|
||||
import { Button, Input, Table, Typography } from "antd";
|
||||
import queryString from "query-string";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -147,11 +147,11 @@ export function PartsOrderListTableComponent({
|
||||
return (
|
||||
<div>
|
||||
<Table
|
||||
size="small"
|
||||
size='small'
|
||||
scroll={{ x: "50%", y: "40rem" }}
|
||||
pagination={{ position: "top", defaultPageSize: 25 }}
|
||||
columns={columns}
|
||||
rowKey="id"
|
||||
rowKey='id'
|
||||
dataSource={record.parts_order_lines}
|
||||
/>
|
||||
</div>
|
||||
@@ -159,57 +159,62 @@ export function PartsOrderListTableComponent({
|
||||
};
|
||||
|
||||
return (
|
||||
<Table
|
||||
loading={loading}
|
||||
size="small"
|
||||
title={() => (
|
||||
<div className="imex-table-header">
|
||||
<Button onClick={() => refetch()}>
|
||||
<SyncOutlined />
|
||||
</Button>
|
||||
<div>
|
||||
<Typography.Title level={4}>
|
||||
{t("parts_orders.labels.parts_orders")}
|
||||
</Typography.Title>
|
||||
<Table
|
||||
loading={loading}
|
||||
size='small'
|
||||
title={() => (
|
||||
<div className='imex-table-header'>
|
||||
<Button onClick={() => refetch()}>
|
||||
<SyncOutlined />
|
||||
</Button>
|
||||
|
||||
<div className="imex-table-header__search">
|
||||
<Input.Search
|
||||
placeholder={t("general.labels.search")}
|
||||
onChange={(e) => {
|
||||
e.preventDefault();
|
||||
}}
|
||||
/>
|
||||
<div className='imex-table-header__search'>
|
||||
<Input.Search
|
||||
placeholder={t("general.labels.search")}
|
||||
onChange={(e) => {
|
||||
e.preventDefault();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
scroll={{ x: "50%", y: "40rem" }}
|
||||
expandedRowRender={rowExpander}
|
||||
pagination={{ position: "top", defaultPageSize: 25 }}
|
||||
columns={columns}
|
||||
rowKey="id"
|
||||
dataSource={parts_orders}
|
||||
onChange={handleTableChange}
|
||||
expandable={{
|
||||
expandedRowKeys: [selectedpartsorder],
|
||||
onExpand: (expanded, record) => {
|
||||
handleOnRowClick(expanded ? record : null);
|
||||
},
|
||||
}}
|
||||
rowSelection={{
|
||||
onSelect: (record) => {
|
||||
handleOnRowClick(record);
|
||||
},
|
||||
selectedRowKeys: [selectedpartsorder],
|
||||
type: "radio",
|
||||
}}
|
||||
onRow={(record, rowIndex) => {
|
||||
return {
|
||||
onClick: (event) => {
|
||||
)}
|
||||
scroll={{ x: "50%", y: "40rem" }}
|
||||
expandedRowRender={rowExpander}
|
||||
pagination={{ position: "top", defaultPageSize: 25 }}
|
||||
columns={columns}
|
||||
rowKey='id'
|
||||
dataSource={parts_orders}
|
||||
onChange={handleTableChange}
|
||||
expandable={{
|
||||
expandedRowKeys: [selectedpartsorder],
|
||||
onExpand: (expanded, record) => {
|
||||
handleOnRowClick(expanded ? record : null);
|
||||
},
|
||||
}}
|
||||
rowSelection={{
|
||||
onSelect: (record) => {
|
||||
handleOnRowClick(record);
|
||||
}, // click row
|
||||
onDoubleClick: (event) => {}, // double click row
|
||||
onContextMenu: (event) => {}, // right button click row
|
||||
onMouseEnter: (event) => {}, // mouse enter row
|
||||
onMouseLeave: (event) => {}, // mouse leave row
|
||||
};
|
||||
}}
|
||||
/>
|
||||
},
|
||||
selectedRowKeys: [selectedpartsorder],
|
||||
type: "radio",
|
||||
}}
|
||||
onRow={(record, rowIndex) => {
|
||||
return {
|
||||
onClick: (event) => {
|
||||
handleOnRowClick(record);
|
||||
}, // click row
|
||||
onDoubleClick: (event) => {}, // double click row
|
||||
onContextMenu: (event) => {}, // right button click row
|
||||
onMouseEnter: (event) => {}, // mouse enter row
|
||||
onMouseLeave: (event) => {}, // mouse leave row
|
||||
};
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export default connect(null, mapDispatchToProps)(PartsOrderListTableComponent);
|
||||
|
||||
@@ -32,6 +32,7 @@ const sortByParentId = (arr) => {
|
||||
sortedList.push(origItem);
|
||||
console.log("DATA CONSISTENCY ERROR: ", origItem.ro_number);
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import React from "react";
|
||||
import { MinusCircleTwoTone } from "@ant-design/icons";
|
||||
import { Dropdown, Menu } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useMutation } from "@apollo/react-hooks";
|
||||
import { INSERT_APPOINTMENT } from "../../graphql/appointments.queries";
|
||||
import { Dropdown, Menu, notification } from "antd";
|
||||
import moment from "moment";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { INSERT_APPOINTMENT } from "../../graphql/appointments.queries";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(ScheduleBlockDay);
|
||||
|
||||
export function ScheduleBlockDay({ date, children, refetch, bodyshop }) {
|
||||
const { t } = useTranslation();
|
||||
@@ -41,15 +41,23 @@ export function ScheduleBlockDay({ date, children, refetch, bodyshop }) {
|
||||
variables: { app: [blockAppt] },
|
||||
});
|
||||
|
||||
if (!!result.errors) {
|
||||
notification["error"]({
|
||||
message: t("appointments.errors.blocking", {
|
||||
message: JSON.stringify(result.errors),
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
if (!!refetch) refetch();
|
||||
}
|
||||
};
|
||||
|
||||
const menu = (
|
||||
<Menu onClick={handleMenu}>
|
||||
<Menu.Item key="block">{t("appointments.actions.block")}</Menu.Item>
|
||||
<Menu.Item key="2">2nd menu item</Menu.Item>
|
||||
<Menu.Item key="3">3rd menu item</Menu.Item>
|
||||
<Menu.Item key='block'>{t("appointments.actions.block")}</Menu.Item>
|
||||
<Menu.Item key='2'>2nd menu item</Menu.Item>
|
||||
<Menu.Item key='3'>3rd menu item</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
@@ -59,3 +67,4 @@ export function ScheduleBlockDay({ date, children, refetch, bodyshop }) {
|
||||
</Dropdown>
|
||||
);
|
||||
}
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(ScheduleBlockDay);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
"viewjob": "View Job"
|
||||
},
|
||||
"errors": {
|
||||
"blocking": "Error creating block {{message}}.",
|
||||
"canceling": "Error canceling appointment. {{message}}",
|
||||
"saving": "Error scheduling appointment. {{message}}"
|
||||
},
|
||||
@@ -477,6 +478,7 @@
|
||||
"entered_total": "Total of Entered Lines",
|
||||
"federal_tax": "Federal Tax",
|
||||
"invoice_total": "Invoice Total Amount",
|
||||
"invoices": "Invoices",
|
||||
"local_tax": "Local Tax",
|
||||
"new": "New Invoice",
|
||||
"noneselected": "No invoice selected.",
|
||||
@@ -906,6 +908,7 @@
|
||||
"receive": "Receive"
|
||||
},
|
||||
"errors": {
|
||||
"backordering": "Error backordering part {{message}}.",
|
||||
"creating": "Error encountered when creating parts order. "
|
||||
},
|
||||
"fields": {
|
||||
@@ -927,6 +930,7 @@
|
||||
"inthisorder": "Parts in this Order",
|
||||
"newpartsorder": "New Parts Order",
|
||||
"orderhistory": "Order History",
|
||||
"parts_orders": "Parts Orders",
|
||||
"print": "Show Printed Form",
|
||||
"returnpartsorder": "Return Parts Order"
|
||||
},
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
"viewjob": "Ver trabajo"
|
||||
},
|
||||
"errors": {
|
||||
"blocking": "",
|
||||
"canceling": "Error al cancelar la cita. {{message}}",
|
||||
"saving": "Error al programar la cita. {{message}}"
|
||||
},
|
||||
@@ -477,6 +478,7 @@
|
||||
"entered_total": "",
|
||||
"federal_tax": "",
|
||||
"invoice_total": "",
|
||||
"invoices": "",
|
||||
"local_tax": "",
|
||||
"new": "",
|
||||
"noneselected": "",
|
||||
@@ -906,6 +908,7 @@
|
||||
"receive": ""
|
||||
},
|
||||
"errors": {
|
||||
"backordering": "",
|
||||
"creating": "Se encontró un error al crear el pedido de piezas."
|
||||
},
|
||||
"fields": {
|
||||
@@ -927,6 +930,7 @@
|
||||
"inthisorder": "Partes en este pedido",
|
||||
"newpartsorder": "",
|
||||
"orderhistory": "Historial de pedidos",
|
||||
"parts_orders": "",
|
||||
"print": "Mostrar formulario impreso",
|
||||
"returnpartsorder": ""
|
||||
},
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
"viewjob": "Voir le travail"
|
||||
},
|
||||
"errors": {
|
||||
"blocking": "",
|
||||
"canceling": "Erreur lors de l'annulation du rendez-vous. {{message}}",
|
||||
"saving": "Erreur lors de la planification du rendez-vous. {{message}}"
|
||||
},
|
||||
@@ -477,6 +478,7 @@
|
||||
"entered_total": "",
|
||||
"federal_tax": "",
|
||||
"invoice_total": "",
|
||||
"invoices": "",
|
||||
"local_tax": "",
|
||||
"new": "",
|
||||
"noneselected": "",
|
||||
@@ -906,6 +908,7 @@
|
||||
"receive": ""
|
||||
},
|
||||
"errors": {
|
||||
"backordering": "",
|
||||
"creating": "Erreur rencontrée lors de la création de la commande de pièces."
|
||||
},
|
||||
"fields": {
|
||||
@@ -927,6 +930,7 @@
|
||||
"inthisorder": "Pièces dans cette commande",
|
||||
"newpartsorder": "",
|
||||
"orderhistory": "Historique des commandes",
|
||||
"parts_orders": "",
|
||||
"print": "Afficher le formulaire imprimé",
|
||||
"returnpartsorder": ""
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user