diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 940b72ff0..58b4146bf 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -1,6 +1,6 @@ diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index 0111366f5..655f37059 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -78,6 +78,10 @@ const props = defineProps({ type: String, default: '', }, + keyData: { + type: String, + default: undefined, + }, }); const emit = defineEmits(['onFetch', 'onPaginate', 'onChange']); @@ -255,7 +259,7 @@ defineExpose({ :disable="disableInfiniteScroll || !store.hasMoreData" v-bind="$attrs" > - +
diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index d7838d58e..3268939de 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -170,10 +170,9 @@ export function useArrayData(key, userOptions) { async function addOrder(field, direction = 'ASC') { const newOrder = field + ' ' + direction; - let order = store.order || []; - if (typeof order == 'string') order = [order]; + const order = toArray(store.order); - let index = order.findIndex((o) => o.split(' ')[0] === field); + let index = getOrderIndex(order, field); if (index > -1) { order[index] = newOrder; } else { @@ -190,16 +189,24 @@ export function useArrayData(key, userOptions) { } async function deleteOrder(field) { - let order = store.order ?? []; - if (typeof order == 'string') order = [order]; - - const index = order.findIndex((o) => o.split(' ')[0] === field); + const order = toArray(store.order); + const index = getOrderIndex(order, field); if (index > -1) order.splice(index, 1); store.order = order; fetch({}); } + function getOrderIndex(order, field) { + return order.findIndex((o) => o.split(' ')[0] === field); + } + + function toArray(str = []) { + if (!str) return []; + if (Array.isArray(str)) return str; + if (typeof str === 'string') return str.split(',').map((item) => item.trim()); + } + function sanitizerParams(params, exprBuilder) { for (const param in params) { if (params[param] === '' || params[param] === null) { @@ -290,8 +297,7 @@ export function useArrayData(key, userOptions) { Object.assign(params, store.userParams); if (params.filter) params.filter.skip = store.skip; - if (store?.order && typeof store?.order == 'string') store.order = [store.order]; - if (store.order?.length) params.filter.order = [...store.order]; + if (store.order) params.filter.order = toArray(store.order); else delete params.filter.order; return { filter, params, limit: filter.limit }; diff --git a/src/css/app.scss b/src/css/app.scss index f0fa12856..a1ca8985f 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -314,11 +314,11 @@ input::-webkit-inner-spin-button { } .q-item > .q-item__section:has(.q-checkbox) { - max-width: min-content; + max-width: fit-content; } .row > .column:has(.q-checkbox) { - max-width: min-content; + max-width: fit-content; } .q-field__inner { .q-field__control { diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index dca965248..68b29f5a6 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -2,14 +2,13 @@ globals: lang: es: Spanish en: English - quantity: Quantity language: Language + quantity: Quantity entity: Entity + preview: Preview user: User details: Details - Preview: Preview - collapseMenu: Collapse lateral menu - advancedMenu: Advanced menu + collapseMenu: Collapse left menu backToDashboard: Return to dashboard notifications: Notifications userPanel: User panel @@ -24,7 +23,6 @@ globals: search: Search changes: Changes dataCreated: Data created - split: Split add: Add create: Create edit: Edit @@ -37,7 +35,6 @@ globals: clone: Clone confirm: Confirm assign: Assign - replace: Replace back: Back downloadPdf: Download PDF yes: 'Yes' @@ -69,7 +66,6 @@ globals: shipped: Shipped totalEntries: Total entries amount: Amount - removeSelection: Clear selection packages: Packages download: Download selectRows: 'Select all { numberRows } row(s)' @@ -81,7 +77,6 @@ globals: type: Type reason: reason noResults: No results - results: results system: System notificationSent: Notification sent warehouse: Warehouse @@ -147,7 +142,6 @@ globals: agency: Agency workCenters: Work centers modes: Modes - negative: Tickets negative zones: Zones zonesList: List deliveryDays: Delivery days @@ -245,6 +239,7 @@ globals: routeCreate: New route RouteRoadmap: Roadmaps RouteRoadmapCreate: Create roadmap + RouteExtendedList: Router autonomous: Autonomous suppliers: Suppliers supplier: Supplier @@ -259,6 +254,7 @@ globals: addresses: Addresses agencyTerm: Agency agreement travel: Travels + create: Create extraCommunity: Extra community travelCreate: New travel history: Log @@ -266,14 +262,13 @@ globals: items: Items diary: Diary tags: Tags - create: Create - buyRequest: Buy requests fixedPrice: Fixed prices + buyRequest: Buy requests wasteBreakdown: Waste breakdown itemCreate: New item - barcode: Barcodes tax: Tax botanical: Botanical + barcode: Barcodes itemTypeCreate: New item type family: Item Type lastEntries: Last entries @@ -289,13 +284,14 @@ globals: formation: Formation locations: Locations warehouses: Warehouses - saleTracking: Sale tracking roles: Roles connections: Connections acls: ACLs mailForwarding: Mail forwarding mailAlias: Mail alias privileges: Privileges + observation: Notes + saleTracking: Sale tracking ldap: LDAP samba: Samba twoFactor: Two factor @@ -306,27 +302,12 @@ globals: serial: Serial medical: Mutual pit: IRPF - RouteExtendedList: Router wasteRecalc: Waste recaclulate operator: Operator parking: Parking - supplier: Supplier - created: Created - worker: Worker - now: Now - name: Name - new: New - comment: Comment - observations: Observations - goToModuleIndex: Go to module index unsavedPopup: title: Unsaved changes will be lost subtitle: Are you sure exit without saving? - createInvoiceIn: Create invoice in - myAccount: My account - noOne: No one - maxTemperature: Max - minTemperature: Min params: clientFk: Client id salesPersonFk: Sales person @@ -344,7 +325,7 @@ globals: supplierFk: Supplier supplierRef: Supplier ref serial: Serial - amount: Importe + amount: Amount awbCode: AWB correctedFk: Rectified correctingFk: Rectificative @@ -352,7 +333,6 @@ globals: countryFk: Country companyFk: Company changePass: Change password - setPass: Set password deleteConfirmTitle: Delete selected elements changeState: Change state raid: 'Raid {daysInForward} days' @@ -395,44 +375,74 @@ cau: subtitle: By sending this ticket, all the data related to the error, the section, the user, etc., are already sent. inputLabel: Explain why this error should not appear askPrivileges: Ask for privileges -ticket: - params: - ticketFk: Ticket ID - weekDay: Weekday - agencyModeFk: Agency - id: Worker - state: State - created: Created - externalId: External ID - counter: Counter - freightItemName: Freight item name - packageItemName: Package item name - longName: Long name - pageTitles: - tickets: Tickets - list: List - ticketCreate: New ticket - summary: Summary - basicData: Basic Data - boxing: Boxing - sms: Sms - notes: Notes - sale: Sale - dms: File management - negative: Tickets negative - volume: Volume - observation: Notes - ticketAdvance: Advance tickets - futureTickets: Future tickets - purchaseRequest: Purchase request - weeklyTickets: Weekly tickets +entry: list: - nickname: Nickname - state: State - shipped: Shipped - landed: Landed - salesPerson: Sales person - total: Total + newEntry: New entry + tableVisibleColumns: + created: Creation + supplierFk: Supplier + isBooked: Booked + isConfirmed: Confirmed + isOrdered: Ordered + companyFk: Company + travelFk: Travel + isExcludedFromAvailable: Inventory + invoiceAmount: Import + summary: + commission: Commission + currency: Currency + invoiceNumber: Invoice number + ordered: Ordered + booked: Booked + excludedFromAvailable: Inventory + travelReference: Reference + travelAgency: Agency + travelShipped: Shipped + travelDelivered: Delivered + travelLanded: Landed + travelReceived: Received + buys: Buys + stickers: Stickers + package: Package + packing: Pack. + grouping: Group. + buyingValue: Buying value + import: Import + pvp: PVP + basicData: + travel: Travel + currency: Currency + commission: Commission + observation: Observation + booked: Booked + excludedFromAvailable: Inventory + buys: + observations: Observations + packagingFk: Box + color: Color + printedStickers: Printed stickers + notes: + observationType: Observation type + latestBuys: + tableVisibleColumns: + image: Picture + itemFk: Item ID + weightByPiece: Weight/Piece + isActive: Active + family: Family + entryFk: Entry + freightValue: Freight value + comissionValue: Commission value + packageValue: Package value + isIgnored: Is ignored + price2: Grouping + price3: Packing + minPrice: Min + ektFk: Ekt + packingOut: Package out + landing: Landing + isExcludedFromAvailable: Es inventory +ticket: card: customerId: Customer ID customerCard: Customer card @@ -483,7 +493,6 @@ invoiceOut: card: issued: Issued customerCard: Customer card - ticketList: Ticket List summary: issued: Issued dued: Due @@ -536,6 +545,27 @@ parking: searchBar: info: You can search by parking code label: Search parking... +order: + field: + salesPersonFk: Sales Person + form: + clientFk: Client + addressFk: Address + agencyModeFk: Agency + list: + newOrder: New Order + summary: + basket: Basket + notConfirmed: Not confirmed + created: Created + createdFrom: Created From + address: Address + total: Total + items: Items + orderTicketList: Order Ticket List + amount: Amount + confirm: Confirm + confirmLines: Confirm lines department: chat: Chat bossDepartment: Boss Department @@ -654,11 +684,6 @@ wagon: minHeightBetweenTrays: 'The minimum height between trays is ' maxWagonHeight: 'The maximum height of the wagon is ' uncompleteTrays: There are incomplete trays - params: - label: Label - plate: Plate - volume: Volume - name: Name supplier: list: @@ -827,10 +852,7 @@ components: hasMinPrice: Minimum price # LatestBuysFilter salesPersonFk: Buyer - supplierFk: Supplier from: From - to: To - visible: Is visible active: Is active floramondo: Is floramondo showBadDates: Show future items diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index aad4f68cd..3752c29ae 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -5,6 +5,7 @@ globals: language: Idioma quantity: Cantidad entity: Entidad + preview: Vista previa user: Usuario details: Detalles preview: Vista previa @@ -58,11 +59,12 @@ globals: today: Hoy yesterday: Ayer dateFormat: es-ES - noSelectedRows: No tienes ninguna línea seleccionada microsip: Abrir en MicroSIP + noSelectedRows: No tienes ninguna línea seleccionada downloadCSVSuccess: Descarga de CSV exitosa reference: Referencia agency: Agencia + entry: Entrada warehouseOut: Alm. salida warehouseIn: Alm. entrada landed: F. entrega @@ -138,6 +140,26 @@ globals: medium: Mediano/a big: Grande email: Correo + supplier: Proveedor + ticketList: Listado de tickets + created: Fecha creación + worker: Trabajador + now: Ahora + name: Nombre + new: Nuevo + comment: Comentario + observations: Observaciones + goToModuleIndex: Ir al índice del módulo + createInvoiceIn: Crear factura recibida + myAccount: Mi cuenta + noOne: Nadie + maxTemperature: Máx + minTemperature: Mín + changePass: Cambiar contraseña + deleteConfirmTitle: Eliminar los elementos seleccionados + changeState: Cambiar estado + raid: 'Redada {daysInForward} días' + isVies: Vies pageTitles: logIn: Inicio de sesión addressEdit: Modificar consignatario @@ -161,17 +183,17 @@ globals: inheritedRoles: Roles heredados customers: Clientes customerCreate: Nuevo cliente + createCustomer: Crear cliente createOrder: Nuevo pedido list: Listado webPayments: Pagos Web extendedList: Listado extendido notifications: Notificaciones defaulter: Morosos - createCustomer: Crear cliente fiscalData: Datos fiscales billingData: Forma de pago consignees: Consignatarios - 'address-create': Nuevo consignatario + address-create: Nuevo consignatario notes: Notas credits: Créditos greuges: Greuges @@ -236,10 +258,10 @@ globals: wagonsList: Listado vagones wagonCreate: Crear tipo wagonEdit: Editar tipo + wagonCounter: Contador de carros typesList: Listado tipos typeCreate: Crear tipo typeEdit: Editar tipo - wagonCounter: Contador de carros roadmap: Troncales stops: Paradas routes: Rutas @@ -248,8 +270,8 @@ globals: routeCreate: Nueva ruta RouteRoadmap: Troncales RouteRoadmapCreate: Crear troncal - autonomous: Autónomos RouteExtendedList: Enrutador + autonomous: Autónomos suppliers: Proveedores supplier: Proveedor supplierCreate: Nuevo proveedor @@ -314,23 +336,9 @@ globals: wasteRecalc: Recalcular mermas operator: Operario parking: Parking - supplier: Proveedor - created: Fecha creación - worker: Trabajador - now: Ahora - name: Nombre - new: Nuevo - comment: Comentario - observations: Observaciones - goToModuleIndex: Ir al índice del módulo unsavedPopup: title: Los cambios que no haya guardado se perderán subtitle: ¿Seguro que quiere salir sin guardar? - createInvoiceIn: Crear factura recibida - myAccount: Mi cuenta - noOne: Nadie - maxTemperature: Máx - minTemperature: Mín params: clientFk: Id cliente salesPersonFk: Comercial @@ -353,12 +361,6 @@ globals: packing: ITP countryFk: País companyFk: Empresa - changePass: Cambiar contraseña - setPass: Establecer contraseña - deleteConfirmTitle: Eliminar los elementos seleccionados - changeState: Cambiar estado - raid: 'Redada {daysInForward} días' - isVies: Vies errors: statusUnauthorized: Acceso denegado statusInternalServerError: Ha ocurrido un error interno del servidor @@ -485,11 +487,15 @@ ticket: attender: Consignatario create: address: Dirección -invoiceOut: - card: - issued: Fecha emisión - customerCard: Ficha del cliente - ticketList: Listado de tickets +order: + field: + salesPersonFk: Comercial + form: + clientFk: Cliente + addressFk: Dirección + agencyModeFk: Agencia + list: + newOrder: Nuevo Pedido summary: issued: Fecha dued: Fecha límite @@ -500,47 +506,6 @@ invoiceOut: fee: Cuota tickets: Tickets totalWithVat: Importe - globalInvoices: - errors: - chooseValidClient: Selecciona un cliente válido - chooseValidCompany: Selecciona una empresa válida - chooseValidPrinter: Selecciona una impresora válida - chooseValidSerialType: Selecciona una tipo de serie válida - fillDates: La fecha de la factura y la fecha máxima deben estar completas - invoiceDateLessThanMaxDate: La fecha de la factura no puede ser menor que la fecha máxima - invoiceWithFutureDate: Existe una factura con una fecha futura - noTicketsToInvoice: No existen tickets para facturar - criticalInvoiceError: Error crítico en la facturación proceso detenido - invalidSerialTypeForAll: El tipo de serie debe ser global cuando se facturan todos los clientes - table: - addressId: Id dirección - streetAddress: Dirección fiscal - statusCard: - percentageText: '{getPercentage}% {getAddressNumber} de {getNAddresses}' - pdfsNumberText: '{nPdfs} de {totalPdfs} PDFs' - negativeBases: - clientId: Id cliente - base: Base - active: Activo - hasToInvoice: Facturar - verifiedData: Datos comprobados - comercial: Comercial - errors: - downloadCsvFailed: Error al descargar CSV -shelving: - list: - parking: Parking - priority: Prioridad - newShelving: Nuevo Carro - summary: - recyclable: Reciclable -parking: - pickingOrder: Orden de recogida - row: Fila - column: Columna - searchBar: - info: Puedes buscar por código de parking - label: Buscar parking... department: chat: Chat bossDepartment: Jefe de departamento @@ -730,6 +695,9 @@ supplier: consumption: entry: Entrada travel: + search: Buscar envío + searchInfo: Buscar envío por id o nombre + id: Id travelList: tableVisibleColumns: ref: Referencia @@ -760,62 +728,6 @@ travel: destination: Destino thermograph: Termógrafo travelFileDescription: 'Id envío { travelId }' -item: - descriptor: - buyer: Comprador - color: Color - category: Categoría - available: Disponible - warehouseText: 'Calculado sobre el almacén de { warehouseName }' - itemDiary: Registro de compra-venta - list: - id: Identificador - stems: Tallos - category: Reino - typeName: Tipo - isActive: Activo - weightByPiece: Peso (gramos)/tallo - userName: Comprador - stemMultiplier: Multiplicador - fixedPrice: - itemFk: ID Artículo - groupingPrice: Precio grouping - packingPrice: Precio packing - hasMinPrice: Tiene precio mínimo - minPrice: Precio min - started: Inicio - ended: Fin - create: - priority: Prioridad - summary: - otherData: Otros datos - tax: IVA - botanical: Botánico - barcode: Código de barras - completeName: Nombre completo - family: Familia - stems: Tallos - multiplier: Multiplicador - buyer: Comprador - doPhoto: Hacer foto - intrastatCode: Código intrastat - ref: Referencia - relevance: Relevancia - weight: Peso (gramos)/tallo - units: Unidades/caja - expense: Gasto - generic: Genérico - recycledPlastic: Plástico reciclado - nonRecycledPlastic: Plástico no reciclado - minSalesQuantity: Cantidad mínima de venta - genus: Genus - specie: Specie - buyRequest: - requester: Solicitante - requested: Solicitado - attender: Comprador - achieved: Conseguido - concept: Concepto components: topbar: {} itemsFilterPanel: diff --git a/src/pages/Customer/Card/CustomerConsumption.vue b/src/pages/Customer/Card/CustomerConsumption.vue index 640e37ed3..f0d8dea47 100644 --- a/src/pages/Customer/Card/CustomerConsumption.vue +++ b/src/pages/Customer/Card/CustomerConsumption.vue @@ -152,7 +152,8 @@ const updateDateParams = (value, params) => { v-if="campaignList" data-key="CustomerConsumption" url="Clients/consumption" - :order="['itemTypeFk', 'itemName', 'itemSize', 'description']" + :order="['itemTypeFk', 'itemName', 'itemSize', 'description']" + :filter="{ where: { clientFk: route.params.id } }" :columns="columns" search-url="consumption" :user-params="userParams" diff --git a/src/pages/Customer/Card/CustomerDescriptor.vue b/src/pages/Customer/Card/CustomerDescriptor.vue index cd88e5198..57cd6cd0b 100644 --- a/src/pages/Customer/Card/CustomerDescriptor.vue +++ b/src/pages/Customer/Card/CustomerDescriptor.vue @@ -201,14 +201,18 @@ const debtWarning = computed(() => { - {{ t('Go to user') }} + {{ t('globals.pageTitles.createOrder') }} { }; const clientFk = { ticket: 'clientId', - order: 'clientFk', }; const key = clientFk[type]; if (!key) return; @@ -80,11 +79,6 @@ const updateSubstitutionAllowed = async () => { {{ t('globals.pageTitles.createTicket') }} - - - {{ t('globals.pageTitles.createOrder') }} - - {{ $props.customer.substitutionAllowed diff --git a/src/pages/Customer/Card/CustomerUnpaid.vue b/src/pages/Customer/Card/CustomerUnpaid.vue index 18b12c60c..f76e35821 100644 --- a/src/pages/Customer/Card/CustomerUnpaid.vue +++ b/src/pages/Customer/Card/CustomerUnpaid.vue @@ -50,7 +50,8 @@ const filterClientFindOne = { >