1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

uses_inclusive_taxes (#3377)

This commit is contained in:
David Bomba 2020-02-26 16:18:38 +11:00 committed by GitHub
parent acb0c0f7c1
commit 0f050ae236
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,8 +12,8 @@
namespace App\Repositories;
use App\Factory\InvoiceInvitationFactory;
use App\Jobs\Product\UpdateOrCreateProduct;
use App\Models\Client;
use App\Models\ClientContact;
use App\Models\Invoice;
use App\Models\InvoiceInvitation;
@ -48,6 +48,11 @@ class InvoiceRepository extends BaseRepository {
/* Always carry forward the initial invoice amount this is important for tracking client balance changes later......*/
$starting_amount = $invoice->amount;
if(!$invoice->id) {
$client = Client::find($data['client_id']);
$invoice->uses_inclusive_taxes = $client->getSetting('inclusive_taxes');
}
$invoice->fill($data);
$invoice->save();