1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Fixes for gateway fees

This commit is contained in:
Hillel Coren 2017-03-17 16:58:33 +02:00
parent 0f63ea782f
commit c68bbf252c

View File

@ -622,6 +622,7 @@ class InvoiceRepository extends BaseRepository
}
}
if (Auth::check()) {
if ($productKey = trim($item['product_key'])) {
if ($account->update_products
&& ! $invoice->has_tasks
@ -646,8 +647,9 @@ class InvoiceRepository extends BaseRepository
}
}
}
}
$invoiceItem = InvoiceItem::createNew();
$invoiceItem = InvoiceItem::createNew($invoice);
$invoiceItem->fill($item);
$invoiceItem->product_id = isset($product) ? $product->id : null;
$invoiceItem->product_key = isset($item['product_key']) ? (trim($invoice->is_recurring ? $item['product_key'] : Utils::processVariables($item['product_key']))) : '';
@ -1043,6 +1045,7 @@ class InvoiceRepository extends BaseRepository
$data = $invoice->toArray();
$data[$location] = 0;
$this->save($data, $invoice);
$invoice->load('invoice_items');
}
}
}