Fix for #2
This commit is contained in:
@@ -883,7 +883,7 @@ const documentReport = computed(() => {
|
||||
if (row.product) {
|
||||
let product = products.value.find(i => i.id === row.product)
|
||||
|
||||
totalProductsPurchasePrice += product.purchasePrice * row.quantity
|
||||
totalProductsPurchasePrice += (product?.purchase_price || 0) * row.quantity
|
||||
|
||||
} else if (row.service) {
|
||||
let service = services.value.find(i => i.id === row.service)
|
||||
@@ -892,7 +892,7 @@ const documentReport = computed(() => {
|
||||
service.materialComposition.forEach(entry => {
|
||||
let productData = products.value.find(i => i.id === entry.product)
|
||||
|
||||
totalProductsFromServicesPurchasePrice += productData.purchasePrice * entry.quantity * row.quantity
|
||||
totalProductsFromServicesPurchasePrice += (productData?.purchase_price || 0) * entry.quantity * row.quantity
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user