Issues resolved with Bill Enter Modal IO-480

This commit is contained in:
Patrick Fic
2021-02-04 19:11:00 -08:00
parent 69ac212f0c
commit 89d59d256c
13 changed files with 52 additions and 47 deletions

View File

@@ -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")