diff --git a/src/components/pages/purchase/form/order/PurchaseOrderForm.schema.ts b/src/components/pages/purchase/form/order/PurchaseOrderForm.schema.ts index 637a3aa4..0d776cb0 100644 --- a/src/components/pages/purchase/form/order/PurchaseOrderForm.schema.ts +++ b/src/components/pages/purchase/form/order/PurchaseOrderForm.schema.ts @@ -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, })) : [ {