mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 07:15:44 +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 || '',
|
label: item.warehouse?.name || '',
|
||||||
},
|
},
|
||||||
qty: item.sub_qty || item.qty || 0,
|
qty: item.sub_qty || item.qty || 0,
|
||||||
price: type === 'add'
|
price:
|
||||||
? ('ProductPrice' in item.product ? (item.product.ProductPrice || item.price || '') : item.price)
|
type === 'add'
|
||||||
: item.price,
|
? 'ProductPrice' in item.product
|
||||||
total_price: type === 'add'
|
? item.product.ProductPrice || item.price || ''
|
||||||
? (('ProductPrice' in item.product ? (item.product.ProductPrice || item.price || 0) : item.price) * (item.sub_qty || item.qty || 0))
|
: item.price
|
||||||
: item.total_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