Add recurring invoices button to the client portal dashboard

This commit is contained in:
Hillel Coren 2017-12-03 15:16:09 +02:00
parent f34f3e18b1
commit f773a5df13
5 changed files with 26 additions and 14 deletions

View File

@ -494,6 +494,7 @@ class AccountController extends BaseController
'account' => Auth::user()->account, 'account' => Auth::user()->account,
'title' => trans('texts.tax_rates'), 'title' => trans('texts.tax_rates'),
'taxRates' => TaxRate::scope()->whereIsInclusive(false)->get(), 'taxRates' => TaxRate::scope()->whereIsInclusive(false)->get(),
'countInvoices' => Invoice::scope()->withTrashed()->count(),
]; ];
return View::make('accounts.tax_rates', $data); return View::make('accounts.tax_rates', $data);

View File

@ -35,11 +35,12 @@
->label(' ') ->label(' ')
->value(1) !!} ->value(1) !!}
{!! Former::checkbox('inclusive_taxes') @if ($account->inclusive_taxes || $countInvoices <= 10)
->text(trans('texts.inclusive_taxes_help')) {!! Former::checkbox('inclusive_taxes')
->label('&nbsp;') ->text(trans('texts.inclusive_taxes_help'))
->value(1) !!} ->label('&nbsp;')
->value(1) !!}
@endif
{!! Former::checkbox('include_item_taxes_inline') {!! Former::checkbox('include_item_taxes_inline')
->text(trans('texts.include_item_taxes_inline')) ->text(trans('texts.include_item_taxes_inline'))
@ -84,7 +85,7 @@
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
@if (App\Models\Invoice::scope()->withTrashed()->count()) @if ($countInvoices > 0)
$('#inclusive_taxes').change(function() { $('#inclusive_taxes').change(function() {
swal("{{ trans('texts.inclusive_taxes_warning') }}"); swal("{{ trans('texts.inclusive_taxes_warning') }}");
}) })

View File

@ -341,13 +341,20 @@
</div> </div>
</div> </div>
@if (!empty($account->getTokenGatewayId())) <div class="row">
<div class="row"> <div class="col-xs-12">
<div class="col-xs-12"> @if (!empty($account->getTokenGatewayId()))
@include('payments.paymentmethods_list') <div class="pull-left">
</div> @include('payments.paymentmethods_list')
</div>
@endif
@if ($client->hasRecurringInvoices())
<div class="pull-right">
{!! Button::primary(trans("texts.recurring_invoices"))->asLinkTo(URL::to('/client/invoices/recurring')) !!}
</div>
@endif
</div>
</div> </div>
@endif
<div class="row" id="account-row"> <div class="row" id="account-row">
<div class="col-md-2 invoices-from"> <div class="col-md-2 invoices-from">

View File

@ -78,8 +78,10 @@
@endif @endif
@if ($invitationKey = $client->firstInvitationKey()) @if ($invitationKey = $client->firstInvitationKey())
<h3> <h3 style="margin-top:0px;">
{{ trans('texts.payment_methods') }} <span style="padding-top:4px">
{{ trans('texts.payment_methods') }}
</span>
@if ($account->getGatewayByType(GATEWAY_TYPE_CREDIT_CARD) @if ($account->getGatewayByType(GATEWAY_TYPE_CREDIT_CARD)
&& $account->getGatewayByType(GATEWAY_TYPE_TOKEN) && $account->getGatewayByType(GATEWAY_TYPE_TOKEN)
&& $account->token_billing_type_id != TOKEN_BILLING_DISABLED) && $account->token_billing_type_id != TOKEN_BILLING_DISABLED)

View File

@ -48,6 +48,7 @@
{!! Button::primary(trans("texts.recurring_invoices"))->asLinkTo(URL::to('/client/invoices/recurring')) !!} {!! Button::primary(trans("texts.recurring_invoices"))->asLinkTo(URL::to('/client/invoices/recurring')) !!}
</div> </div>
@endif @endif
<h3>{{ $title }}</h3> <h3>{{ $title }}</h3>
{!! Datatable::table() {!! Datatable::table()