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(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user