Fixes for tests

This commit is contained in:
David Bomba 2024-01-09 22:16:37 +11:00
parent edd0a57b29
commit 1ec4773ad3

View File

@ -100,7 +100,7 @@ class ProductTest extends TestCase
foreach ($line_items as $key => $item) {
if($item?->product_cost == 0 && $product = Product::where('company_id', $invoice->company_id)->where('product_key', $item->product_key)->where('cost', '>', 0)->first()) {
if(property_exists($item, 'product_cost') && $item->product_cost == 0 && $product = Product::where('company_id', $invoice->company_id)->where('product_key', $item->product_key)->where('cost', '>', 0)->first()) {
$line_items[$key]->product_cost = $product->cost;
}
}