fix: auto-complete item entry with cost price.

This commit is contained in:
a.bouhuolia
2021-08-02 16:48:16 +02:00
parent 738dd5f505
commit c09a99a773
4 changed files with 7 additions and 8 deletions

View File

@@ -65,12 +65,12 @@ function ItemsEntriesTable({
const { rowIndex } = rowItem;
const price =
itemType === ITEM_TYPE.PURCHASABLE
? item.purchase_price
? item.cost_price
: item.sell_price;
const description =
itemType === ITEM_TYPE.PURCHASABLE
? item.purchase_description
? item.cost_description
: item.sell_description;
// Update the rate, description and quantity data of the row.

View File

@@ -1,4 +1,3 @@
import { repeat } from 'lodash';
import { toSafeNumber } from 'utils';
/**

View File

@@ -4,9 +4,8 @@ import { FastField } from 'formik';
import { CLASSES } from 'common/classes';
import { useBillFormContext } from './BillFormProvider';
import ItemsEntriesTable from 'containers/Entries/ItemsEntriesTable';
import {
entriesFieldShouldUpdate
} from './utils';
import { entriesFieldShouldUpdate } from './utils';
import { ITEM_TYPE } from 'containers/Entries/utils';
/**
* Bill form body.
@@ -35,6 +34,7 @@ export default function BillFormBody({ defaultBill }) {
errors={error}
linesNumber={4}
currencyCode={values.currency_code}
itemType={ITEM_TYPE.PURCHASABLE}
landedCost={true}
/>
)}