From 27a25d429b5c67fc6e6138142d876292aa98a5b5 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 24 Dec 2017 11:45:18 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20update=20product=20price=20if?= =?UTF-8?q?=20prices=20are=20converted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Ninja/Repositories/InvoiceRepository.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Ninja/Repositories/InvoiceRepository.php b/app/Ninja/Repositories/InvoiceRepository.php index acce6bbba3..be8eec1ebe 100644 --- a/app/Ninja/Repositories/InvoiceRepository.php +++ b/app/Ninja/Repositories/InvoiceRepository.php @@ -739,7 +739,9 @@ class InvoiceRepository extends BaseRepository } if ($product && (Auth::user()->can('edit', $product))) { $product->notes = ($task || $expense) ? '' : $item['notes']; - $product->cost = $expense ? 0 : $item['cost']; + if (! $account->convert_products) { + $product->cost = $expense ? 0 : $item['cost']; + } $product->tax_name1 = isset($item['tax_name1']) ? $item['tax_name1'] : null; $product->tax_rate1 = isset($item['tax_rate1']) ? $item['tax_rate1'] : 0; $product->tax_name2 = isset($item['tax_name2']) ? $item['tax_name2'] : null;