Issues resolved with Bill Enter Modal IO-480
This commit is contained in:
@@ -17898,6 +17898,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>costs</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>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
<name>create</name>
|
<name>create</name>
|
||||||
<children>
|
<children>
|
||||||
|
|||||||
@@ -150,19 +150,20 @@ export default function AccountingPayablesTableComponent({ loading, bills }) {
|
|||||||
loading={loading}
|
loading={loading}
|
||||||
title={() => {
|
title={() => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="imex-table-header">
|
||||||
<Input
|
|
||||||
value={state.search}
|
|
||||||
onChange={handleSearch}
|
|
||||||
placeholder={t("general.labels.search")}
|
|
||||||
allowClear
|
|
||||||
/>
|
|
||||||
<PayableExportAll
|
<PayableExportAll
|
||||||
billIds={selectedBills}
|
billIds={selectedBills}
|
||||||
disabled={transInProgress || selectedBills.length === 0}
|
disabled={transInProgress || selectedBills.length === 0}
|
||||||
loadingCallback={setTransInProgress}
|
loadingCallback={setTransInProgress}
|
||||||
completedCallback={setSelectedBills}
|
completedCallback={setSelectedBills}
|
||||||
/>
|
/>
|
||||||
|
<Input
|
||||||
|
className="imex-table-header__search"
|
||||||
|
value={state.search}
|
||||||
|
onChange={handleSearch}
|
||||||
|
placeholder={t("general.labels.search")}
|
||||||
|
allowClear
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -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 VendorSearchSelect from "../vendor-search-select/vendor-search-select.component";
|
||||||
import BillFormLines from "./bill-form.lines.component";
|
import BillFormLines from "./bill-form.lines.component";
|
||||||
import { CalculateBillTotal } from "./bill-form.totals.utility";
|
import { CalculateBillTotal } from "./bill-form.totals.utility";
|
||||||
|
import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component";
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
@@ -66,8 +66,8 @@ export function BillFormComponent({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<FormFieldsChanged form={form} />
|
||||||
<Form.Item
|
<Form.Item
|
||||||
// label={t("bills.fields.isinhouse")}
|
|
||||||
style={{ display: "none" }}
|
style={{ display: "none" }}
|
||||||
name="isinhouse"
|
name="isinhouse"
|
||||||
valuePropName="checked"
|
valuePropName="checked"
|
||||||
@@ -139,6 +139,12 @@ export function BillFormComponent({
|
|||||||
|
|
||||||
if (response.data.bills_aggregate.aggregate.count === 0) {
|
if (response.data.bills_aggregate.aggregate.count === 0) {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
|
} else if (
|
||||||
|
response.data.bills_aggregate.nodes.length === 1 &&
|
||||||
|
response.data.bills_aggregate.nodes[0].id ===
|
||||||
|
form.getFieldValue("id")
|
||||||
|
) {
|
||||||
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
return Promise.reject(
|
return Promise.reject(
|
||||||
t("bills.validation.unique_invoice_number")
|
t("bills.validation.unique_invoice_number")
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ export const CalculateBillTotal = (invoice) => {
|
|||||||
|
|
||||||
billlines.forEach((i) => {
|
billlines.forEach((i) => {
|
||||||
if (!!i) {
|
if (!!i) {
|
||||||
console.log("Amount:", (i.actual_cost || 0) * 100);
|
|
||||||
const itemTotal = Dinero({
|
const itemTotal = Dinero({
|
||||||
amount:
|
amount:
|
||||||
Math.round(((i.actual_cost || 0) * 100 + Number.EPSILON) * 100) / 100,
|
Math.round(((i.actual_cost || 0) * 100 + Number.EPSILON) * 100) / 100,
|
||||||
|
|||||||
@@ -258,8 +258,7 @@ export function BillsListTableComponent({
|
|||||||
!selectedBillLinesByBill[record.id] ||
|
!selectedBillLinesByBill[record.id] ||
|
||||||
(selectedBillLinesByBill[record.id] &&
|
(selectedBillLinesByBill[record.id] &&
|
||||||
selectedBillLinesByBill[record.id].length === 0) ||
|
selectedBillLinesByBill[record.id].length === 0) ||
|
||||||
record.is_credit_memo ||
|
record.is_credit_memo
|
||||||
record.exported
|
|
||||||
}
|
}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
setPartsOrderContext({
|
setPartsOrderContext({
|
||||||
|
|||||||
@@ -55,8 +55,6 @@ const JobSearchSelect = (
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (value === option && value) {
|
if (value === option && value) {
|
||||||
console.log("Calling");
|
|
||||||
console.log("value, option :>> ", value, option);
|
|
||||||
callIdSearch({ variables: { id: value } });
|
callIdSearch({ variables: { id: value } });
|
||||||
}
|
}
|
||||||
}, [value, option, callIdSearch]);
|
}, [value, option, callIdSearch]);
|
||||||
|
|||||||
@@ -126,6 +126,9 @@ export function PartsOrderModalContainer({
|
|||||||
invoice_number: "ih",
|
invoice_number: "ih",
|
||||||
isinhouse: true,
|
isinhouse: true,
|
||||||
date: new moment(),
|
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) => {
|
billlines: values.parts_order_lines.data.map((p) => {
|
||||||
return {
|
return {
|
||||||
joblineid: p.job_line_id,
|
joblineid: p.job_line_id,
|
||||||
@@ -137,8 +140,8 @@ export function PartsOrderModalContainer({
|
|||||||
quantity: p.quantity || 1,
|
quantity: p.quantity || 1,
|
||||||
applicable_taxes: {
|
applicable_taxes: {
|
||||||
local: false,
|
local: false,
|
||||||
state: p.tax_part,
|
state: false,
|
||||||
federal: true,
|
federal: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export const QUERY_JOBS_FOR_EXPORT = gql`
|
|||||||
|
|
||||||
export const QUERY_BILLS_FOR_EXPORT = gql`
|
export const QUERY_BILLS_FOR_EXPORT = gql`
|
||||||
query QUERY_BILLS_FOR_EXPORT {
|
query QUERY_BILLS_FOR_EXPORT {
|
||||||
bills(where: { exported: { _eq: false } }) {
|
bills(where: { exported: { _eq: false }, isinhouse: { _eq: false } }) {
|
||||||
id
|
id
|
||||||
exported
|
exported
|
||||||
date
|
date
|
||||||
|
|||||||
@@ -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`
|
export const QUERY_BILL_BY_PK = gql`
|
||||||
query QUERY_BILL_BY_PK($billid: uuid!) {
|
query QUERY_BILL_BY_PK($billid: uuid!) {
|
||||||
bills_by_pk(id: $billid) {
|
bills_by_pk(id: $billid) {
|
||||||
@@ -238,6 +208,9 @@ export const CHECK_BILL_INVOICE_NUMBER = gql`
|
|||||||
aggregate {
|
aggregate {
|
||||||
count
|
count
|
||||||
}
|
}
|
||||||
|
nodes {
|
||||||
|
id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Link, useHistory, useLocation } from "react-router-dom";
|
import { Link, useHistory, useLocation } from "react-router-dom";
|
||||||
import BillDeleteButton from "../../components/bill-delete-button/bill-delete-button.component";
|
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 { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
import { DateFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
@@ -188,6 +189,7 @@ export function BillsListPage({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<PartsOrderModalContainer />
|
||||||
<Typography.Title level={4}>{t("bills.labels.bills")}</Typography.Title>
|
<Typography.Title level={4}>{t("bills.labels.bills")}</Typography.Title>
|
||||||
<Table
|
<Table
|
||||||
loading={loading}
|
loading={loading}
|
||||||
|
|||||||
@@ -1091,6 +1091,7 @@
|
|||||||
"cost": "Cost",
|
"cost": "Cost",
|
||||||
"cost_labor": "Cost - Labor",
|
"cost_labor": "Cost - Labor",
|
||||||
"cost_parts": "Cost - Parts",
|
"cost_parts": "Cost - Parts",
|
||||||
|
"costs": "Costs",
|
||||||
"create": {
|
"create": {
|
||||||
"jobinfo": "Job Info",
|
"jobinfo": "Job Info",
|
||||||
"newowner": "Create a new Owner instead. ",
|
"newowner": "Create a new Owner instead. ",
|
||||||
|
|||||||
@@ -1091,6 +1091,7 @@
|
|||||||
"cost": "",
|
"cost": "",
|
||||||
"cost_labor": "",
|
"cost_labor": "",
|
||||||
"cost_parts": "",
|
"cost_parts": "",
|
||||||
|
"costs": "",
|
||||||
"create": {
|
"create": {
|
||||||
"jobinfo": "",
|
"jobinfo": "",
|
||||||
"newowner": "",
|
"newowner": "",
|
||||||
|
|||||||
@@ -1091,6 +1091,7 @@
|
|||||||
"cost": "",
|
"cost": "",
|
||||||
"cost_labor": "",
|
"cost_labor": "",
|
||||||
"cost_parts": "",
|
"cost_parts": "",
|
||||||
|
"costs": "",
|
||||||
"create": {
|
"create": {
|
||||||
"jobinfo": "",
|
"jobinfo": "",
|
||||||
"newowner": "",
|
"newowner": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user