first commit
This commit is contained in:
commit
c182ae552c
18
.editorconfig
Normal file
18
.editorconfig
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[*.{yml,yaml}]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[docker-compose.yml]
|
||||||
|
indent_size = 4
|
38
.gitattributes
vendored
Normal file
38
.gitattributes
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
* text=auto eol=lf
|
||||||
|
|
||||||
|
*.blade.php diff=html
|
||||||
|
*.css diff=css
|
||||||
|
*.html diff=html
|
||||||
|
*.md diff=markdown
|
||||||
|
*.php diff=php
|
||||||
|
|
||||||
|
/.github export-ignore
|
||||||
|
CHANGELOG.md export-ignore
|
||||||
|
.styleci.yml export-ignore
|
||||||
|
|
||||||
|
# Ignorar archivos de configuración y herramientas de desarrollo
|
||||||
|
.editorconfig export-ignore
|
||||||
|
.prettierrc.json export-ignore
|
||||||
|
.prettierignore export-ignore
|
||||||
|
.eslintrc.json export-ignore
|
||||||
|
|
||||||
|
# Ignorar node_modules y dependencias locales
|
||||||
|
node_modules/ export-ignore
|
||||||
|
vendor/ export-ignore
|
||||||
|
|
||||||
|
# Ignorar archivos de build
|
||||||
|
npm-debug.log export-ignore
|
||||||
|
|
||||||
|
# Ignorar carpetas de logs y caché
|
||||||
|
storage/logs/ export-ignore
|
||||||
|
storage/framework/ export-ignore
|
||||||
|
|
||||||
|
# Ignorar carpetas de compilación de frontend
|
||||||
|
public/build/ export-ignore
|
||||||
|
dist/ export-ignore
|
||||||
|
|
||||||
|
# Ignorar archivos de CI/CD
|
||||||
|
.github/ export-ignore
|
||||||
|
.gitlab-ci.yml export-ignore
|
||||||
|
.vscode/ export-ignore
|
||||||
|
.idea/ export-ignore
|
10
.gitignore
vendored
Normal file
10
.gitignore
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/node_modules
|
||||||
|
/vendor
|
||||||
|
/.vscode
|
||||||
|
/.nova
|
||||||
|
/.fleet
|
||||||
|
/.phpactor.json
|
||||||
|
/.phpunit.cache
|
||||||
|
/.phpunit.result.cache
|
||||||
|
/.zed
|
||||||
|
/.idea
|
16
.prettierignore
Normal file
16
.prettierignore
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Dependencias de Composer y Node.js
|
||||||
|
/vendor/
|
||||||
|
/node_modules/
|
||||||
|
|
||||||
|
# Caché y logs
|
||||||
|
/storage/
|
||||||
|
*.log
|
||||||
|
*.cache
|
||||||
|
|
||||||
|
# Archivos del sistema
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Configuración de editores
|
||||||
|
.idea/
|
||||||
|
.vscode/
|
29
.prettierrc.json
Normal file
29
.prettierrc.json
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"bracketSameLine": true,
|
||||||
|
"htmlWhitespaceSensitivity": "css",
|
||||||
|
"insertPragma": false,
|
||||||
|
"jsxSingleQuote": true,
|
||||||
|
"printWidth": 120,
|
||||||
|
"proseWrap": "preserve",
|
||||||
|
"quoteProps": "as-needed",
|
||||||
|
"requirePragma": false,
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"tabWidth": 4,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"useTabs": false,
|
||||||
|
"endOfLine": "lf",
|
||||||
|
"embeddedLanguageFormatting": "auto",
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"resources/assets/**/*.js"
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"semi": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
39
CHANGELOG.md
Normal file
39
CHANGELOG.md
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# 📜 CHANGELOG - Laravel Vuexy Asset Management
|
||||||
|
|
||||||
|
Este documento sigue el formato [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
|
## [0.1.0] - ALPHA - 2024-03-05
|
||||||
|
|
||||||
|
### ✨ Added (Agregado)
|
||||||
|
- 🚀 Primera versión alpha de la librería.
|
||||||
|
- 🔹 Implementación inicial de [funcionalidad clave 1].
|
||||||
|
- 🔹 Integración con [dependencia o servicio principal].
|
||||||
|
- 🔹 Soporte para [Laravel/Vuexy Admin, si aplica].
|
||||||
|
|
||||||
|
### 🛠 Changed (Modificado)
|
||||||
|
- 🔄 Optimización de [código o estructura interna].
|
||||||
|
|
||||||
|
### 🐛 Fixed (Correcciones)
|
||||||
|
- 🐞 Correcciones iniciales en [migraciones, modelos, servicios, etc.].
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📅 Próximos Cambios Planeados
|
||||||
|
- 📊 **Mejoras en [feature futuro]**.
|
||||||
|
- 🏪 **Compatibilidad con [Laravel 11, Vuexy, etc.]**.
|
||||||
|
- 📍 **Integración con [API o funcionalidad esperada]**.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**📌 Nota:** Esta es una versión **ALPHA**, aún en desarrollo.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔄 Sincronización de Cambios
|
||||||
|
Este `CHANGELOG.md` se actualiza primero en nuestro repositorio principal en **[Tea - Koneko Git](https://git.koneko.mx/koneko/laravel-vuexy-asset-management)** y luego se refleja en GitHub.
|
||||||
|
Los cambios recientes pueden verse antes en **Tea** que en **GitHub** debido a la sincronización automática.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
📅 Última actualización: **2024-03-05**.
|
||||||
|
|
9
CONTRIBUTING.md
Normal file
9
CONTRIBUTING.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
## 🔐 Acceso al Repositorio Privado
|
||||||
|
|
||||||
|
Nuestro servidor Git en **Tea** tiene un registro cerrado. Para contribuir:
|
||||||
|
|
||||||
|
1. Abre un **Issue** en [GitHub](https://github.com/koneko-mx/laravel-vuexy-asset-management/issues) indicando tu interés en contribuir.
|
||||||
|
2. Alternativamente, envía un correo a **contacto@koneko.mx** solicitando acceso.
|
||||||
|
3. Una vez aprobado, recibirás una invitación para registrarte y clonar el repositorio.
|
||||||
|
|
||||||
|
Si solo necesitas acceso de lectura, puedes clonar la versión pública en **GitHub**.
|
65
Http/AssetAassignmentController.php
Normal file
65
Http/AssetAassignmentController.php
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Koneko\VuexyWarehouse\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class AssetAassignmentController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return view('vuexy-warehouse::asset-assignments.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new resource.
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*/
|
||||||
|
public function show(string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*/
|
||||||
|
public function edit(string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(Request $request, string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy(string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
65
Http/AssetController.php
Normal file
65
Http/AssetController.php
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Koneko\VuexyWarehouse\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class AssetController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return view('vuexy-warehouse::assets.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new resource.
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*/
|
||||||
|
public function show(string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*/
|
||||||
|
public function edit(string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(Request $request, string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy(string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
65
Http/AssetLifecycleController.php
Normal file
65
Http/AssetLifecycleController.php
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Koneko\VuexyWarehouse\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class AssetLifecycleController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return view('vuexy-warehouse::asset-lifecycles.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new resource.
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*/
|
||||||
|
public function show(string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*/
|
||||||
|
public function edit(string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(Request $request, string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy(string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
65
Http/AssetMaintenanceController.php
Normal file
65
Http/AssetMaintenanceController.php
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Koneko\VuexyWarehouse\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class AssetMaintenanceController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return view('vuexy-warehouse::asset-maintenances.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new resource.
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*/
|
||||||
|
public function show(string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*/
|
||||||
|
public function edit(string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(Request $request, string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy(string $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
65
Http/FixedAssetController.php
Normal file
65
Http/FixedAssetController.php
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Koneko\VuexyAssetManagement\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Models\FixedAsset;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class FixedAssetController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new resource.
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*/
|
||||||
|
public function show(FixedAsset $fixedAsset)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*/
|
||||||
|
public function edit(FixedAsset $fixedAsset)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(Request $request, FixedAsset $fixedAsset)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy(FixedAsset $fixedAsset)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
65
Http/FixedAssetEventController.php
Normal file
65
Http/FixedAssetEventController.php
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Koneko\VuexyAssetManagement\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Models\FixedAssetEvent;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class FixedAssetEventController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new resource.
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*/
|
||||||
|
public function show(FixedAssetEvent $fixedAssetEvent)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*/
|
||||||
|
public function edit(FixedAssetEvent $fixedAssetEvent)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(Request $request, FixedAssetEvent $fixedAssetEvent)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy(FixedAssetEvent $fixedAssetEvent)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
65
Http/FixedAssetStatusHistoryController.php
Normal file
65
Http/FixedAssetStatusHistoryController.php
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Koneko\VuexyAssetManagement\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Models\FixedAssetStatusHistory;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class FixedAssetStatusHistoryController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new resource.
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*/
|
||||||
|
public function show(FixedAssetStatusHistory $fixedAssetStatusHistory)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*/
|
||||||
|
public function edit(FixedAssetStatusHistory $fixedAssetStatusHistory)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(Request $request, FixedAssetStatusHistory $fixedAssetStatusHistory)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy(FixedAssetStatusHistory $fixedAssetStatusHistory)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
9
LICENSE
Normal file
9
LICENSE
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2025 koneko
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
109
Livewire/AssetAassignments/AssetAassignmentsIndex.php
Normal file
109
Livewire/AssetAassignments/AssetAassignmentsIndex.php
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Koneko\VuexyWarehouse\Livewire\AssetAassignments;
|
||||||
|
|
||||||
|
use Koneko\SatCatalogs\Models\RegimenFiscal;
|
||||||
|
use Koneko\SatCatalogs\Models\UsoCfdi;
|
||||||
|
use Koneko\VuexyAdmin\Models\User;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Spatie\Permission\Models\Role;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class AssetAassignmentsIndex extends Component
|
||||||
|
{
|
||||||
|
public $tipo_persona_options, $estado_options, $status_options;
|
||||||
|
public $status_list, $status_list_class;
|
||||||
|
|
||||||
|
public $userId,
|
||||||
|
$name,
|
||||||
|
$email,
|
||||||
|
$cargo,
|
||||||
|
$rfc,
|
||||||
|
$nombre_fiscal,
|
||||||
|
$c_regimen_fiscal,
|
||||||
|
$domicilio_fiscal,
|
||||||
|
$c_uso_cfdi,
|
||||||
|
$roles,
|
||||||
|
$password,
|
||||||
|
$status,
|
||||||
|
$is_prospect,
|
||||||
|
$is_customer,
|
||||||
|
$is_provider,
|
||||||
|
$is_user;
|
||||||
|
|
||||||
|
public $statuses;
|
||||||
|
|
||||||
|
public $rows_roles = [];
|
||||||
|
public $roles_options = [];
|
||||||
|
|
||||||
|
public $uso_cfdi_options = [];
|
||||||
|
public $regimen_fiscal_options = [];
|
||||||
|
|
||||||
|
public $roles_html_select;
|
||||||
|
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
$this->tipo_persona_options = [
|
||||||
|
User::TIPO_RFC_FISICA => User::$tipoRfcList[User::TIPO_RFC_FISICA],
|
||||||
|
User::TIPO_RFC_MORAL => User::$tipoRfcList[User::TIPO_RFC_MORAL],
|
||||||
|
User::TIPO_RFC_PUBLICO => User::$tipoRfcList[User::TIPO_RFC_PUBLICO],
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->estado_options = DB::table('sat_estado')
|
||||||
|
->select('sat_estado.c_estado', 'sat_estado.nombre_del_estado')
|
||||||
|
->join('sat_codigo_postal', 'sat_estado.c_estado', '=', 'sat_codigo_postal.c_estado')
|
||||||
|
->join('users', 'users.domicilio_fiscal', '=', 'sat_codigo_postal.c_codigo_postal')
|
||||||
|
->distinct()
|
||||||
|
->orderBy('sat_estado.c_estado')
|
||||||
|
->pluck('sat_estado.nombre_del_estado', 'sat_estado.c_estado');
|
||||||
|
|
||||||
|
|
||||||
|
$this->status_options = $this->status_list = [
|
||||||
|
User::STATUS_ENABLED => User::$statusList[User::STATUS_ENABLED],
|
||||||
|
User::STATUS_DISABLED => User::$statusList[User::STATUS_DISABLED],
|
||||||
|
];
|
||||||
|
|
||||||
|
//$this->status = User::STATUS_ENABLED;
|
||||||
|
$this->status_list_class = User::$statusListClass;
|
||||||
|
|
||||||
|
$this->statuses = [
|
||||||
|
User::STATUS_ENABLED => ['title' => 'Activo', 'class' => 'badge bg-label-' . User::$statusListClass[User::STATUS_ENABLED]],
|
||||||
|
User::STATUS_DISABLED => ['title' => 'Deshabilitado', 'class' => 'badge bg-label-' . User::$statusListClass[User::STATUS_DISABLED]],
|
||||||
|
User::STATUS_REMOVED => ['title' => 'Eliminado', 'class' => 'badge bg-label-' . User::$statusListClass[User::STATUS_REMOVED]],
|
||||||
|
];
|
||||||
|
|
||||||
|
$roles = Role::whereNotIn('name', ['Patient', 'Doctor'])->get();
|
||||||
|
|
||||||
|
$this->roles_html_select = "<select id=\"UserRole\" class=\"form-select text-capitalize\"><option value=\"\"> Selecciona un rol </option>";
|
||||||
|
|
||||||
|
foreach ($roles as $role) {
|
||||||
|
$this->rows_roles[$role->name] = "<span class=\"badge bg-label-" . $role->style . " mx-1\">" . $role->name . "</span>";
|
||||||
|
|
||||||
|
if (Auth::user()->hasRole('SuperAdmin') || $role->name != 'SuperAdmin') {
|
||||||
|
$this->roles_html_select .= "<option value=\"" . $role->name . "\" class=\"text-capitalize\">" . $role->name . "</option>";
|
||||||
|
$this->roles_options[$role->name] = $role->name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->roles_html_select .= "</select>";
|
||||||
|
|
||||||
|
$this->status_options = [
|
||||||
|
User::STATUS_ENABLED => User::$statusList[User::STATUS_ENABLED],
|
||||||
|
User::STATUS_DISABLED => User::$statusList[User::STATUS_DISABLED],
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->uso_cfdi_options = UsoCfdi::selectList();
|
||||||
|
$this->regimen_fiscal_options = RegimenFiscal::selectList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('vuexy-warehouse::livewire.assets-aasigments.assets-aassignments-index');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
109
Livewire/AssetLifecycles/AssetLifecyclesIndex.php
Normal file
109
Livewire/AssetLifecycles/AssetLifecyclesIndex.php
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Koneko\VuexyWarehouse\Livewire\AssetLifecycles;
|
||||||
|
|
||||||
|
use Koneko\SatCatalogs\Models\RegimenFiscal;
|
||||||
|
use Koneko\SatCatalogs\Models\UsoCfdi;
|
||||||
|
use Koneko\VuexyAdmin\Models\User;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Spatie\Permission\Models\Role;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class AssetLifecyclesIndex extends Component
|
||||||
|
{
|
||||||
|
public $tipo_persona_options, $estado_options, $status_options;
|
||||||
|
public $status_list, $status_list_class;
|
||||||
|
|
||||||
|
public $userId,
|
||||||
|
$name,
|
||||||
|
$email,
|
||||||
|
$cargo,
|
||||||
|
$rfc,
|
||||||
|
$nombre_fiscal,
|
||||||
|
$c_regimen_fiscal,
|
||||||
|
$domicilio_fiscal,
|
||||||
|
$c_uso_cfdi,
|
||||||
|
$roles,
|
||||||
|
$password,
|
||||||
|
$status,
|
||||||
|
$is_prospect,
|
||||||
|
$is_customer,
|
||||||
|
$is_provider,
|
||||||
|
$is_user;
|
||||||
|
|
||||||
|
public $statuses;
|
||||||
|
|
||||||
|
public $rows_roles = [];
|
||||||
|
public $roles_options = [];
|
||||||
|
|
||||||
|
public $uso_cfdi_options = [];
|
||||||
|
public $regimen_fiscal_options = [];
|
||||||
|
|
||||||
|
public $roles_html_select;
|
||||||
|
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
$this->tipo_persona_options = [
|
||||||
|
User::TIPO_RFC_FISICA => User::$tipoRfcList[User::TIPO_RFC_FISICA],
|
||||||
|
User::TIPO_RFC_MORAL => User::$tipoRfcList[User::TIPO_RFC_MORAL],
|
||||||
|
User::TIPO_RFC_PUBLICO => User::$tipoRfcList[User::TIPO_RFC_PUBLICO],
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->estado_options = DB::table('sat_estado')
|
||||||
|
->select('sat_estado.c_estado', 'sat_estado.nombre_del_estado')
|
||||||
|
->join('sat_codigo_postal', 'sat_estado.c_estado', '=', 'sat_codigo_postal.c_estado')
|
||||||
|
->join('users', 'users.domicilio_fiscal', '=', 'sat_codigo_postal.c_codigo_postal')
|
||||||
|
->distinct()
|
||||||
|
->orderBy('sat_estado.c_estado')
|
||||||
|
->pluck('sat_estado.nombre_del_estado', 'sat_estado.c_estado');
|
||||||
|
|
||||||
|
|
||||||
|
$this->status_options = $this->status_list = [
|
||||||
|
User::STATUS_ENABLED => User::$statusList[User::STATUS_ENABLED],
|
||||||
|
User::STATUS_DISABLED => User::$statusList[User::STATUS_DISABLED],
|
||||||
|
];
|
||||||
|
|
||||||
|
//$this->status = User::STATUS_ENABLED;
|
||||||
|
$this->status_list_class = User::$statusListClass;
|
||||||
|
|
||||||
|
$this->statuses = [
|
||||||
|
User::STATUS_ENABLED => ['title' => 'Activo', 'class' => 'badge bg-label-' . User::$statusListClass[User::STATUS_ENABLED]],
|
||||||
|
User::STATUS_DISABLED => ['title' => 'Deshabilitado', 'class' => 'badge bg-label-' . User::$statusListClass[User::STATUS_DISABLED]],
|
||||||
|
User::STATUS_REMOVED => ['title' => 'Eliminado', 'class' => 'badge bg-label-' . User::$statusListClass[User::STATUS_REMOVED]],
|
||||||
|
];
|
||||||
|
|
||||||
|
$roles = Role::whereNotIn('name', ['Patient', 'Doctor'])->get();
|
||||||
|
|
||||||
|
$this->roles_html_select = "<select id=\"UserRole\" class=\"form-select text-capitalize\"><option value=\"\"> Selecciona un rol </option>";
|
||||||
|
|
||||||
|
foreach ($roles as $role) {
|
||||||
|
$this->rows_roles[$role->name] = "<span class=\"badge bg-label-" . $role->style . " mx-1\">" . $role->name . "</span>";
|
||||||
|
|
||||||
|
if (Auth::user()->hasRole('SuperAdmin') || $role->name != 'SuperAdmin') {
|
||||||
|
$this->roles_html_select .= "<option value=\"" . $role->name . "\" class=\"text-capitalize\">" . $role->name . "</option>";
|
||||||
|
$this->roles_options[$role->name] = $role->name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->roles_html_select .= "</select>";
|
||||||
|
|
||||||
|
$this->status_options = [
|
||||||
|
User::STATUS_ENABLED => User::$statusList[User::STATUS_ENABLED],
|
||||||
|
User::STATUS_DISABLED => User::$statusList[User::STATUS_DISABLED],
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->uso_cfdi_options = UsoCfdi::selectList();
|
||||||
|
$this->regimen_fiscal_options = RegimenFiscal::selectList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('vuexy-warehouse::livewire.asset-lifecycles.asset-lifecycles-index');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
109
Livewire/AssetMaintenances/AssetMaintenancesIndex.php
Normal file
109
Livewire/AssetMaintenances/AssetMaintenancesIndex.php
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Koneko\VuexyWarehouse\Livewire\AssetMaintenances;
|
||||||
|
|
||||||
|
use Koneko\SatCatalogs\Models\RegimenFiscal;
|
||||||
|
use Koneko\SatCatalogs\Models\UsoCfdi;
|
||||||
|
use Koneko\VuexyAdmin\Models\User;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Spatie\Permission\Models\Role;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class AssetMaintenancesIndex extends Component
|
||||||
|
{
|
||||||
|
public $tipo_persona_options, $estado_options, $status_options;
|
||||||
|
public $status_list, $status_list_class;
|
||||||
|
|
||||||
|
public $userId,
|
||||||
|
$name,
|
||||||
|
$email,
|
||||||
|
$cargo,
|
||||||
|
$rfc,
|
||||||
|
$nombre_fiscal,
|
||||||
|
$c_regimen_fiscal,
|
||||||
|
$domicilio_fiscal,
|
||||||
|
$c_uso_cfdi,
|
||||||
|
$roles,
|
||||||
|
$password,
|
||||||
|
$status,
|
||||||
|
$is_prospect,
|
||||||
|
$is_customer,
|
||||||
|
$is_provider,
|
||||||
|
$is_user;
|
||||||
|
|
||||||
|
public $statuses;
|
||||||
|
|
||||||
|
public $rows_roles = [];
|
||||||
|
public $roles_options = [];
|
||||||
|
|
||||||
|
public $uso_cfdi_options = [];
|
||||||
|
public $regimen_fiscal_options = [];
|
||||||
|
|
||||||
|
public $roles_html_select;
|
||||||
|
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
$this->tipo_persona_options = [
|
||||||
|
User::TIPO_RFC_FISICA => User::$tipoRfcList[User::TIPO_RFC_FISICA],
|
||||||
|
User::TIPO_RFC_MORAL => User::$tipoRfcList[User::TIPO_RFC_MORAL],
|
||||||
|
User::TIPO_RFC_PUBLICO => User::$tipoRfcList[User::TIPO_RFC_PUBLICO],
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->estado_options = DB::table('sat_estado')
|
||||||
|
->select('sat_estado.c_estado', 'sat_estado.nombre_del_estado')
|
||||||
|
->join('sat_codigo_postal', 'sat_estado.c_estado', '=', 'sat_codigo_postal.c_estado')
|
||||||
|
->join('users', 'users.domicilio_fiscal', '=', 'sat_codigo_postal.c_codigo_postal')
|
||||||
|
->distinct()
|
||||||
|
->orderBy('sat_estado.c_estado')
|
||||||
|
->pluck('sat_estado.nombre_del_estado', 'sat_estado.c_estado');
|
||||||
|
|
||||||
|
|
||||||
|
$this->status_options = $this->status_list = [
|
||||||
|
User::STATUS_ENABLED => User::$statusList[User::STATUS_ENABLED],
|
||||||
|
User::STATUS_DISABLED => User::$statusList[User::STATUS_DISABLED],
|
||||||
|
];
|
||||||
|
|
||||||
|
//$this->status = User::STATUS_ENABLED;
|
||||||
|
$this->status_list_class = User::$statusListClass;
|
||||||
|
|
||||||
|
$this->statuses = [
|
||||||
|
User::STATUS_ENABLED => ['title' => 'Activo', 'class' => 'badge bg-label-' . User::$statusListClass[User::STATUS_ENABLED]],
|
||||||
|
User::STATUS_DISABLED => ['title' => 'Deshabilitado', 'class' => 'badge bg-label-' . User::$statusListClass[User::STATUS_DISABLED]],
|
||||||
|
User::STATUS_REMOVED => ['title' => 'Eliminado', 'class' => 'badge bg-label-' . User::$statusListClass[User::STATUS_REMOVED]],
|
||||||
|
];
|
||||||
|
|
||||||
|
$roles = Role::whereNotIn('name', ['Patient', 'Doctor'])->get();
|
||||||
|
|
||||||
|
$this->roles_html_select = "<select id=\"UserRole\" class=\"form-select text-capitalize\"><option value=\"\"> Selecciona un rol </option>";
|
||||||
|
|
||||||
|
foreach ($roles as $role) {
|
||||||
|
$this->rows_roles[$role->name] = "<span class=\"badge bg-label-" . $role->style . " mx-1\">" . $role->name . "</span>";
|
||||||
|
|
||||||
|
if (Auth::user()->hasRole('SuperAdmin') || $role->name != 'SuperAdmin') {
|
||||||
|
$this->roles_html_select .= "<option value=\"" . $role->name . "\" class=\"text-capitalize\">" . $role->name . "</option>";
|
||||||
|
$this->roles_options[$role->name] = $role->name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->roles_html_select .= "</select>";
|
||||||
|
|
||||||
|
$this->status_options = [
|
||||||
|
User::STATUS_ENABLED => User::$statusList[User::STATUS_ENABLED],
|
||||||
|
User::STATUS_DISABLED => User::$statusList[User::STATUS_DISABLED],
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->uso_cfdi_options = UsoCfdi::selectList();
|
||||||
|
$this->regimen_fiscal_options = RegimenFiscal::selectList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('vuexy-warehouse::livewire.asset-maintenances.asset-maintenances-index');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
109
Livewire/Assets/AssetsIndex.php
Normal file
109
Livewire/Assets/AssetsIndex.php
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Koneko\VuexyWarehouse\Livewire\Assets;
|
||||||
|
|
||||||
|
use Koneko\SatCatalogs\Models\RegimenFiscal;
|
||||||
|
use Koneko\SatCatalogs\Models\UsoCfdi;
|
||||||
|
use Koneko\VuexyAdmin\Models\User;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Spatie\Permission\Models\Role;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class AssetsIndex extends Component
|
||||||
|
{
|
||||||
|
public $tipo_persona_options, $estado_options, $status_options;
|
||||||
|
public $status_list, $status_list_class;
|
||||||
|
|
||||||
|
public $userId,
|
||||||
|
$name,
|
||||||
|
$email,
|
||||||
|
$cargo,
|
||||||
|
$rfc,
|
||||||
|
$nombre_fiscal,
|
||||||
|
$c_regimen_fiscal,
|
||||||
|
$domicilio_fiscal,
|
||||||
|
$c_uso_cfdi,
|
||||||
|
$roles,
|
||||||
|
$password,
|
||||||
|
$status,
|
||||||
|
$is_prospect,
|
||||||
|
$is_customer,
|
||||||
|
$is_provider,
|
||||||
|
$is_user;
|
||||||
|
|
||||||
|
public $statuses;
|
||||||
|
|
||||||
|
public $rows_roles = [];
|
||||||
|
public $roles_options = [];
|
||||||
|
|
||||||
|
public $uso_cfdi_options = [];
|
||||||
|
public $regimen_fiscal_options = [];
|
||||||
|
|
||||||
|
public $roles_html_select;
|
||||||
|
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
$this->tipo_persona_options = [
|
||||||
|
User::TIPO_RFC_FISICA => User::$tipoRfcList[User::TIPO_RFC_FISICA],
|
||||||
|
User::TIPO_RFC_MORAL => User::$tipoRfcList[User::TIPO_RFC_MORAL],
|
||||||
|
User::TIPO_RFC_PUBLICO => User::$tipoRfcList[User::TIPO_RFC_PUBLICO],
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->estado_options = DB::table('sat_estado')
|
||||||
|
->select('sat_estado.c_estado', 'sat_estado.nombre_del_estado')
|
||||||
|
->join('sat_codigo_postal', 'sat_estado.c_estado', '=', 'sat_codigo_postal.c_estado')
|
||||||
|
->join('users', 'users.domicilio_fiscal', '=', 'sat_codigo_postal.c_codigo_postal')
|
||||||
|
->distinct()
|
||||||
|
->orderBy('sat_estado.c_estado')
|
||||||
|
->pluck('sat_estado.nombre_del_estado', 'sat_estado.c_estado');
|
||||||
|
|
||||||
|
|
||||||
|
$this->status_options = $this->status_list = [
|
||||||
|
User::STATUS_ENABLED => User::$statusList[User::STATUS_ENABLED],
|
||||||
|
User::STATUS_DISABLED => User::$statusList[User::STATUS_DISABLED],
|
||||||
|
];
|
||||||
|
|
||||||
|
//$this->status = User::STATUS_ENABLED;
|
||||||
|
$this->status_list_class = User::$statusListClass;
|
||||||
|
|
||||||
|
$this->statuses = [
|
||||||
|
User::STATUS_ENABLED => ['title' => 'Activo', 'class' => 'badge bg-label-' . User::$statusListClass[User::STATUS_ENABLED]],
|
||||||
|
User::STATUS_DISABLED => ['title' => 'Deshabilitado', 'class' => 'badge bg-label-' . User::$statusListClass[User::STATUS_DISABLED]],
|
||||||
|
User::STATUS_REMOVED => ['title' => 'Eliminado', 'class' => 'badge bg-label-' . User::$statusListClass[User::STATUS_REMOVED]],
|
||||||
|
];
|
||||||
|
|
||||||
|
$roles = Role::whereNotIn('name', ['Patient', 'Doctor'])->get();
|
||||||
|
|
||||||
|
$this->roles_html_select = "<select id=\"UserRole\" class=\"form-select text-capitalize\"><option value=\"\"> Selecciona un rol </option>";
|
||||||
|
|
||||||
|
foreach ($roles as $role) {
|
||||||
|
$this->rows_roles[$role->name] = "<span class=\"badge bg-label-" . $role->style . " mx-1\">" . $role->name . "</span>";
|
||||||
|
|
||||||
|
if (Auth::user()->hasRole('SuperAdmin') || $role->name != 'SuperAdmin') {
|
||||||
|
$this->roles_html_select .= "<option value=\"" . $role->name . "\" class=\"text-capitalize\">" . $role->name . "</option>";
|
||||||
|
$this->roles_options[$role->name] = $role->name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->roles_html_select .= "</select>";
|
||||||
|
|
||||||
|
$this->status_options = [
|
||||||
|
User::STATUS_ENABLED => User::$statusList[User::STATUS_ENABLED],
|
||||||
|
User::STATUS_DISABLED => User::$statusList[User::STATUS_DISABLED],
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->uso_cfdi_options = UsoCfdi::selectList();
|
||||||
|
$this->regimen_fiscal_options = RegimenFiscal::selectList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('vuexy-warehouse::livewire.assets.assets-index');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
49
Providers/VuexyAssetManagementServiceProvider.php
Normal file
49
Providers/VuexyAssetManagementServiceProvider.php
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Koneko\VuexyAssetManagement\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Livewire\Livewire;
|
||||||
|
use OwenIt\Auditing\AuditableObserver;
|
||||||
|
|
||||||
|
class VuexyAssetManagementServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Register any application services.
|
||||||
|
*/
|
||||||
|
public function register(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bootstrap any application services.
|
||||||
|
*/
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
// Register the module's routes
|
||||||
|
$this->loadRoutesFrom(__DIR__.'/../routes/admin.php');
|
||||||
|
|
||||||
|
|
||||||
|
// Cargar vistas del paquete
|
||||||
|
$this->loadViewsFrom(__DIR__.'/../resources/views', 'vuexy-asset-management');
|
||||||
|
|
||||||
|
|
||||||
|
// Register the migrations
|
||||||
|
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
|
||||||
|
|
||||||
|
|
||||||
|
// Registrar Livewire Components
|
||||||
|
$components = [
|
||||||
|
//'cache-functions' => CacheFunctions::class,
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($components as $alias => $component) {
|
||||||
|
Livewire::component($alias, $component);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Registrar auditoría en usuarios
|
||||||
|
//User::observe(AuditableObserver::class);
|
||||||
|
}
|
||||||
|
}
|
133
README.md
Normal file
133
README.md
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
# 🎨 Laravel Vuexy Asset Management - Vuexy Admin
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://koneko.mx" target="_blank"> <img src="https://git.koneko.mx/Koneko-ST/koneko-st/raw/branch/main/logo-images/horizontal-05.png" width="400" alt="Koneko Soluciones Tecnológicas Logo"> </a>
|
||||||
|
</p>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://koneko.mx"><img src="https://img.shields.io/badge/Website-koneko.mx-blue" alt="Sitio Web"></a>
|
||||||
|
<a href="https://packagist.org/packages/koneko/laravel-vuexy-asset-management"><img src="https://img.shields.io/packagist/v/koneko/laravel-vuexy-asset-management" alt="Latest Stable Version"></a>
|
||||||
|
<a href="https://packagist.org/packages/koneko/laravel-vuexy-asset-management"><img src="https://img.shields.io/packagist/l/koneko/laravel-vuexy-asset-management" alt="License"></a>
|
||||||
|
<a href="https://git.koneko.mx/koneko"><img src="https://img.shields.io/badge/Git%20Server-Koneko%20Git-orange" alt="Servidor Git"></a>
|
||||||
|
<a href="https://github.com/koneko-mx/laravel-vuexy-asset-management/actions/workflows/tests.yml"><img src="https://github.com/koneko-mx/laravel-vuexy-asset-management/actions/workflows/tests.yml/badge.svg" alt="Build Status"></a>
|
||||||
|
<a href="https://github.com/koneko-mx/laravel-vuexy-asset-management/issues"><img src="https://img.shields.io/github/issues/koneko/laravel-vuexy-asset-management" alt="Issues"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📌 Descripción
|
||||||
|
|
||||||
|
**Laravel Vuexy Asset Management** es un módulo diseñado para **Laravel Vuexy Admin**, proporcionando [breve descripción de la funcionalidad].
|
||||||
|
|
||||||
|
### ✨ Características:
|
||||||
|
- 🔹 Integración completa con Vuexy Admin.
|
||||||
|
- 🔹 Funcionalidad clave 1.
|
||||||
|
- 🔹 Funcionalidad clave 2.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📦 Instalación
|
||||||
|
|
||||||
|
Instalar vía **Composer**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
composer require koneko/laravel-vuexy-asset-management
|
||||||
|
```
|
||||||
|
|
||||||
|
Publicar archivos de configuración y migraciones (si aplica):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
php artisan vendor:publish --tag=laravel-vuexy-asset-management-config
|
||||||
|
php artisan migrate
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 Uso básico
|
||||||
|
|
||||||
|
```php
|
||||||
|
use Koneko\NombreLibreria\Models\Model;
|
||||||
|
|
||||||
|
$model = Model::create([
|
||||||
|
'campo1' => 'Valor',
|
||||||
|
'campo2' => 'Otro valor',
|
||||||
|
]);
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📚 Configuración adicional
|
||||||
|
|
||||||
|
Si necesitas personalizar la configuración del módulo, publica el archivo de configuración:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
php artisan vendor:publish --tag=laravel-vuexy-asset-management-config
|
||||||
|
```
|
||||||
|
|
||||||
|
Esto generará `config/laravel-vuexy-asset-management.php`, donde puedes modificar valores predeterminados.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🛠 Dependencias
|
||||||
|
|
||||||
|
Este paquete requiere las siguientes dependencias:
|
||||||
|
- Laravel 11
|
||||||
|
- `koneko/laravel-vuexy-asset-management`
|
||||||
|
- Dependencias específicas de la librería
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📦 Publicación de Assets y Configuraciones
|
||||||
|
|
||||||
|
Para publicar configuraciones y seeders:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
php artisan vendor:publish --tag=laravel-vuexy-asset-management-config
|
||||||
|
php artisan vendor:publish --tag=laravel-vuexy-asset-management-seeders
|
||||||
|
php artisan migrate --seed
|
||||||
|
```
|
||||||
|
|
||||||
|
Para publicar imágenes del tema:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
php artisan vendor:publish --tag=laravel-vuexy-asset-management-images
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🛠 Pruebas
|
||||||
|
|
||||||
|
Ejecuta los tests con:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
php artisan test
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🌍 Repositorio Principal y Sincronización
|
||||||
|
|
||||||
|
Este repositorio es una **copia sincronizada** del repositorio principal alojado en **[Tea - Koneko Git](https://git.koneko.mx/koneko/laravel-vuexy-asset-management)**.
|
||||||
|
|
||||||
|
### 🔄 Sincronización con GitHub
|
||||||
|
- **Repositorio Principal:** [git.koneko.mx](https://git.koneko.mx/koneko/laravel-vuexy-asset-management)
|
||||||
|
- **Repositorio en GitHub:** [github.com/koneko/laravel-vuexy-asset-management](https://github.com/koneko/laravel-vuexy-asset-management)
|
||||||
|
- **Los cambios pueden reflejarse primero en Tea antes de GitHub.**
|
||||||
|
|
||||||
|
### 🤝 Contribuciones
|
||||||
|
Si deseas contribuir:
|
||||||
|
1. Puedes abrir un **Issue** en [GitHub Issues](https://github.com/koneko/laravel-vuexy-asset-management/issues).
|
||||||
|
2. Para Pull Requests, **preferimos contribuciones en Tea**. Contacta a `admin@koneko.mx` para solicitar acceso.
|
||||||
|
|
||||||
|
⚠️ **Nota:** Algunos cambios pueden tardar en reflejarse en GitHub, ya que este repositorio se actualiza automáticamente desde Tea.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🏅 Licencia
|
||||||
|
|
||||||
|
Este paquete es de código abierto bajo la licencia [MIT](LICENSE).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
Hecho con ❤️ por <a href="https://koneko.mx">Koneko Soluciones Tecnológicas</a>
|
||||||
|
</p>
|
36
composer.json
Normal file
36
composer.json
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"name": "koneko/laravel-vuexy-asset-management",
|
||||||
|
"description": "Laravel Vuexy Asset Management, un modulo de administracion de activos optimizado para México.",
|
||||||
|
"keywords": ["laravel", "koneko", "framework", "vuexy", "asset", "management", "admin", "mexico"],
|
||||||
|
"type": "library",
|
||||||
|
"license": "MIT",
|
||||||
|
"require": {
|
||||||
|
"php": "^8.2",
|
||||||
|
"koneko/laravel-vuexy-warehouse": "@dev",
|
||||||
|
"laravel/framework": "^11.31"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Koneko\\VuexyAssetManagement\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"laravel": {
|
||||||
|
"providers": [
|
||||||
|
"Koneko\\VuexyAssetManagement\\Providers\\VuexyAssetManagementServiceProvider"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Arturo Corro Pacheco",
|
||||||
|
"email": "arturo@koneko.mx"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/koneko-mx/laravel-vuexy-asset-management",
|
||||||
|
"issues": "https://github.com/koneko-mx/laravel-vuexy-asset-management/issues"
|
||||||
|
},
|
||||||
|
"minimum-stability": "dev",
|
||||||
|
"prefer-stable": true
|
||||||
|
}
|
@ -0,0 +1,97 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('fixed_assets', function (Blueprint $table) {
|
||||||
|
$table->smallIncrements('id'); // ID del activo fijo
|
||||||
|
|
||||||
|
// Información básica del activo
|
||||||
|
$table->string('name', 100)->index(); // Nombre del activo
|
||||||
|
$table->string('asset_code', 50)->unique(); // Código único para identificar el activo
|
||||||
|
$table->string('description')->nullable(); // Descripción del activo
|
||||||
|
$table->string('model')->nullable(); // Modelo del activo
|
||||||
|
$table->string('manufacturer')->nullable(); // Fabricante del activo
|
||||||
|
$table->unsignedSmallInteger('year_of_manufacture')->nullable(); // Año de fabricación
|
||||||
|
$table->date('purchase_date')->nullable(); // Fecha de compra
|
||||||
|
$table->decimal('purchase_price', 10, 2)->unsigned(); // Precio de compra
|
||||||
|
$table->decimal('salvage_value', 10, 2)->unsigned()->nullable(); // Valor residual
|
||||||
|
$table->unsignedSmallInteger('useful_life_years')->nullable(); // Vida útil en años
|
||||||
|
|
||||||
|
// Cálculo de depreciación
|
||||||
|
$table->decimal('depreciation_rate', 5, 2)->unsigned(); // Tasa de depreciación
|
||||||
|
$table->decimal('depreciation_expense', 10, 2)->unsigned()->default(0); // Gastos de depreciación acumulados
|
||||||
|
|
||||||
|
// Especificaciones adicionales
|
||||||
|
$table->decimal('hourly_cost', 8, 2)->unsigned()->default(0); // Costo por hora de uso
|
||||||
|
$table->string('location')->nullable(); // Ubicación del activo
|
||||||
|
|
||||||
|
// Estado del activo
|
||||||
|
$table->unsignedTinyInteger('status')->index(); // 'available', 'in_maintenance', 'out_of_service'
|
||||||
|
|
||||||
|
// Auditoría
|
||||||
|
$table->unsignedMediumInteger('created_by')->index(); // Usuario que creó el registro
|
||||||
|
$table->unsignedMediumInteger('updated_by')->index(); // Último usuario que actualizó el registro
|
||||||
|
|
||||||
|
$table->timestamps();
|
||||||
|
|
||||||
|
// Relaciones
|
||||||
|
$table->foreign('created_by')->references('id')->on('users')->onDelete('restrict');
|
||||||
|
$table->foreign('updated_by')->references('id')->on('users')->onDelete('restrict');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Schema::create('fixed_asset_status_history', function (Blueprint $table) {
|
||||||
|
$table->smallIncrements('id'); // ID del historial
|
||||||
|
|
||||||
|
$table->unsignedSmallInteger('fixed_asset_id')->index(); // Relación con el activo fijo
|
||||||
|
$table->unsignedTinyInteger('status'); // Estado del activo (por ejemplo, disponible, en mantenimiento, fuera de servicio)
|
||||||
|
$table->date('status_change_date'); // Fecha del cambio de estado
|
||||||
|
$table->mediumText('notes')->nullable(); // Notas sobre el cambio de estado
|
||||||
|
|
||||||
|
// Auditoría
|
||||||
|
$table->unsignedMediumInteger('created_by')->index(); // Usuario que creó el registro
|
||||||
|
$table->timestamps();
|
||||||
|
|
||||||
|
// Relaciones
|
||||||
|
$table->foreign('fixed_asset_id')->references('id')->on('fixed_assets')->onDelete('cascade');
|
||||||
|
$table->foreign('created_by')->references('id')->on('users')->onDelete('restrict');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Schema::create('fixed_asset_events', function (Blueprint $table) {
|
||||||
|
$table->smallIncrements('id'); // ID del evento
|
||||||
|
|
||||||
|
$table->unsignedSmallInteger('fixed_asset_id')->index(); // Relación con el activo fijo
|
||||||
|
$table->date('event_date'); // Fecha del evento (mantenimiento, inspección fiscal, etc.)
|
||||||
|
$table->string('event_type'); // Tipo de evento (mantenimiento, auditoría, etc.)
|
||||||
|
$table->string('frequency')->nullable(); // Frecuencia del evento (por ejemplo, mensual, trimestral)
|
||||||
|
$table->mediumText('notes')->nullable(); // Notas sobre el evento
|
||||||
|
|
||||||
|
// Auditoría
|
||||||
|
$table->unsignedMediumInteger('created_by')->index(); // Usuario que creó el evento
|
||||||
|
$table->timestamps();
|
||||||
|
|
||||||
|
// Relaciones
|
||||||
|
$table->foreign('fixed_asset_id')->references('id')->on('fixed_assets')->onDelete('cascade');
|
||||||
|
$table->foreign('created_by')->references('id')->on('users')->onDelete('restrict');
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('fixed_assets_tables');
|
||||||
|
}
|
||||||
|
};
|
24
resources/views/asset-aassignments/index.blade.php
Normal file
24
resources/views/asset-aassignments/index.blade.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
@extends('vuexy-admin::layouts.vuexy.layoutMaster')
|
||||||
|
|
||||||
|
@section('title', 'Asignaciones de Activos')
|
||||||
|
|
||||||
|
<!-- Vendor Styles -->
|
||||||
|
@section('vendor-style')
|
||||||
|
@vite([
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/select2/select2.scss',
|
||||||
|
])
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
<!-- Vendor Scripts -->
|
||||||
|
@section('vendor-script')
|
||||||
|
@vite([
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/bootstrap-table/bootstrap-table.js',
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/js/components/datatables/btFormatter.js',
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/select2/select2.js',
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/jquery-validation/jquery.validate.js',
|
||||||
|
])
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
@livewire('asset-aassignments-index')
|
||||||
|
@endsection
|
24
resources/views/asset-lifecycles/index.blade.php
Normal file
24
resources/views/asset-lifecycles/index.blade.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
@extends('vuexy-admin::layouts.vuexy.layoutMaster')
|
||||||
|
|
||||||
|
@section('title', 'Control de vida util')
|
||||||
|
|
||||||
|
<!-- Vendor Styles -->
|
||||||
|
@section('vendor-style')
|
||||||
|
@vite([
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/select2/select2.scss',
|
||||||
|
])
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
<!-- Vendor Scripts -->
|
||||||
|
@section('vendor-script')
|
||||||
|
@vite([
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/bootstrap-table/bootstrap-table.js',
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/js/components/datatables/btFormatter.js',
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/select2/select2.js',
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/jquery-validation/jquery.validate.js',
|
||||||
|
])
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
@livewire('asset-lifecycles-index')
|
||||||
|
@endsection
|
24
resources/views/asset-maintenances/index.blade.php
Normal file
24
resources/views/asset-maintenances/index.blade.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
@extends('vuexy-admin::layouts.vuexy.layoutMaster')
|
||||||
|
|
||||||
|
@section('title', 'Mantenimientos de Activos')
|
||||||
|
|
||||||
|
<!-- Vendor Styles -->
|
||||||
|
@section('vendor-style')
|
||||||
|
@vite([
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/select2/select2.scss',
|
||||||
|
])
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
<!-- Vendor Scripts -->
|
||||||
|
@section('vendor-script')
|
||||||
|
@vite([
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/bootstrap-table/bootstrap-table.js',
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/js/components/datatables/btFormatter.js',
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/select2/select2.js',
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/jquery-validation/jquery.validate.js',
|
||||||
|
])
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
@livewire('asset-maintenances-index')
|
||||||
|
@endsection
|
24
resources/views/assets/index.blade.php
Normal file
24
resources/views/assets/index.blade.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
@extends('vuexy-admin::layouts.vuexy.layoutMaster')
|
||||||
|
|
||||||
|
@section('title', 'Activos registrados')
|
||||||
|
|
||||||
|
<!-- Vendor Styles -->
|
||||||
|
@section('vendor-style')
|
||||||
|
@vite([
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/select2/select2.scss',
|
||||||
|
])
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
<!-- Vendor Scripts -->
|
||||||
|
@section('vendor-script')
|
||||||
|
@vite([
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/bootstrap-table/bootstrap-table.js',
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/js/components/datatables/btFormatter.js',
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/select2/select2.js',
|
||||||
|
'vendor/koneko/laravel-vuexy-admin/resources/assets/vendor/libs/jquery-validation/jquery.validate.js',
|
||||||
|
])
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
@livewire('assets-index')
|
||||||
|
@endsection
|
@ -0,0 +1,516 @@
|
|||||||
|
<section id="crm-warehouses-index">
|
||||||
|
<div class="crm-warehouses-index alert-errors"></div>
|
||||||
|
<div wire:ignore>
|
||||||
|
<div class="query-filters" id="toolbar">
|
||||||
|
<div class="d-flex flex-wrap">
|
||||||
|
<div class="pt-1 pr-2 pb-1" style="min-width: 175px; max-width: 225px">
|
||||||
|
<button data-bs-toggle='offcanvas' data-bs-target='#offcanvasUser' class="btn btn-primary waves-effect waves-light">Agregar almacén</button>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#accordionFiltrado" aria-expanded="false" aria-controls="accordionFiltrado">
|
||||||
|
Filtrado
|
||||||
|
</button>
|
||||||
|
<div class="px-2 pt-1">
|
||||||
|
<button class="btn btn-label-secondary waves-effect py-3 btn-refresh" disabled><i class="fa-solid fa-rotate"></i></button>
|
||||||
|
</div>
|
||||||
|
<div class="pr-2" style="width: 60px;">
|
||||||
|
<a href="javascript:void(0)" class="clear-filters">Limpiar Filtrado</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="bt-warehouses"></table>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
@section('page-script')
|
||||||
|
<script>
|
||||||
|
const store_route = '{{ route('admin.core.users.store') }}',
|
||||||
|
route_show = '{{ route('admin.inventory.warehouse.show', ['warehouse' => '~warehouse~']) }}',
|
||||||
|
route_destroy = '{{ route('admin.inventory.warehouse.destroy', ['warehouse' => '~warehouse~']) }}',
|
||||||
|
statusList = {!! json_encode($status_list) !!},
|
||||||
|
statusIntCatalogCss = {!! json_encode($status_list_class) !!};
|
||||||
|
|
||||||
|
var btt_height;
|
||||||
|
|
||||||
|
|
||||||
|
// BootstrapTable Petición AJAX
|
||||||
|
function ajaxRequest(params) {
|
||||||
|
let url = '{{ url()->current() }}' +
|
||||||
|
'?' +
|
||||||
|
$.param(params.data) +
|
||||||
|
'&' +
|
||||||
|
$('.query-filters :input').serialize();
|
||||||
|
|
||||||
|
$.get(url).then(function (res) {
|
||||||
|
params.success(res)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// BootstrapTable Formatter
|
||||||
|
function userAvatarFormatter(value, row, index) {
|
||||||
|
if(row.id){
|
||||||
|
let show_href = route_show.replace('~warehouseo~', row.id);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'<div class="d-flex justify-content-start align-items-center user-name">',
|
||||||
|
'<div class="avatar-wrapper">',
|
||||||
|
'<div class="avatar avatar-sm me-4">' +
|
||||||
|
'<img src="' + row.profile_photo_url + '" alt="Avatar" class="rounded-circle">' +
|
||||||
|
'</div>',
|
||||||
|
'</div>',
|
||||||
|
'<div class="d-flex flex-column">',
|
||||||
|
'<a href="' + show_href + '" class="text-heading text-truncate"><span class="fw-medium">' + row.name + '</span></a>',
|
||||||
|
'<small>' + row.email + '</small>',
|
||||||
|
'</div>',
|
||||||
|
'</div>',
|
||||||
|
].join('')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function uidFormatter(value, row, index) {
|
||||||
|
if(row.id){
|
||||||
|
let show_href = route_show.replace('~warehouseo~', row.id);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'<div class="d-flex align-items-center justify-content-center">',
|
||||||
|
'<a href="' + show_href + '" class="whitespace-nowrap" title="Ver warehouseo"> ' + row.id + '</a>',
|
||||||
|
@can('crm.warehouses.update')
|
||||||
|
'<a href="javascript:;" class="btn btn-icon btn-text-secondary waves-effect waves-light rounded-pill dropdown-toggle hide-arrow" data-bs-toggle="dropdown"><i class="ti ti-dots-vertical ti-md"></i></a>',
|
||||||
|
'<div class="dropdown-menu dropdown-menu-end m-0">',
|
||||||
|
'<a href="javascript:deleteRow(' + row.id + ');" class="dropdown-item delete-record">Eliminar</a>',
|
||||||
|
'</div>',
|
||||||
|
@endcan
|
||||||
|
'</div>'
|
||||||
|
].join('')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// BootstrapTable Init
|
||||||
|
function initTable(table) {
|
||||||
|
$(table)
|
||||||
|
.bootstrapTable('destroy')
|
||||||
|
.bootstrapTable({
|
||||||
|
height: btt_height,
|
||||||
|
locale: 'es-MX',
|
||||||
|
ajax: "ajaxRequest",
|
||||||
|
toolbar: "#toolbar",
|
||||||
|
search: true,
|
||||||
|
showColumns: true,
|
||||||
|
showColumnsToggleAll: true,
|
||||||
|
showExport: true,
|
||||||
|
showFullscreen: true,
|
||||||
|
showPaginationSwitch: true,
|
||||||
|
showRefresh: true,
|
||||||
|
showToggle: true,
|
||||||
|
clickToSelect: true,
|
||||||
|
minimumCountColumns: 4,
|
||||||
|
fixedColumns: true,
|
||||||
|
fixedNumber: 1,
|
||||||
|
idField: "id",
|
||||||
|
pagination: true,
|
||||||
|
pageList: [10, 25, 50, 100, 500],
|
||||||
|
sidePagination: "server",
|
||||||
|
exportTypes: ['csv', 'txt', 'excel'],
|
||||||
|
exportOptions: {
|
||||||
|
fileName: 'warehouseos',
|
||||||
|
},
|
||||||
|
sortName: 'users.id',
|
||||||
|
sortOrder: 'desc',
|
||||||
|
mobileResponsive: true,
|
||||||
|
cookie: true,
|
||||||
|
resizable: true,
|
||||||
|
cookieIdTable:"crm-warehouses-index",
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: 'UID',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
sortName: 'users.id',
|
||||||
|
switchable: false,
|
||||||
|
formatter: uidFormatter
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'name',
|
||||||
|
title: 'Nombre',
|
||||||
|
formatter: userAvatarFormatter,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'email',
|
||||||
|
title: 'Correo electrónico',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tipo_persona',
|
||||||
|
title: 'Tipo persona',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.tipoPersona,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'rfc',
|
||||||
|
title: 'RFC',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'nombre_fiscal',
|
||||||
|
title: 'Nombre fiscal',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'c_regimen_fiscal',
|
||||||
|
title: 'Regimen fiscal',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
formatter: window.btFormatter.regimenFiscal,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'domicilio_fiscal',
|
||||||
|
title: 'Domicilio fiscal',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'estado',
|
||||||
|
title: 'Estado',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'municipio',
|
||||||
|
title: 'Municipio',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'localidad',
|
||||||
|
title: 'Localidad',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'c_uso_cfdi',
|
||||||
|
title: 'Uso de CFDI',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
formatter: window.btFormatter.usoCfdi,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'cargo',
|
||||||
|
title: 'Cargo',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'is_prospect',
|
||||||
|
title: 'Es prospecto',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'is_customer',
|
||||||
|
title: 'Es cliente',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'is_provider',
|
||||||
|
title: 'Es proveedor',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'is_user',
|
||||||
|
title: 'Es usuario',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'status',
|
||||||
|
title: 'Estado',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.status,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'created_at',
|
||||||
|
title: 'Creado ',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'created_by_name',
|
||||||
|
title: 'Creado por',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
sortName: 'created_by_name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'updated_at',
|
||||||
|
title: 'Modificado ',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleSections() {
|
||||||
|
const isProspect = $('#is_prospect').is(':checked');
|
||||||
|
const isCustomer = $('#is_customer').is(':checked');
|
||||||
|
const isProvider = $('#is_provider').is(':checked');
|
||||||
|
const isUser = $('#is_user').is(':checked');
|
||||||
|
|
||||||
|
$('.div-sat').toggle(isCustomer || isProvider);
|
||||||
|
$('.div-sat-customer').toggle(isCustomer);
|
||||||
|
$('.div-user-auth').toggle(isCustomer || isUser);
|
||||||
|
$('.div-roles').toggle(isUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleCheckboxes(status) {
|
||||||
|
const isDisabled = status == 1;
|
||||||
|
$('#is_prospect, #is_customer, #is_provider, #is_user').prop('disabled', isDisabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
load_js_form = () => {
|
||||||
|
$('#userForm .select2')
|
||||||
|
.each(function() {
|
||||||
|
var $this = $(this)
|
||||||
|
|
||||||
|
$this.wrap('<div class="position-relative"></div>')
|
||||||
|
|
||||||
|
$this.select2({
|
||||||
|
dropdownAutoWidth: true,
|
||||||
|
width: '100%',
|
||||||
|
dropdownParent: $this.parent()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Evento para los checkboxes
|
||||||
|
$('#is_prospect, #is_customer, #is_provider, #is_user').on('change', toggleSections);
|
||||||
|
|
||||||
|
// Evento para el select de estado
|
||||||
|
$('.div-status').on('change', 'select[name="status"]', function() {
|
||||||
|
toggleCheckboxes($(this).val());
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Previo de imagenes
|
||||||
|
document.getElementById("photo").addEventListener('change', updatePreviewImage);
|
||||||
|
|
||||||
|
|
||||||
|
// Reset form
|
||||||
|
$("#userForm")
|
||||||
|
.on('reset', function(){
|
||||||
|
var form = $("#userForm");
|
||||||
|
|
||||||
|
form.validate().resetForm();
|
||||||
|
|
||||||
|
setTimeout(function(){
|
||||||
|
$('#roles').trigger('change');
|
||||||
|
|
||||||
|
toggleSections();
|
||||||
|
}, 250)
|
||||||
|
|
||||||
|
$('#user-image').prop("src", "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
|
||||||
|
|
||||||
|
$('#userForm .alert-errors').html('');
|
||||||
|
|
||||||
|
$('.pdf-dropzone-div').show();
|
||||||
|
|
||||||
|
$("#pdf-dropzone").removeAllFiles(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$("#userForm")
|
||||||
|
.validate({
|
||||||
|
errorClass: 'error',
|
||||||
|
highlight: function(element, errorClass, validClass) {
|
||||||
|
// Agrega la clase de error a la fila (contenedor del campo)
|
||||||
|
$(element).closest('.mb-3').addClass('has-error');
|
||||||
|
},
|
||||||
|
unhighlight: function(element, errorClass, validClass) {
|
||||||
|
// Elimina la clase de error de la fila (contenedor del campo)
|
||||||
|
$(element).closest('.mb-3').removeClass('has-error');
|
||||||
|
},
|
||||||
|
errorPlacement: function(error, element) {
|
||||||
|
// Controla dónde se colocan los mensajes de error
|
||||||
|
error.appendTo(element.closest('.mb-3').find('.error-message'));
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
name: {
|
||||||
|
required: true,
|
||||||
|
minlength: 5
|
||||||
|
},
|
||||||
|
email: {
|
||||||
|
required: true,
|
||||||
|
email: true
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
required: function(element) {
|
||||||
|
return !$("#userForm input[name=id]").val() && ($('#is_user').is(':checked') || $('#is_customer').is(':checked'));
|
||||||
|
},
|
||||||
|
minlength: 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
name: {
|
||||||
|
required: "Por favor ingrese su nombre completo",
|
||||||
|
minlength: "El nombre completo debe tener al menos 8 caracteres"
|
||||||
|
},
|
||||||
|
email: {
|
||||||
|
required: "Por favor ingrese su correo electrónico",
|
||||||
|
email: "El valor no es una dirección de correo válida"
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
required: "La contraseña es obligatoria para nuevos usuarios",
|
||||||
|
minlength: "La contraseña debe tener al menos 6 caracteres"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitHandler: function(form, event) {
|
||||||
|
// Evita que el formulario se envíe automáticamente
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
var form = $("#userForm")[0],
|
||||||
|
data = new FormData(form);
|
||||||
|
|
||||||
|
$('#userForm :input').prop('disabled', true);
|
||||||
|
$('#userForm .alert-errors').html('');
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: store_route,
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||||
|
},
|
||||||
|
data: data,
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
cache: false,
|
||||||
|
timeout: 3000,
|
||||||
|
success: function(data) {
|
||||||
|
$('#userForm :input').prop('disabled', false);
|
||||||
|
|
||||||
|
if (data.errors) {
|
||||||
|
$('#userForm .alert-errors').html('<div class="alert alert-danger alert-dismissible fade show" role="alert">' +
|
||||||
|
'<div class="alert-body">' + data.errors + '</div>' +
|
||||||
|
'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>' +
|
||||||
|
'</div>');
|
||||||
|
|
||||||
|
} else {
|
||||||
|
let $usersIndexAlert = $('.crm-warehouses-index.alert-errors');
|
||||||
|
|
||||||
|
$usersIndexAlert.html('<div class="alert alert-success alert-dismissible fade show" role="alert">' +
|
||||||
|
'<div class="alert-body">' +
|
||||||
|
'<p class="mb-0"><strong>' + data.success + '</strong></p>' +
|
||||||
|
'</div>' +
|
||||||
|
'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>' +
|
||||||
|
'</div>');
|
||||||
|
|
||||||
|
$('#userForm button[type=reset]').trigger('click');
|
||||||
|
$('#toolbar .clear-filters').trigger('click');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(e) {
|
||||||
|
$('#userForm :input').prop('disabled', false);
|
||||||
|
|
||||||
|
$('#userForm .alert-errors').html('<div class="alert alert-danger alert-dismissible fade show" role="alert">' +
|
||||||
|
'<div class="alert-body">' + e.responseJSON.message + '</div>' +
|
||||||
|
'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>' +
|
||||||
|
'</div>');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Inicializar el estado al cargar la página
|
||||||
|
toggleSections();
|
||||||
|
toggleCheckboxes($('select[name="status"]').val());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Previo de imagen de perfil
|
||||||
|
updatePreviewImage = (event) => {
|
||||||
|
var file = event.target.files[0],
|
||||||
|
reader = new FileReader();
|
||||||
|
|
||||||
|
reader.onload = event => {
|
||||||
|
document.getElementById('user-image').setAttribute('src', event.target.result);
|
||||||
|
};
|
||||||
|
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
$(document).ready(function() {
|
||||||
|
var $table = $('#bt-warehouses'),
|
||||||
|
$btnRefresh = $('#toolbar .btn-refresh'),
|
||||||
|
$clearFilters = $('a.clear-filters');
|
||||||
|
|
||||||
|
var btt_rest_height = 220,
|
||||||
|
btt_min_height = 600;
|
||||||
|
|
||||||
|
btt_height = (window.innerHeight - btt_rest_height) < btt_min_height?
|
||||||
|
btt_height:
|
||||||
|
window.innerHeight - btt_rest_height;
|
||||||
|
|
||||||
|
var offcanvasElement = document.getElementById('offcanvasUser'),
|
||||||
|
offcanvasUser = new bootstrap.Offcanvas(offcanvasElement);
|
||||||
|
|
||||||
|
const refreshButton = document.querySelector('.btn-refresh');
|
||||||
|
const inputs = document.querySelectorAll('#toolbar input, #toolbar select');
|
||||||
|
|
||||||
|
inputs.forEach(input => {
|
||||||
|
input.addEventListener('change', () => {
|
||||||
|
refreshButton.disabled = false;
|
||||||
|
refreshButton.classList.remove('btn-label-secondary');
|
||||||
|
refreshButton.classList.add('btn-label-success');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Button Refresh
|
||||||
|
$btnRefresh
|
||||||
|
.on('click', () => {
|
||||||
|
$table.bootstrapTable('refresh');
|
||||||
|
refreshButton.disabled = true;
|
||||||
|
refreshButton.classList.remove('btn-label-success');
|
||||||
|
refreshButton.classList.add('btn-label-secondary');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Button clear filters
|
||||||
|
$clearFilters
|
||||||
|
.on('click', () => {
|
||||||
|
$table.bootstrapTable('resetSearch', ''); // Inicializa la búsqueda con cadena vacía
|
||||||
|
refreshButton.disabled = true;
|
||||||
|
refreshButton.classList.remove('btn-label-success');
|
||||||
|
refreshButton.classList.add('btn-label-secondary');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
initTable('#bt-warehouses'); // Una vez que todos los scripts estén cargados, inicializa Bootstrap Table
|
||||||
|
|
||||||
|
|
||||||
|
load_js_form();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endsection
|
@ -0,0 +1,516 @@
|
|||||||
|
<section id="crm-warehouses-index">
|
||||||
|
<div class="crm-warehouses-index alert-errors"></div>
|
||||||
|
<div wire:ignore>
|
||||||
|
<div class="query-filters" id="toolbar">
|
||||||
|
<div class="d-flex flex-wrap">
|
||||||
|
<div class="pt-1 pr-2 pb-1" style="min-width: 175px; max-width: 225px">
|
||||||
|
<button data-bs-toggle='offcanvas' data-bs-target='#offcanvasUser' class="btn btn-primary waves-effect waves-light">Agregar almacén</button>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#accordionFiltrado" aria-expanded="false" aria-controls="accordionFiltrado">
|
||||||
|
Filtrado
|
||||||
|
</button>
|
||||||
|
<div class="px-2 pt-1">
|
||||||
|
<button class="btn btn-label-secondary waves-effect py-3 btn-refresh" disabled><i class="fa-solid fa-rotate"></i></button>
|
||||||
|
</div>
|
||||||
|
<div class="pr-2" style="width: 60px;">
|
||||||
|
<a href="javascript:void(0)" class="clear-filters">Limpiar Filtrado</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="bt-warehouses"></table>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
@section('page-script')
|
||||||
|
<script>
|
||||||
|
const store_route = '{{ route('admin.core.users.store') }}',
|
||||||
|
route_show = '{{ route('admin.inventory.warehouse.show', ['warehouse' => '~warehouse~']) }}',
|
||||||
|
route_destroy = '{{ route('admin.inventory.warehouse.destroy', ['warehouse' => '~warehouse~']) }}',
|
||||||
|
statusList = {!! json_encode($status_list) !!},
|
||||||
|
statusIntCatalogCss = {!! json_encode($status_list_class) !!};
|
||||||
|
|
||||||
|
var btt_height;
|
||||||
|
|
||||||
|
|
||||||
|
// BootstrapTable Petición AJAX
|
||||||
|
function ajaxRequest(params) {
|
||||||
|
let url = '{{ url()->current() }}' +
|
||||||
|
'?' +
|
||||||
|
$.param(params.data) +
|
||||||
|
'&' +
|
||||||
|
$('.query-filters :input').serialize();
|
||||||
|
|
||||||
|
$.get(url).then(function (res) {
|
||||||
|
params.success(res)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// BootstrapTable Formatter
|
||||||
|
function userAvatarFormatter(value, row, index) {
|
||||||
|
if(row.id){
|
||||||
|
let show_href = route_show.replace('~warehouseo~', row.id);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'<div class="d-flex justify-content-start align-items-center user-name">',
|
||||||
|
'<div class="avatar-wrapper">',
|
||||||
|
'<div class="avatar avatar-sm me-4">' +
|
||||||
|
'<img src="' + row.profile_photo_url + '" alt="Avatar" class="rounded-circle">' +
|
||||||
|
'</div>',
|
||||||
|
'</div>',
|
||||||
|
'<div class="d-flex flex-column">',
|
||||||
|
'<a href="' + show_href + '" class="text-heading text-truncate"><span class="fw-medium">' + row.name + '</span></a>',
|
||||||
|
'<small>' + row.email + '</small>',
|
||||||
|
'</div>',
|
||||||
|
'</div>',
|
||||||
|
].join('')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function uidFormatter(value, row, index) {
|
||||||
|
if(row.id){
|
||||||
|
let show_href = route_show.replace('~warehouseo~', row.id);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'<div class="d-flex align-items-center justify-content-center">',
|
||||||
|
'<a href="' + show_href + '" class="whitespace-nowrap" title="Ver warehouseo"> ' + row.id + '</a>',
|
||||||
|
@can('crm.warehouses.update')
|
||||||
|
'<a href="javascript:;" class="btn btn-icon btn-text-secondary waves-effect waves-light rounded-pill dropdown-toggle hide-arrow" data-bs-toggle="dropdown"><i class="ti ti-dots-vertical ti-md"></i></a>',
|
||||||
|
'<div class="dropdown-menu dropdown-menu-end m-0">',
|
||||||
|
'<a href="javascript:deleteRow(' + row.id + ');" class="dropdown-item delete-record">Eliminar</a>',
|
||||||
|
'</div>',
|
||||||
|
@endcan
|
||||||
|
'</div>'
|
||||||
|
].join('')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// BootstrapTable Init
|
||||||
|
function initTable(table) {
|
||||||
|
$(table)
|
||||||
|
.bootstrapTable('destroy')
|
||||||
|
.bootstrapTable({
|
||||||
|
height: btt_height,
|
||||||
|
locale: 'es-MX',
|
||||||
|
ajax: "ajaxRequest",
|
||||||
|
toolbar: "#toolbar",
|
||||||
|
search: true,
|
||||||
|
showColumns: true,
|
||||||
|
showColumnsToggleAll: true,
|
||||||
|
showExport: true,
|
||||||
|
showFullscreen: true,
|
||||||
|
showPaginationSwitch: true,
|
||||||
|
showRefresh: true,
|
||||||
|
showToggle: true,
|
||||||
|
clickToSelect: true,
|
||||||
|
minimumCountColumns: 4,
|
||||||
|
fixedColumns: true,
|
||||||
|
fixedNumber: 1,
|
||||||
|
idField: "id",
|
||||||
|
pagination: true,
|
||||||
|
pageList: [10, 25, 50, 100, 500],
|
||||||
|
sidePagination: "server",
|
||||||
|
exportTypes: ['csv', 'txt', 'excel'],
|
||||||
|
exportOptions: {
|
||||||
|
fileName: 'warehouseos',
|
||||||
|
},
|
||||||
|
sortName: 'users.id',
|
||||||
|
sortOrder: 'desc',
|
||||||
|
mobileResponsive: true,
|
||||||
|
cookie: true,
|
||||||
|
resizable: true,
|
||||||
|
cookieIdTable:"crm-warehouses-index",
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: 'UID',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
sortName: 'users.id',
|
||||||
|
switchable: false,
|
||||||
|
formatter: uidFormatter
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'name',
|
||||||
|
title: 'Nombre',
|
||||||
|
formatter: userAvatarFormatter,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'email',
|
||||||
|
title: 'Correo electrónico',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tipo_persona',
|
||||||
|
title: 'Tipo persona',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.tipoPersona,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'rfc',
|
||||||
|
title: 'RFC',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'nombre_fiscal',
|
||||||
|
title: 'Nombre fiscal',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'c_regimen_fiscal',
|
||||||
|
title: 'Regimen fiscal',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
formatter: window.btFormatter.regimenFiscal,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'domicilio_fiscal',
|
||||||
|
title: 'Domicilio fiscal',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'estado',
|
||||||
|
title: 'Estado',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'municipio',
|
||||||
|
title: 'Municipio',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'localidad',
|
||||||
|
title: 'Localidad',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'c_uso_cfdi',
|
||||||
|
title: 'Uso de CFDI',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
formatter: window.btFormatter.usoCfdi,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'cargo',
|
||||||
|
title: 'Cargo',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'is_prospect',
|
||||||
|
title: 'Es prospecto',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'is_customer',
|
||||||
|
title: 'Es cliente',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'is_provider',
|
||||||
|
title: 'Es proveedor',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'is_user',
|
||||||
|
title: 'Es usuario',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'status',
|
||||||
|
title: 'Estado',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.status,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'created_at',
|
||||||
|
title: 'Creado ',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'created_by_name',
|
||||||
|
title: 'Creado por',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
sortName: 'created_by_name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'updated_at',
|
||||||
|
title: 'Modificado ',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleSections() {
|
||||||
|
const isProspect = $('#is_prospect').is(':checked');
|
||||||
|
const isCustomer = $('#is_customer').is(':checked');
|
||||||
|
const isProvider = $('#is_provider').is(':checked');
|
||||||
|
const isUser = $('#is_user').is(':checked');
|
||||||
|
|
||||||
|
$('.div-sat').toggle(isCustomer || isProvider);
|
||||||
|
$('.div-sat-customer').toggle(isCustomer);
|
||||||
|
$('.div-user-auth').toggle(isCustomer || isUser);
|
||||||
|
$('.div-roles').toggle(isUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleCheckboxes(status) {
|
||||||
|
const isDisabled = status == 1;
|
||||||
|
$('#is_prospect, #is_customer, #is_provider, #is_user').prop('disabled', isDisabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
load_js_form = () => {
|
||||||
|
$('#userForm .select2')
|
||||||
|
.each(function() {
|
||||||
|
var $this = $(this)
|
||||||
|
|
||||||
|
$this.wrap('<div class="position-relative"></div>')
|
||||||
|
|
||||||
|
$this.select2({
|
||||||
|
dropdownAutoWidth: true,
|
||||||
|
width: '100%',
|
||||||
|
dropdownParent: $this.parent()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Evento para los checkboxes
|
||||||
|
$('#is_prospect, #is_customer, #is_provider, #is_user').on('change', toggleSections);
|
||||||
|
|
||||||
|
// Evento para el select de estado
|
||||||
|
$('.div-status').on('change', 'select[name="status"]', function() {
|
||||||
|
toggleCheckboxes($(this).val());
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Previo de imagenes
|
||||||
|
document.getElementById("photo").addEventListener('change', updatePreviewImage);
|
||||||
|
|
||||||
|
|
||||||
|
// Reset form
|
||||||
|
$("#userForm")
|
||||||
|
.on('reset', function(){
|
||||||
|
var form = $("#userForm");
|
||||||
|
|
||||||
|
form.validate().resetForm();
|
||||||
|
|
||||||
|
setTimeout(function(){
|
||||||
|
$('#roles').trigger('change');
|
||||||
|
|
||||||
|
toggleSections();
|
||||||
|
}, 250)
|
||||||
|
|
||||||
|
$('#user-image').prop("src", "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
|
||||||
|
|
||||||
|
$('#userForm .alert-errors').html('');
|
||||||
|
|
||||||
|
$('.pdf-dropzone-div').show();
|
||||||
|
|
||||||
|
$("#pdf-dropzone").removeAllFiles(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$("#userForm")
|
||||||
|
.validate({
|
||||||
|
errorClass: 'error',
|
||||||
|
highlight: function(element, errorClass, validClass) {
|
||||||
|
// Agrega la clase de error a la fila (contenedor del campo)
|
||||||
|
$(element).closest('.mb-3').addClass('has-error');
|
||||||
|
},
|
||||||
|
unhighlight: function(element, errorClass, validClass) {
|
||||||
|
// Elimina la clase de error de la fila (contenedor del campo)
|
||||||
|
$(element).closest('.mb-3').removeClass('has-error');
|
||||||
|
},
|
||||||
|
errorPlacement: function(error, element) {
|
||||||
|
// Controla dónde se colocan los mensajes de error
|
||||||
|
error.appendTo(element.closest('.mb-3').find('.error-message'));
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
name: {
|
||||||
|
required: true,
|
||||||
|
minlength: 5
|
||||||
|
},
|
||||||
|
email: {
|
||||||
|
required: true,
|
||||||
|
email: true
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
required: function(element) {
|
||||||
|
return !$("#userForm input[name=id]").val() && ($('#is_user').is(':checked') || $('#is_customer').is(':checked'));
|
||||||
|
},
|
||||||
|
minlength: 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
name: {
|
||||||
|
required: "Por favor ingrese su nombre completo",
|
||||||
|
minlength: "El nombre completo debe tener al menos 8 caracteres"
|
||||||
|
},
|
||||||
|
email: {
|
||||||
|
required: "Por favor ingrese su correo electrónico",
|
||||||
|
email: "El valor no es una dirección de correo válida"
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
required: "La contraseña es obligatoria para nuevos usuarios",
|
||||||
|
minlength: "La contraseña debe tener al menos 6 caracteres"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitHandler: function(form, event) {
|
||||||
|
// Evita que el formulario se envíe automáticamente
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
var form = $("#userForm")[0],
|
||||||
|
data = new FormData(form);
|
||||||
|
|
||||||
|
$('#userForm :input').prop('disabled', true);
|
||||||
|
$('#userForm .alert-errors').html('');
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: store_route,
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||||
|
},
|
||||||
|
data: data,
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
cache: false,
|
||||||
|
timeout: 3000,
|
||||||
|
success: function(data) {
|
||||||
|
$('#userForm :input').prop('disabled', false);
|
||||||
|
|
||||||
|
if (data.errors) {
|
||||||
|
$('#userForm .alert-errors').html('<div class="alert alert-danger alert-dismissible fade show" role="alert">' +
|
||||||
|
'<div class="alert-body">' + data.errors + '</div>' +
|
||||||
|
'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>' +
|
||||||
|
'</div>');
|
||||||
|
|
||||||
|
} else {
|
||||||
|
let $usersIndexAlert = $('.crm-warehouses-index.alert-errors');
|
||||||
|
|
||||||
|
$usersIndexAlert.html('<div class="alert alert-success alert-dismissible fade show" role="alert">' +
|
||||||
|
'<div class="alert-body">' +
|
||||||
|
'<p class="mb-0"><strong>' + data.success + '</strong></p>' +
|
||||||
|
'</div>' +
|
||||||
|
'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>' +
|
||||||
|
'</div>');
|
||||||
|
|
||||||
|
$('#userForm button[type=reset]').trigger('click');
|
||||||
|
$('#toolbar .clear-filters').trigger('click');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(e) {
|
||||||
|
$('#userForm :input').prop('disabled', false);
|
||||||
|
|
||||||
|
$('#userForm .alert-errors').html('<div class="alert alert-danger alert-dismissible fade show" role="alert">' +
|
||||||
|
'<div class="alert-body">' + e.responseJSON.message + '</div>' +
|
||||||
|
'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>' +
|
||||||
|
'</div>');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Inicializar el estado al cargar la página
|
||||||
|
toggleSections();
|
||||||
|
toggleCheckboxes($('select[name="status"]').val());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Previo de imagen de perfil
|
||||||
|
updatePreviewImage = (event) => {
|
||||||
|
var file = event.target.files[0],
|
||||||
|
reader = new FileReader();
|
||||||
|
|
||||||
|
reader.onload = event => {
|
||||||
|
document.getElementById('user-image').setAttribute('src', event.target.result);
|
||||||
|
};
|
||||||
|
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
$(document).ready(function() {
|
||||||
|
var $table = $('#bt-warehouses'),
|
||||||
|
$btnRefresh = $('#toolbar .btn-refresh'),
|
||||||
|
$clearFilters = $('a.clear-filters');
|
||||||
|
|
||||||
|
var btt_rest_height = 220,
|
||||||
|
btt_min_height = 600;
|
||||||
|
|
||||||
|
btt_height = (window.innerHeight - btt_rest_height) < btt_min_height?
|
||||||
|
btt_height:
|
||||||
|
window.innerHeight - btt_rest_height;
|
||||||
|
|
||||||
|
var offcanvasElement = document.getElementById('offcanvasUser'),
|
||||||
|
offcanvasUser = new bootstrap.Offcanvas(offcanvasElement);
|
||||||
|
|
||||||
|
const refreshButton = document.querySelector('.btn-refresh');
|
||||||
|
const inputs = document.querySelectorAll('#toolbar input, #toolbar select');
|
||||||
|
|
||||||
|
inputs.forEach(input => {
|
||||||
|
input.addEventListener('change', () => {
|
||||||
|
refreshButton.disabled = false;
|
||||||
|
refreshButton.classList.remove('btn-label-secondary');
|
||||||
|
refreshButton.classList.add('btn-label-success');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Button Refresh
|
||||||
|
$btnRefresh
|
||||||
|
.on('click', () => {
|
||||||
|
$table.bootstrapTable('refresh');
|
||||||
|
refreshButton.disabled = true;
|
||||||
|
refreshButton.classList.remove('btn-label-success');
|
||||||
|
refreshButton.classList.add('btn-label-secondary');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Button clear filters
|
||||||
|
$clearFilters
|
||||||
|
.on('click', () => {
|
||||||
|
$table.bootstrapTable('resetSearch', ''); // Inicializa la búsqueda con cadena vacía
|
||||||
|
refreshButton.disabled = true;
|
||||||
|
refreshButton.classList.remove('btn-label-success');
|
||||||
|
refreshButton.classList.add('btn-label-secondary');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
initTable('#bt-warehouses'); // Una vez que todos los scripts estén cargados, inicializa Bootstrap Table
|
||||||
|
|
||||||
|
|
||||||
|
load_js_form();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endsection
|
@ -0,0 +1,516 @@
|
|||||||
|
<section id="crm-warehouses-index">
|
||||||
|
<div class="crm-warehouses-index alert-errors"></div>
|
||||||
|
<div wire:ignore>
|
||||||
|
<div class="query-filters" id="toolbar">
|
||||||
|
<div class="d-flex flex-wrap">
|
||||||
|
<div class="pt-1 pr-2 pb-1" style="min-width: 175px; max-width: 225px">
|
||||||
|
<button data-bs-toggle='offcanvas' data-bs-target='#offcanvasUser' class="btn btn-primary waves-effect waves-light">Agregar almacén</button>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#accordionFiltrado" aria-expanded="false" aria-controls="accordionFiltrado">
|
||||||
|
Filtrado
|
||||||
|
</button>
|
||||||
|
<div class="px-2 pt-1">
|
||||||
|
<button class="btn btn-label-secondary waves-effect py-3 btn-refresh" disabled><i class="fa-solid fa-rotate"></i></button>
|
||||||
|
</div>
|
||||||
|
<div class="pr-2" style="width: 60px;">
|
||||||
|
<a href="javascript:void(0)" class="clear-filters">Limpiar Filtrado</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="bt-warehouses"></table>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
@section('page-script')
|
||||||
|
<script>
|
||||||
|
const store_route = '{{ route('admin.core.users.store') }}',
|
||||||
|
route_show = '{{ route('admin.inventory.warehouse.show', ['warehouse' => '~warehouse~']) }}',
|
||||||
|
route_destroy = '{{ route('admin.inventory.warehouse.destroy', ['warehouse' => '~warehouse~']) }}',
|
||||||
|
statusList = {!! json_encode($status_list) !!},
|
||||||
|
statusIntCatalogCss = {!! json_encode($status_list_class) !!};
|
||||||
|
|
||||||
|
var btt_height;
|
||||||
|
|
||||||
|
|
||||||
|
// BootstrapTable Petición AJAX
|
||||||
|
function ajaxRequest(params) {
|
||||||
|
let url = '{{ url()->current() }}' +
|
||||||
|
'?' +
|
||||||
|
$.param(params.data) +
|
||||||
|
'&' +
|
||||||
|
$('.query-filters :input').serialize();
|
||||||
|
|
||||||
|
$.get(url).then(function (res) {
|
||||||
|
params.success(res)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// BootstrapTable Formatter
|
||||||
|
function userAvatarFormatter(value, row, index) {
|
||||||
|
if(row.id){
|
||||||
|
let show_href = route_show.replace('~warehouseo~', row.id);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'<div class="d-flex justify-content-start align-items-center user-name">',
|
||||||
|
'<div class="avatar-wrapper">',
|
||||||
|
'<div class="avatar avatar-sm me-4">' +
|
||||||
|
'<img src="' + row.profile_photo_url + '" alt="Avatar" class="rounded-circle">' +
|
||||||
|
'</div>',
|
||||||
|
'</div>',
|
||||||
|
'<div class="d-flex flex-column">',
|
||||||
|
'<a href="' + show_href + '" class="text-heading text-truncate"><span class="fw-medium">' + row.name + '</span></a>',
|
||||||
|
'<small>' + row.email + '</small>',
|
||||||
|
'</div>',
|
||||||
|
'</div>',
|
||||||
|
].join('')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function uidFormatter(value, row, index) {
|
||||||
|
if(row.id){
|
||||||
|
let show_href = route_show.replace('~warehouseo~', row.id);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'<div class="d-flex align-items-center justify-content-center">',
|
||||||
|
'<a href="' + show_href + '" class="whitespace-nowrap" title="Ver warehouseo"> ' + row.id + '</a>',
|
||||||
|
@can('crm.warehouses.update')
|
||||||
|
'<a href="javascript:;" class="btn btn-icon btn-text-secondary waves-effect waves-light rounded-pill dropdown-toggle hide-arrow" data-bs-toggle="dropdown"><i class="ti ti-dots-vertical ti-md"></i></a>',
|
||||||
|
'<div class="dropdown-menu dropdown-menu-end m-0">',
|
||||||
|
'<a href="javascript:deleteRow(' + row.id + ');" class="dropdown-item delete-record">Eliminar</a>',
|
||||||
|
'</div>',
|
||||||
|
@endcan
|
||||||
|
'</div>'
|
||||||
|
].join('')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// BootstrapTable Init
|
||||||
|
function initTable(table) {
|
||||||
|
$(table)
|
||||||
|
.bootstrapTable('destroy')
|
||||||
|
.bootstrapTable({
|
||||||
|
height: btt_height,
|
||||||
|
locale: 'es-MX',
|
||||||
|
ajax: "ajaxRequest",
|
||||||
|
toolbar: "#toolbar",
|
||||||
|
search: true,
|
||||||
|
showColumns: true,
|
||||||
|
showColumnsToggleAll: true,
|
||||||
|
showExport: true,
|
||||||
|
showFullscreen: true,
|
||||||
|
showPaginationSwitch: true,
|
||||||
|
showRefresh: true,
|
||||||
|
showToggle: true,
|
||||||
|
clickToSelect: true,
|
||||||
|
minimumCountColumns: 4,
|
||||||
|
fixedColumns: true,
|
||||||
|
fixedNumber: 1,
|
||||||
|
idField: "id",
|
||||||
|
pagination: true,
|
||||||
|
pageList: [10, 25, 50, 100, 500],
|
||||||
|
sidePagination: "server",
|
||||||
|
exportTypes: ['csv', 'txt', 'excel'],
|
||||||
|
exportOptions: {
|
||||||
|
fileName: 'warehouseos',
|
||||||
|
},
|
||||||
|
sortName: 'users.id',
|
||||||
|
sortOrder: 'desc',
|
||||||
|
mobileResponsive: true,
|
||||||
|
cookie: true,
|
||||||
|
resizable: true,
|
||||||
|
cookieIdTable:"crm-warehouses-index",
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: 'UID',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
sortName: 'users.id',
|
||||||
|
switchable: false,
|
||||||
|
formatter: uidFormatter
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'name',
|
||||||
|
title: 'Nombre',
|
||||||
|
formatter: userAvatarFormatter,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'email',
|
||||||
|
title: 'Correo electrónico',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tipo_persona',
|
||||||
|
title: 'Tipo persona',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.tipoPersona,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'rfc',
|
||||||
|
title: 'RFC',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'nombre_fiscal',
|
||||||
|
title: 'Nombre fiscal',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'c_regimen_fiscal',
|
||||||
|
title: 'Regimen fiscal',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
formatter: window.btFormatter.regimenFiscal,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'domicilio_fiscal',
|
||||||
|
title: 'Domicilio fiscal',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'estado',
|
||||||
|
title: 'Estado',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'municipio',
|
||||||
|
title: 'Municipio',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'localidad',
|
||||||
|
title: 'Localidad',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'c_uso_cfdi',
|
||||||
|
title: 'Uso de CFDI',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
formatter: window.btFormatter.usoCfdi,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'cargo',
|
||||||
|
title: 'Cargo',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'is_prospect',
|
||||||
|
title: 'Es prospecto',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'is_customer',
|
||||||
|
title: 'Es cliente',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'is_provider',
|
||||||
|
title: 'Es proveedor',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'is_user',
|
||||||
|
title: 'Es usuario',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'status',
|
||||||
|
title: 'Estado',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.status,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'created_at',
|
||||||
|
title: 'Creado ',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'created_by_name',
|
||||||
|
title: 'Creado por',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
sortName: 'created_by_name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'updated_at',
|
||||||
|
title: 'Modificado ',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleSections() {
|
||||||
|
const isProspect = $('#is_prospect').is(':checked');
|
||||||
|
const isCustomer = $('#is_customer').is(':checked');
|
||||||
|
const isProvider = $('#is_provider').is(':checked');
|
||||||
|
const isUser = $('#is_user').is(':checked');
|
||||||
|
|
||||||
|
$('.div-sat').toggle(isCustomer || isProvider);
|
||||||
|
$('.div-sat-customer').toggle(isCustomer);
|
||||||
|
$('.div-user-auth').toggle(isCustomer || isUser);
|
||||||
|
$('.div-roles').toggle(isUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleCheckboxes(status) {
|
||||||
|
const isDisabled = status == 1;
|
||||||
|
$('#is_prospect, #is_customer, #is_provider, #is_user').prop('disabled', isDisabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
load_js_form = () => {
|
||||||
|
$('#userForm .select2')
|
||||||
|
.each(function() {
|
||||||
|
var $this = $(this)
|
||||||
|
|
||||||
|
$this.wrap('<div class="position-relative"></div>')
|
||||||
|
|
||||||
|
$this.select2({
|
||||||
|
dropdownAutoWidth: true,
|
||||||
|
width: '100%',
|
||||||
|
dropdownParent: $this.parent()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Evento para los checkboxes
|
||||||
|
$('#is_prospect, #is_customer, #is_provider, #is_user').on('change', toggleSections);
|
||||||
|
|
||||||
|
// Evento para el select de estado
|
||||||
|
$('.div-status').on('change', 'select[name="status"]', function() {
|
||||||
|
toggleCheckboxes($(this).val());
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Previo de imagenes
|
||||||
|
document.getElementById("photo").addEventListener('change', updatePreviewImage);
|
||||||
|
|
||||||
|
|
||||||
|
// Reset form
|
||||||
|
$("#userForm")
|
||||||
|
.on('reset', function(){
|
||||||
|
var form = $("#userForm");
|
||||||
|
|
||||||
|
form.validate().resetForm();
|
||||||
|
|
||||||
|
setTimeout(function(){
|
||||||
|
$('#roles').trigger('change');
|
||||||
|
|
||||||
|
toggleSections();
|
||||||
|
}, 250)
|
||||||
|
|
||||||
|
$('#user-image').prop("src", "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
|
||||||
|
|
||||||
|
$('#userForm .alert-errors').html('');
|
||||||
|
|
||||||
|
$('.pdf-dropzone-div').show();
|
||||||
|
|
||||||
|
$("#pdf-dropzone").removeAllFiles(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$("#userForm")
|
||||||
|
.validate({
|
||||||
|
errorClass: 'error',
|
||||||
|
highlight: function(element, errorClass, validClass) {
|
||||||
|
// Agrega la clase de error a la fila (contenedor del campo)
|
||||||
|
$(element).closest('.mb-3').addClass('has-error');
|
||||||
|
},
|
||||||
|
unhighlight: function(element, errorClass, validClass) {
|
||||||
|
// Elimina la clase de error de la fila (contenedor del campo)
|
||||||
|
$(element).closest('.mb-3').removeClass('has-error');
|
||||||
|
},
|
||||||
|
errorPlacement: function(error, element) {
|
||||||
|
// Controla dónde se colocan los mensajes de error
|
||||||
|
error.appendTo(element.closest('.mb-3').find('.error-message'));
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
name: {
|
||||||
|
required: true,
|
||||||
|
minlength: 5
|
||||||
|
},
|
||||||
|
email: {
|
||||||
|
required: true,
|
||||||
|
email: true
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
required: function(element) {
|
||||||
|
return !$("#userForm input[name=id]").val() && ($('#is_user').is(':checked') || $('#is_customer').is(':checked'));
|
||||||
|
},
|
||||||
|
minlength: 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
name: {
|
||||||
|
required: "Por favor ingrese su nombre completo",
|
||||||
|
minlength: "El nombre completo debe tener al menos 8 caracteres"
|
||||||
|
},
|
||||||
|
email: {
|
||||||
|
required: "Por favor ingrese su correo electrónico",
|
||||||
|
email: "El valor no es una dirección de correo válida"
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
required: "La contraseña es obligatoria para nuevos usuarios",
|
||||||
|
minlength: "La contraseña debe tener al menos 6 caracteres"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitHandler: function(form, event) {
|
||||||
|
// Evita que el formulario se envíe automáticamente
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
var form = $("#userForm")[0],
|
||||||
|
data = new FormData(form);
|
||||||
|
|
||||||
|
$('#userForm :input').prop('disabled', true);
|
||||||
|
$('#userForm .alert-errors').html('');
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: store_route,
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||||
|
},
|
||||||
|
data: data,
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
cache: false,
|
||||||
|
timeout: 3000,
|
||||||
|
success: function(data) {
|
||||||
|
$('#userForm :input').prop('disabled', false);
|
||||||
|
|
||||||
|
if (data.errors) {
|
||||||
|
$('#userForm .alert-errors').html('<div class="alert alert-danger alert-dismissible fade show" role="alert">' +
|
||||||
|
'<div class="alert-body">' + data.errors + '</div>' +
|
||||||
|
'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>' +
|
||||||
|
'</div>');
|
||||||
|
|
||||||
|
} else {
|
||||||
|
let $usersIndexAlert = $('.crm-warehouses-index.alert-errors');
|
||||||
|
|
||||||
|
$usersIndexAlert.html('<div class="alert alert-success alert-dismissible fade show" role="alert">' +
|
||||||
|
'<div class="alert-body">' +
|
||||||
|
'<p class="mb-0"><strong>' + data.success + '</strong></p>' +
|
||||||
|
'</div>' +
|
||||||
|
'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>' +
|
||||||
|
'</div>');
|
||||||
|
|
||||||
|
$('#userForm button[type=reset]').trigger('click');
|
||||||
|
$('#toolbar .clear-filters').trigger('click');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(e) {
|
||||||
|
$('#userForm :input').prop('disabled', false);
|
||||||
|
|
||||||
|
$('#userForm .alert-errors').html('<div class="alert alert-danger alert-dismissible fade show" role="alert">' +
|
||||||
|
'<div class="alert-body">' + e.responseJSON.message + '</div>' +
|
||||||
|
'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>' +
|
||||||
|
'</div>');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Inicializar el estado al cargar la página
|
||||||
|
toggleSections();
|
||||||
|
toggleCheckboxes($('select[name="status"]').val());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Previo de imagen de perfil
|
||||||
|
updatePreviewImage = (event) => {
|
||||||
|
var file = event.target.files[0],
|
||||||
|
reader = new FileReader();
|
||||||
|
|
||||||
|
reader.onload = event => {
|
||||||
|
document.getElementById('user-image').setAttribute('src', event.target.result);
|
||||||
|
};
|
||||||
|
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
$(document).ready(function() {
|
||||||
|
var $table = $('#bt-warehouses'),
|
||||||
|
$btnRefresh = $('#toolbar .btn-refresh'),
|
||||||
|
$clearFilters = $('a.clear-filters');
|
||||||
|
|
||||||
|
var btt_rest_height = 220,
|
||||||
|
btt_min_height = 600;
|
||||||
|
|
||||||
|
btt_height = (window.innerHeight - btt_rest_height) < btt_min_height?
|
||||||
|
btt_height:
|
||||||
|
window.innerHeight - btt_rest_height;
|
||||||
|
|
||||||
|
var offcanvasElement = document.getElementById('offcanvasUser'),
|
||||||
|
offcanvasUser = new bootstrap.Offcanvas(offcanvasElement);
|
||||||
|
|
||||||
|
const refreshButton = document.querySelector('.btn-refresh');
|
||||||
|
const inputs = document.querySelectorAll('#toolbar input, #toolbar select');
|
||||||
|
|
||||||
|
inputs.forEach(input => {
|
||||||
|
input.addEventListener('change', () => {
|
||||||
|
refreshButton.disabled = false;
|
||||||
|
refreshButton.classList.remove('btn-label-secondary');
|
||||||
|
refreshButton.classList.add('btn-label-success');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Button Refresh
|
||||||
|
$btnRefresh
|
||||||
|
.on('click', () => {
|
||||||
|
$table.bootstrapTable('refresh');
|
||||||
|
refreshButton.disabled = true;
|
||||||
|
refreshButton.classList.remove('btn-label-success');
|
||||||
|
refreshButton.classList.add('btn-label-secondary');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Button clear filters
|
||||||
|
$clearFilters
|
||||||
|
.on('click', () => {
|
||||||
|
$table.bootstrapTable('resetSearch', ''); // Inicializa la búsqueda con cadena vacía
|
||||||
|
refreshButton.disabled = true;
|
||||||
|
refreshButton.classList.remove('btn-label-success');
|
||||||
|
refreshButton.classList.add('btn-label-secondary');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
initTable('#bt-warehouses'); // Una vez que todos los scripts estén cargados, inicializa Bootstrap Table
|
||||||
|
|
||||||
|
|
||||||
|
load_js_form();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endsection
|
516
resources/views/livewire/assets/assets-index.blade.php
Normal file
516
resources/views/livewire/assets/assets-index.blade.php
Normal file
@ -0,0 +1,516 @@
|
|||||||
|
<section id="crm-warehouses-index">
|
||||||
|
<div class="crm-warehouses-index alert-errors"></div>
|
||||||
|
<div wire:ignore>
|
||||||
|
<div class="query-filters" id="toolbar">
|
||||||
|
<div class="d-flex flex-wrap">
|
||||||
|
<div class="pt-1 pr-2 pb-1" style="min-width: 175px; max-width: 225px">
|
||||||
|
<button data-bs-toggle='offcanvas' data-bs-target='#offcanvasUser' class="btn btn-primary waves-effect waves-light">Agregar almacén</button>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#accordionFiltrado" aria-expanded="false" aria-controls="accordionFiltrado">
|
||||||
|
Filtrado
|
||||||
|
</button>
|
||||||
|
<div class="px-2 pt-1">
|
||||||
|
<button class="btn btn-label-secondary waves-effect py-3 btn-refresh" disabled><i class="fa-solid fa-rotate"></i></button>
|
||||||
|
</div>
|
||||||
|
<div class="pr-2" style="width: 60px;">
|
||||||
|
<a href="javascript:void(0)" class="clear-filters">Limpiar Filtrado</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="bt-warehouses"></table>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
@section('page-script')
|
||||||
|
<script>
|
||||||
|
const store_route = '{{ route('admin.core.users.store') }}',
|
||||||
|
route_show = '{{ route('admin.inventory.warehouse.show', ['warehouse' => '~warehouse~']) }}',
|
||||||
|
route_destroy = '{{ route('admin.inventory.warehouse.destroy', ['warehouse' => '~warehouse~']) }}',
|
||||||
|
statusList = {!! json_encode($status_list) !!},
|
||||||
|
statusIntCatalogCss = {!! json_encode($status_list_class) !!};
|
||||||
|
|
||||||
|
var btt_height;
|
||||||
|
|
||||||
|
|
||||||
|
// BootstrapTable Petición AJAX
|
||||||
|
function ajaxRequest(params) {
|
||||||
|
let url = '{{ url()->current() }}' +
|
||||||
|
'?' +
|
||||||
|
$.param(params.data) +
|
||||||
|
'&' +
|
||||||
|
$('.query-filters :input').serialize();
|
||||||
|
|
||||||
|
$.get(url).then(function (res) {
|
||||||
|
params.success(res)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// BootstrapTable Formatter
|
||||||
|
function userAvatarFormatter(value, row, index) {
|
||||||
|
if(row.id){
|
||||||
|
let show_href = route_show.replace('~warehouseo~', row.id);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'<div class="d-flex justify-content-start align-items-center user-name">',
|
||||||
|
'<div class="avatar-wrapper">',
|
||||||
|
'<div class="avatar avatar-sm me-4">' +
|
||||||
|
'<img src="' + row.profile_photo_url + '" alt="Avatar" class="rounded-circle">' +
|
||||||
|
'</div>',
|
||||||
|
'</div>',
|
||||||
|
'<div class="d-flex flex-column">',
|
||||||
|
'<a href="' + show_href + '" class="text-heading text-truncate"><span class="fw-medium">' + row.name + '</span></a>',
|
||||||
|
'<small>' + row.email + '</small>',
|
||||||
|
'</div>',
|
||||||
|
'</div>',
|
||||||
|
].join('')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function uidFormatter(value, row, index) {
|
||||||
|
if(row.id){
|
||||||
|
let show_href = route_show.replace('~warehouseo~', row.id);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'<div class="d-flex align-items-center justify-content-center">',
|
||||||
|
'<a href="' + show_href + '" class="whitespace-nowrap" title="Ver warehouseo"> ' + row.id + '</a>',
|
||||||
|
@can('crm.warehouses.update')
|
||||||
|
'<a href="javascript:;" class="btn btn-icon btn-text-secondary waves-effect waves-light rounded-pill dropdown-toggle hide-arrow" data-bs-toggle="dropdown"><i class="ti ti-dots-vertical ti-md"></i></a>',
|
||||||
|
'<div class="dropdown-menu dropdown-menu-end m-0">',
|
||||||
|
'<a href="javascript:deleteRow(' + row.id + ');" class="dropdown-item delete-record">Eliminar</a>',
|
||||||
|
'</div>',
|
||||||
|
@endcan
|
||||||
|
'</div>'
|
||||||
|
].join('')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// BootstrapTable Init
|
||||||
|
function initTable(table) {
|
||||||
|
$(table)
|
||||||
|
.bootstrapTable('destroy')
|
||||||
|
.bootstrapTable({
|
||||||
|
height: btt_height,
|
||||||
|
locale: 'es-MX',
|
||||||
|
ajax: "ajaxRequest",
|
||||||
|
toolbar: "#toolbar",
|
||||||
|
search: true,
|
||||||
|
showColumns: true,
|
||||||
|
showColumnsToggleAll: true,
|
||||||
|
showExport: true,
|
||||||
|
showFullscreen: true,
|
||||||
|
showPaginationSwitch: true,
|
||||||
|
showRefresh: true,
|
||||||
|
showToggle: true,
|
||||||
|
clickToSelect: true,
|
||||||
|
minimumCountColumns: 4,
|
||||||
|
fixedColumns: true,
|
||||||
|
fixedNumber: 1,
|
||||||
|
idField: "id",
|
||||||
|
pagination: true,
|
||||||
|
pageList: [10, 25, 50, 100, 500],
|
||||||
|
sidePagination: "server",
|
||||||
|
exportTypes: ['csv', 'txt', 'excel'],
|
||||||
|
exportOptions: {
|
||||||
|
fileName: 'warehouseos',
|
||||||
|
},
|
||||||
|
sortName: 'users.id',
|
||||||
|
sortOrder: 'desc',
|
||||||
|
mobileResponsive: true,
|
||||||
|
cookie: true,
|
||||||
|
resizable: true,
|
||||||
|
cookieIdTable:"crm-warehouses-index",
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: 'UID',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
sortName: 'users.id',
|
||||||
|
switchable: false,
|
||||||
|
formatter: uidFormatter
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'name',
|
||||||
|
title: 'Nombre',
|
||||||
|
formatter: userAvatarFormatter,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'email',
|
||||||
|
title: 'Correo electrónico',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tipo_persona',
|
||||||
|
title: 'Tipo persona',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.tipoPersona,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'rfc',
|
||||||
|
title: 'RFC',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'nombre_fiscal',
|
||||||
|
title: 'Nombre fiscal',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'c_regimen_fiscal',
|
||||||
|
title: 'Regimen fiscal',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
formatter: window.btFormatter.regimenFiscal,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'domicilio_fiscal',
|
||||||
|
title: 'Domicilio fiscal',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'estado',
|
||||||
|
title: 'Estado',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'municipio',
|
||||||
|
title: 'Municipio',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'localidad',
|
||||||
|
title: 'Localidad',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'c_uso_cfdi',
|
||||||
|
title: 'Uso de CFDI',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
formatter: window.btFormatter.usoCfdi,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'cargo',
|
||||||
|
title: 'Cargo',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'is_prospect',
|
||||||
|
title: 'Es prospecto',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'is_customer',
|
||||||
|
title: 'Es cliente',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'is_provider',
|
||||||
|
title: 'Es proveedor',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'is_user',
|
||||||
|
title: 'Es usuario',
|
||||||
|
align: 'center',
|
||||||
|
visible: false,
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.check,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'status',
|
||||||
|
title: 'Estado',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
formatter: window.btFormatter.status,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'created_at',
|
||||||
|
title: 'Creado ',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'created_by_name',
|
||||||
|
title: 'Creado por',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
sortName: 'created_by_name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'updated_at',
|
||||||
|
title: 'Modificado ',
|
||||||
|
align: 'center',
|
||||||
|
sortable: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleSections() {
|
||||||
|
const isProspect = $('#is_prospect').is(':checked');
|
||||||
|
const isCustomer = $('#is_customer').is(':checked');
|
||||||
|
const isProvider = $('#is_provider').is(':checked');
|
||||||
|
const isUser = $('#is_user').is(':checked');
|
||||||
|
|
||||||
|
$('.div-sat').toggle(isCustomer || isProvider);
|
||||||
|
$('.div-sat-customer').toggle(isCustomer);
|
||||||
|
$('.div-user-auth').toggle(isCustomer || isUser);
|
||||||
|
$('.div-roles').toggle(isUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleCheckboxes(status) {
|
||||||
|
const isDisabled = status == 1;
|
||||||
|
$('#is_prospect, #is_customer, #is_provider, #is_user').prop('disabled', isDisabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
load_js_form = () => {
|
||||||
|
$('#userForm .select2')
|
||||||
|
.each(function() {
|
||||||
|
var $this = $(this)
|
||||||
|
|
||||||
|
$this.wrap('<div class="position-relative"></div>')
|
||||||
|
|
||||||
|
$this.select2({
|
||||||
|
dropdownAutoWidth: true,
|
||||||
|
width: '100%',
|
||||||
|
dropdownParent: $this.parent()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Evento para los checkboxes
|
||||||
|
$('#is_prospect, #is_customer, #is_provider, #is_user').on('change', toggleSections);
|
||||||
|
|
||||||
|
// Evento para el select de estado
|
||||||
|
$('.div-status').on('change', 'select[name="status"]', function() {
|
||||||
|
toggleCheckboxes($(this).val());
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Previo de imagenes
|
||||||
|
document.getElementById("photo").addEventListener('change', updatePreviewImage);
|
||||||
|
|
||||||
|
|
||||||
|
// Reset form
|
||||||
|
$("#userForm")
|
||||||
|
.on('reset', function(){
|
||||||
|
var form = $("#userForm");
|
||||||
|
|
||||||
|
form.validate().resetForm();
|
||||||
|
|
||||||
|
setTimeout(function(){
|
||||||
|
$('#roles').trigger('change');
|
||||||
|
|
||||||
|
toggleSections();
|
||||||
|
}, 250)
|
||||||
|
|
||||||
|
$('#user-image').prop("src", "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
|
||||||
|
|
||||||
|
$('#userForm .alert-errors').html('');
|
||||||
|
|
||||||
|
$('.pdf-dropzone-div').show();
|
||||||
|
|
||||||
|
$("#pdf-dropzone").removeAllFiles(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$("#userForm")
|
||||||
|
.validate({
|
||||||
|
errorClass: 'error',
|
||||||
|
highlight: function(element, errorClass, validClass) {
|
||||||
|
// Agrega la clase de error a la fila (contenedor del campo)
|
||||||
|
$(element).closest('.mb-3').addClass('has-error');
|
||||||
|
},
|
||||||
|
unhighlight: function(element, errorClass, validClass) {
|
||||||
|
// Elimina la clase de error de la fila (contenedor del campo)
|
||||||
|
$(element).closest('.mb-3').removeClass('has-error');
|
||||||
|
},
|
||||||
|
errorPlacement: function(error, element) {
|
||||||
|
// Controla dónde se colocan los mensajes de error
|
||||||
|
error.appendTo(element.closest('.mb-3').find('.error-message'));
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
name: {
|
||||||
|
required: true,
|
||||||
|
minlength: 5
|
||||||
|
},
|
||||||
|
email: {
|
||||||
|
required: true,
|
||||||
|
email: true
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
required: function(element) {
|
||||||
|
return !$("#userForm input[name=id]").val() && ($('#is_user').is(':checked') || $('#is_customer').is(':checked'));
|
||||||
|
},
|
||||||
|
minlength: 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
name: {
|
||||||
|
required: "Por favor ingrese su nombre completo",
|
||||||
|
minlength: "El nombre completo debe tener al menos 8 caracteres"
|
||||||
|
},
|
||||||
|
email: {
|
||||||
|
required: "Por favor ingrese su correo electrónico",
|
||||||
|
email: "El valor no es una dirección de correo válida"
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
required: "La contraseña es obligatoria para nuevos usuarios",
|
||||||
|
minlength: "La contraseña debe tener al menos 6 caracteres"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitHandler: function(form, event) {
|
||||||
|
// Evita que el formulario se envíe automáticamente
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
var form = $("#userForm")[0],
|
||||||
|
data = new FormData(form);
|
||||||
|
|
||||||
|
$('#userForm :input').prop('disabled', true);
|
||||||
|
$('#userForm .alert-errors').html('');
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: store_route,
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||||
|
},
|
||||||
|
data: data,
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
cache: false,
|
||||||
|
timeout: 3000,
|
||||||
|
success: function(data) {
|
||||||
|
$('#userForm :input').prop('disabled', false);
|
||||||
|
|
||||||
|
if (data.errors) {
|
||||||
|
$('#userForm .alert-errors').html('<div class="alert alert-danger alert-dismissible fade show" role="alert">' +
|
||||||
|
'<div class="alert-body">' + data.errors + '</div>' +
|
||||||
|
'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>' +
|
||||||
|
'</div>');
|
||||||
|
|
||||||
|
} else {
|
||||||
|
let $usersIndexAlert = $('.crm-warehouses-index.alert-errors');
|
||||||
|
|
||||||
|
$usersIndexAlert.html('<div class="alert alert-success alert-dismissible fade show" role="alert">' +
|
||||||
|
'<div class="alert-body">' +
|
||||||
|
'<p class="mb-0"><strong>' + data.success + '</strong></p>' +
|
||||||
|
'</div>' +
|
||||||
|
'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>' +
|
||||||
|
'</div>');
|
||||||
|
|
||||||
|
$('#userForm button[type=reset]').trigger('click');
|
||||||
|
$('#toolbar .clear-filters').trigger('click');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(e) {
|
||||||
|
$('#userForm :input').prop('disabled', false);
|
||||||
|
|
||||||
|
$('#userForm .alert-errors').html('<div class="alert alert-danger alert-dismissible fade show" role="alert">' +
|
||||||
|
'<div class="alert-body">' + e.responseJSON.message + '</div>' +
|
||||||
|
'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>' +
|
||||||
|
'</div>');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Inicializar el estado al cargar la página
|
||||||
|
toggleSections();
|
||||||
|
toggleCheckboxes($('select[name="status"]').val());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Previo de imagen de perfil
|
||||||
|
updatePreviewImage = (event) => {
|
||||||
|
var file = event.target.files[0],
|
||||||
|
reader = new FileReader();
|
||||||
|
|
||||||
|
reader.onload = event => {
|
||||||
|
document.getElementById('user-image').setAttribute('src', event.target.result);
|
||||||
|
};
|
||||||
|
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
$(document).ready(function() {
|
||||||
|
var $table = $('#bt-warehouses'),
|
||||||
|
$btnRefresh = $('#toolbar .btn-refresh'),
|
||||||
|
$clearFilters = $('a.clear-filters');
|
||||||
|
|
||||||
|
var btt_rest_height = 220,
|
||||||
|
btt_min_height = 600;
|
||||||
|
|
||||||
|
btt_height = (window.innerHeight - btt_rest_height) < btt_min_height?
|
||||||
|
btt_height:
|
||||||
|
window.innerHeight - btt_rest_height;
|
||||||
|
|
||||||
|
var offcanvasElement = document.getElementById('offcanvasUser'),
|
||||||
|
offcanvasUser = new bootstrap.Offcanvas(offcanvasElement);
|
||||||
|
|
||||||
|
const refreshButton = document.querySelector('.btn-refresh');
|
||||||
|
const inputs = document.querySelectorAll('#toolbar input, #toolbar select');
|
||||||
|
|
||||||
|
inputs.forEach(input => {
|
||||||
|
input.addEventListener('change', () => {
|
||||||
|
refreshButton.disabled = false;
|
||||||
|
refreshButton.classList.remove('btn-label-secondary');
|
||||||
|
refreshButton.classList.add('btn-label-success');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Button Refresh
|
||||||
|
$btnRefresh
|
||||||
|
.on('click', () => {
|
||||||
|
$table.bootstrapTable('refresh');
|
||||||
|
refreshButton.disabled = true;
|
||||||
|
refreshButton.classList.remove('btn-label-success');
|
||||||
|
refreshButton.classList.add('btn-label-secondary');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Button clear filters
|
||||||
|
$clearFilters
|
||||||
|
.on('click', () => {
|
||||||
|
$table.bootstrapTable('resetSearch', ''); // Inicializa la búsqueda con cadena vacía
|
||||||
|
refreshButton.disabled = true;
|
||||||
|
refreshButton.classList.remove('btn-label-success');
|
||||||
|
refreshButton.classList.add('btn-label-secondary');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
initTable('#bt-warehouses'); // Una vez que todos los scripts estén cargados, inicializa Bootstrap Table
|
||||||
|
|
||||||
|
|
||||||
|
load_js_form();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endsection
|
208
routes/admin.php
Normal file
208
routes/admin.php
Normal file
@ -0,0 +1,208 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\ProductCategorieController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\ProductCatalogController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\ProductController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\PurchaseOrderController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\ProductReceiptController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\MaterialController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\WarehouseController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\InventoryStockController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\InventoryMovementController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\WarehouseTransfersController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\ShippingOrderController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\ShipmentTrackingController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\ShippingCarrierController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\ShippingRateController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\AssetController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\AssetMaintenanceController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\AssetLifecycleController;
|
||||||
|
use Koneko\VuexyWarehouse\Http\Controllers\AssetAassignmentController;
|
||||||
|
|
||||||
|
// Grupo raíz para admin con middleware y prefijos comunes
|
||||||
|
Route::prefix('admin/productos-y-servicios')->name('admin.inventory.')->middleware(['web', 'auth', 'admin'])->group(function () {
|
||||||
|
Route::controller(ProductCategorieController::class)->prefix('categorias')->name('product-categories.')->group(function () {
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'categorie')->name('store'); // Guardar
|
||||||
|
Route::get('{categorie}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{categorie}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{categorie}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{categorie}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(ProductCatalogController::class)->prefix('catalogos')->name('product-catalogs.')->group(function () {
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'catalog')->name('store'); // Guardar
|
||||||
|
Route::get('{catalog}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{catalog}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{catalog}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{catalog}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(ProductController::class)->prefix('productos')->name('products.')->group(function () {
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'product')->name('store'); // Guardar
|
||||||
|
Route::get('{product}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{product}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{product}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{product}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::prefix('admin/inventario-y-logistica')->name('admin.inventory.')->middleware(['web', 'auth', 'admin'])->group(function () {
|
||||||
|
Route::controller(PurchaseOrderController::class)->prefix('ordenes-de-compra')->name('orders.')->group(function () {;
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'orders')->name('store'); // Guardar
|
||||||
|
Route::get('{orders}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{orders}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{orders}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{orders}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(ProductReceiptController::class)->prefix('recepcion-de-productos')->name('reception.')->group(function () {;
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'reception')->name('store'); // Guardar
|
||||||
|
Route::get('{reception}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{reception}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{reception}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{reception}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(MaterialController::class)->prefix('gestion-de-insumos')->name('materials.')->group(function () {;
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'materials')->name('store'); // Guardar
|
||||||
|
Route::get('{materials}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{materials}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{materials}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{materials}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(WarehouseController::class)->prefix('almacenes')->name('warehouse.')->group(function () {;
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'warehouse')->name('store'); // Guardar
|
||||||
|
Route::get('{warehouse}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{warehouse}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{warehouse}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{warehouse}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(InventoryStockController::class)->prefix('stock-de-inventario')->name('stock.')->group(function () {;
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'stock')->name('store'); // Guardar
|
||||||
|
Route::get('{stock}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{stock}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{stock}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{stock}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(InventoryMovementController::class)->prefix('movimientos-de-inventario')->name('movements.')->group(function () {;
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'movements')->name('store'); // Guardar
|
||||||
|
Route::get('{movements}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{movements}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{movements}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{movements}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(WarehouseTransfersController::class)->prefix('transferencias-entre-almacenes')->name('transfers.')->group(function () {;
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'transfers')->name('store'); // Guardar
|
||||||
|
Route::get('{transfers}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{transfers}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{transfers}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{transfers}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(ShippingOrderController::class)->prefix('ordenes-de-envio')->name('shipping-orders.')->group(function () {;
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'shipping-order')->name('store'); // Guardar
|
||||||
|
Route::get('{shipping-order}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{shipping-order}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{shipping-order}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{shipping-order}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(ShipmentTrackingController::class)->prefix('seguimiento-de-envios')->name('shipping-tracking.')->group(function () {;
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'shippingTracking')->name('store'); // Guardar
|
||||||
|
Route::get('{shippingTracking}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{shippingTracking}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{shippingTracking}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{shippingTracking}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(ShippingCarrierController::class)->prefix('transportistas')->name('shipping-carriers.')->group(function () {;
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'shippingCarrier')->name('store'); // Guardar
|
||||||
|
Route::get('{shippingCarrier}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{shippingCarrier}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{shippingCarrier}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{shippingCarrier}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(ShippingRateController::class)->prefix('tarifas-y-metodos-de-envio')->name('shipping-rates.')->group(function () {;
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'shippingRate')->name('store'); // Guardar
|
||||||
|
Route::get('{shippingRate}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{shippingRate}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{shippingRate}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{shippingRate}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(AssetController::class)->prefix('activos-registrados')->name('assets.')->group(function () {;
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'asset')->name('store'); // Guardar
|
||||||
|
Route::get('{asset}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{asset}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{asset}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{asset}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(AssetMaintenanceController::class)->prefix('mantenimiento-preventivo')->name('asset-maintenance.')->group(function () {;
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'assetMaintenance')->name('store'); // Guardar
|
||||||
|
Route::get('{assetMaintenance}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{assetMaintenance}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{assetMaintenance}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{assetMaintenance}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(AssetLifecycleController::class)->prefix('control-de-vida-util')->name('asset-lifecycle.')->group(function () {;
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'assetLifecycle')->name('store'); // Guardar
|
||||||
|
Route::get('{assetLifecycle}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{assetLifecycle}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{assetLifecycle}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{assetLifecycle}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::controller(AssetAassignmentController::class)->prefix('asignacion-de-activos')->name('asset-assignments.')->group(function () {;
|
||||||
|
Route::get('/', 'index')->name('index'); // Listar
|
||||||
|
Route::get('create', 'create')->name('create'); // Formulario de creación
|
||||||
|
Route::post('/', 'assetAssignmen')->name('store'); // Guardar
|
||||||
|
Route::get('{assetAssignmen}', 'show')->name('show'); // Ver
|
||||||
|
Route::get('{assetAssignmen}/edit', 'edit')->name('edit'); // Formulario de edición
|
||||||
|
Route::put('{assetAssignmen}', 'update')->name('update'); // Actualizar
|
||||||
|
Route::delete('{assetAssignmen}', 'destroy')->name('destroy'); // Eliminar
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user