mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 10:44:29 -04: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 ($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);
|
$product = Product::findProductByKey($productKey);
|
||||||
if (!$product) {
|
if (!$product) {
|
||||||
if (Auth::user()->can('create', ENTITY_PRODUCT)) {
|
if (Auth::user()->can('create', ENTITY_PRODUCT)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user