-
+
);
}}
diff --git a/client/src/components/bill-form/bill-form.component.jsx b/client/src/components/bill-form/bill-form.component.jsx
index 9f12c1b3f..0c6770d8e 100644
--- a/client/src/components/bill-form/bill-form.component.jsx
+++ b/client/src/components/bill-form/bill-form.component.jsx
@@ -24,7 +24,7 @@ import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import VendorSearchSelect from "../vendor-search-select/vendor-search-select.component";
import BillFormLines from "./bill-form.lines.component";
import { CalculateBillTotal } from "./bill-form.totals.utility";
-
+import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
@@ -66,8 +66,8 @@ export function BillFormComponent({
return (
+
{
billlines.forEach((i) => {
if (!!i) {
- console.log("Amount:", (i.actual_cost || 0) * 100);
const itemTotal = Dinero({
amount:
Math.round(((i.actual_cost || 0) * 100 + Number.EPSILON) * 100) / 100,
diff --git a/client/src/components/bills-list-table/bills-list-table.component.jsx b/client/src/components/bills-list-table/bills-list-table.component.jsx
index 506f1c4a7..4e611a4bf 100644
--- a/client/src/components/bills-list-table/bills-list-table.component.jsx
+++ b/client/src/components/bills-list-table/bills-list-table.component.jsx
@@ -258,8 +258,7 @@ export function BillsListTableComponent({
!selectedBillLinesByBill[record.id] ||
(selectedBillLinesByBill[record.id] &&
selectedBillLinesByBill[record.id].length === 0) ||
- record.is_credit_memo ||
- record.exported
+ record.is_credit_memo
}
onClick={() =>
setPartsOrderContext({
diff --git a/client/src/components/job-search-select/job-search-select.component.jsx b/client/src/components/job-search-select/job-search-select.component.jsx
index 332c7eb4b..194140d73 100644
--- a/client/src/components/job-search-select/job-search-select.component.jsx
+++ b/client/src/components/job-search-select/job-search-select.component.jsx
@@ -55,8 +55,6 @@ const JobSearchSelect = (
useEffect(() => {
if (value === option && value) {
- console.log("Calling");
- console.log("value, option :>> ", value, option);
callIdSearch({ variables: { id: value } });
}
}, [value, option, callIdSearch]);
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 7542bcdc9..166feb9e2 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
@@ -126,6 +126,9 @@ export function PartsOrderModalContainer({
invoice_number: "ih",
isinhouse: true,
date: new moment(),
+ total: values.parts_order_lines.data.reduce((acc, val) => {
+ return acc + val.act_price * val.quantity;
+ }, 0),
billlines: values.parts_order_lines.data.map((p) => {
return {
joblineid: p.job_line_id,
@@ -137,8 +140,8 @@ export function PartsOrderModalContainer({
quantity: p.quantity || 1,
applicable_taxes: {
local: false,
- state: p.tax_part,
- federal: true,
+ state: false,
+ federal: false,
},
};
}),
diff --git a/client/src/graphql/accounting.queries.js b/client/src/graphql/accounting.queries.js
index 6bb6c32b4..f6010f583 100644
--- a/client/src/graphql/accounting.queries.js
+++ b/client/src/graphql/accounting.queries.js
@@ -30,7 +30,7 @@ export const QUERY_JOBS_FOR_EXPORT = gql`
export const QUERY_BILLS_FOR_EXPORT = gql`
query QUERY_BILLS_FOR_EXPORT {
- bills(where: { exported: { _eq: false } }) {
+ bills(where: { exported: { _eq: false }, isinhouse: { _eq: false } }) {
id
exported
date
diff --git a/client/src/graphql/bills.queries.js b/client/src/graphql/bills.queries.js
index a92ce8691..a4a870ee3 100644
--- a/client/src/graphql/bills.queries.js
+++ b/client/src/graphql/bills.queries.js
@@ -129,36 +129,6 @@ export const QUERY_BILLS_BY_JOBID = gql`
}
`;
-// 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_BILL_BY_PK = gql`
query QUERY_BILL_BY_PK($billid: uuid!) {
bills_by_pk(id: $billid) {
@@ -238,6 +208,9 @@ export const CHECK_BILL_INVOICE_NUMBER = gql`
aggregate {
count
}
+ nodes {
+ id
+ }
}
}
`;
diff --git a/client/src/pages/bills/bills.page.component.jsx b/client/src/pages/bills/bills.page.component.jsx
index 638a86fb1..785b33453 100644
--- a/client/src/pages/bills/bills.page.component.jsx
+++ b/client/src/pages/bills/bills.page.component.jsx
@@ -6,6 +6,7 @@ import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { Link, useHistory, useLocation } from "react-router-dom";
import BillDeleteButton from "../../components/bill-delete-button/bill-delete-button.component";
+import PartsOrderModalContainer from "../../components/parts-order-modal/parts-order-modal.container";
import { setModalContext } from "../../redux/modals/modals.actions";
import CurrencyFormatter from "../../utils/CurrencyFormatter";
import { DateFormatter } from "../../utils/DateFormatter";
@@ -188,6 +189,7 @@ export function BillsListPage({
return (
+
{t("bills.labels.bills")}