1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00

Use default payment type for all payments

This commit is contained in:
Hillel Coren 2017-03-31 14:32:41 +03:00
parent 022852b0c8
commit 3e9c8e7d5b

View File

@ -7,6 +7,7 @@ use App\Models\Invoice;
use App\Models\Payment; use App\Models\Payment;
use DB; use DB;
use Utils; use Utils;
use Auth;
class PaymentRepository extends BaseRepository class PaymentRepository extends BaseRepository
{ {
@ -161,6 +162,10 @@ class PaymentRepository extends BaseRepository
} }
} else { } else {
$payment = Payment::createNew(); $payment = Payment::createNew();
if (Auth::check()) {
$payment->payment_type_id = Auth::user()->account->payment_type_id;
}
} }
if ($payment->is_deleted) { if ($payment->is_deleted) {