diff --git a/src/components/CatalogSalesManagement.vue b/src/components/CatalogSalesManagement.vue new file mode 100644 index 0000000..9d596b3 --- /dev/null +++ b/src/components/CatalogSalesManagement.vue @@ -0,0 +1,278 @@ + + + + + + Ventas por Catálogo + + + + {{ catalogSales.length }} venta(s) + + + + + + + + + + + + + + + + + + Limpiar filtros + + + + + + + + + + + + {{ formatDate(item.date) }} + + + + + ${{ Number(item.total).toLocaleString('es-CO') }} + + + + + {{ item.customer_name }} + + ID: {{ item.customer }} + + + + + + + + + + Datos de envío + + + mdi-account + {{ item.customer_name }} + + + mdi-map-marker + {{ item.customer_address }} + + + mdi-phone + {{ item.customer_phone }} + + + mdi-truck + + {{ item.pickup_method === 'DELIVERY' ? 'Domicilio' : 'Recoge en tienda' }} + + + + + + Productos + + + + Producto ID + Precio + Cantidad + Subtotal + + + + + {{ line.product }} + ${{ Number(line.unit_price).toLocaleString('es-CO') }} + {{ line.quantity }} + + ${{ (Number(line.unit_price) * Number(line.quantity)).toLocaleString('es-CO') }} + + + + + + + + + + + + + + + + + + + No hay ventas por catálogo para mostrar + + + + + + + + + + {{ snackbar.message }} + + Cerrar + + + + + + + + diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index 20f99ef..b9f84a6 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -105,6 +105,7 @@ { title: 'CSV Tryton', route: '/ventas_para_tryton', icon: 'mdi-file-table'}, { title: 'Compra adm', route: '/compra_admin', icon: 'mdi-cart'}, { title: 'Gestión de Productos', route: '/admin/products', icon: 'mdi-package-variant'}, + { title: 'Ver Ventas por Catálogo', route: '/admin/catalog-sales', icon: 'mdi-cart-arrow-down'}, { title: 'Actualizar Productos De Tryton', route: '/sincronizar_productos_tryton', icon: 'trytonIcon'}, { title: 'Actualizar Clientes De Tryton', route: '/sincronizar_clientes_tryton', icon: 'trytonIcon'}, { title: 'Actualizar Ventas Tryton', route: '/sincronizar_ventas_tryton', icon: 'trytonIcon'} diff --git a/src/pages/admin/catalog-sales.vue b/src/pages/admin/catalog-sales.vue new file mode 100644 index 0000000..c08dbab --- /dev/null +++ b/src/pages/admin/catalog-sales.vue @@ -0,0 +1,10 @@ + + + + + diff --git a/src/router/index.js b/src/router/index.js index 7b1a181..6cb9cb5 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -20,6 +20,7 @@ const ADMIN_ROUTES = [ '/compra_admin', '/cuadrar_tarro', '/admin/products', + '/admin/catalog-sales', ] const router = createRouter({ diff --git a/src/services/api.js b/src/services/api.js index 113f1ce..7d6f6ef 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -67,6 +67,10 @@ class Api { return this.apiImplementation.sendSalesToTryton(); } + getCatalogSales() { + return this.apiImplementation.getCatalogSales(); + } + getCurrentUser() { return this.apiImplementation.getCurrentUser(); } diff --git a/src/services/django-api.js b/src/services/django-api.js index 05a10f8..9ed6a87 100644 --- a/src/services/django-api.js +++ b/src/services/django-api.js @@ -110,6 +110,11 @@ class DjangoApi { return this.postRequest(url, {}); } + getCatalogSales() { + const url = this.base + "/don_confiao/api/catalog_sales/"; + return this.getRequest(url); + } + getCurrentUser() { const url = this.base + "/api/users/me/"; return this.getRequest(url);