Finalizacion de la primera version del proyecto
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Http\Livewire;
|
||||
|
||||
use App\Models\Venta;
|
||||
use App\Models\Movimiento;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Component;
|
||||
|
||||
@@ -16,11 +16,8 @@ class CancelacionController extends Component
|
||||
protected $rules = [
|
||||
'cancelacion.codigo' => 'min:0',
|
||||
'cancelacion.pago_efectivo' => 'numeric',
|
||||
'cancelacion.pago_tarjeta_debito' => 'numeric',
|
||||
'cancelacion.pago_tarjeta_credito' => 'numeric',
|
||||
'cancelacion.pago_vales' => 'numeric',
|
||||
'cancelacion.precio_venta' => 'numeric',
|
||||
'cancelacion.estado_venta_id' => 'numeric',
|
||||
'cancelacion.estado_movimiento_id' => 'numeric',
|
||||
'cancelacion.motivo' => 'required',
|
||||
'cancelacion.user_id',
|
||||
];
|
||||
|
||||
@@ -31,7 +28,7 @@ class CancelacionController extends Component
|
||||
|
||||
public function render()
|
||||
{
|
||||
$cancelaciones = Venta::where([['codigo','like','%'.$this->buscador.'%'],['estado_venta_id','=',CancelacionController::CODIGO_CANCELACION]])->paginate(10);
|
||||
$cancelaciones = Movimiento::where([['codigo','like','%'.$this->buscador.'%'],['estado_movimiento_id','=',CancelacionController::CODIGO_CANCELACION]])->paginate(10);
|
||||
return view('venta.cancelacion',[
|
||||
'cancelaciones' => $cancelaciones
|
||||
]);
|
||||
@@ -41,14 +38,14 @@ class CancelacionController extends Component
|
||||
public function create()
|
||||
{
|
||||
$this->clearInputs();
|
||||
$this->cancelacion = new Venta([
|
||||
$this->cancelacion = new Movimiento([
|
||||
'codigo' => 0,
|
||||
'pago_efectivo' => 0,
|
||||
'pago_tarjeta_debito' => 0,
|
||||
'pago_tarjeta_credito' => 0,
|
||||
'pago_vales' => 0,
|
||||
'precio_venta' => 0,
|
||||
'estado_venta_id' => 3,
|
||||
'estado_movimiento_id' => 3,
|
||||
]);
|
||||
|
||||
$this->showModal();
|
||||
@@ -57,12 +54,9 @@ class CancelacionController extends Component
|
||||
public function save()
|
||||
{
|
||||
$this->validate([
|
||||
'cancelacion.pago_efectivo' => 'numeric',
|
||||
'cancelacion.pago_tarjeta_debito' => 'numeric',
|
||||
'cancelacion.pago_tarjeta_credito' => 'numeric',
|
||||
'cancelacion.pago_vales' => 'numeric',
|
||||
'cancelacion.precio_venta' => 'numeric',
|
||||
'cancelacion.estado_venta_id' => 'numeric',
|
||||
'cancelacion.pago_efectivo' => 'numeric|required|gte:1',
|
||||
'cancelacion.estado_movimiento_id' => 'numeric',
|
||||
'cancelacion.motivo' => 'required',
|
||||
]);
|
||||
|
||||
$this->cancelacion->user_id = Auth::user()->id;
|
||||
|
||||
Reference in New Issue
Block a user