add payments by invoice
This commit is contained in:
43
app/Datatables/Shop/InvoicePaymentsDataTable.php
Normal file
43
app/Datatables/Shop/InvoicePaymentsDataTable.php
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\InvoicePayment;
|
||||||
|
use App\Repositories\Shop\InvoicePayments;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class InvoicesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'InvoicePayments';
|
||||||
|
|
||||||
|
public function query(InvoicePayment $model)
|
||||||
|
{
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('payment_type', function (InvoicePayment $payment) {
|
||||||
|
return InvoicePayments::getPaymentType($payment->payment_type);
|
||||||
|
})
|
||||||
|
->editColumn('date', function (InvoicePayment $payment) {
|
||||||
|
return $payment->date;
|
||||||
|
})
|
||||||
|
->rawColumns(['action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('payment_type')->title('Type')->width(80),
|
||||||
|
Column::make('status')->width(60),
|
||||||
|
Column::make('amount')->title('Montant')->width(100),
|
||||||
|
Column::make('reference')->title('Référence'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Http\Controllers\Admin\Shop;
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
use App\Datatables\Admin\Shop\InvoicesDataTable;
|
use App\Datatables\Admin\Shop\InvoicesDataTable;
|
||||||
|
use App\Datatables\Admin\Shop\InvoicePaymentsDataTable;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Repositories\Shop\Invoices;
|
use App\Repositories\Shop\Invoices;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@@ -28,15 +29,20 @@ class InvoiceController extends Controller
|
|||||||
|
|
||||||
public function show($id)
|
public function show($id)
|
||||||
{
|
{
|
||||||
$data['invoice'] = Invoices::get($id)->toArray();
|
$data['invoice'] = Invoices::getFull($id)->toArray();
|
||||||
|
|
||||||
return view('Admin.Shop.Invoices.view', $data);
|
return view('Admin.Shop.Invoices.view', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$data['invoice'] = Invoices::get($id, ['order.customer', 'order.address', 'order.detail'])->toArray();
|
$data = Invoices::init();
|
||||||
$data['statuses'] = Invoices::statuses();
|
$data['invoice'] = Invoices::getFull($id)->toArray();
|
||||||
|
$model = new invoicePaymentsDataTable();
|
||||||
|
$data['invoice_payments'] = $model->html();
|
||||||
|
|
||||||
|
// dump($data);
|
||||||
|
// exit;
|
||||||
|
|
||||||
return view('Admin.Shop.Invoices.edit', $data);
|
return view('Admin.Shop.Invoices.edit', $data);
|
||||||
}
|
}
|
||||||
|
|||||||
50
app/Http/Controllers/Admin/Shop/InvoicePaymentController.php
Normal file
50
app/Http/Controllers/Admin/Shop/InvoicePaymentController.php
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Shop\InvoicePaymentsDataTable;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Repositories\Shop\InvoicePayments;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class InvoicePaymentController extends Controller
|
||||||
|
{
|
||||||
|
public function index(InvoicePaymentsDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.InvoicePayments.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('Admin.Shop.InvoicePayments.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = InvoicePayments::store($request->all());
|
||||||
|
|
||||||
|
return redirect()->route('Admin.Shop.InvoicePayments.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data['invoice_payment'] = InvoicePayments::getFull($id)->toArray();
|
||||||
|
|
||||||
|
return view('Admin.Shop.InvoicePayments.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = InvoicePayments::init();
|
||||||
|
$data['invoice_payment'] = InvoicePayments::getFull($id)->toArray();
|
||||||
|
$model = new invoice_paymentPaymentsDataTable();
|
||||||
|
$data['invoice_payment_payments'] = $model->html();
|
||||||
|
|
||||||
|
return view('Admin.Shop.InvoicePayments.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return InvoicePayments::delete($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
21
app/Http/Requests/Admin/Shop/StoreMerchandisePost.php
Normal file
21
app/Http/Requests/Admin/Shop/StoreMerchandisePost.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class StoreMerchandisePost extends FormRequest
|
||||||
|
{
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name' => 'required',
|
||||||
|
'producer_id' => 'required',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -37,10 +37,10 @@ class InvoicePayments
|
|||||||
|
|
||||||
public static function getPaymentType($id)
|
public static function getPaymentType($id)
|
||||||
{
|
{
|
||||||
return self::PaymentTypes()[$id] ?? false;
|
return self::paymentTypes()[$id] ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function PaymentTypes()
|
public static function paymentTypes()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'',
|
'',
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class Invoices
|
|||||||
|
|
||||||
public static function getInvoiceHtml($id)
|
public static function getInvoiceHtml($id)
|
||||||
{
|
{
|
||||||
$invoice = self::get($id, ['order.customer', 'order.delivery_address', 'order.detail']);
|
$invoice = self::getFull($id);
|
||||||
$order = $invoice->order;
|
$order = $invoice->order;
|
||||||
$customer = $order->customer;
|
$customer = $order->customer;
|
||||||
unset($invoice->order, $order->customer);
|
unset($invoice->order, $order->customer);
|
||||||
@@ -26,6 +26,19 @@ class Invoices
|
|||||||
return view('Shop.Invoices.mail', $data)->render();
|
return view('Shop.Invoices.mail', $data)->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function init()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'statuses' => Invoices::statuses(),
|
||||||
|
'payment_types' => InvoicePayments::paymentTypes(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getFull($id)
|
||||||
|
{
|
||||||
|
return self::get($id, ['address', 'order.customer', 'order.delivery_address', 'order.detail']);
|
||||||
|
}
|
||||||
|
|
||||||
public static function getByUUID($uuid)
|
public static function getByUUID($uuid)
|
||||||
{
|
{
|
||||||
return Invoice::byUUID($uuid)->first();
|
return Invoice::byUUID($uuid)->first();
|
||||||
|
|||||||
16
resources/views/Admin/Shop/InvoicePayments/create.blade.php
Normal file
16
resources/views/Admin/Shop/InvoicePayments/create.blade.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
@extends('layout.index', [
|
||||||
|
'title' => __('invoices.title'),
|
||||||
|
'subtitle' => __('invoices.create.title'),
|
||||||
|
'breadcrumb' => [__('invoices.title'), __('invoices.create.title')]
|
||||||
|
])
|
||||||
|
|
||||||
|
@include('boilerplate::load.fileinput')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
{{ Form::open(['route' => 'Admin.Shop.Invoices.store', 'id' => 'invoice-form', 'autocomplete' => 'off']) }}
|
||||||
|
@include('Admin.Shop.Invoices.form')
|
||||||
|
@include('components.save')
|
||||||
|
</form>
|
||||||
|
|
||||||
|
@endsection
|
||||||
95
resources/views/Admin/Shop/InvoicePayments/edit.blade.php
Normal file
95
resources/views/Admin/Shop/InvoicePayments/edit.blade.php
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
@extends('layout.index', [
|
||||||
|
'title' => 'Factures',
|
||||||
|
'subtitle' => 'Edition d\'une facture',
|
||||||
|
'breadcrumb' => ['Articles'],
|
||||||
|
])
|
||||||
|
|
||||||
|
@include('boilerplate::load.fileinput')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-8">
|
||||||
|
{{ Form::open(['route' => 'Admin.Shop.Invoices.update', 'id' => 'invoice-form', 'autocomplete' => 'off']) }}
|
||||||
|
<input type="hidden" name="id" value="{{ $invoice['id'] }}">
|
||||||
|
<x-card>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6">
|
||||||
|
<h4> </h4>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 text-right">
|
||||||
|
@include('components.form.buttons.button-save')
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-6">
|
||||||
|
<h3>
|
||||||
|
{{ $invoice['order']['customer']['last_name'] }}
|
||||||
|
{{ $invoice['order']['customer']['first_name'] }}
|
||||||
|
</h3>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<h6>
|
||||||
|
@if ($invoice['order']['delivery_address'])
|
||||||
|
{{ $invoice['order']['delivery_address']['address'] }}<br />
|
||||||
|
@isset($invoice['order']['delivery_address']['address2'])
|
||||||
|
{{ $invoice['order']['delivery_address']['address2'] }}<br />
|
||||||
|
@endisset
|
||||||
|
{{ $invoice['order']['delivery_address']['zipcode'] }}
|
||||||
|
{{ $invoice['order']['delivery_address']['city'] }}<br />
|
||||||
|
@endif
|
||||||
|
</h6>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-6" style="font-size: 1.2em; font-weight: 500;">
|
||||||
|
Facture N° {{ $invoice['ref'] }}<br />
|
||||||
|
du {{ Carbon\Carbon::parse($invoice['created_at'])->isoFormat('LLLL') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-6">
|
||||||
|
@include('components.form.select', [
|
||||||
|
'label' => 'Statut',
|
||||||
|
'name' => 'status',
|
||||||
|
'list' => $statuses ?? [],
|
||||||
|
'value' => $invoice['status'],
|
||||||
|
'class' => 'select2',
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
@include('components.form.select', [
|
||||||
|
'label' => 'Règlement',
|
||||||
|
'name' => 'payment_type',
|
||||||
|
'list' => $payment_types ?? [],
|
||||||
|
'value' => $invoice['order']['payment_type'],
|
||||||
|
'class' => 'select2',
|
||||||
|
'disabled' => false,
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-12">
|
||||||
|
@include('Admin.Shop.Orders.partials.detail', [
|
||||||
|
'detail_type' => 'facture',
|
||||||
|
'order' => $invoice['order'],
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</x-card>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<x-card>
|
||||||
|
<h4>Règlements</h4>
|
||||||
|
</x-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
26
resources/views/Admin/Shop/InvoicePayments/form.blade.php
Normal file
26
resources/views/Admin/Shop/InvoicePayments/form.blade.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<div class="row">
|
||||||
|
<div class="col-6">
|
||||||
|
@include('components.form.select', [
|
||||||
|
'label' => 'Règlement',
|
||||||
|
'name' => 'payment_type',
|
||||||
|
'list' => $payment_types ?? [],
|
||||||
|
'value' => $invoice_payment['payment_type'],
|
||||||
|
'class' => 'select2',
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
@include('components.form.input', [
|
||||||
|
'label' => 'Montant',
|
||||||
|
'name' => 'amount',
|
||||||
|
'value' => $invoice_payment['amount'],
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-8">
|
||||||
|
<div class="float-right mt-3">
|
||||||
|
@include('components.form.buttons.button-save')
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
14
resources/views/Admin/Shop/InvoicePayments/index.blade.php
Normal file
14
resources/views/Admin/Shop/InvoicePayments/index.blade.php
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
@extends('layout.index', [
|
||||||
|
'title' => __('shop.invoice_payments.title'),
|
||||||
|
'subtitle' => __('shop.invoice_payments.list'),
|
||||||
|
'breadcrumb' => [__('shop.invoice_payments.title')],
|
||||||
|
])
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<x-card>
|
||||||
|
@include('components.datatable', [
|
||||||
|
'route' => route('Admin.Shop.InvoicePayments.index'),
|
||||||
|
'model' => 'invoice_payments',
|
||||||
|
])
|
||||||
|
</x-card>
|
||||||
|
@endsection
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
@include('components.datatable', [
|
||||||
|
'route' => route('Admin.Shop.InvoicePayments.index'),
|
||||||
|
'model' => 'invoice_payments',
|
||||||
|
])
|
||||||
36
resources/views/Admin/Shop/InvoicePayments/show.blade.php
Normal file
36
resources/views/Admin/Shop/InvoicePayments/show.blade.php
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
@extends('layout.index', [
|
||||||
|
'title' => __('products.title'),
|
||||||
|
'subtitle' => __('products.title'),
|
||||||
|
'breadcrumb' => [__('products.title')]
|
||||||
|
])
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<form action="{{ route('Shop.Products') }}" method="GET">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-offset-2 col-md-8">
|
||||||
|
|
||||||
|
<div class="box box-info">
|
||||||
|
<div class="box-body">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<h3>{{ name }}</h3>
|
||||||
|
<h4>
|
||||||
|
{{ $product.section.name }}<br>
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 text-right">
|
||||||
|
<h2>{{ $prix_total }} €</h2>
|
||||||
|
<h4>{{ $residence['type_produit']['name'] }}</h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
@include('Hestimmo.modules.Lot.partials.carousel')
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
@endsection
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => 'Factures',
|
'title' => 'Factures',
|
||||||
'subtitle' => 'Edition d\'une facture',
|
'subtitle' => 'Edition d\'une facture',
|
||||||
'breadcrumb' => ['Articles']
|
'breadcrumb' => ['Articles'],
|
||||||
])
|
])
|
||||||
|
|
||||||
@include('boilerplate::load.fileinput')
|
@include('boilerplate::load.fileinput')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-8">
|
||||||
{{ Form::open(['route' => 'Admin.Shop.Invoices.update', 'id' => 'invoice-form', 'autocomplete' => 'off']) }}
|
{{ Form::open(['route' => 'Admin.Shop.Invoices.update', 'id' => 'invoice-form', 'autocomplete' => 'off']) }}
|
||||||
<input type="hidden" name="id" value="{{ $invoice['id'] }}">
|
<input type="hidden" name="id" value="{{ $invoice['id'] }}">
|
||||||
<x-card>
|
<x-card>
|
||||||
@@ -22,16 +23,20 @@
|
|||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<h3>{{ $invoice['order']['customer']['last_name'] }} {{ $invoice['order']['customer']['first_name'] }}</h3>
|
<h3>
|
||||||
|
{{ $invoice['order']['customer']['last_name'] }}
|
||||||
|
{{ $invoice['order']['customer']['first_name'] }}
|
||||||
|
</h3>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<h6>
|
<h6>
|
||||||
@if ($invoice['order']['address'])
|
@if ($invoice['order']['delivery_address'])
|
||||||
{{ $invoice['order']['address']['address'] }}<br/>
|
{{ $invoice['order']['delivery_address']['address'] }}<br />
|
||||||
@isset ($invoice['order']['address']['address2'])
|
@isset($invoice['order']['delivery_address']['address2'])
|
||||||
{{ $invoice['order']['address']['address2'] }}<br/>
|
{{ $invoice['order']['delivery_address']['address2'] }}<br />
|
||||||
@endisset
|
@endisset
|
||||||
{{ $invoice['order']['address']['zipcode'] }} {{ $invoice['order']['address']['city'] }}<br/>
|
{{ $invoice['order']['delivery_address']['zipcode'] }}
|
||||||
|
{{ $invoice['order']['delivery_address']['city'] }}<br />
|
||||||
@endif
|
@endif
|
||||||
</h6>
|
</h6>
|
||||||
</div>
|
</div>
|
||||||
@@ -72,10 +77,22 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
@include('Admin.Shop.Orders.partials.detail', ['detail_type' => 'facture', 'order' => $invoice['order']])
|
@include('Admin.Shop.Orders.partials.detail', [
|
||||||
|
'detail_type' => 'facture',
|
||||||
|
'order' => $invoice['order'],
|
||||||
|
])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</x-card>
|
</x-card>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<x-card>
|
||||||
|
<h4>Règlements</h4>
|
||||||
|
@include('Admin.Shop.InvoicePayments.list', [
|
||||||
|
'dataTable' => $invoice_payments,
|
||||||
|
])
|
||||||
|
</x-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
@include('boilerplate::load.tinymce')
|
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
{{ Form::label('name', 'Nom') }}
|
@include('components.form.input', [
|
||||||
@include('components.form.input', ['name' => 'name', 'value' => (isset($family['name'])) ? $family['name'] : null, 'required' => true])
|
'name' => 'name',
|
||||||
|
'value' => $family['name'] ?? null,
|
||||||
|
'required' => true,
|
||||||
|
'label' => 'Nom',
|
||||||
|
])
|
||||||
|
|
||||||
{{ Form::label('description', 'Description') }}
|
@include('components.form.textarea', [
|
||||||
@include('components.form.textarea', ['name' => 'description', 'value' => isset($description) ? $description : null, 'class' => 'editor', 'required' => false])
|
'name' => 'description',
|
||||||
|
'value' => isset($description) ? $description : null,
|
||||||
|
'class' => 'editor',
|
||||||
|
'required' => false,
|
||||||
|
'label' => 'Description',
|
||||||
|
])
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -20,10 +26,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@push('js')
|
@include('boilerplate::load.tinymce')
|
||||||
<script>
|
|
||||||
$(function() {
|
|
||||||
$('.editor').tinymce({});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('shop.invoices.title'),
|
'title' => __('shop.invoice_payments.title'),
|
||||||
'subtitle' => __('shop.invoices.list'),
|
'subtitle' => __('shop.invoice_payments.list'),
|
||||||
'breadcrumb' => [__('shop.invoices.title')]
|
'breadcrumb' => [__('shop.invoice_payments.title')],
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@component('components.card')
|
<x-card>
|
||||||
@include('components.datatable', ['route' => route('Admin.Shop.Invoices.index'), 'model' => 'invoices'])
|
@include('components.datatable', [
|
||||||
@endcomponent
|
'route' => route('Admin.Shop.InvoicePayments.index'),
|
||||||
|
'model' => 'invoice_payments',
|
||||||
|
])
|
||||||
|
</x-card>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -4,16 +4,19 @@
|
|||||||
<script src="/assets/plugins/tinymce/tinymce.min.js"></script>
|
<script src="/assets/plugins/tinymce/tinymce.min.js"></script>
|
||||||
@component('boilerplate::minify')
|
@component('boilerplate::minify')
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
tinymce.defaultSettings = {
|
tinymce.defaultSettings = {
|
||||||
path_absolute: "/",
|
path_absolute: "/",
|
||||||
plugins: "autolink autoresize fullscreen codemirror link lists table media preview image paste customalign stickytoolbar",
|
plugins: "autolink autoresize fullscreen codemirror link lists table media preview image paste customalign",
|
||||||
toolbar: "insertfile undo redo | styleselect | bold italic underline | customalignleft aligncenter customalignright | link media image | bullist numlist | table | code fullscreen",
|
toolbar: "insertfile undo redo | styleselect | bold italic underline | customalignleft aligncenter customalignright | link media image | bullist numlist | table | code fullscreen",
|
||||||
contextmenu: "link image imagetools table spellchecker bold italic underline",
|
contextmenu: "link image imagetools table spellchecker bold italic underline",
|
||||||
sticky_toolbar_container: '.tox-editor-header',
|
sticky_toolbar_container: '.tox-editor-header',
|
||||||
toolbar_drawer: "sliding",
|
toolbar_drawer: "sliding",
|
||||||
sticky_offset: $('nav.main-header').outerHeight(),
|
sticky_offset: $('nav.main-header').outerHeight(),
|
||||||
codemirror: { config: { theme: 'storm' } },
|
codemirror: {
|
||||||
|
config: {
|
||||||
|
theme: 'storm'
|
||||||
|
}
|
||||||
|
},
|
||||||
menubar: false,
|
menubar: false,
|
||||||
removed_menuitems: 'newdocument',
|
removed_menuitems: 'newdocument',
|
||||||
remove_linebreaks: false,
|
remove_linebreaks: false,
|
||||||
@@ -27,15 +30,21 @@
|
|||||||
encoding: 'UTF-8',
|
encoding: 'UTF-8',
|
||||||
image_uploadtab: false,
|
image_uploadtab: false,
|
||||||
paste_preprocess: function(plugin, args) {
|
paste_preprocess: function(plugin, args) {
|
||||||
args.content = args.content.replace(/<(\/)*(\\?xml:|meta|link|span|font|del|ins|st1:|[ovwxp]:)((.|\s)*?)>/gi, ''); // Unwanted tags
|
args.content = args.content.replace(
|
||||||
args.content = args.content.replace(/\s(class|style|type|start)=("(.*?)"|(\w*))/gi, ''); // Unwanted attributes
|
/<(\/)*(\\?xml:|meta|link|span|font|del|ins|st1:|[ovwxp]:)((.|\s)*?)>/gi, ''); // Unwanted tags
|
||||||
args.content = args.content.replace(/<(p|a|div|span|strike|strong|i|u)[^>]*?>(\s| |<br\/>|\r|\n)*?<\/(p|a|div|span|strike|strong|i|u)>/gi, ''); // Empty tags
|
args.content = args.content.replace(/\s(class|style|type|start)=("(.*?)"|(\w*))/gi,
|
||||||
|
''); // Unwanted attributes
|
||||||
|
args.content = args.content.replace(
|
||||||
|
/<(p|a|div|span|strike|strong|i|u)[^>]*?>(\s| |<br\/>|\r|\n)*?<\/(p|a|div|span|strike|strong|i|u)>/gi,
|
||||||
|
''); // Empty tags
|
||||||
},
|
},
|
||||||
skin: "boilerplate",
|
skin: "boilerplate",
|
||||||
language: '{{ App::getLocale() }}',
|
language: '{{ App::getLocale() }}',
|
||||||
file_picker_callback: function(callback, value, meta) {
|
file_picker_callback: function(callback, value, meta) {
|
||||||
var x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
|
var x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName(
|
||||||
var y = window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight;
|
'body')[0].clientWidth;
|
||||||
|
var y = window.innerHeight || document.documentElement.clientHeight || document
|
||||||
|
.getElementsByTagName('body')[0].clientHeight;
|
||||||
|
|
||||||
var cmsURL = tinymce.defaultSettings.path_absolute + 'filemanager?editor=' + meta.fieldname;
|
var cmsURL = tinymce.defaultSettings.path_absolute + 'filemanager?editor=' + meta.fieldname;
|
||||||
if (meta.filetype == 'image') {
|
if (meta.filetype == 'image') {
|
||||||
@@ -60,7 +69,8 @@
|
|||||||
|
|
||||||
// Prevent Bootstrap dialog from blocking focusin
|
// Prevent Bootstrap dialog from blocking focusin
|
||||||
$(document).on('focusin', function(e) {
|
$(document).on('focusin', function(e) {
|
||||||
if ($(e.target).closest(".tox-tinymce, .tox-tinymce-aux, .moxman-window, .tam-assetmanager-root").length) {
|
if ($(e.target).closest(".tox-tinymce, .tox-tinymce-aux, .moxman-window, .tam-assetmanager-root")
|
||||||
|
.length) {
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -82,7 +92,6 @@
|
|||||||
}
|
}
|
||||||
$(selector).tinymce(options);
|
$(selector).tinymce(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@endcomponent
|
@endcomponent
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
function initSelect2(sel, parent) {
|
function initSelect2(sel, parent) {
|
||||||
console.log('initSelect2');
|
|
||||||
// $.fn.modal.Constructor.prototype.enforceFocus = function() {};
|
// $.fn.modal.Constructor.prototype.enforceFocus = function() {};
|
||||||
|
|
||||||
var selector = (typeof(sel) == 'undefined') ? '.select2' : sel;
|
var selector = (typeof(sel) == 'undefined') ? '.select2' : sel;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
<script src="/assets/plugins/bootstrap-fileinput/js/fileinput.min.js"></script>
|
<script src="/assets/plugins/bootstrap-fileinput/js/fileinput.min.js"></script>
|
||||||
@if (App::getLocale() !== 'en')
|
@if (App::getLocale() !== 'en')
|
||||||
<script src="/assets/plugins/bootstrap-fileinput/js/locales/{{ App::getLocale() }}.js"></script>
|
<script src="/assets/plugins/bootstrap-fileinput/js/locales/{{ App::getLocale() }}.js"></script>
|
||||||
<script src="/assets/plugins/bootstrap-fileinput/themes/fas/theme.min.js"></script>
|
|
||||||
<script>
|
<script>
|
||||||
$.fn.fileinput.defaults.language = '{{ App::getLocale() }}';
|
$.fn.fileinput.defaults.language = '{{ App::getLocale() }}';
|
||||||
</script>
|
</script>
|
||||||
@@ -47,11 +46,14 @@
|
|||||||
|
|
||||||
function UploadOptions(options) {
|
function UploadOptions(options) {
|
||||||
return {
|
return {
|
||||||
allowedFileExtensions: (typeof(options.allowedFileExtensions) == 'undefined') ? ['doc','docx','jpg','jpeg','png','xls','xlsx','pdf'] : options.allowedFileExtensions,
|
allowedFileExtensions: (typeof(options.allowedFileExtensions) == 'undefined') ? ['doc', 'docx', 'jpg',
|
||||||
|
'jpeg', 'png', 'xls', 'xlsx', 'pdf'
|
||||||
|
] : options.allowedFileExtensions,
|
||||||
browseOnZoneClick: (typeof(options.browseOnZoneClick) == 'undefined') ? true : options.browseOnZoneClick,
|
browseOnZoneClick: (typeof(options.browseOnZoneClick) == 'undefined') ? true : options.browseOnZoneClick,
|
||||||
dropZoneEnabled: (typeof(options.dropZoneEnabled) == 'undefined') ? false : options.dropZoneEnabled,
|
dropZoneEnabled: (typeof(options.dropZoneEnabled) == 'undefined') ? false : options.dropZoneEnabled,
|
||||||
initialPreview: (typeof(options.initialPreview) == 'undefined') ? false : options.initialPreview,
|
initialPreview: (typeof(options.initialPreview) == 'undefined') ? false : options.initialPreview,
|
||||||
initialPreviewAsData: (typeof(options.initialPreviewAsData) == 'undefined') ? false : options.initialPreviewAsData,
|
initialPreviewAsData: (typeof(options.initialPreviewAsData) == 'undefined') ? false : options
|
||||||
|
.initialPreviewAsData,
|
||||||
maxFilesize: (typeof(options.maxFilesize) == 'undefined') ? false : options.maxFilesize,
|
maxFilesize: (typeof(options.maxFilesize) == 'undefined') ? false : options.maxFilesize,
|
||||||
overwriteInitial: (typeof(options.overwriteInitial) == 'undefined') ? false : options.overwriteInitial,
|
overwriteInitial: (typeof(options.overwriteInitial) == 'undefined') ? false : options.overwriteInitial,
|
||||||
showCaption: (typeof(options.showCaption) == 'undefined') ? true : options.showCaption,
|
showCaption: (typeof(options.showCaption) == 'undefined') ? true : options.showCaption,
|
||||||
@@ -117,8 +119,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function initFileInputImage(images, sel)
|
function initFileInputImage(images, sel) {
|
||||||
{
|
|
||||||
UploadInit(sel, {
|
UploadInit(sel, {
|
||||||
allowedFileExtensions: ['jpg', 'jpeg', 'png', 'gif'],
|
allowedFileExtensions: ['jpg', 'jpeg', 'png', 'gif'],
|
||||||
overwriteInitial: true,
|
overwriteInitial: true,
|
||||||
@@ -131,8 +132,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function uploadShowImage(id, image)
|
function uploadShowImage(id, image) {
|
||||||
{
|
|
||||||
$('#' + id + '_preview').toggleClass('d-none');
|
$('#' + id + '_preview').toggleClass('d-none');
|
||||||
$('#' + id + '_preview').find('img').attr('src', image);
|
$('#' + id + '_preview').find('img').attr('src', image);
|
||||||
$('#' + id + '_uploader').toggleClass('d-none');
|
$('#' + id + '_uploader').toggleClass('d-none');
|
||||||
|
|||||||
11
routes/Admin/Shop/InvoicePayments.php
Normal file
11
routes/Admin/Shop/InvoicePayments.php
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
Route::prefix('InvoicePayments')->name('InvoicePayments.')->group(function () {
|
||||||
|
Route::get('', 'InvoicePaymentController@index')->name('index');
|
||||||
|
Route::get('create', 'InvoicePaymentController@create')->name('create');
|
||||||
|
Route::delete('destroy', 'InvoicePaymentController@destroy')->name('destroy');
|
||||||
|
Route::post('update', 'InvoicePaymentController@update')->name('update');
|
||||||
|
Route::post('store', 'InvoicePaymentController@store')->name('store');
|
||||||
|
Route::get('edit/{id}', 'InvoicePaymentController@edit')->name('edit');
|
||||||
|
|
||||||
|
});
|
||||||
@@ -13,6 +13,7 @@ Route::middleware('auth')->prefix('Shop')->namespace('Shop')->name('Shop.')->gro
|
|||||||
include_once __DIR__.'/DeliveryTypeCalculations.php';
|
include_once __DIR__.'/DeliveryTypeCalculations.php';
|
||||||
include_once __DIR__.'/Homepages.php';
|
include_once __DIR__.'/Homepages.php';
|
||||||
include_once __DIR__.'/InvoiceItems.php';
|
include_once __DIR__.'/InvoiceItems.php';
|
||||||
|
include_once __DIR__.'/InvoicePayments.php';
|
||||||
include_once __DIR__.'/Invoices.php';
|
include_once __DIR__.'/Invoices.php';
|
||||||
include_once __DIR__.'/Merchandises.php';
|
include_once __DIR__.'/Merchandises.php';
|
||||||
include_once __DIR__.'/Offers.php';
|
include_once __DIR__.'/Offers.php';
|
||||||
|
|||||||
Reference in New Issue
Block a user