add datatbles for invoices, add pdf icon, refactor icons components, add autocomplete on search, adapt searching to meilisearch
This commit is contained in:
@@ -4,8 +4,8 @@ namespace App\Datatables\Shop;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Order;
|
||||
use App\Repositories\Shop\InvoicePayments;
|
||||
use App\Repositories\Shop\Orders;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class CustomerOrdersDataTable extends DataTable
|
||||
@@ -18,6 +18,8 @@ class CustomerOrdersDataTable extends DataTable
|
||||
|
||||
public $stateSave = true;
|
||||
|
||||
public $url = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->url = route('Shop.Orders.index');
|
||||
@@ -26,11 +28,16 @@ class CustomerOrdersDataTable extends DataTable
|
||||
public function query(Order $model)
|
||||
{
|
||||
$customerId = Auth::id();
|
||||
$model = $model->byCustomer($customerId)->with(['delivery']);
|
||||
$model = $model->byCustomer($customerId);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
public function getHtmlButtons()
|
||||
{
|
||||
return self::getButtonShow('uuid', 'Voir la commande');
|
||||
}
|
||||
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
@@ -38,10 +45,7 @@ class CustomerOrdersDataTable extends DataTable
|
||||
return Orders::getStatus($order->status);
|
||||
})
|
||||
->editColumn('created_at', function (Order $order) {
|
||||
return $order->created_at->toDateTimeString();
|
||||
})
|
||||
->editColumn('payment_type', function (Order $order) {
|
||||
return InvoicePayments::getPaymentType($order->payment_type);
|
||||
return $order->created_at->isoFormat('DD/MM/YY HH:mm');
|
||||
})
|
||||
->rawColumns(['action']);
|
||||
|
||||
@@ -53,7 +57,6 @@ class CustomerOrdersDataTable extends DataTable
|
||||
return [
|
||||
Column::make('created_at')->title('Date'),
|
||||
Column::make('ref')->title('Ref'),
|
||||
Column::make('payment_type')->title('Règlement'),
|
||||
Column::make('total_shipped')->title('Montant')->class('text-right'),
|
||||
Column::make('status')->title('Statut'),
|
||||
$this->makeColumnButtons(),
|
||||
|
||||
Reference in New Issue
Block a user