Working on portal

This commit is contained in:
Hillel Coren 2018-01-18 12:16:02 +02:00
parent d1f5b8dd32
commit 1de93e0f03
9 changed files with 201 additions and 5 deletions

View File

@ -962,4 +962,19 @@ class ClientPortalController extends BaseController
return Redirect::to('client/invoices/recurring'); return Redirect::to('client/invoices/recurring');
} }
public function showDetails()
{
if (! $contact = $this->getContact()) {
return $this->returnError();
}
$data = [
'contact' => $contact,
'client' => $contact->client,
'account' => $contact->account,
];
return view('invited.details', $data);
}
} }

View File

@ -23,6 +23,7 @@ class ComposerServiceProvider extends ServiceProvider
'expenses.edit', 'expenses.edit',
'accounts.localization', 'accounts.localization',
'payments.credit_card', 'payments.credit_card',
'invited.details',
], ],
'App\Http\ViewComposers\TranslationComposer' 'App\Http\ViewComposers\TranslationComposer'
); );

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
body { body {
font-family: 'Roboto', sans-serif; font-family: 'Roboto', sans-serif;
font-size: 14px; font-size: 14px;
background-color: #f0f0f0; background-color: #f8f8f8;
} }
html { html {
overflow-y: scroll; overflow-y: scroll;

View File

@ -2651,7 +2651,8 @@ $LANG = array(
'return_to_login' => 'Return to Login', 'return_to_login' => 'Return to Login',
'convert_products_tip' => 'Note: add a custom field named ":name" to see the exchange rate.', 'convert_products_tip' => 'Note: add a custom field named ":name" to see the exchange rate.',
'amount_greater_than_balance' => 'The amount is greater than the invoice balance, a credit will be created with the remaining amount.', 'amount_greater_than_balance' => 'The amount is greater than the invoice balance, a credit will be created with the remaining amount.',
'custom_fields_tip' => 'Use <code>Label|Option1,Option2</code> to show a select box.' 'custom_fields_tip' => 'Use <code>Label|Option1,Option2</code> to show a select box.',
'client_information' => 'Client Information',
); );

View File

@ -350,7 +350,8 @@
@endif @endif
@if ($client->hasRecurringInvoices()) @if ($client->hasRecurringInvoices())
<div class="pull-right"> <div class="pull-right">
{!! Button::primary(trans("texts.recurring_invoices"))->asLinkTo(URL::to('/client/invoices/recurring')) !!} {!! Button::primary(strtoupper(trans("texts.recurring")))->asLinkTo(URL::to('/client/invoices/recurring')) !!}
{!! Button::success(strtoupper(trans("texts.edit_details")))->asLinkTo(URL::to('/client/details')) !!}
</div> </div>
@endif @endif
</div> </div>

View File

@ -0,0 +1,176 @@
@extends('public.header')
@section('content')
@include('payments.payment_css')
<div class="container">
<p>&nbsp;</p>
<div class="panel panel-default">
<div class="panel-body">
<p>&nbsp;</p>
<p>&nbsp;</p>
{!! Former::vertical_open()
->autocomplete('on')
->addClass('payment-form')
->id('payment-form')
->rules(array(
'first_name' => 'required',
'last_name' => 'required',
'address1' => 'required',
'city' => 'required',
'state' => 'required',
'postal_code' => 'required',
'country_id' => 'required',
'phone' => 'required',
'email' => 'required|email',
)) !!}
@if ($client)
{{ Former::populate($client) }}
{{ Former::populateField('first_name', $contact->first_name) }}
{{ Former::populateField('last_name', $contact->last_name) }}
{{ Former::populateField('email', $contact->email) }}
@if (!$client->country_id && $client->account->country_id)
{{ Former::populateField('country_id', $client->account->country_id) }}
{{ Former::populateField('shipping_country_id', $client->account->country_id) }}
@endif
@if (!$client->currency_id && $client->account->currency_id)
{{ Former::populateField('currency_id', $client->account->currency_id) }}
{{ Former::populateField('currency', $client->account->currency->code) }}
@endif
@endif
<h3>{{ trans('texts.client_information') }}</h3>
<hr class="form-legend"/>
<div style="padding-bottom: 22px;">
<div class="row">
<div class="col-md-6">
{!! Former::text('name')
->placeholder(trans('texts.name'))
->label('') !!}
</div>
@if ($account->vat_number)
<div class="col-md-6">
{!! Former::text('vat_number')
->placeholder(trans('texts.vat_number'))
->label('') !!}
</div>
@endif
</div>
</div>
<h3>{{ trans('texts.contact_information') }}</h3>
<hr class="form-legend"/>
<div style="padding-bottom: 22px;">
<div class="row">
<div class="col-md-6">
{!! Former::text('first_name')
->placeholder(trans('texts.first_name'))
->label('') !!}
</div>
<div class="col-md-6">
{!! Former::text('last_name')
->placeholder(trans('texts.last_name'))
->autocomplete('family-name')
->label('') !!}
</div>
</div>
<div class="row" style="display:{{ isset($paymentTitle) || empty($contact->email) ? 'block' : 'none' }}">
<div class="col-md-12">
{!! Former::text('email')
->placeholder(trans('texts.email'))
->autocomplete('email')
->label('') !!}
</div>
</div>
</div>
<h3>{{ trans('texts.billing_address') }}</h3>
<hr class="form-legend"/>
<div style="padding-bottom: 22px;" class="billing-address">
<div class="row">
<div class="col-md-6">
{!! Former::text('address1')
->autocomplete('address-line1')
->placeholder(trans('texts.address1'))
->label('') !!}
</div>
<div class="col-md-6">
{!! Former::text('address2')
->autocomplete('address-line2')
->placeholder(trans('texts.address2'))
->label('') !!}
</div>
</div>
<div class="row">
<div class="col-md-6">
{!! Former::text('city')
->autocomplete('address-level2')
->placeholder(trans('texts.city'))
->label('') !!}
</div>
<div class="col-md-6">
{!! Former::text('state')
->autocomplete('address-level1')
->placeholder(trans('texts.state'))
->label('') !!}
</div>
</div>
<div class="row">
<div class="col-md-6">
{!! Former::text('postal_code')
->autocomplete('postal-code')
->placeholder(trans('texts.postal_code'))
->label('') !!}
</div>
<div class="col-md-6">
{!! Former::select('country_id')
->placeholder(trans('texts.country_id'))
->fromQuery($countries, 'name', 'id')
->addGroupClass('country-select')
->label('') !!}
</div>
</div>
</div>
<p>&nbsp;</p>
<center>
{!! Button::normal(strtoupper(trans('texts.cancel') ))->asLinkTo('/client/dashboard')->large() !!} &nbsp;
{!! Button::success(strtoupper(trans('texts.save') ))->submit()->large() !!}
</center>
</div>
{!! Former::close() !!}
</div>
</div>
</div>
<script type="text/javascript">
$(function() {
$('#country_id, #shipping_country_id').combobox();
$('#first_name').focus();
});
</script>
@stop

View File

@ -29,6 +29,8 @@ Route::group(['middleware' => ['lookup:contact', 'auth:client']], function () {
Route::post('client/payment_methods/verify', 'ClientPortalController@verifyPaymentMethod'); Route::post('client/payment_methods/verify', 'ClientPortalController@verifyPaymentMethod');
Route::post('client/payment_methods/default', 'ClientPortalController@setDefaultPaymentMethod'); Route::post('client/payment_methods/default', 'ClientPortalController@setDefaultPaymentMethod');
Route::post('client/payment_methods/{source_id}/remove', 'ClientPortalController@removePaymentMethod'); Route::post('client/payment_methods/{source_id}/remove', 'ClientPortalController@removePaymentMethod');
Route::get('client/details', 'ClientPortalController@showDetails');
Route::post('client/details', 'ClientPortalController@updateDetails');
Route::get('client/quotes', 'ClientPortalController@quoteIndex'); Route::get('client/quotes', 'ClientPortalController@quoteIndex');
Route::get('client/credits', 'ClientPortalController@creditIndex'); Route::get('client/credits', 'ClientPortalController@creditIndex');
Route::get('client/invoices', 'ClientPortalController@invoiceIndex'); Route::get('client/invoices', 'ClientPortalController@invoiceIndex');