fix invoice payment
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
namespace App\Datatables\Admin\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
|
||||
class InvoicePaymentsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'InvoicePayments';
|
||||
public $model_name = 'invoice_payments';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->url = route('Admin.Shop.InvoicePayments.index');
|
||||
}
|
||||
|
||||
public function query(InvoicePayment $model)
|
||||
{
|
||||
@@ -34,7 +39,7 @@ class InvoicesDataTable extends DataTable
|
||||
{
|
||||
return [
|
||||
Column::make('payment_type')->title('Type')->width(80),
|
||||
Column::make('status')->width(60),
|
||||
Column::make('date')->width(60),
|
||||
Column::make('amount')->title('Montant')->width(100),
|
||||
Column::make('reference')->title('Référence'),
|
||||
$this->makeColumnButtons(),
|
||||
@@ -38,12 +38,9 @@ class InvoiceController extends Controller
|
||||
{
|
||||
$data = Invoices::init();
|
||||
$data['invoice'] = Invoices::getFull($id)->toArray();
|
||||
$model = new invoicePaymentsDataTable();
|
||||
$model = new InvoicePaymentsDataTable();
|
||||
$data['invoice_payments'] = $model->html();
|
||||
|
||||
// dump($data);
|
||||
// exit;
|
||||
|
||||
return view('Admin.Shop.Invoices.edit', $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,9 @@ class InvoicePaymentController extends Controller
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Admin.Shop.InvoicePayments.create');
|
||||
$data = InvoicePayments::init();
|
||||
|
||||
return view('Admin.Shop.InvoicePayments.create' , $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
@@ -37,8 +39,6 @@ class InvoicePaymentController extends Controller
|
||||
{
|
||||
$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);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@ use App\Models\Shop\InvoicePayment;
|
||||
|
||||
class InvoicePayments
|
||||
{
|
||||
public static function init()
|
||||
{
|
||||
return [
|
||||
'payment_types' => self::paymentTypes(),
|
||||
];
|
||||
}
|
||||
public static function get($id, $relations = false)
|
||||
{
|
||||
return $relations ? InvoicePayment::with($relations)->findOrFail($id) : InvoicePayment::findOrFail($id);
|
||||
|
||||
Reference in New Issue
Block a user