diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index 4c7445aab..e921d8e1f 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -42,10 +42,13 @@ const $props = defineProps({ type: Number, default: null, }, + uppercase: { + type: Boolean, + default: false, + }, }); const vnInputRef = ref(null); -const showPassword = ref(false); const value = computed({ get() { return $props.modelValue; @@ -117,6 +120,10 @@ const handleInsertMode = (e) => { input.setSelectionRange(cursorPos + 1, cursorPos + 1); }); }; + +const handleUppercase = () => { + value.value = value.value?.toUpperCase() || ''; +}; @@ -159,7 +166,16 @@ const handleInsertMode = (e) => { emit('remove'); } " + > + + + @@ -170,3 +186,14 @@ const handleInsertMode = (e) => { + + + en: + inputMin: Must be more than {value} + maxLength: The value exceeds {value} characters + inputMax: Must be less than {value} + es: + inputMin: Debe ser mayor a {value} + maxLength: El valor excede los {value} carácteres + inputMax: Debe ser menor a {value} + \ No newline at end of file diff --git a/src/components/common/__tests__/VnInputTime.spec.js b/src/components/common/__tests__/VnInputTime.spec.js new file mode 100644 index 000000000..2692ac71b --- /dev/null +++ b/src/components/common/__tests__/VnInputTime.spec.js @@ -0,0 +1,63 @@ +import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest'; +import { createWrapper } from 'app/test/vitest/helper'; +import VnInputTime from 'components/common/VnInputTime.vue'; + +describe('VnInputTime', () => { + let wrapper; + let vm; + + beforeAll(() => { + wrapper = createWrapper(VnInputTime, { + props: { + isOutlined: true, + timeOnly: false, + }, + }); + vm = wrapper.vm; + wrapper = wrapper.wrapper; + }); + + afterEach(() => { + vi.clearAllMocks(); + }); + + it('should return the correct data if isOutlined is true', () => { + expect(vm.isOutlined).toBe(true); + expect(vm.styleAttrs).toEqual({ dense: true, outlined: true, rounded: true }); + }); + + it('should return the formatted data', () => { + expect(vm.dateToTime('2022-01-01T03:23:43')).toBe('03:23'); + }); + + describe('formattedTime', () => { + it('should return the formatted time for a valid ISO date', () => { + vm.model = '2025-01-02T15:45:00'; + expect(vm.formattedTime).toBe('15:45'); + }); + + it('should handle null model value gracefully', () => { + vm.model = null; + expect(vm.formattedTime).toBe(null); + }); + + it('should handle time-only input correctly', async () => { + await wrapper.setProps({ timeOnly: true }); + vm.formattedTime = '14:30'; + expect(vm.model).toBe('14:30'); + }); + + it('should pad short time values correctly', async () => { + await wrapper.setProps({ timeOnly: true }); + vm.formattedTime = '9'; + expect(vm.model).toBe('09:00'); + }); + + it('should not update the model if the value is unchanged', () => { + vm.model = '14:30'; + const previousModel = vm.model; + vm.formattedTime = '14:30'; + expect(vm.model).toBe(previousModel); + }); + }); +}); \ No newline at end of file diff --git a/src/components/ui/SkeletonSummary.vue b/src/components/ui/SkeletonSummary.vue index e8407ee7b..659d4c53d 100644 --- a/src/components/ui/SkeletonSummary.vue +++ b/src/components/ui/SkeletonSummary.vue @@ -1,38 +1,49 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index e1ec62175..dbc3e4077 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -389,80 +389,6 @@ 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 -entry: - list: - 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 - params: - toShipped: To - fromShipped: From - warehouseiNFk: Warehouse - daysOnward: Days onward - daysAgo: Days ago - warehouseInFk: Warehouse in ticket: params: ticketFk: Ticket ID @@ -869,7 +795,10 @@ 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 4b4f6f552..1b6ed7b71 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -389,80 +389,6 @@ cau: subtitle: Al enviar este cau ya se envían todos los datos relacionados con el error, la sección, el usuario, etc inputLabel: Explique el motivo por el que no deberia aparecer este fallo askPrivileges: Solicitar permisos -entry: - list: - newEntry: Nueva entrada - tableVisibleColumns: - created: Creación - supplierFk: Proveedor - isBooked: Asentado - isConfirmed: Confirmado - isOrdered: Pedida - companyFk: Empresa - travelFk: Envio - isExcludedFromAvailable: Inventario - invoiceAmount: Importe - summary: - commission: Comisión - currency: Moneda - invoiceNumber: Núm. factura - ordered: Pedida - booked: Contabilizada - excludedFromAvailable: Inventario - travelReference: Referencia - travelAgency: Agencia - travelShipped: F. envio - travelWarehouseOut: Alm. salida - travelDelivered: Enviada - travelLanded: F. entrega - travelReceived: Recibida - buys: Compras - stickers: Etiquetas - package: Embalaje - packing: Pack. - grouping: Group. - buyingValue: Coste - import: Importe - pvp: PVP - basicData: - travel: Envío - currency: Moneda - observation: Observación - commission: Comisión - booked: Asentado - excludedFromAvailable: Inventario - buys: - observations: Observaciónes - packagingFk: Embalaje - color: Color - printedStickers: Etiquetas impresas - notes: - observationType: Tipo de observación - latestBuys: - tableVisibleColumns: - image: Foto - itemFk: Id Artículo - weightByPiece: Peso (gramos)/tallo - isActive: Activo - family: Familia - entryFk: Entrada - freightValue: Porte - comissionValue: Comisión - packageValue: Embalaje - isIgnored: Ignorado - price2: Grouping - price3: Packing - minPrice: Min - ektFk: Ekt - packingOut: Embalaje envíos - landing: Llegada - isExcludedFromAvailable: Es inventario - params: - toShipped: Hasta - fromShipped: Desde - warehouseInFk: Alm. entrada - daysOnward: Días adelante - daysAgo: Días atras ticket: params: ticketFk: ID de ticket @@ -866,7 +792,11 @@ components: wareHouseFk: Almacén # LatestBuysFilter salesPersonFk: Comprador + supplierFk: Proveedor + visible: Visible active: Activo + from: Desde + to: Hasta floramondo: Floramondo showBadDates: Ver items a futuro userPanel: diff --git a/src/pages/Customer/Card/CustomerFiscalData.vue b/src/pages/Customer/Card/CustomerFiscalData.vue index aff7deda4..8f2c4efb0 100644 --- a/src/pages/Customer/Card/CustomerFiscalData.vue +++ b/src/pages/Customer/Card/CustomerFiscalData.vue @@ -44,6 +44,7 @@ function handleLocation(data, location) { :required="true" :rules="validate('client.socialName')" clearable + uppercase="true" v-model="data.socialName" > diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue index fdfd7ff9c..51788a842 100644 --- a/src/pages/Customer/CustomerList.vue +++ b/src/pages/Customer/CustomerList.vue @@ -50,6 +50,14 @@ const columns = computed(() => [ isTitle: true, create: true, columnClass: 'expand', + attrs: { + uppercase: true, + }, + columnFilter: { + attrs: { + uppercase: false, + }, + }, }, { align: 'left', diff --git a/src/pages/Customer/components/CustomerAddressCreate.vue b/src/pages/Customer/components/CustomerAddressCreate.vue index bc4d6a128..32b4078db 100644 --- a/src/pages/Customer/components/CustomerAddressCreate.vue +++ b/src/pages/Customer/components/CustomerAddressCreate.vue @@ -11,6 +11,7 @@ import VnInput from 'src/components/common/VnInput.vue'; import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelectDialog from 'src/components/common/VnSelectDialog.vue'; import CustomerNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue'; +import VnInputNumber from 'src/components/common/VnInputNumber.vue'; const { t } = useI18n(); const route = useRoute(); @@ -150,6 +151,22 @@ function onAgentCreated({ id, fiscalName }, data) { + + + + @@ -175,4 +192,6 @@ es: Mobile: Movíl Incoterms: Incoterms Customs agent: Agente de aduanas + Longitude: Longitud + Latitude: Latitud diff --git a/src/pages/Entry/Card/EntryCard.vue b/src/pages/Entry/Card/EntryCard.vue index 3f2596338..e00623a21 100644 --- a/src/pages/Entry/Card/EntryCard.vue +++ b/src/pages/Entry/Card/EntryCard.vue @@ -1,21 +1,13 @@ - diff --git a/src/pages/Entry/EntryFilter.vue b/src/pages/Entry/EntryFilter.vue index f91f7f128..bc8b40aaa 100644 --- a/src/pages/Entry/EntryFilter.vue +++ b/src/pages/Entry/EntryFilter.vue @@ -40,7 +40,7 @@ const companiesOptions = ref([]); - {{ t(`params.${tag.label}`) }}: + {{ t(`entryFilter.params.${tag.label}`) }}: {{ formatFn(tag.value) }} @@ -49,7 +49,7 @@ const companiesOptions = ref([]); @@ -58,7 +58,7 @@ const companiesOptions = ref([]); @@ -67,7 +67,7 @@ const companiesOptions = ref([]); @@ -76,7 +76,7 @@ const companiesOptions = ref([]); @@ -84,7 +84,7 @@ const companiesOptions = ref([]); @@ -194,7 +194,7 @@ const companiesOptions = ref([]); @@ -202,35 +202,4 @@ const companiesOptions = ref([]); - - - -en: - params: - - invoiceNumber: Invoice number - travelFk: Travel - companyFk: Company - currencyFk: Currency - supplierFk: Supplier - from: From - to: To - created: Created - isBooked: Booked - isConfirmed: Confirmed - isOrdered: Ordered -es: - params: - - invoiceNumber: Núm. factura - travelFk: Envío - companyFk: Empresa - currencyFk: Moneda - supplierFk: Proveedor - from: Desde - to: Hasta - created: Fecha creación - isBooked: Asentado - isConfirmed: Confirmado - isOrdered: Pedida - + \ No newline at end of file diff --git a/src/pages/Entry/EntryLatestBuys.vue b/src/pages/Entry/EntryLatestBuys.vue index 450efe624..73fdcbbbf 100644 --- a/src/pages/Entry/EntryLatestBuys.vue +++ b/src/pages/Entry/EntryLatestBuys.vue @@ -102,7 +102,7 @@ const columns = [ }, { align: 'left', - label: t('globals.weightByPiece'), + label: t('entry.latestBuys.tableVisibleColumns.weightByPiece'), name: 'weightByPiece', columnFilter: { component: 'number', @@ -157,7 +157,7 @@ const columns = [ }, { align: 'left', - label: t('entry.buys.packageValue'), + label: t('entry.latestBuys.tableVisibleColumns.packageValue'), name: 'packageValue', columnFilter: { component: 'number', @@ -262,8 +262,3 @@ onUnmounted(() => (stateStore.rightDrawer = false)); :right-search="false" /> - - -es: - Edit buy(s): Editar compra(s) - diff --git a/src/pages/Entry/EntryList.vue b/src/pages/Entry/EntryList.vue index 879a50914..ea6f1a621 100644 --- a/src/pages/Entry/EntryList.vue +++ b/src/pages/Entry/EntryList.vue @@ -2,17 +2,17 @@ import { ref, computed } from 'vue'; import { useI18n } from 'vue-i18n'; import EntryFilter from './EntryFilter.vue'; -import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import VnTable from 'components/VnTable/VnTable.vue'; -import RightMenu from 'src/components/common/RightMenu.vue'; import { toDate } from 'src/filters'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import EntrySummary from './Card/EntrySummary.vue'; import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue'; import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue'; +import VnSection from 'src/components/common/VnSection.vue'; const { t } = useI18n(); const tableRef = ref(); +const dataKey = 'EntryList'; const { viewSummary } = useSummaryDialog(); const entryFilter = { @@ -178,73 +178,73 @@ const columns = computed(() => [ }, ]); + - - - + :array-data-props="{ + url: 'Entries/filter', + order: 'id DESC', + userFilter: 'entryFilter', + }" + > + - - - - - - {{ - t('entry.list.tableVisibleColumns.isExcludedFromAvailable') - }} - - - - {{ - t('globals.raid', { daysInForward: row.daysInForward }) - }} - - + + + + + + {{ + t( + 'entry.list.tableVisibleColumns.isExcludedFromAvailable' + ) + }} + + + + {{ + t('globals.raid', { + daysInForward: row.daysInForward, + }) + }} + + + + + + {{ row.supplierName }} + + + + + + {{ row.travelRef }} + + + + - - - {{ row.supplierName }} - - - - - - {{ row.travelRef }} - - - - + - - -es: - Virtual entry: Es una redada - Search entries: Buscar entradas - You can search by entry reference: Puedes buscar por referencia de la entrada - Create entry: Crear entrada - diff --git a/src/pages/Entry/EntryStockBought.vue b/src/pages/Entry/EntryStockBought.vue index 3f0cd2d99..fa0bdc12e 100644 --- a/src/pages/Entry/EntryStockBought.vue +++ b/src/pages/Entry/EntryStockBought.vue @@ -1,5 +1,5 @@