Merge pull request #22 from bagisto/master

This commit is contained in:
Glenn Hermans 2021-05-05 01:54:08 +02:00 committed by GitHub
commit 76fa152ba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 363 additions and 207 deletions

View File

@ -2,11 +2,12 @@
namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\DataGrid;
use Illuminate\Support\Facades\DB;
use Webkul\Ui\DataGrid\DataGrid;
class CustomerDataGrid extends DataGrid
{
protected $index = 'customer_id';
protected $sortOrder = 'desc';
@ -130,11 +131,10 @@ class CustomerDataGrid extends DataGrid
]);
$this->addAction([
'type' => 'Edit',
'method' => 'GET',
'route' => 'admin.customer.addresses.index',
'icon' => 'icon list-icon',
'title' => trans('admin::app.customers.customers.addresses'),
'route' => 'admin.customer.note.create',
'icon' => 'icon note-icon',
'title' => trans('admin::app.customers.note.help-title'),
]);
$this->addAction([
@ -143,26 +143,8 @@ class CustomerDataGrid extends DataGrid
'icon' => 'icon trash-icon',
'title' => trans('admin::app.customers.customers.delete-help-title'),
]);
$this->addAction([
'method' => 'GET',
'route' => 'admin.customer.note.create',
'icon' => 'icon note-icon',
'title' => trans('admin::app.customers.note.help-title'),
]);
$this->addAction([
'type' => 'Edit',
'method' => 'GET',
'route' => 'admin.customer.orders.index',
'icon' => 'icon list-icon',
'title' => trans('admin::app.customers.orders.title'),
]);
}
/**
* Customer Mass Action To Delete And Change Their
*/
public function prepareMassActions()
{
$this->addMassAction([

View File

@ -3,11 +3,15 @@
namespace Webkul\Admin\DataGrids;
use Illuminate\Support\Facades\DB;
use Webkul\Sales\Models\OrderAddress;
use Webkul\Ui\DataGrid\DataGrid;
use Webkul\Ui\DataGrid\Traits\ProvideDataGridPlus;
use Webkul\Sales\Models\OrderAddress;
class CustomerOrderDataGrid extends DataGrid
{
use ProvideDataGridPlus;
protected $index = 'id';
protected $sortOrder = 'desc';
@ -47,24 +51,6 @@ class CustomerOrderDataGrid extends DataGrid
'filterable' => true,
]);
$this->addColumn([
'index' => 'base_sub_total',
'label' => trans('admin::app.datagrid.sub-total'),
'type' => 'price',
'searchable' => false,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'base_grand_total',
'label' => trans('admin::app.datagrid.grand-total'),
'type' => 'price',
'searchable' => false,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'created_at',
'label' => trans('admin::app.datagrid.order-date'),
@ -83,6 +69,24 @@ class CustomerOrderDataGrid extends DataGrid
'filterable' => true,
]);
$this->addColumn([
'index' => 'base_sub_total',
'label' => trans('admin::app.datagrid.sub-total'),
'type' => 'price',
'searchable' => false,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'base_grand_total',
'label' => trans('admin::app.datagrid.grand-total'),
'type' => 'price',
'searchable' => false,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'status',
'label' => trans('admin::app.datagrid.status'),
@ -109,24 +113,6 @@ class CustomerOrderDataGrid extends DataGrid
}
},
]);
$this->addColumn([
'index' => 'billed_to',
'label' => trans('admin::app.datagrid.billed-to'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'shipped_to',
'label' => trans('admin::app.datagrid.shipped-to'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true,
]);
}
public function prepareActions()

View File

@ -0,0 +1,113 @@
<?php
namespace Webkul\Admin\DataGrids;
use Illuminate\Support\Facades\DB;
use Webkul\Ui\DataGrid\DataGrid;
use Webkul\Ui\DataGrid\Traits\ProvideDataGridPlus;
class CustomersInvoicesDataGrid extends DataGrid
{
use ProvideDataGridPlus;
protected $index = 'id';
protected $sortOrder = 'desc';
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('invoices')
->leftJoin('orders as ors', 'invoices.order_id', '=', 'ors.id')
->select('invoices.id as id', 'ors.increment_id as order_id', 'invoices.state as state', 'ors.channel_name as channel_name', 'invoices.base_grand_total as base_grand_total', 'invoices.created_at as created_at');
$this->addFilter('id', 'invoices.id');
$this->addFilter('order_id', 'ors.increment_id');
$this->addFilter('base_grand_total', 'invoices.base_grand_total');
$this->addFilter('created_at', 'invoices.created_at');
$this->setQueryBuilder($queryBuilder);
}
public function addColumns()
{
$this->addColumn([
'index' => 'id',
'label' => trans('admin::app.sales.invoices.invoice-id'),
'type' => 'number',
'searchable' => false,
'sortable' => true,
'filterable' => true
]);
$this->addColumn([
'index' => 'created_at',
'label' => trans('admin::app.datagrid.invoice-date'),
'type' => 'date',
'searchable' => true,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'channel_name',
'label' => trans('admin::app.datagrid.channel-name'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'order_id',
'label' => trans('admin::app.datagrid.order-id'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'closure' => true,
'filterable' => true,
'wrapper' => function ($value) {
return '<a href="'. route('admin.sales.orders.view', $value->order_id). '">' . $value->order_id . '</a>';
}
]);
$this->addColumn([
'index' => 'base_grand_total',
'label' => trans('admin::app.datagrid.grand-total'),
'type' => 'price',
'searchable' => true,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'state',
'label' => trans('admin::app.datagrid.status'),
'type' => 'string',
'sortable' => true,
'searchable' => true,
'closure' => true,
'filterable' => true,
'wrapper' => function ($value) {
if ($value->state == 'paid') {
return '<span class="badge badge-md badge-success">' . trans('admin::app.sales.invoices.status-paid') . '</span>';
} elseif ($value->state == 'pending' || $value->state == 'pending_payment') {
return '<span class="badge badge-md badge-warning">' . trans('admin::app.sales.invoices.status-pending') . '</span>';
} elseif ($value->state == 'overdue') {
return '<span class="badge badge-md badge-info">' . trans('admin::app.sales.invoices.status-overdue') . '</span>';
} else {
return $value->state;
}
},
]);
}
public function prepareActions()
{
$this->addAction([
'title' => trans('admin::app.datagrid.view'),
'method' => 'GET',
'route' => 'admin.sales.invoices.view',
'icon' => 'icon eye-icon',
]);
}
}

View File

@ -102,7 +102,7 @@ class AddressController extends Controller
if ($this->customerAddressRepository->create($data)) {
session()->flash('success', trans('admin::app.customers.addresses.success-create'));
return redirect()->route('admin.customer.addresses.index', ['id' => $data['customer_id']]);
return redirect()->route('admin.customer.edit', ['id' => $data['customer_id']]);
} else {
session()->flash('success', trans('admin::app.customers.addresses.error-create'));

View File

@ -13,6 +13,9 @@ use Webkul\Core\Repositories\ChannelRepository;
use Webkul\Admin\Mail\NewCustomerNotification;
use Mail;
use Webkul\Admin\DataGrids\CustomerOrderDataGrid;
use Webkul\Admin\DataGrids\CustomersInvoicesDataGrid;
class CustomerController extends Controller
{
/**
@ -303,15 +306,28 @@ class CustomerController extends Controller
}
/**
* Display a listing of the customer orders.
* Retrieve all invoices from customer.
*
* @param int $id
* @return \Illuminate\View\View
* @return \Webkul\Admin\DataGrids\CustomersInvoicesDataGrid
*/
public function invoices($id)
{
if (request()->ajax()) {
return app(CustomersInvoicesDataGrid::class)->toJson();
}
}
/**
* Retrieve all orders from customer.
*
* @param int $id
* @return \Webkul\Admin\DataGrids\CustomerOrderDataGrid
*/
public function orders($id)
{
$customer = $this->customerRepository->find($id);
return view($this->_config['view'], compact('customer'));
if (request()->ajax()) {
return app(CustomerOrderDataGrid::class)->toJson();
}
}
}

View File

@ -43,7 +43,7 @@ Route::group(['middleware' => ['web']], function () {
'view' => 'admin::dashboard.index',
])->name('admin.dashboard.index');
//Customer Management Routes
// Customer Management Routes
Route::get('customers', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@index')->defaults('_config', [
'view' => 'admin::customers.index',
])->name('admin.customer.index');
@ -82,7 +82,7 @@ Route::group(['middleware' => ['web']], function () {
'view' => 'admin::customers.reviews.index',
])->name('admin.customer.review.index');
//Customer's addresses routes
// Customer's addresses routes
Route::get('customers/{id}/addresses', 'Webkul\Admin\Http\Controllers\Customer\AddressController@index')->defaults('_config', [
'view' => 'admin::customers.addresses.index',
])->name('admin.customer.addresses.index');
@ -112,10 +112,11 @@ Route::group(['middleware' => ['web']], function () {
'redirect' => 'admin.customer.addresses.index',
])->name('admin.customer.addresses.massdelete');
//customer's orders route
Route::get('customers/{id}/orders', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@orders')->defaults('_config', [
'view' => 'admin::customers.orders.index',
])->name('admin.customer.orders.index');
// Customer's invoices route
Route::get('customers/{id}/invoices', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@invoices')->name('admin.customer.invoices.data');
// Customer's orders route
Route::get('customers/{id}/orders', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@orders')->name('admin.customer.orders.data');
// Configuration routes
Route::get('configuration/{slug?}/{slug2?}', 'Webkul\Admin\Http\Controllers\ConfigurationController@index')->defaults('_config', [

View File

@ -420,7 +420,10 @@ return [
'print' => 'اطبع',
'order-date' => 'تاريخ الطلب',
'creation-error' => 'لا يسمح بإنشاء الفواتير.',
'product-error' => 'ولا يمكن إعداد الفاتورة بدون منتجات.'
'product-error' => 'ولا يمكن إعداد الفاتورة بدون منتجات.',
'status-overdue' => 'Overdue',
'status-pending' => 'Pending Payment',
'status-paid' => 'Paid',
],
'shipments' => [

View File

@ -416,6 +416,9 @@ return [
'order-date' => 'Bestell-Datum',
'creation-error' => 'Die Erstellung einer Bestellrechnung ist nicht zulässig.',
'product-error' => 'Eine Rechnung kann nicht ohne Produkte erstellt werden.',
'status-overdue' => 'Overdue',
'status-pending' => 'Pending Payment',
'status-paid' => 'Paid',
],
'shipments' =>
[

View File

@ -409,28 +409,31 @@ return [
],
'invoices' => [
'title' => 'Invoices',
'id' => 'Id',
'invoice' => 'Invoice',
'invoice-id' => 'Invoice Id',
'date' => 'Invoice Date',
'order-id' => 'Order Id',
'customer-name' => 'Customer Name',
'status' => 'Status',
'amount' => 'Amount',
'action' => 'Action',
'add-title' => 'Create Invoice',
'save-btn-title' => 'Save Invoice',
'qty' => 'Qty',
'qty-ordered' => 'Qty Ordered',
'qty-to-invoice' => 'Qty to Invoice',
'view-title' => 'Invoice #:invoice_id',
'bill-to' => 'Bill to',
'ship-to' => 'Ship to',
'print' => 'Print',
'order-date' => 'Order Date',
'creation-error' => 'Order invoice creation is not allowed.',
'product-error' => 'Invoice can not be created without products.'
'title' => 'Invoices',
'id' => 'Id',
'invoice' => 'Invoice',
'invoice-id' => 'Invoice Id',
'date' => 'Invoice Date',
'order-id' => 'Order Id',
'customer-name' => 'Customer Name',
'status' => 'Status',
'amount' => 'Amount',
'action' => 'Action',
'add-title' => 'Create Invoice',
'save-btn-title' => 'Save Invoice',
'qty' => 'Qty',
'qty-ordered' => 'Qty Ordered',
'qty-to-invoice' => 'Qty to Invoice',
'view-title' => 'Invoice #:invoice_id',
'bill-to' => 'Bill to',
'ship-to' => 'Ship to',
'print' => 'Print',
'order-date' => 'Order Date',
'creation-error' => 'Order invoice creation is not allowed.',
'product-error' => 'Invoice can not be created without products.',
'status-overdue' => 'Overdue',
'status-pending' => 'Pending Payment',
'status-paid' => 'Paid',
],
'shipments' => [

View File

@ -430,7 +430,10 @@ return [
'print' => 'Imprimir',
'order-date' => 'Fecha del pedido',
'creation-error' => 'La creación de facturas al pedido no está permitida.',
'product-error' => 'La factura no puede ser creada sin productos.'
'product-error' => 'La factura no puede ser creada sin productos.',
'status-overdue' => 'Overdue',
'status-pending' => 'Pending Payment',
'status-paid' => 'Paid',
],
'shipments' => [

View File

@ -418,7 +418,10 @@ return [
'print' => 'چاپ',
'order-date' => 'تاریخ سفارش',
'creation-error' => 'ایجاد فاکتور سفارش مجاز نیست.',
'product-error' => 'بدون محصولات نمی توان فاکتور ایجاد کرد.'
'product-error' => 'بدون محصولات نمی توان فاکتور ایجاد کرد.',
'status-overdue' => 'Overdue',
'status-pending' => 'Pending Payment',
'status-paid' => 'Paid',
],
'shipments' => [

View File

@ -421,7 +421,10 @@ return [
'print' => 'Stampa',
'order-date' => 'Data Ordine',
'creation-error' => 'La creazione della fattura dell\'Ordine non è consentita.',
'product-error' => 'La fattura non può essere creata senza prodotti.'
'product-error' => 'La fattura non può essere creata senza prodotti.',
'status-overdue' => 'Pending',
'status-pending' => 'Pending Payment',
'status-paid' => 'Paid',
],
'shipments' => [

View File

@ -417,7 +417,10 @@ return [
'print' => 'Print',
'order-date' => 'Besteldatum',
'creation-error' => 'De bestelling staat niet toe dat er een factuur wordt aangemaakt.',
'product-error' => 'Zonder producten kan er geen factuur worden aangemaakt.'
'product-error' => 'Zonder producten kan er geen factuur worden aangemaakt.',
'status-overdue' => 'Verlopen',
'status-pending' => 'Wachten op betaling',
'status-paid' => 'Betaald',
],
'shipments' => [

View File

@ -419,7 +419,10 @@ return [
'print' => 'Drukuj',
'order-date' => 'Data zamówienia',
'creation-error' => 'Tworzenie faktury za zamówienie jest niedozwolone.',
'product-error' => 'Faktury nie można utworzyć bez produktów.'
'product-error' => 'Faktury nie można utworzyć bez produktów.',
'status-overdue' => 'Overdue',
'status-pending' => 'Pending Payment',
'status-paid' => 'Paid',
],
'shipments' => [

View File

@ -418,7 +418,10 @@ return [
'print' => 'Imprimir',
'order-date' => 'Data do Pedido',
'creation-error' => 'A criação de fatura de pedido não é permitida.',
'product-error' => 'A fatura não pode ser criada sem produtos.'
'product-error' => 'A fatura não pode ser criada sem produtos.',
'status-overdue' => 'Overdue',
'status-pending' => 'Pending Payment',
'status-paid' => 'Paid',
],
'shipments' => [

View File

@ -417,7 +417,10 @@ return [
'print' => 'Yazdır',
'order-date' => 'Sipariş Tarihi',
'creation-error' => 'Fatura oluşturulmasına izin verilmedi.',
'product-error' => 'Fatura oluşturulması için ürün ekleyiniz.'
'product-error' => 'Fatura oluşturulması için ürün ekleyiniz.',
'status-overdue' => 'Overdue',
'status-pending' => 'Pending Payment',
'status-paid' => 'Paid',
],
'shipments' => [

View File

@ -42,24 +42,24 @@
<span class="control-error" v-if="errors.has('company_name')">@{{ errors.first('company_name') }}</span>
</div>
<div class="control-group" :class="[errors.has('vat_id') ? 'has-error' : '']">
<label for="vat_id">{{ __('shop::app.customer.account.address.create.vat_id') }}</label>
<input type="text" class="control" name="vat_id" v-validate="" value="{{ old('vat_id') }}" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.vat_id') }}&quot;">
<span class="control-error" v-if="errors.has('vat_id')">@{{ errors.first('vat_id') }}</span>
</div>
<div class="control-group" :class="[errors.has('first_name') ? 'has-error' : '']">
<label for="first_name" class="required">{{ __('shop::app.customer.account.address.create.first_name') }}</label>
<input type="text" class="control" name="first_name" v-validate="'required'" value="{{ old('first_name') }}" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.first_name') }}&quot;">
<input type="text" class="control" name="first_name" v-validate="'required'" value="{{ $customer->first_name }}" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.first_name') }}&quot;">
<span class="control-error" v-if="errors.has('first_name')">@{{ errors.first('first_name') }}</span>
</div>
<div class="control-group" :class="[errors.has('last_name') ? 'has-error' : '']">
<label for="last_name" class="required">{{ __('shop::app.customer.account.address.create.last_name') }}</label>
<input type="text" class="control" name="last_name" v-validate="'required'" value="{{ old('last_name') }}" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.last_name') }}&quot;">
<input type="text" class="control" name="last_name" v-validate="'required'" value="{{ $customer->last_name }}" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.last_name') }}&quot;">
<span class="control-error" v-if="errors.has('last_name')">@{{ errors.first('last_name') }}</span>
</div>
<div class="control-group" :class="[errors.has('vat_id') ? 'has-error' : '']">
<label for="vat_id">{{ __('shop::app.customer.account.address.create.vat_id') }}</label>
<input type="text" class="control" name="vat_id" v-validate="" value="{{ old('vat_id') }}" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.vat_id') }}&quot;">
<span class="control-error" v-if="errors.has('vat_id')">@{{ errors.first('vat_id') }}</span>
</div>
<div class="control-group" :class="[errors.has('address1[]') ? 'has-error' : '']">
<label for="address_0" class="required">{{ __('shop::app.customer.account.address.edit.street-address') }}</label>
<input type="text" class="control" name="address1[]" id="address_0" v-validate="'required'" value="{{ old('address1') }}" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.street-address') }}&quot;">
@ -90,7 +90,7 @@
<div class="control-group" :class="[errors.has('phone') ? 'has-error' : '']">
<label for="phone" class="required">{{ __('shop::app.customer.account.address.create.phone') }}</label>
<input type="text" class="control" name="phone" v-validate="'required'" value="{{ old('phone') }}" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.phone') }}&quot;">
<input type="text" class="control" name="phone" v-validate="'required'" value="{{ $customer->phone }}" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.phone') }}&quot;">
<span class="control-error" v-if="errors.has('phone')">@{{ errors.first('phone') }}</span>
</div>

View File

@ -35,7 +35,7 @@
<div class="control-group" :class="[errors.has('first_name') ? 'has-error' : '']">
<label for="first_name" class="required">{{ __('admin::app.customers.customers.first_name') }}</label>
<input type="text" class="control" name="first_name" v-validate="'required'" value="{{ old('first_name') }}" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.firstname') }}&quot;">
<input type="text" class="control" id="first_name" name="first_name" v-validate="'required'" value="{{ old('first_name') }}" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.firstname') }}&quot;">
<span class="control-error" v-if="errors.has('first_name')">@{{ errors.first('first_name') }}</span>
</div>
@ -43,7 +43,7 @@
<div class="control-group" :class="[errors.has('last_name') ? 'has-error' : '']">
<label for="last_name" class="required">{{ __('admin::app.customers.customers.last_name') }}</label>
<input type="text" class="control" name="last_name" v-validate="'required'" value="{{ old('last_name') }}" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.lastname') }}&quot;">
<input type="text" class="control" id="last_name" name="last_name" v-validate="'required'" value="{{ old('last_name') }}" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.lastname') }}&quot;">
<span class="control-error" v-if="errors.has('last_name')">@{{ errors.first('last_name') }}</span>
</div>
@ -51,7 +51,7 @@
<div class="control-group" :class="[errors.has('email') ? 'has-error' : '']">
<label for="email" class="required">{{ __('shop::app.customer.signup-form.email') }}</label>
<input type="email" class="control" name="email" v-validate="'required|email'" value="{{ old('email') }}" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.email') }}&quot;">
<input type="email" class="control" id="email" name="email" v-validate="'required|email'" value="{{ old('email') }}" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.email') }}&quot;">
<span class="control-error" v-if="errors.has('email')">@{{ errors.first('email') }}</span>
</div>
@ -59,7 +59,7 @@
<div class="control-group" :class="[errors.has('gender') ? 'has-error' : '']">
<label for="gender" class="required">{{ __('admin::app.customers.customers.gender') }}</label>
<select name="gender" class="control" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.customers.customers.gender') }}&quot;">
<select name="gender" class="control" id="gender" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.customers.customers.gender') }}&quot;">
<option value=""></option>
<option value="{{ __('admin::app.customers.customers.male') }}">{{ __('admin::app.customers.customers.male') }}</option>
<option value="{{ __('admin::app.customers.customers.female') }}">{{ __('admin::app.customers.customers.female') }}</option>
@ -72,7 +72,7 @@
<div class="control-group" :class="[errors.has('date_of_birth') ? 'has-error' : '']">
<label for="dob">{{ __('admin::app.customers.customers.date_of_birth') }}</label>
<input type="date" class="control" name="date_of_birth" v-validate="" value="{{ old('date_of_birth') }}" placeholder="{{ __('admin::app.customers.customers.date_of_birth_placeholder') }}" data-vv-as="&quot;{{ __('admin::app.customers.customers.date_of_birth') }}&quot;">
<input type="date" class="control" id="dob" name="date_of_birth" v-validate="" value="{{ old('date_of_birth') }}" placeholder="{{ __('admin::app.customers.customers.date_of_birth_placeholder') }}" data-vv-as="&quot;{{ __('admin::app.customers.customers.date_of_birth') }}&quot;">
<span class="control-error" v-if="errors.has('date_of_birth')">@{{ errors.first('date_of_birth') }}</span>
</div>
@ -80,7 +80,7 @@
<div class="control-group" :class="[errors.has('phone') ? 'has-error' : '']">
<label for="phone">{{ __('admin::app.customers.customers.phone') }}</label>
<input type="text" class="control" name="phone" value="{{ old('phone') }}" data-vv-as="&quot;{{ __('admin::app.customers.customers.phone') }}&quot;">
<input type="text" class="control" id="phone" name="phone" value="{{ old('phone') }}" data-vv-as="&quot;{{ __('admin::app.customers.customers.phone') }}&quot;">
<span class="control-error" v-if="errors.has('phone')">@{{ errors.first('phone') }}</span>
</div>
@ -88,7 +88,7 @@
<div class="control-group">
<label for="customerGroup" >{{ __('admin::app.customers.customers.customer_group') }}</label>
<select class="control" name="customer_group_id">
<select class="control" id="customerGroup" name="customer_group_id">
@foreach ($customerGroup as $group)
<option value="{{ $group->id }}"> {{ $group->name}} </>
@endforeach

View File

@ -13,6 +13,10 @@
{{ $customer->first_name . " " . $customer->last_name }}
</h1>
</div>
<div class="page-action">
</div>
</div>
<tabs>
@ -25,11 +29,38 @@
<tab name="{{ __('admin::app.customers.customers.addresses') }}" :selected="false">
<div class="style:overflow: auto;">&nbsp;</div>
{!! view_render_event('bagisto.admin.customer.addresses.list.before') !!}
{!! app('Webkul\Admin\DataGrids\AddressDataGrid')->render() !!}
{!! view_render_event('bagisto.admin.customer.addresses.list.after') !!}
<div style="float: right">
<a href="{{ route('admin.customer.addresses.create', ['id' => $customer->id]) }}" class="btn btn-lg btn-primary">
{{ __('admin::app.customers.addresses.create-btn-title') }}
</a>
</div>
@inject('addressDataGrid', 'Webkul\Admin\DataGrids\AddressDataGrid')
{!! $addressDataGrid->render() !!}
</tab>
<tab name="{{ __('admin::app.layouts.invoices') }}" :selected="false">
<div class="style:overflow: auto;">&nbsp;</div>
{!! view_render_event('bagisto.admin.customer.invoices.list.before') !!}
<datagrid-plus src="{{ route('admin.customer.invoices.data', $customer->id) }}"></datagrid-plus>
{!! view_render_event('bagisto.admin.customer.invoices.list.after') !!}
</tab>
<tab name="{{ __('admin::app.customers.orders.title') }}" :selected="false">
<div class="style:overflow: auto;">&nbsp;</div>
{!! view_render_event('bagisto.admin.customer.orders.list.before') !!}
<datagrid-plus src="{{ route('admin.customer.orders.data', $customer->id) }}"></datagrid-plus>
{!! view_render_event('bagisto.admin.customer.orders.list.after') !!}
</tab>
{!! view_render_event('bagisto.admin.customer.edit.after', ['customer' => $customer]) !!}
</tabs>
</div>

View File

@ -11,95 +11,92 @@
<div class="control-group" :class="[errors.has('first_name') ? 'has-error' : '']">
<label for="first_name" class="required"> {{ __('admin::app.customers.customers.first_name') }}</label>
<input type="text" class="control" name="first_name" v-validate="'required'" value="{{old('first_name') ?:$customer->first_name}}"
<input type="text" class="control" id="first_name" name="first_name" v-validate="'required'" value="{{old('first_name') ?:$customer->first_name}}"
data-vv-as="&quot;{{ __('shop::app.customer.signup-form.firstname') }}&quot;"/>
<span class="control-error" v-if="errors.has('first_name')">@{{ errors.first('first_name') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.first_name.after', ['customer' => $customer]) !!}
<div class="control-group" :class="[errors.has('last_name') ? 'has-error' : '']">
<label for="last_name" class="required"> {{ __('admin::app.customers.customers.last_name') }}</label>
<input type="text" class="control" name="last_name" v-validate="'required'" value="{{old('last_name') ?:$customer->last_name}}" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.lastname') }}&quot;">
<span class="control-error" v-if="errors.has('last_name')">@{{ errors.first('last_name') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.last_name.after', ['customer' => $customer]) !!}
<div class="control-group" :class="[errors.has('email') ? 'has-error' : '']">
<label for="email" class="required"> {{ __('admin::app.customers.customers.email') }}</label>
<input type="email" class="control" name="email" v-validate="'required|email'" value="{{old('email') ?:$customer->email}}" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.email') }}&quot;">
<span class="control-error" v-if="errors.has('email')">@{{ errors.first('email') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.email.after', ['customer' => $customer]) !!}
<div class="control-group" :class="[errors.has('gender') ? 'has-error' : '']">
<label for="gender" class="required">{{ __('admin::app.customers.customers.gender') }}</label>
<select name="gender" class="control" value="{{ $customer->gender }}" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.customers.customers.gender') }}&quot;">
<option value="" {{ $customer->gender == "" ? 'selected' : '' }}></option>
<option value="{{ __('admin::app.customers.customers.male') }}" {{ $customer->gender == __('admin::app.customers.customers.male') ? 'selected' : '' }}>{{ __('admin::app.customers.customers.male') }}</option>
<option value="{{ __('admin::app.customers.customers.female') }}" {{ $customer->gender == __('admin::app.customers.customers.female') ? 'selected' : '' }}>{{ __('admin::app.customers.customers.female') }}</option>
<option value="{{ __('admin::app.customers.customers.other') }}" {{ $customer->gender == __('admin::app.customers.customers.other') ? 'selected' : '' }}>{{ __('admin::app.customers.customers.other') }}</option>
</select>
<span class="control-error" v-if="errors.has('gender')">@{{ errors.first('gender') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.gender.after', ['customer' => $customer]) !!}
<div class="control-group">
<label for="status" class="required">{{ __('admin::app.customers.customers.status') }}</label>
<label class="switch">
<input type="checkbox" id="status" name="status" value="{{ $customer->status }}" {{ $customer->status ? 'checked' : '' }}>
<span class="slider round"></span>
</label>
<span class="control-error" v-if="errors.has('status')">@{{ errors.first('status') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.status.after', ['customer' => $customer]) !!}
<div class="control-group" :class="[errors.has('date_of_birth') ? 'has-error' : '']">
<label for="dob">{{ __('admin::app.customers.customers.date_of_birth') }}</label>
<input type="date" class="control" name="date_of_birth" value="{{ old('date_of_birth') ?:$customer->date_of_birth }}" v-validate="" data-vv-as="&quot;{{ __('admin::app.customers.customers.date_of_birth') }}&quot;">
<span class="control-error" v-if="errors.has('date_of_birth')">@{{ errors.first('date_of_birth') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.date_of_birth.after', ['customer' => $customer]) !!}
<div class="control-group" :class="[errors.has('phone') ? 'has-error' : '']">
<label for="phone">{{ __('admin::app.customers.customers.phone') }}</label>
<input type="text" class="control" name="phone" value="{{ $customer->phone }}" data-vv-as="&quot;{{ __('admin::app.customers.customers.phone') }}&quot;">
<span class="control-error" v-if="errors.has('phone')">@{{ errors.first('phone') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.phone.after', ['customer' => $customer]) !!}
<div class="control-group">
<label for="customerGroup" >{{ __('admin::app.customers.customers.customer_group') }}</label>
@if (! is_null($customer->customer_group_id))
<?php $selectedCustomerOption = $customer->group->id ?>
@else
<?php $selectedCustomerOption = '' ?>
@endif
<select class="control" name="customer_group_id">
@foreach ($customerGroup as $group)
<option value="{{ $group->id }}" {{ $selectedCustomerOption == $group->id ? 'selected' : '' }}>
{{ $group->name}}
</option>
@endforeach
</select>
</div>
{!! view_render_event('bagisto.admin.customer.edit.form.after', ['customer' => $customer]) !!}
</div>
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.customers.customers.save-btn-title') }}
</button>
<div class="control-group" :class="[errors.has('last_name') ? 'has-error' : '']">
<label for="last_name" class="required"> {{ __('admin::app.customers.customers.last_name') }}</label>
<input type="text" class="control" id="last_name" name="last_name" v-validate="'required'" value="{{old('last_name') ?:$customer->last_name}}" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.lastname') }}&quot;">
<span class="control-error" v-if="errors.has('last_name')">@{{ errors.first('last_name') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.last_name.after', ['customer' => $customer]) !!}
<div class="control-group" :class="[errors.has('email') ? 'has-error' : '']">
<label for="email" class="required"> {{ __('admin::app.customers.customers.email') }}</label>
<input type="email" class="control" id="email" name="email" v-validate="'required|email'" value="{{old('email') ?:$customer->email}}" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.email') }}&quot;">
<span class="control-error" v-if="errors.has('email')">@{{ errors.first('email') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.email.after', ['customer' => $customer]) !!}
<div class="control-group" :class="[errors.has('gender') ? 'has-error' : '']">
<label for="gender" class="required">{{ __('admin::app.customers.customers.gender') }}</label>
<select name="gender" class="control" id="gender" value="{{ $customer->gender }}" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.customers.customers.gender') }}&quot;">
<option value="" {{ $customer->gender == "" ? 'selected' : '' }}></option>
<option value="{{ __('admin::app.customers.customers.male') }}" {{ $customer->gender == __('admin::app.customers.customers.male') ? 'selected' : '' }}>{{ __('admin::app.customers.customers.male') }}</option>
<option value="{{ __('admin::app.customers.customers.female') }}" {{ $customer->gender == __('admin::app.customers.customers.female') ? 'selected' : '' }}>{{ __('admin::app.customers.customers.female') }}</option>
<option value="{{ __('admin::app.customers.customers.other') }}" {{ $customer->gender == __('admin::app.customers.customers.other') ? 'selected' : '' }}>{{ __('admin::app.customers.customers.other') }}</option>
</select>
<span class="control-error" v-if="errors.has('gender')">@{{ errors.first('gender') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.gender.after', ['customer' => $customer]) !!}
<div class="control-group">
<label for="status" class="required">{{ __('admin::app.customers.customers.status') }}</label>
<label class="switch">
<input type="checkbox" id="status" name="status" value="{{ $customer->status }}" {{ $customer->status ? 'checked' : '' }}>
<span class="slider round"></span>
</label>
<span class="control-error" v-if="errors.has('status')">@{{ errors.first('status') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.status.after', ['customer' => $customer]) !!}
<div class="control-group" :class="[errors.has('date_of_birth') ? 'has-error' : '']">
<label for="dob">{{ __('admin::app.customers.customers.date_of_birth') }}</label>
<input type="date" class="control" id="dob" name="date_of_birth" value="{{ old('date_of_birth') ?:$customer->date_of_birth }}" v-validate="" data-vv-as="&quot;{{ __('admin::app.customers.customers.date_of_birth') }}&quot;">
<span class="control-error" v-if="errors.has('date_of_birth')">@{{ errors.first('date_of_birth') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.date_of_birth.after', ['customer' => $customer]) !!}
<div class="control-group" :class="[errors.has('phone') ? 'has-error' : '']">
<label for="phone">{{ __('admin::app.customers.customers.phone') }}</label>
<input type="text" class="control" id="phone" name="phone" value="{{ $customer->phone }}" data-vv-as="&quot;{{ __('admin::app.customers.customers.phone') }}&quot;">
<span class="control-error" v-if="errors.has('phone')">@{{ errors.first('phone') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.phone.after', ['customer' => $customer]) !!}
<div class="control-group">
<label for="customerGroup" >{{ __('admin::app.customers.customers.customer_group') }}</label>
@if (! is_null($customer->customer_group_id))
@php $selectedCustomerOption = $customer->group->id @endphp
@else
@php $selectedCustomerOption = '' @endphp
@endif
<select class="control" id="customerGroup" name="customer_group_id">
@foreach ($customerGroup as $group)
<option value="{{ $group->id }}" {{ $selectedCustomerOption == $group->id ? 'selected' : '' }}>
{{ $group->name}}
</option>
@endforeach
</select>
</div>
{!! view_render_event('bagisto.admin.customer.edit.form.after', ['customer' => $customer]) !!}
</div>
</form>
<button type="submit" class="btn btn-lg btn-primary">{{ __('admin::app.customers.customers.save-btn-title') }}</button>
</div>
</div>
</form>

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/ui.js": "/js/ui.js?id=5cad8be39456ffe19e34",
"/js/ui.js": "/js/ui.js?id=37bd4257e03367bb39c4",
"/css/ui.css": "/css/ui.css?id=6d93a4a052e38d6aa795"
}