1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00

Prevent invoices with expenses from creating products

This commit is contained in:
Hillel Coren 2016-08-21 18:47:56 +03:00
parent de602283c1
commit b405ed84da

View File

@ -541,7 +541,7 @@ class InvoiceRepository extends BaseRepository
}
if ($productKey = trim($item['product_key'])) {
if (\Auth::user()->account->update_products && ! strtotime($productKey) && ! $task && ! $expense) {
if (\Auth::user()->account->update_products && ! $invoice->has_tasks && ! $invoice->has_expenses) {
$product = Product::findProductByKey($productKey);
if (!$product) {
if (Auth::user()->can('create', ENTITY_PRODUCT)) {