Issues resolved with Bill Enter Modal IO-480
This commit is contained in:
@@ -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,
|
||||
},
|
||||
};
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user