1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Fixes for product transformer

This commit is contained in:
David Bomba 2023-12-12 16:06:06 +11:00
parent 820c76ea4d
commit deffec538b

View File

@ -74,7 +74,7 @@ class ProductTransformer extends EntityTransformer
'notes' => $product->notes ?: '',
'cost' => (float) $product->cost ?: 0,
'price' => (float) $product->price ?: 0,
'quantity' => (float) is_numeric($product->quantity) ? $product->quantity : 1.0,
'quantity' => is_numeric($product->quantity) ? (float) $product->quantity : (float) 1.0,
'tax_name1' => $product->tax_name1 ?: '',
'tax_rate1' => (float) $product->tax_rate1 ?: 0,
'tax_name2' => $product->tax_name2 ?: '',