fixes
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Admin\Shop;
|
||||
use App\Datatables\Admin\Shop\InvoicePaymentsDataTable;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\InvoicePayments;
|
||||
use App\Repositories\Shop\Invoices;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class InvoicePaymentController extends Controller
|
||||
@@ -14,18 +15,21 @@ class InvoicePaymentController extends Controller
|
||||
return $dataTable->render('Admin.Shop.InvoicePayments.list');
|
||||
}
|
||||
|
||||
public function create()
|
||||
public function create($invoice_id)
|
||||
{
|
||||
$data = InvoicePayments::init();
|
||||
$data['invoice_id'] = $invoice_id;
|
||||
|
||||
return view('Admin.Shop.InvoicePayments.create', $data);
|
||||
return view('Admin.Shop.InvoicePayments.form', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = InvoicePayments::store($request->all());
|
||||
$data = $request->all();
|
||||
$ret = InvoicePayments::store($data);
|
||||
Invoices::checkPayments($data['invoice_id']);
|
||||
|
||||
return redirect()->route('Admin.Shop.InvoicePayments.index');
|
||||
return redirect()->route('Admin.Shop.Invoices.edit', ['id' => $request->input('invoice_id')]);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
@@ -40,12 +44,15 @@ class InvoicePaymentController extends Controller
|
||||
{
|
||||
$data = InvoicePayments::init();
|
||||
$data['invoice_payment'] = InvoicePayments::getArray($id);
|
||||
$data['invoice_id'] = $data['invoice_payment']['invoice_id'];
|
||||
|
||||
return view('Admin.Shop.InvoicePayments.edit', $data);
|
||||
return view('Admin.Shop.InvoicePayments.form', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return InvoicePayments::destroy($id);
|
||||
$payment = InvoicePayments::get($id);
|
||||
InvoicePayments::destroy($id);
|
||||
Invoices::checkPayments($payment->invoice_id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user