add payments by invoice
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Datatables\Admin\Shop\InvoicesDataTable;
|
||||
use App\Datatables\Admin\Shop\InvoicePaymentsDataTable;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\Invoices;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -28,15 +29,20 @@ class InvoiceController extends Controller
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['invoice'] = Invoices::get($id)->toArray();
|
||||
$data['invoice'] = Invoices::getFull($id)->toArray();
|
||||
|
||||
return view('Admin.Shop.Invoices.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['invoice'] = Invoices::get($id, ['order.customer', 'order.address', 'order.detail'])->toArray();
|
||||
$data['statuses'] = Invoices::statuses();
|
||||
$data = Invoices::init();
|
||||
$data['invoice'] = Invoices::getFull($id)->toArray();
|
||||
$model = new invoicePaymentsDataTable();
|
||||
$data['invoice_payments'] = $model->html();
|
||||
|
||||
// dump($data);
|
||||
// exit;
|
||||
|
||||
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',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user