mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
refactor(FE): Support add/edit type and use ProductPrice for add
This commit is contained in:
@@ -332,12 +332,18 @@ export const PurchaseRequestStaffApprovalFormDefaultValues = (
|
||||
label: item.warehouse?.name || '',
|
||||
},
|
||||
qty: item.sub_qty || item.qty || 0,
|
||||
price: type === 'add'
|
||||
? ('ProductPrice' in item.product ? (item.product.ProductPrice || item.price || '') : item.price)
|
||||
: item.price,
|
||||
total_price: type === 'add'
|
||||
? (('ProductPrice' in item.product ? (item.product.ProductPrice || item.price || 0) : item.price) * (item.sub_qty || item.qty || 0))
|
||||
: item.total_price,
|
||||
price:
|
||||
type === 'add'
|
||||
? 'ProductPrice' in item.product
|
||||
? item.product.ProductPrice || item.price || ''
|
||||
: item.price
|
||||
: item.price,
|
||||
total_price:
|
||||
type === 'add'
|
||||
? ('ProductPrice' in item.product
|
||||
? item.product.ProductPrice || item.price || 0
|
||||
: item.price) * (item.sub_qty || item.qty || 0)
|
||||
: item.total_price,
|
||||
}))
|
||||
: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user