From c09a99a77357acee49014f6c3f0c5b98ea03b396 Mon Sep 17 00:00:00 2001 From: "a.bouhuolia" Date: Mon, 2 Aug 2021 16:48:16 +0200 Subject: [PATCH] fix: auto-complete item entry with cost price. --- client/src/containers/Entries/ItemsEntriesTable.js | 4 ++-- client/src/containers/Entries/utils.js | 1 - .../Purchases/Bills/BillForm/BillItemsEntriesEditor.js | 6 +++--- client/src/style/containers/Dashboard/Sidebar.scss | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/client/src/containers/Entries/ItemsEntriesTable.js b/client/src/containers/Entries/ItemsEntriesTable.js index ce4e0ce9f..b24207136 100644 --- a/client/src/containers/Entries/ItemsEntriesTable.js +++ b/client/src/containers/Entries/ItemsEntriesTable.js @@ -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. diff --git a/client/src/containers/Entries/utils.js b/client/src/containers/Entries/utils.js index e51b59c5f..6024f8db3 100644 --- a/client/src/containers/Entries/utils.js +++ b/client/src/containers/Entries/utils.js @@ -1,4 +1,3 @@ -import { repeat } from 'lodash'; import { toSafeNumber } from 'utils'; /** diff --git a/client/src/containers/Purchases/Bills/BillForm/BillItemsEntriesEditor.js b/client/src/containers/Purchases/Bills/BillForm/BillItemsEntriesEditor.js index 9ec38558d..c857a8fd1 100644 --- a/client/src/containers/Purchases/Bills/BillForm/BillItemsEntriesEditor.js +++ b/client/src/containers/Purchases/Bills/BillForm/BillItemsEntriesEditor.js @@ -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} /> )} diff --git a/client/src/style/containers/Dashboard/Sidebar.scss b/client/src/style/containers/Dashboard/Sidebar.scss index 392a31d0e..d9a8df52b 100644 --- a/client/src/style/containers/Dashboard/Sidebar.scss +++ b/client/src/style/containers/Dashboard/Sidebar.scss @@ -164,7 +164,7 @@ display: block; color: $sidebar-menu-label-color; font-size: 11px; - padding: 10px 20px; + padding: 8px 20px; margin-top: 4px; text-transform: uppercase; font-weight: 500; @@ -268,7 +268,7 @@ } &:hover { - min-width: 220px; + min-width: 190px; .sidebar__head-logo { opacity: 0;