Issues resolved with Bill Enter Modal IO-480
This commit is contained in:
@@ -17898,6 +17898,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</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>
|
||||
<name>create</name>
|
||||
<children>
|
||||
|
||||
@@ -150,19 +150,20 @@ export default function AccountingPayablesTableComponent({ loading, bills }) {
|
||||
loading={loading}
|
||||
title={() => {
|
||||
return (
|
||||
<div>
|
||||
<Input
|
||||
value={state.search}
|
||||
onChange={handleSearch}
|
||||
placeholder={t("general.labels.search")}
|
||||
allowClear
|
||||
/>
|
||||
<div className="imex-table-header">
|
||||
<PayableExportAll
|
||||
billIds={selectedBills}
|
||||
disabled={transInProgress || selectedBills.length === 0}
|
||||
loadingCallback={setTransInProgress}
|
||||
completedCallback={setSelectedBills}
|
||||
/>
|
||||
<Input
|
||||
className="imex-table-header__search"
|
||||
value={state.search}
|
||||
onChange={handleSearch}
|
||||
placeholder={t("general.labels.search")}
|
||||
allowClear
|
||||
/>
|
||||
</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 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 (
|
||||
<div>
|
||||
<FormFieldsChanged form={form} />
|
||||
<Form.Item
|
||||
// label={t("bills.fields.isinhouse")}
|
||||
style={{ display: "none" }}
|
||||
name="isinhouse"
|
||||
valuePropName="checked"
|
||||
@@ -139,6 +139,12 @@ export function BillFormComponent({
|
||||
|
||||
if (response.data.bills_aggregate.aggregate.count === 0) {
|
||||
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(
|
||||
t("bills.validation.unique_invoice_number")
|
||||
|
||||
@@ -22,7 +22,6 @@ export const CalculateBillTotal = (invoice) => {
|
||||
|
||||
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,
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
};
|
||||
}),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -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 (
|
||||
<div>
|
||||
<PartsOrderModalContainer />
|
||||
<Typography.Title level={4}>{t("bills.labels.bills")}</Typography.Title>
|
||||
<Table
|
||||
loading={loading}
|
||||
|
||||
@@ -1091,6 +1091,7 @@
|
||||
"cost": "Cost",
|
||||
"cost_labor": "Cost - Labor",
|
||||
"cost_parts": "Cost - Parts",
|
||||
"costs": "Costs",
|
||||
"create": {
|
||||
"jobinfo": "Job Info",
|
||||
"newowner": "Create a new Owner instead. ",
|
||||
|
||||
@@ -1091,6 +1091,7 @@
|
||||
"cost": "",
|
||||
"cost_labor": "",
|
||||
"cost_parts": "",
|
||||
"costs": "",
|
||||
"create": {
|
||||
"jobinfo": "",
|
||||
"newowner": "",
|
||||
|
||||
@@ -1091,6 +1091,7 @@
|
||||
"cost": "",
|
||||
"cost_labor": "",
|
||||
"cost_parts": "",
|
||||
"costs": "",
|
||||
"create": {
|
||||
"jobinfo": "",
|
||||
"newowner": "",
|
||||
|
||||
Reference in New Issue
Block a user