Commit 46eb1e35 by Francisco Salazar

validacion en categorias sat y config de facturacion

parent 2476456f
......@@ -27,6 +27,7 @@ use Onestartup\Shop\Libs\Util;
use Onestartup\Shop\Requests\RequestProduct;
use Onestartup\Shop\Requests\RequestProductInfo;
use Onestartup\Shop\Requests\RequestGallery;
use Onestartup\Shop\Requests\RequestConfigFactura;
use Onestartup\Shop\Payment\MP;
use PayPal\Api\Amount;
......@@ -646,7 +647,7 @@ class AdminProductController extends Controller
->with('regimen', $regimen);
}
public function postConfigs(Request $request) {
public function postConfigs(RequestConfigFactura $request) {
$config = Config::first();
......
......@@ -11,6 +11,8 @@ use Onestartup\Shop\Model\CategoriaSat as Category;
use Onestartup\Shop\Model\Unidad;
use Onestartup\Shop\Model\ClavesProducto;
use Onestartup\Shop\Requests\RequestCategorySat;
class CategorySatController extends Controller
{
/**
......@@ -36,7 +38,7 @@ class CategorySatController extends Controller
* @param Request $request
* @return Response
*/
public function store(Request $request)
public function store(RequestCategorySat $request)
{
$category = new Category($request->all());
......@@ -69,7 +71,7 @@ class CategorySatController extends Controller
* @param Request $request
* @return Response
*/
public function update(Request $request, $id)
public function update(RequestCategorySat $request, $id)
{
$category = Category::find($id);
$category->fill($request->all());
......@@ -77,7 +79,7 @@ class CategorySatController extends Controller
return redirect()
->back()
->with('message_success', 'Categoria actualizado correctamente');
->with('message_success', 'Categoría actualizado correctamente');
}
/**
......
<?php
namespace Onestartup\Shop\Requests;
use Illuminate\Foundation\Http\FormRequest;
class RequestCategorySat extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'nombre' => 'required|max:255',
'clave_producto' => 'required|max:255',
'clave_unidad'=> 'required|max:255',
'unidad' => 'required|max:255',
];
}
}
\ No newline at end of file
<?php
namespace Onestartup\Shop\Requests;
use Illuminate\Foundation\Http\FormRequest;
class RequestConfigFactura extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'regimen_fiscal' => 'required|max:255',
'lugar_expedicion' => 'required|numeric',
];
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@
<a href="{{route('admin-shop-client.orders')}}">Tienda</a>
</li>
<li class="breadcrumb-item">
<a href="{{route('admin.shop.category.index')}}">Listado de categorías</a>
<a href="{{route('admin.shop.categoriasat.index')}}">Listado de categorías del SAT</a>
</li>
<li class="breadcrumb-item active">
{{$category->nombre}}
......
......@@ -9,7 +9,7 @@
<div class="col-md-6">
<div class="form-group">
{!! Form::label('lugar_expedicion', 'Lugar de expedición (Código Postal)') !!}
{!! Form::text('lugar_expedicion', null, ["class"=>"form-control"]) !!}
{!! Form::text('lugar_expedicion', null, ["class"=>"form-control", "maxlength" => "5"]) !!}
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment