<?php

use App\Http\Controllers\ArticuloController;
use App\Http\Controllers\AsientoController;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\ClienteController;
use App\Http\Controllers\EmpresaController;
use App\Http\Controllers\UsuarioController;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\ProveedorController;
use App\Http\Controllers\SucursalController;
use App\Http\Controllers\CiudadController;
use App\Http\Controllers\CompraController;
use App\Http\Controllers\CuentaController;
use App\Http\Controllers\RolController;
use App\Http\Controllers\VentaController;
use Illuminate\Support\Facades\Auth;


/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


// Route::get('/', function () {
//      return view('auth.login');
// });


Route::group(['middleware'], function () {    
    #modulo seguridad
    Auth::routes();
    //este cambie
    Route::get('/', [App\Http\Controllers\HomeController::class, 'index'])->name('home'); 
    // Route::get('/', 'App\Http\Controllers\HomeController@acceso')->name('home'); // y le puse este
    // Route::get('home', 'App\Http\Controllers\HomeController@acceso')->name('home'); // y le puse este
    Route::get('login', 'App\Http\Controllers\Auth\LoginController@login')->name('login');
    Route::post('/loginempresa', 'App\Http\Controllers\Auth\LoginController@loginempresa')->name('loginempresa');
    // Route::get('/', 'App\Http\Controllers\Auth\LoginController@loginempresa')->name('loginempresa');
    Route::get('logout', 'App\Http\Controllers\Auth\LoginController@logout')->name('logout');
    Route::resource('/usuario',UsuarioController::class);
    Route::get('usuario/cambiarpass/{id?}', 'App\Http\Controllers\UsuarioController@cambiarpass')->name('cambiarpass');
    Route::get('usuario/perfiles/{id?}', 'App\Http\Controllers\UsuarioController@perfiles')->name('perfiles');
    Route::resource('/rol',RolController::class);
    Route::get('/rol/permisos/{id?}','App\Http\Controllers\RolController@permisos')->name('permisos');

    Route::resource('/usuario',UsuarioController::class);
    Route::resource('/empresa',EmpresaController::class);
    Route::resource('/cliente',ClienteController::class);
    Route::resource('/proveedor',ProveedorController::class);
    Route::resource('/sucursal',SucursalController::class);
    Route::resource('/ciudad',CiudadController::class);
    Route::resource('/asiento',AsientoController::class);
    Route::resource('/cuenta',CuentaController::class);
    Route::resource('/compra',CompraController::class);
    Route::resource('/venta',VentaController::class);
    Route::resource('/articulo',ArticuloController::class);
 
    // Route::get('ciudad/pdf', 'App\Http\Controllers\CiudadController@pdf')->name('ciudadpdf');
    // Route::resource('/ciudad',CiudadController::class);
    // Route::resource('/grupo',GrupoController::class);
    // Route::resource('/deposito',DepositoController::class);
    // Route::resource('/compra',CompraController::class);
    // Route::get('compra/anular/{id?}', 'App\Http\Controllers\CompraController@anular')->name('anular_compra');
    // Route::post('compra/anular_guardar/{id?}', 'App\Http\Controllers\CompraController@anular_guardar')->name('anular_guardar_compra');
    // Route::post('compra/credito', 'App\Http\Controllers\CompraController@credito')->name('compra_credito');
    
    // Route::resource('/venta',VentaController::class);
    // Route::get('venta/anular/{id?}', 'App\Http\Controllers\VentaController@anular')->name('anular');
    // Route::get('venta/factura/{id?}', 'App\Http\Controllers\VentaController@factura')->name('factura');
    // Route::post('venta/anular_guardar/{id?}', 'App\Http\Controllers\VentaController@anular_guardar')->name('anular_guardar');
    // Route::post('venta/credito', 'App\Http\Controllers\VentaController@credito')->name('venta_credito');

    // Route::resource('/articulo',ArticuloController::class);
    // Route::resource('/caja',CajaController::class);
    // Route::resource('/proveedor',ProveedorController::class);
    // Route::resource('/cliente',ClienteController::class);
    // Route::resource('/motivo',MotivoController::class);
    // Route::resource('/ajuste',AjusteController::class);

    // Route::resource('/existencia',ExistenciaController::class);    
    // Route::post('/existencia/pdf', 'App\Http\Controllers\ExistenciaController@pdf_existencia')->name('pdf_existencia');
    // Route::resource('/apertura',AperturaController::class);    
    // Route::resource('/transferencia',TransferenciaController::class);    
    // Route::resource('/reimprimir',ReimprimirController::class);
    // Route::resource('/pagina',PaginaController::class);
    
    // Route::resource('/cobro',CobroController::class);
    // Route::get('cobro/det_venta/{id?}', 'App\Http\Controllers\CobroController@det_venta')->name('det_venta');
    // Route::get('cobro/det_cobro/{id?}', 'App\Http\Controllers\CobroController@det_cobro')->name('det_cobro');
    // Route::get('cobro/cobrar/{id?}', 'App\Http\Controllers\CobroController@cobrar')->name('cobrar');
    // Route::post('cobro/cta_a_cobrar', 'App\Http\Controllers\CobroController@store')->name('cuotas_acobrar');
    // Route::post('cobro/cobrarguardar', 'App\Http\Controllers\CobroController@cobrarguardar')->name('cobrarguardar');

    // Route::resource('/pago',PagoController::class);
    // Route::get('pago/det_compra/{id?}', 'App\Http\Controllers\PagoController@det_compra')->name('det_compra');
    // Route::get('pago/det_pago/{id?}', 'App\Http\Controllers\PagoController@det_pago')->name('det_pago');
    // Route::get('pago/pagar/{id?}', 'App\Http\Controllers\PagoController@pagar')->name('pagar');
    // Route::post('pago/cta_a_pagar', 'App\Http\Controllers\PagoController@store')->name('cuotas_apagar');
    // Route::post('pago/pagarguardar', 'App\Http\Controllers\PagoController@pagarguardar')->name('pagarguardar');

    // Route::resource('/ctacobrar',CtaCobrarController::class);
    // Route::resource('/ctapagar',CtaPagarController::class);
    
    // Route::get('informes/inf_compras', 'App\Http\Controllers\InformesController@inf_compras')->name('inf_compras');
    // Route::post('informes/pdf_compras', 'App\Http\Controllers\InformesController@pdf_compras')->name('pdf_compras');
    // Route::get('informes/inf_ventas', 'App\Http\Controllers\InformesController@inf_ventas')->name('inf_ventas');
    // Route::post('informes/pdf_ventas', 'App\Http\Controllers\InformesController@pdf_ventas')->name('pdf_ventas');
    // Route::get('informes/lista_morosos', 'App\Http\Controllers\InformesController@lista_morosos')->name('lista_morosos');
    // Route::post('informes/pdf_morosos', 'App\Http\Controllers\InformesController@pdf_morosos')->name('pdf_morosos');
    // Route::get('informes/extracto_cliente', 'App\Http\Controllers\InformesController@extracto_cliente')->name('extracto_cliente');
    // Route::get('informes/pdf_extracto_cliente/{id?}', 'App\Http\Controllers\InformesController@pdf_extracto_cliente')->name('pdf_extracto_cliente');
    // Route::get('informes/ejemplo', 'App\Http\Controllers\InformesController@ejemplo')->name('ejemplo');
    // Route::get('informes/footer', 'App\Http\Controllers\InformesController@footer')->name('footer');
    /* Route::post('informes/pdf_compras', 'App\Http\Controllers\InformesController@pdf_compras')->name('pdf_compras'); */
});
