Skip to content

Commit

Permalink
fix: shopping list price issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJiang2021 authored and CarlLiu2023 committed Jun 6, 2023
1 parent d1e3f87 commit 774b8f7
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
updateB2BShoppingList,
updateBcShoppingList,
} from '@/shared/service/b2b'
import { store } from '@/store'
import {
calculateProductListPrice,
getDefaultCurrencyInfo,
Expand Down Expand Up @@ -91,6 +92,10 @@ function ShoppingListDetails({ setOpenPage }: ShoppingListDetailsProps) {
const [isMobile] = useMobile()
const { dispatch } = useContext(ShoppingListDetailsContext)

const {
global: { enteredInclusive: enteredInclusiveTax },
} = store.getState()

const theme = useTheme()

const primaryColor = theme.palette.primary.main
Expand Down Expand Up @@ -308,10 +313,11 @@ function ShoppingListDetails({ setOpenPage }: ShoppingListDetailsProps) {

checkedArr.forEach((item: ListItemProps) => {
const {
node: { quantity, basePrice, baseAllPrice = 0 },
node: { quantity, basePrice, taxPrice },
} = item

const price = +baseAllPrice || +basePrice
const price = enteredInclusiveTax ? +basePrice : +basePrice + +taxPrice

total += price * +quantity
})

Expand Down

0 comments on commit 774b8f7

Please sign in to comment.