diff --git a/client/src/components/parts-order-modal/parts-order-modal.container.jsx b/client/src/components/parts-order-modal/parts-order-modal.container.jsx
index 5cc2f91c9..0d73cbfb8 100644
--- a/client/src/components/parts-order-modal/parts-order-modal.container.jsx
+++ b/client/src/components/parts-order-modal/parts-order-modal.container.jsx
@@ -4,7 +4,7 @@ import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
-import { INSERT_NEW_INVOICE } from "../../graphql/invoices.queries";
+import { INSERT_NEW_BILL } from "../../graphql/bills.queries";
import { UPDATE_JOB_LINE_STATUS } from "../../graphql/jobs-lines.queries";
import { INSERT_NEW_PARTS_ORDERS } from "../../graphql/parts-orders.queries";
import { QUERY_ALL_VENDORS_FOR_ORDER } from "../../graphql/vendors.queries";
@@ -68,7 +68,7 @@ export function PartsOrderModalContainer({
const [insertPartOrder] = useMutation(INSERT_NEW_PARTS_ORDERS);
const [updateJobLines] = useMutation(UPDATE_JOB_LINE_STATUS);
- const [insertInvoice] = useMutation(INSERT_NEW_INVOICE);
+ const [insertBill] = useMutation(INSERT_NEW_BILL);
const handleFinish = async (values) => {
logImEXEvent("parts_order_insert");
@@ -120,9 +120,9 @@ export function PartsOrderModalContainer({
jobid: jobId,
total: 0,
invoice_number: `${jobId}`,
- federal_tax_rate: bodyshop.invoice_tax_rates.federal_tax_rate || 0,
- state_tax_rate: bodyshop.invoice_tax_rates.state_tax_rate || 0,
- local_tax_rate: bodyshop.invoice_tax_rates.local_tax_rate || 0,
+ federal_tax_rate: bodyshop.bill_tax_rates.federal_tax_rate || 0,
+ state_tax_rate: bodyshop.bill_tax_rates.state_tax_rate || 0,
+ local_tax_rate: bodyshop.bill_tax_rates.local_tax_rate || 0,
invoicelines: {
data: values.parts_order_lines.data.map((p) => {
return {
@@ -138,8 +138,8 @@ export function PartsOrderModalContainer({
},
};
- await insertInvoice({
- variables: { invoice: invoiceToPost },
+ await insertBill({
+ variables: { bill: invoiceToPost },
});
}
diff --git a/client/src/components/invoice-export-all-button/invoice-export-all-button.component.jsx b/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx
similarity index 80%
rename from client/src/components/invoice-export-all-button/invoice-export-all-button.component.jsx
rename to client/src/components/payable-export-all-button/payable-export-all-button.component.jsx
index 2c2c1f5cc..c3645b741 100644
--- a/client/src/components/invoice-export-all-button/invoice-export-all-button.component.jsx
+++ b/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx
@@ -6,7 +6,7 @@ import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { auth } from "../../firebase/firebase.utils";
-import { UPDATE_INVOICES } from "../../graphql/invoices.queries";
+import { UPDATE_BILLS } from "../../graphql/bills.queries";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { logImEXEvent } from "../../firebase/firebase.utils";
@@ -14,15 +14,15 @@ const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
-export function InvoiceExportAllButton({
+export function PayableExportAll({
bodyshop,
- invoiceIds,
+ billids,
disabled,
loadingCallback,
completedCallback,
}) {
const { t } = useTranslation();
- const [updateInvoice] = useMutation(UPDATE_INVOICES);
+ const [updateBill] = useMutation(UPDATE_BILLS);
const [loading, setLoading] = useState(false);
const handleQbxml = async () => {
@@ -35,7 +35,7 @@ export function InvoiceExportAllButton({
try {
QbXmlResponse = await axios.post(
"/accounting/qbxml/payables",
- { invoices: invoiceIds },
+ { bills: billids },
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
@@ -45,7 +45,7 @@ export function InvoiceExportAllButton({
} catch (error) {
console.log("Error getting QBXML from Server.", error);
notification["error"]({
- message: t("invoices.errors.exporting", {
+ message: t("bills.errors.exporting", {
error: "Unable to retrieve QBXML. " + JSON.stringify(error.message),
}),
});
@@ -64,7 +64,7 @@ export function InvoiceExportAllButton({
} catch (error) {
console.log("Error connecting to quickbooks or partner.", error);
notification["error"]({
- message: t("invoices.errors.exporting-partner"),
+ message: t("bills.errors.exporting-partner"),
});
if (!!loadingCallback) loadingCallback(false);
setLoading(false);
@@ -80,36 +80,35 @@ export function InvoiceExportAllButton({
//Uh oh. At least one was no good.
failedTransactions.map((ft) =>
notification["error"]({
- message: t("invoices.errors.exporting", {
+ message: t("bills.errors.exporting", {
error: ft.errorMessage || "",
}),
})
);
}
if (successfulTransactions.length > 0) {
- const invoiceUpdateResponse = await updateInvoice({
+ const billUpdateResponse = await updateBill({
variables: {
- invoiceIdList: successfulTransactions.map((st) => st.id),
- invoice: {
+ billIdList: successfulTransactions.map((st) => st.id),
+ bill: {
exported: true,
exported_at: new Date(),
},
},
});
- if (!!!invoiceUpdateResponse.errors) {
+ if (!!!billUpdateResponse.errors) {
notification["success"]({
message: t("jobs.successes.exported"),
});
} else {
notification["error"]({
message: t("jobs.errors.exporting", {
- error: JSON.stringify(invoiceUpdateResponse.error),
+ error: JSON.stringify(billUpdateResponse.error),
}),
});
}
}
- //Set the list of selected invoices to be nothing.
if (!!completedCallback) completedCallback([]);
if (!!loadingCallback) loadingCallback(false);
setLoading(false);
@@ -127,4 +126,4 @@ export function InvoiceExportAllButton({
);
}
-export default connect(mapStateToProps, null)(InvoiceExportAllButton);
+export default connect(mapStateToProps, null)(PayableExportAll);
diff --git a/client/src/components/invoice-export-button/invoice-export-button.component.jsx b/client/src/components/payable-export-button/payable-export-button.component.jsx
similarity index 81%
rename from client/src/components/invoice-export-button/invoice-export-button.component.jsx
rename to client/src/components/payable-export-button/payable-export-button.component.jsx
index 24a241724..08bebba60 100644
--- a/client/src/components/invoice-export-button/invoice-export-button.component.jsx
+++ b/client/src/components/payable-export-button/payable-export-button.component.jsx
@@ -6,7 +6,7 @@ import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { auth } from "../../firebase/firebase.utils";
-import { UPDATE_INVOICES } from "../../graphql/invoices.queries";
+import { UPDATE_BILLS } from "../../graphql/bills.queries";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { logImEXEvent } from "../../firebase/firebase.utils";
@@ -14,14 +14,14 @@ const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
-export function InvoiceExportButton({
+export function PayableExportButton({
bodyshop,
- invoiceId,
+ billId,
disabled,
loadingCallback,
}) {
const { t } = useTranslation();
- const [updateInvoice] = useMutation(UPDATE_INVOICES);
+ const [updateBill] = useMutation(UPDATE_BILLS);
const [loading, setLoading] = useState(false);
const handleQbxml = async () => {
@@ -34,7 +34,7 @@ export function InvoiceExportButton({
try {
QbXmlResponse = await axios.post(
"/accounting/qbxml/payables",
- { invoices: [invoiceId] },
+ { bills: [billId] },
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
@@ -44,7 +44,7 @@ export function InvoiceExportButton({
} catch (error) {
console.log("Error getting QBXML from Server.", error);
notification["error"]({
- message: t("invoices.errors.exporting", {
+ message: t("bills.errors.exporting", {
error: "Unable to retrieve QBXML. " + JSON.stringify(error.message),
}),
});
@@ -63,7 +63,7 @@ export function InvoiceExportButton({
} catch (error) {
console.log("Error connecting to quickbooks or partner.", error);
notification["error"]({
- message: t("invoices.errors.exporting-partner"),
+ message: t("bills.errors.exporting-partner"),
});
if (!!loadingCallback) loadingCallback(false);
setLoading(false);
@@ -79,30 +79,30 @@ export function InvoiceExportButton({
//Uh oh. At least one was no good.
failedTransactions.map((ft) =>
notification["error"]({
- message: t("invoices.errors.exporting", {
+ message: t("bills.errors.exporting", {
error: ft.errorMessage || "",
}),
})
);
}
if (successfulTransactions.length > 0) {
- const invoiceUpdateResponse = await updateInvoice({
+ const billUpdateResponse = await updateBill({
variables: {
- invoiceIdList: successfulTransactions.map((st) => st.id),
- invoice: {
+ billIdList: successfulTransactions.map((st) => st.id),
+ bill: {
exported: true,
exported_at: new Date(),
},
},
});
- if (!!!invoiceUpdateResponse.errors) {
+ if (!!!billUpdateResponse.errors) {
notification["success"]({
message: t("jobs.successes.exported"),
});
} else {
notification["error"]({
message: t("jobs.errors.exporting", {
- error: JSON.stringify(invoiceUpdateResponse.error),
+ error: JSON.stringify(billUpdateResponse.error),
}),
});
}
@@ -124,4 +124,4 @@ export function InvoiceExportButton({
);
}
-export default connect(mapStateToProps, null)(InvoiceExportButton);
+export default connect(mapStateToProps, null)(PayableExportButton);
diff --git a/client/src/components/payment-form/payment-form.component.jsx b/client/src/components/payment-form/payment-form.component.jsx
index 695776db0..d7409ccb1 100644
--- a/client/src/components/payment-form/payment-form.component.jsx
+++ b/client/src/components/payment-form/payment-form.component.jsx
@@ -25,7 +25,7 @@ export function PaymentFormComponent({ form, stripeStateArr, bodyshop }) {
({
toggleModalVisible: () => dispatch(toggleModalVisible("payment")),
});
-function InvoiceEnterModalContainer({
+function BillEnterModalContainer({
paymentModal,
toggleModalVisible,
bodyshop,
@@ -189,7 +189,7 @@ function InvoiceEnterModalContainer({
export default connect(
mapStateToProps,
mapDispatchToProps
-)(InvoiceEnterModalContainer);
+)(BillEnterModalContainer);
// const pr = stripe.paymentRequest({
// country: "CA",
diff --git a/client/src/components/rbac-wrapper/rbac-defaults.js b/client/src/components/rbac-wrapper/rbac-defaults.js
index 826ddb184..7cefb0cb3 100644
--- a/client/src/components/rbac-wrapper/rbac-defaults.js
+++ b/client/src/components/rbac-wrapper/rbac-defaults.js
@@ -22,9 +22,9 @@ export default {
"jobs:close": 5,
"jobs:detail": 1,
- "invoices:enter": 2,
- "invoices:view": 2,
- "invoices:list": 2,
+ "bills:enter": 2,
+ "bills:view": 2,
+ "bills:list": 2,
"employees:page": 5,
diff --git a/client/src/components/shop-info/shop-info.component.jsx b/client/src/components/shop-info/shop-info.component.jsx
index 548ad5d9a..f03d90150 100644
--- a/client/src/components/shop-info/shop-info.component.jsx
+++ b/client/src/components/shop-info/shop-info.component.jsx
@@ -137,7 +137,7 @@ export default function ShopInfoComponent({ form, saveLoading }) {
diff --git a/client/src/components/vendors-form/vendors-form.component.jsx b/client/src/components/vendors-form/vendors-form.component.jsx
index a72da4f13..73e292c0a 100644
--- a/client/src/components/vendors-form/vendors-form.component.jsx
+++ b/client/src/components/vendors-form/vendors-form.component.jsx
@@ -58,7 +58,7 @@ export default function VendorsFormComponent({
}}
style={{ width: "100%" }}
>
- {t("invoicelines.actions.newline")}
+ {t("billlines.actions.newline")}
diff --git a/client/src/graphql/accounting.queries.js b/client/src/graphql/accounting.queries.js
index 8e2c6c8ed..e9dca50de 100644
--- a/client/src/graphql/accounting.queries.js
+++ b/client/src/graphql/accounting.queries.js
@@ -28,9 +28,9 @@ export const QUERY_JOBS_FOR_EXPORT = gql`
}
`;
-export const QUERY_INVOICES_FOR_EXPORT = gql`
- query QUERY_INVOICES_FOR_EXPORT {
- invoices(where: { exported: { _eq: false } }) {
+export const QUERY_BILLS_FOR_EXPORT = gql`
+ query QUERY_BILLS_FOR_EXPORT {
+ bills(where: { exported: { _eq: false } }) {
id
exported
date
diff --git a/client/src/graphql/bill-lines.queries.js b/client/src/graphql/bill-lines.queries.js
new file mode 100644
index 000000000..3242d8195
--- /dev/null
+++ b/client/src/graphql/bill-lines.queries.js
@@ -0,0 +1,14 @@
+import gql from "graphql-tag";
+
+export const UPDATE_BILL_LINE = gql`
+ mutation UPDATE_BILL_LINE(
+ $billLineId: uuid!
+ $billLine: billlines_set_input!
+ ) {
+ update_billlines(where: { id: { _eq: $billLineId } }, _set: $billLine) {
+ returning {
+ id
+ }
+ }
+ }
+`;
diff --git a/client/src/graphql/invoices.queries.js b/client/src/graphql/bills.queries.js
similarity index 53%
rename from client/src/graphql/invoices.queries.js
rename to client/src/graphql/bills.queries.js
index 07f0d2d05..e341dfc74 100644
--- a/client/src/graphql/invoices.queries.js
+++ b/client/src/graphql/bills.queries.js
@@ -1,8 +1,8 @@
import gql from "graphql-tag";
-export const INSERT_NEW_INVOICE = gql`
- mutation INSERT_NEW_INVOICE($invoice: [invoices_insert_input!]!) {
- insert_invoices(objects: $invoice) {
+export const INSERT_NEW_BILL = gql`
+ mutation INSERT_NEW_BILL($bill: [bills_insert_input!]!) {
+ insert_bills(objects: $bill) {
returning {
id
}
@@ -10,14 +10,14 @@ export const INSERT_NEW_INVOICE = gql`
}
`;
-export const QUERY_ALL_INVOICES_PAGINATED = gql`
- query QUERY_ALL_INVOICES_PAGINATED(
+export const QUERY_ALL_BILLS_PAGINATED = gql`
+ query QUERY_ALL_BILLS_PAGINATED(
$search: String
$offset: Int
$limit: Int
- $order: [invoices_order_by!]!
+ $order: [bills_order_by!]!
) {
- search_invoices(
+ search_bills(
args: { search: $search }
offset: $offset
limit: $limit
@@ -39,7 +39,7 @@ export const QUERY_ALL_INVOICES_PAGINATED = gql`
id
ro_number
}
- invoicelines {
+ billlines {
actual_price
quantity
actual_cost
@@ -48,7 +48,7 @@ export const QUERY_ALL_INVOICES_PAGINATED = gql`
line_desc
}
}
- search_invoices_aggregate(args: { search: $search }) {
+ search_bills_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}
@@ -56,8 +56,8 @@ export const QUERY_ALL_INVOICES_PAGINATED = gql`
}
`;
-export const QUERY_INVOICES_BY_JOBID = gql`
- query QUERY_PARTS_INVOICES_BY_JOBID($jobid: uuid!) {
+export const QUERY_BILLS_BY_JOBID = gql`
+ query QUERY_PARTS_BILLS_BY_JOBID($jobid: uuid!) {
parts_orders(
where: { jobid: { _eq: $jobid } }
order_by: { order_date: desc }
@@ -89,7 +89,7 @@ export const QUERY_INVOICES_BY_JOBID = gql`
order_number
user_email
}
- invoices(where: { jobid: { _eq: $jobid } }, order_by: { date: desc }) {
+ bills(where: { jobid: { _eq: $jobid } }, order_by: { date: desc }) {
id
vendorid
vendor {
@@ -103,7 +103,7 @@ export const QUERY_INVOICES_BY_JOBID = gql`
state_tax_rate
local_tax_rate
is_credit_memo
- invoicelines {
+ billlines {
actual_price
quantity
actual_cost
@@ -117,57 +117,39 @@ export const QUERY_INVOICES_BY_JOBID = gql`
}
`;
-export const QUERY_INVOICES_BY_VENDOR = gql`
- query QUERY_INVOICES_BY_VENDOR($vendorId: uuid!) {
- invoices(
- where: { vendorid: { _eq: $vendorId } }
- order_by: { date: desc }
- ) {
- id
- job {
- id
- ro_number
- }
- total
- invoice_number
- date
- }
- }
-`;
+// export const QUERY_INVOICES_BY_VENDOR_PAGINATED = gql`
+// query QUERY_INVOICES_BY_VENDOR_PAGINATED(
+// $vendorId: uuid!
+// $offset: Int
+// $limit: Int
+// $order: [invoices_order_by!]!
+// ) {
+// invoices(
+// where: { vendorid: { _eq: $vendorId } }
+// offset: $offset
+// limit: $limit
+// order_by: $order
+// ) {
+// id
+// job {
+// id
+// ro_number
+// }
+// total
+// invoice_number
+// date
+// }
+// invoices_aggregate(where: { vendorid: { _eq: $vendorId } }) {
+// aggregate {
+// count(distinct: true)
+// }
+// }
+// }
+// `;
-export const QUERY_INVOICES_BY_VENDOR_PAGINATED = gql`
- query QUERY_INVOICES_BY_VENDOR_PAGINATED(
- $vendorId: uuid!
- $offset: Int
- $limit: Int
- $order: [invoices_order_by!]!
- ) {
- invoices(
- where: { vendorid: { _eq: $vendorId } }
- offset: $offset
- limit: $limit
- order_by: $order
- ) {
- id
- job {
- id
- ro_number
- }
- total
- invoice_number
- date
- }
- invoices_aggregate(where: { vendorid: { _eq: $vendorId } }) {
- aggregate {
- count(distinct: true)
- }
- }
- }
-`;
-
-export const QUERY_INVOICE_BY_PK = gql`
- query QUERY_INVOICE_BY_PK($invoiceid: uuid!) {
- invoices_by_pk(id: $invoiceid) {
+export const QUERY_BILL_BY_PK = gql`
+ query QUERY_BILL_BY_PK($billid: uuid!) {
+ bills_by_pk(id: $billid) {
due_date
exported
exported_at
@@ -187,7 +169,7 @@ export const QUERY_INVOICE_BY_PK = gql`
name
discount
}
- invoicelines {
+ billlines {
id
line_desc
actual_price
@@ -207,9 +189,9 @@ export const QUERY_INVOICE_BY_PK = gql`
}
`;
-export const UPDATE_INVOICE = gql`
- mutation UPDATE_INVOICE($invoiceId: uuid!, $invoice: invoices_set_input!) {
- update_invoices(where: { id: { _eq: $invoiceId } }, _set: $invoice) {
+export const UPDATE_BILL = gql`
+ mutation UPDATE_BILL($billId: uuid!, $bill: bills_set_input!) {
+ update_bills(where: { id: { _eq: $billId } }, _set: $bill) {
returning {
id
exported
@@ -219,12 +201,9 @@ export const UPDATE_INVOICE = gql`
}
`;
-export const UPDATE_INVOICES = gql`
- mutation UPDATE_INVOICES(
- $invoiceIdList: [uuid!]!
- $invoice: invoices_set_input!
- ) {
- update_invoices(where: { id: { _in: $invoiceIdList } }, _set: $invoice) {
+export const UPDATE_BILLS = gql`
+ mutation UPDATE_BILLS($billIdList: [uuid!]!, $bill: bills_set_input!) {
+ update_bills(where: { id: { _in: $billIdList } }, _set: $bill) {
returning {
id
exported
diff --git a/client/src/graphql/bodyshop.queries.js b/client/src/graphql/bodyshop.queries.js
index 3a9d27668..f785df942 100644
--- a/client/src/graphql/bodyshop.queries.js
+++ b/client/src/graphql/bodyshop.queries.js
@@ -48,7 +48,7 @@ export const QUERY_BODYSHOP = gql`
template_header
textid
production_config
- invoice_tax_rates
+ bill_tax_rates
inhousevendorid
accountingconfig
appt_length
@@ -118,7 +118,7 @@ export const UPDATE_SHOP = gql`
template_header
textid
production_config
- invoice_tax_rates
+ bill_tax_rates
appt_length
stripe_acct_id
ssbuckets
diff --git a/client/src/graphql/invoice-lines.queries.js b/client/src/graphql/invoice-lines.queries.js
deleted file mode 100644
index 991d6e48f..000000000
--- a/client/src/graphql/invoice-lines.queries.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import gql from "graphql-tag";
-
-export const UPDATE_INVOICE_LINE = gql`
- mutation UPDATE_INVOICE_LINE(
- $invoicelineId: uuid!
- $invoiceLine: invoicelines_set_input!
- ) {
- update_invoicelines(
- where: { id: { _eq: $invoicelineId } }
- _set: $invoiceLine
- ) {
- returning {
- id
- }
- }
- }
-`;
diff --git a/client/src/graphql/jobs-lines.queries.js b/client/src/graphql/jobs-lines.queries.js
index 1af20d349..37d31ad98 100644
--- a/client/src/graphql/jobs-lines.queries.js
+++ b/client/src/graphql/jobs-lines.queries.js
@@ -124,8 +124,8 @@ export const UPDATE_JOB_LINE = gql`
}
`;
-export const GET_JOB_LINES_TO_ENTER_INVOICE = gql`
- query GET_JOB_LINES_TO_ENTER_INVOICE($id: uuid!) {
+export const GET_JOB_LINES_TO_ENTER_BILL = gql`
+ query GET_JOB_LINES_TO_ENTER_BILL($id: uuid!) {
joblines(where: { jobid: { _eq: $id } }) {
id
line_desc
diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js
index 64fd2a484..71a1a07bc 100644
--- a/client/src/graphql/jobs.queries.js
+++ b/client/src/graphql/jobs.queries.js
@@ -215,13 +215,13 @@ export const QUERY_JOB_COSTING_DETAILS = gql`
lbr_amt
op_code_desc
}
- invoices {
+ bills {
id
federal_tax_rate
local_tax_rate
state_tax_rate
is_credit_memo
- invoicelines {
+ billlines {
actual_cost
cost_center
id
diff --git a/client/src/graphql/search.queries.js b/client/src/graphql/search.queries.js
index aece6edaf..c8f4f7615 100644
--- a/client/src/graphql/search.queries.js
+++ b/client/src/graphql/search.queries.js
@@ -42,7 +42,7 @@ export const GLOBAL_SEARCH_QUERY = gql`
memo
transactionid
}
- search_invoices(args: { search: $search }) {
+ search_bills(args: { search: $search }) {
id
date
invoice_number
diff --git a/client/src/pages/accounting-payables/accounting-payables.container.jsx b/client/src/pages/accounting-payables/accounting-payables.container.jsx
index 0f2110dc4..556d0ebf4 100644
--- a/client/src/pages/accounting-payables/accounting-payables.container.jsx
+++ b/client/src/pages/accounting-payables/accounting-payables.container.jsx
@@ -5,13 +5,14 @@ import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import AccountingPayablesTable from "../../components/accounting-payables-table/accounting-payables-table.component";
import AlertComponent from "../../components/alert/alert.component";
-import { QUERY_INVOICES_FOR_EXPORT } from "../../graphql/accounting.queries";
+import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
+import { QUERY_BILLS_FOR_EXPORT } from "../../graphql/accounting.queries";
import {
setBreadcrumbs,
setSelectedHeader,
} from "../../redux/application/application.actions";
import { selectBodyshop } from "../../redux/user/user.selectors";
-import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
+
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
@@ -20,6 +21,7 @@ const mapDispatchToProps = (dispatch) => ({
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
setSelectedHeader: (key) => dispatch(setSelectedHeader(key)),
});
+
export function AccountingPayablesContainer({
bodyshop,
setBreadcrumbs,
@@ -38,7 +40,7 @@ export function AccountingPayablesContainer({
]);
}, [t, setBreadcrumbs, setSelectedHeader]);
- const { loading, error, data } = useQuery(QUERY_INVOICES_FOR_EXPORT);
+ const { loading, error, data } = useQuery(QUERY_BILLS_FOR_EXPORT);
if (error) return
;
@@ -47,7 +49,7 @@ export function AccountingPayablesContainer({
diff --git a/client/src/pages/invoices/invoices.page.component.jsx b/client/src/pages/bills/bills.page.component.jsx
similarity index 84%
rename from client/src/pages/invoices/invoices.page.component.jsx
rename to client/src/pages/bills/bills.page.component.jsx
index a3d57ec95..c82a0a56c 100644
--- a/client/src/pages/invoices/invoices.page.component.jsx
+++ b/client/src/pages/bills/bills.page.component.jsx
@@ -13,17 +13,17 @@ import { alphaSort } from "../../utils/sorters";
const mapDispatchToProps = (dispatch) => ({
setPartsOrderContext: (context) =>
dispatch(setModalContext({ context: context, modal: "partsOrder" })),
- setInvoiceEnterContext: (context) =>
- dispatch(setModalContext({ context: context, modal: "invoiceEnter" })),
+ setBillEnterContext: (context) =>
+ dispatch(setModalContext({ context: context, modal: "billEnter" })),
});
-export function InvoicesListPage({
+export function BillsListPage({
loading,
data,
refetch,
total,
setPartsOrderContext,
- setInvoiceEnterContext,
+ setBillEnterContext,
}) {
const { t } = useTranslation();
const [state, setState] = useState({
@@ -35,7 +35,7 @@ export function InvoicesListPage({
const columns = [
{
- title: t("invoices.fields.vendorname"),
+ title: t("bills.fields.vendorname"),
dataIndex: "vendorname",
key: "vendorname",
// sorter: (a, b) => alphaSort(a.vendor.name, b.vendor.name),
@@ -44,7 +44,7 @@ export function InvoicesListPage({
render: (text, record) =>