diff --git a/src/modules/fixed-assets/components/FixedAssetsIndex.vue b/src/modules/fixed-assets/components/FixedAssetsIndex.vue index 37a17e5..08bdecd 100644 --- a/src/modules/fixed-assets/components/FixedAssetsIndex.vue +++ b/src/modules/fixed-assets/components/FixedAssetsIndex.vue @@ -103,6 +103,10 @@ const goToAssignment = () => { router.push('/fixed-assets/assignments'); }; +const goToDetails = (asset: Asset) => { + router.push(`/fixed-assets/${asset.id}`); +}; + const goToEdit = (asset: Asset) => { router.push(`/fixed-assets/${asset.id}/edit`); }; @@ -255,6 +259,7 @@ const handleDelete = (asset: Asset) => {
Valor en Libros
++ {{ formatCurrency(asset.book_value) }} +
+Depreciación Acumulada
++ {{ formatCurrency(asset.accumulated_depreciation) }} +
+| Período | +Monto | +Acumulado | +Valor en Libros | +Método | +Procesado por | +Fecha | +
|---|---|---|---|---|---|---|
| + Cargando historial... + | +||||||
| + {{ formatPeriod(dep.period_year, dep.period_month) }} + | ++ -{{ formatCurrency(dep.depreciation_amount) }} + | +{{ formatCurrency(dep.accumulated_depreciation) }} | +{{ formatCurrency(dep.book_value) }} | ++ + {{ formatMethod(dep.method) }} + + | ++ + {{ dep.processed_by.name }} + + Sistema + | +{{ formatDate(dep.processed_at) }} | +
| + No se han registrado depreciaciones para este activo. + | +||||||
Producto
++ {{ asset.inventory_warehouse?.product?.name ?? '—' }} +
+Método de Depreciación
++ {{ methodLabels[asset.depreciation_method] ?? asset.depreciation_method ?? '—' }} +
+Vida Útil Estimada
++ {{ asset.estimated_useful_life ? `${asset.estimated_useful_life} meses` : '—' }} +
+Valor Residual
++ {{ formatCurrency(asset.residual_value) }} +
+Valor en Libros
++ {{ formatCurrency(asset.book_value) }} +
+Depreciación Acumulada
++ {{ formatCurrency(asset.accumulated_depreciation) }} +
+Días de Garantía
++ {{ asset.warranty_days }} días +
+Fin de Garantía
++ {{ new Date(asset.warranty_end_date).toLocaleDateString('es-MX') }} +
+| ID | Activo | Empleado | Fecha Entrega | @@ -146,9 +145,6 @@ onMounted(loadAssignments); :key="assignment.id" class="border-t border-surface-200 text-sm dark:border-surface-700" > -- #{{ assignment.id }} - |
{{ assignment.asset?.inventory_warehouse?.product?.name ?? assignment.asset?.sku ?? '—' }}
diff --git a/src/modules/fixed-assets/services/fixedAssetsService.ts b/src/modules/fixed-assets/services/fixedAssetsService.ts
index 28d2a97..706638e 100644
--- a/src/modules/fixed-assets/services/fixedAssetsService.ts
+++ b/src/modules/fixed-assets/services/fixedAssetsService.ts
@@ -188,3 +188,48 @@ class FixedAssetsService {
export const fixedAssetsService = new FixedAssetsService();
export default fixedAssetsService;
+
+// ── Depreciation ──────────────────────────────────────────────────────────────
+
+export interface AssetDepreciation {
+ id: number;
+ period_year: number;
+ period_month: number;
+ depreciation_amount: string;
+ accumulated_depreciation: string;
+ book_value: string;
+ method: string;
+ processed_by: { id: number; name: string } | null;
+ processed_at: string | null;
+}
+
+export interface AssetDepreciationResponse {
+ status: string;
+ data: { data: AssetDepreciation };
+}
+
+export interface AssetDepreciationsListResponse {
+ status: string;
+ data: { data: AssetDepreciation[] };
+}
+
+export interface RegisterDepreciationData {
+ year: number;
+ month: number;
+ amount?: number | null;
+ notes?: string;
+}
+
+class FixedAssetDepreciationService {
+ async getDepreciations(assetId: number): Promise |
|---|