mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-17 08:32:51 +01:00
Added default payment method #1273
This commit is contained in:
parent
d89690ebe4
commit
5be79d4208
@ -11,6 +11,7 @@ use App\Ninja\Datatables\PaymentDatatable;
|
||||
use App\Ninja\Mailers\ContactMailer;
|
||||
use App\Ninja\Repositories\PaymentRepository;
|
||||
use App\Services\PaymentService;
|
||||
use Auth;
|
||||
use Cache;
|
||||
use DropdownButton;
|
||||
use Input;
|
||||
@ -93,6 +94,7 @@ class PaymentController extends BaseController
|
||||
->orderBy('invoice_number')->get();
|
||||
|
||||
$data = [
|
||||
'account' => Auth::user()->account,
|
||||
'clientPublicId' => Input::old('client') ? Input::old('client') : ($request->client_id ?: 0),
|
||||
'invoicePublicId' => Input::old('invoice') ? Input::old('invoice') : ($request->invoice_id ?: 0),
|
||||
'invoice' => null,
|
||||
@ -148,6 +150,7 @@ class PaymentController extends BaseController
|
||||
}
|
||||
|
||||
$data = [
|
||||
'account' => Auth::user()->account,
|
||||
'client' => null,
|
||||
'invoice' => null,
|
||||
'invoices' => Invoice::scope()
|
||||
|
@ -92,6 +92,7 @@ class Account extends Eloquent
|
||||
'enable_email_markup',
|
||||
'domain_id',
|
||||
'payment_terms',
|
||||
'payment_type_id',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -32,6 +32,7 @@ class AddCustomProductFields extends Migration
|
||||
|
||||
Schema::table('accounts', function ($table) {
|
||||
$table->smallInteger('reset_counter_frequency_id')->nullable();
|
||||
$table->smallInteger('payment_type_id')->nullable();
|
||||
});
|
||||
|
||||
DB::table('currencies')->where('code', '=', 'HKR')->update(['code' => 'HRK']);
|
||||
@ -73,6 +74,7 @@ class AddCustomProductFields extends Migration
|
||||
|
||||
Schema::table('accounts', function ($table) {
|
||||
$table->dropColumn('reset_counter_frequency_id');
|
||||
$table->dropColumn('payment_type_id');
|
||||
});
|
||||
|
||||
DB::table('currencies')->where('code', '=', 'HRK')->update(['code' => 'HKR']);
|
||||
|
@ -614,7 +614,7 @@ $LANG = array(
|
||||
'or' => 'or',
|
||||
'email_error' => 'There was a problem sending the email',
|
||||
'confirm_recurring_timing' => 'Note: emails are sent at the start of the hour.',
|
||||
'payment_terms_help' => 'Sets the default invoice due date',
|
||||
'payment_terms_help' => 'Sets the default <b>invoice due date</b>.',
|
||||
'unlink_account' => 'Unlink Account',
|
||||
'unlink' => 'Unlink',
|
||||
'show_address' => 'Show Address',
|
||||
@ -2378,6 +2378,8 @@ $LANG = array(
|
||||
'custom_product_fields_help' => 'Add a field when creating a product or invoice and display the label and value on the PDF.',
|
||||
'freq_two_months' => 'Two months',
|
||||
'freq_yearly' => 'Annually',
|
||||
'profile' => 'Profile',
|
||||
'payment_type_help' => 'Sets the default <b>payment type</b>.',
|
||||
|
||||
);
|
||||
|
||||
|
@ -59,20 +59,6 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{!! Former::select('payment_terms')
|
||||
->addOption('','')
|
||||
->fromQuery(Cache::get('paymentTerms'), 'name', 'num_days')
|
||||
->help(trans('texts.payment_terms_help')) !!}
|
||||
|
||||
{!! Former::select('size_id')
|
||||
->addOption('','')
|
||||
->fromQuery($sizes, 'name', 'id') !!}
|
||||
|
||||
{!! Former::select('industry_id')
|
||||
->addOption('','')
|
||||
->fromQuery($industries, 'name', 'id')
|
||||
->help('texts.industry_help') !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -96,14 +82,62 @@
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">{!! trans('texts.signature') !!}</h3>
|
||||
<h3 class="panel-title">{!! trans('texts.settings') !!}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="panel-body form-padding-right">
|
||||
|
||||
<div role="tabpanel">
|
||||
<ul class="nav nav-tabs" role="tablist" style="border: none">
|
||||
<li role="presentation" class="active">
|
||||
<a href="#defaults" aria-controls="client_fields" role="tab" data-toggle="tab">{{ trans('texts.defaults') }}</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a href="#profile" aria-controls="invoice_fields" role="tab" data-toggle="tab">{{ trans('texts.profile') }}</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a href="#signature" aria-controls="company_fields" role="tab" data-toggle="tab">{{ trans('texts.signature') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane active" id="defaults">
|
||||
|
||||
<br/> <br/>
|
||||
{!! Former::select('payment_type_id')
|
||||
->addOption('','')
|
||||
->fromQuery(Cache::get('paymentTypes'), 'name', 'num_days')
|
||||
->help(trans('texts.payment_type_help')) !!}
|
||||
|
||||
{!! Former::select('payment_terms')
|
||||
->addOption('','')
|
||||
->fromQuery(Cache::get('paymentTerms'), 'name', 'num_days')
|
||||
->help(trans('texts.payment_terms_help')) !!}
|
||||
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="profile">
|
||||
|
||||
<br/> <br/>
|
||||
{!! Former::select('size_id')
|
||||
->addOption('','')
|
||||
->fromQuery($sizes, 'name', 'id') !!}
|
||||
|
||||
{!! Former::select('industry_id')
|
||||
->addOption('','')
|
||||
->fromQuery($industries, 'name', 'id')
|
||||
->help('texts.industry_help') !!}
|
||||
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="signature">
|
||||
|
||||
<br/>
|
||||
{!! Former::textarea('email_footer')->style('display:none')->raw() !!}
|
||||
<div id="signatureEditor" class="form-control" style="min-height:160px" onclick="focusEditor()"></div>
|
||||
@include('partials/quill_toolbar', ['name' => 'signature'])
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-10 col-md-offset-1">
|
||||
{!! Former::textarea('email_footer')->style('display:none')->raw() !!}
|
||||
<div id="signatureEditor" class="form-control" style="min-height:160px" onclick="focusEditor()"></div>
|
||||
@include('partials/quill_toolbar', ['name' => 'signature'])
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -26,6 +26,10 @@
|
||||
|
||||
@if ($payment)
|
||||
{!! Former::populate($payment) !!}
|
||||
@else
|
||||
@if ($account->payment_type_id)
|
||||
{!! Former::populateField('payment_type_id', $account->payment_type_id) !!}
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<span style="display:none">
|
||||
|
Loading…
Reference in New Issue
Block a user