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:
parent
de602283c1
commit
b405ed84da
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user