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/VnInputDate.vue b/src/components/common/VnInputDate.vue index 952a843e3..a8888aad8 100644 --- a/src/components/common/VnInputDate.vue +++ b/src/components/common/VnInputDate.vue @@ -105,6 +105,7 @@ const manageDate = (date) => { :rules="mixinRules" :clearable="false" @click="isPopupOpen = !isPopupOpen" + @keydown="isPopupOpen = false" hide-bottom-space > diff --git a/src/components/common/VnInputTime.vue b/src/components/common/VnInputTime.vue index 4147f8976..323427f5b 100644 --- a/src/components/common/VnInputTime.vue +++ b/src/components/common/VnInputTime.vue @@ -79,6 +79,7 @@ function dateToTime(newDate) { style="min-width: 100px" :rules="mixinRules" @click="isPopupOpen = !isPopupOpen" + @keydown="isPopupOpen = false" type="time" hide-bottom-space > diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index a1b8f3f1e..43134dbff 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -297,7 +297,7 @@ async function onScroll({ to, direction, from, index }) { } } -defineExpose({ opts: myOptions }); +defineExpose({ opts: myOptions, vnSelectRef }); function handleKeyDown(event) { if (event.key === 'Tab' && !event.shiftKey) { diff --git a/src/components/common/VnSelectDialog.vue b/src/components/common/VnSelectDialog.vue index 12322c3fa..a4cd0011d 100644 --- a/src/components/common/VnSelectDialog.vue +++ b/src/components/common/VnSelectDialog.vue @@ -1,5 +1,5 @@ emit('update:modelValue', ...args)" diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 047ee8cc2..d76053ce9 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -7,7 +7,9 @@ import { isDialogOpened } from 'src/filters'; const arrayDataStore = useArrayDataStore(); -export function useArrayData(key = useRoute().meta.moduleName, userOptions) { +export function useArrayData(key, userOptions) { + key ??= useRoute().meta.moduleName; + if (!key) throw new Error('ArrayData: A key is required to use this composable'); if (!arrayDataStore.get(key)) arrayDataStore.set(key); diff --git a/src/css/app.scss b/src/css/app.scss index d4790a6b8..a28a04a16 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -310,6 +310,14 @@ input::-webkit-inner-spin-button { .no-visible { visibility: hidden; } + +.q-item > .q-item__section:has(.q-checkbox) { + max-width: min-content; +} + +.row > .column:has(.q-checkbox) { + max-width: min-content; +} .q-field__inner { .q-field__control { min-height: auto !important; diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index e1ec62175..473446970 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 @@ -778,6 +704,7 @@ travel: totalEntries: Total entries totalEntriesTooltip: Total entries daysOnward: Landed days onwards + awb: AWB summary: entryId: Entry Id freight: Freight @@ -869,7 +796,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..b764b1e43 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 @@ -774,6 +700,7 @@ travel: totalEntries: ∑ totalEntriesTooltip: Entradas totales daysOnward: Días de llegada en adelante + awb: AWB summary: entryId: Id entrada freight: Porte @@ -866,7 +793,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/CustomerBillingData.vue b/src/pages/Customer/Card/CustomerBillingData.vue index 48f729e29..29394ceec 100644 --- a/src/pages/Customer/Card/CustomerBillingData.vue +++ b/src/pages/Customer/Card/CustomerBillingData.vue @@ -38,7 +38,7 @@ const getBankEntities = (data, formData) => { hide-selected option-label="name" option-value="id" - v-model="data.payMethod" + v-model="data.payMethodFk" /> diff --git a/src/pages/Customer/Card/CustomerCredits.vue b/src/pages/Customer/Card/CustomerCredits.vue index 1fa7047e5..d6e4be89e 100644 --- a/src/pages/Customer/Card/CustomerCredits.vue +++ b/src/pages/Customer/Card/CustomerCredits.vue @@ -59,6 +59,7 @@ const columns = computed(() => [ diff --git a/src/pages/Customer/Card/CustomerGreuges.vue b/src/pages/Customer/Card/CustomerGreuges.vue index dcf297d12..47a589aaa 100644 --- a/src/pages/Customer/Card/CustomerGreuges.vue +++ b/src/pages/Customer/Card/CustomerGreuges.vue @@ -84,6 +84,7 @@ const columns = computed(() => [ component: 'number', autofocus: true, required: true, + positive: false, }, format: ({ amount }) => toCurrency(amount), create: true, diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue index fdfd7ff9c..bd2947cfc 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', @@ -423,7 +431,7 @@ function handleLocation(data, location) { :label="t('customer.summary.salesPerson')" v-model="data.salesPersonFk" :params="{ - departmentCodes: ['VT', 'shopping'], + departmentCodes: ['VT'], }" :has-avatar="true" :id-value="data.salesPersonFk" diff --git a/src/pages/Department/Card/DepartmentDescriptor.vue b/src/pages/Department/Card/DepartmentDescriptor.vue index e08495faf..b219ccfe1 100644 --- a/src/pages/Department/Card/DepartmentDescriptor.vue +++ b/src/pages/Department/Card/DepartmentDescriptor.vue @@ -106,7 +106,7 @@ const { openConfirmationModal } = useVnConfirm(); :to="{ name: 'WorkerList', query: { - params: JSON.stringify({ departmentFk: entityId }), + table: JSON.stringify({ departmentFk: entityId }), }, }" > 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..7bf45491f 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 @@ @@ -167,6 +168,7 @@ function autocompleteExpense(evt, row, col) { -import { onMounted, computed, reactive, ref, nextTick, watch } from 'vue'; +import { onMounted, computed, ref, nextTick } from 'vue'; import { useI18n } from 'vue-i18n'; -import { useRoute, useRouter } from 'vue-router'; +import { useRoute } from 'vue-router'; import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue'; import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue'; @@ -22,19 +22,16 @@ import VnSubToolbar from 'components/ui/VnSubToolbar.vue'; const { t } = useI18n(); const route = useRoute(); -const router = useRouter(); const state = useState(); const user = state.getUser(); -const today = ref(Date.vnNew()); +const today = Date.vnNew(); +today.setHours(0, 0, 0, 0); const warehousesOptions = ref([]); -const itemBalancesRef = ref(null); -const itemsBalanceFilter = reactive({ - where: { itemFk: route.params.id, warehouseFk: null, date: null }, -}); -const itemBalances = ref([]); -const warehouseFk = ref(null); -const _showWhatsBeforeInventory = ref(false); +const itemBalances = computed(() => arrayDataItemBalances.store.data); +const where = computed(() => arrayDataItemBalances.store.filter.where || {}); +const showWhatsBeforeInventory = ref(false); const inventoriedDate = ref(null); +let arrayDataItemBalances = useArrayData('ItemBalances'); const originTypeMap = { entry: { @@ -122,36 +119,28 @@ const columns = computed(() => [ }, ]); -const showWhatsBeforeInventory = computed({ - get: () => _showWhatsBeforeInventory.value, - set: (val) => { - _showWhatsBeforeInventory.value = val; - if (!val) itemsBalanceFilter.where.date = null; - else itemsBalanceFilter.where.date = inventoriedDate.value ?? new Date(); - }, -}); - onMounted(async () => { - today.value.setHours(0, 0, 0, 0); - if (route.query.warehouseFk) warehouseFk.value = route.query.warehouseFk; - else if (user.value) warehouseFk.value = user.value.warehouseFk; - itemsBalanceFilter.where.warehouseFk = warehouseFk.value; - const { data } = await axios.get('Configs/findOne'); - inventoriedDate.value = data.inventoried; + const ref = where.value; + const query = route.query; + inventoriedDate.value = + (await axios.get('Configs/findOne')).data?.inventoried || today; + + if (query.warehouseFk) ref.warehouseFk = query.warehouseFk; + else if (!ref.warehouseFk && user.value) ref.warehouseFk = user.value.warehouseFk; + if (ref.date) showWhatsBeforeInventory.value = true; + ref.itemFk = route.params.id; + + arrayDataItemBalances = useArrayData('ItemBalances', { + url: 'Items/getBalance', + filter: { where: ref }, + }); + await fetchItemBalances(); await scrollToToday(); - await updateWarehouse(warehouseFk.value); + await updateWarehouse(ref.warehouseFk); }); -watch( - () => router.currentRoute.value.params.id, - (newId) => { - itemsBalanceFilter.where.itemFk = newId; - itemBalancesRef.value.fetch(); - } -); - -const fetchItemBalances = async () => await itemBalancesRef.value.fetch(); +const fetchItemBalances = async () => await arrayDataItemBalances.fetch({}); const getBadgeAttrs = (_date) => { const isSameDate = date.isSameDate(today.value, _date); @@ -178,23 +167,13 @@ const formatDateForAttribute = (dateValue) => { }; async function updateWarehouse(warehouseFk) { - const stock = useArrayData('descriptorStock', { - userParams: { - warehouseFk, - }, - }); + const stock = useArrayData('descriptorStock', { userParams: { warehouseFk } }); await stock.fetch({}); stock.store.data.itemFk = route.params.id; } - (itemBalances = data)" - /> fetchItemBalances() && updateWarehouse(value) + (val) => fetchItemBalances() && updateWarehouse(val) " class="q-mr-lg" + :is-clearable="false" /> { + if (!val) where.date = null; + else where.date = inventoriedDate; + await fetchItemBalances(); + } + " class="q-mr-lg" /> diff --git a/src/pages/Item/Card/ItemLastEntries.vue b/src/pages/Item/Card/ItemLastEntries.vue index c2df553c3..7d8890c2b 100644 --- a/src/pages/Item/Card/ItemLastEntries.vue +++ b/src/pages/Item/Card/ItemLastEntries.vue @@ -36,18 +36,7 @@ const exprBuilder = (param, value) => { } }; -const where = { - itemFk: route.params.id, -}; - -const arrayData = useArrayData('ItemLastEntries', { - url: 'Items/lastEntriesFilter', - order: ['landed DESC', 'buyFk DESC'], - exprBuilder: exprBuilder, - userFilter: { - where: where, - }, -}); +let arrayData = useArrayData('ItemLastEntries'); const itemLastEntries = ref([]); const columns = computed(() => [ @@ -161,25 +150,51 @@ const getDate = (date, type) => { }; const updateFilter = async () => { - let filter; - if (!from.value && to.value) filter = { lte: to.value }; - else if (from.value && !to.value) filter = { gte: from.value }; - else if (from.value && to.value) filter = { between: [from.value, to.value] }; - - const userFilter = arrayData.store.userFilter.where; - - userFilter.landed = filter; + let landed; + if (!from.value && to.value) landed = { lte: to.value }; + else if (from.value && !to.value) landed = { gte: from.value }; + else if (from.value && to.value) landed = { between: [from.value, to.value] }; + arrayData.store.filter.where.landed = landed; await fetchItemLastEntries(); }; onMounted(async () => { - const _from = Date.vnNew(); - _from.setDate(_from.getDate() - 75); - from.value = getDate(_from, 'from'); - const _to = Date.vnNew(); - _to.setDate(_to.getDate() + 10); - to.value = getDate(_to, 'to'); + const landed = arrayData.store.filter.where?.landed; + arrayData = useArrayData('ItemLastEntries', { + url: 'Items/lastEntriesFilter', + order: ['landed DESC', 'buyFk DESC'], + exprBuilder: exprBuilder, + filter: { + where: { + itemFk: route.params.id, + landed, + }, + }, + }); + + if (landed) { + const key = Object.keys(landed)[0]; + switch (key) { + case 'gte': + from.value = landed.gte; + break; + case 'lte': + to.value = landed.lte; + break; + case 'between': + from.value = landed.between[0]; + to.value = landed.between[1]; + break; + } + } else { + const _from = Date.vnNew(); + _from.setDate(_from.getDate() - 75); + from.value = getDate(_from, 'from'); + const _to = Date.vnNew(); + _to.setDate(_to.getDate() + 10); + to.value = getDate(_to, 'to'); + } updateFilter(); diff --git a/src/pages/Order/Card/OrderLines.vue b/src/pages/Order/Card/OrderLines.vue index 9d802c557..36dc3883e 100644 --- a/src/pages/Order/Card/OrderLines.vue +++ b/src/pages/Order/Card/OrderLines.vue @@ -228,9 +228,8 @@ async function handleConfirm() { }); router.push({ name: 'TicketSale', - query: { - table: JSON.stringify({ id: ticket.data[0].ticketFk }), - }, + params: { id: ticket.data[0].ticketFk }, + query: { table: JSON.stringify({ filter: { limit: 20, skip: 0 } }) }, }); } } diff --git a/src/pages/Supplier/Card/SupplierFiscalData.vue b/src/pages/Supplier/Card/SupplierFiscalData.vue index 44235717f..1d9f3ab94 100644 --- a/src/pages/Supplier/Card/SupplierFiscalData.vue +++ b/src/pages/Supplier/Card/SupplierFiscalData.vue @@ -68,6 +68,8 @@ function handleLocation(data, location) { 'supplierActivityFk', 'healthRegister', 'street', + 'isVies', + 'isTrucker', ], include: [ { @@ -92,6 +94,7 @@ function handleLocation(data, location) { [ align: 'left', label: t('globals.name'), name: 'socialName', - create: true, + attrs: { + uppercase: true, + }, columnFilter: { name: 'search', + attrs: { + uppercase: false, + }, }, isTitle: true, }, @@ -118,14 +124,18 @@ const columns = computed(() => [ formInitialData: {}, mapper: (data) => { data.name = data.socialName; - delete data.socialName; + return data; }, }" :right-search="false" order="id ASC" :columns="columns" - /> + > + + + + diff --git a/src/pages/Ticket/Card/TicketSale.vue b/src/pages/Ticket/Card/TicketSale.vue index 8aa785c74..b849b3b35 100644 --- a/src/pages/Ticket/Card/TicketSale.vue +++ b/src/pages/Ticket/Card/TicketSale.vue @@ -54,7 +54,6 @@ const transfer = ref({ }); const tableRef = ref([]); const canProceed = ref(); -const isLoading = ref(false); watch( () => route.params.id, @@ -197,6 +196,7 @@ const changeQuantity = async (sale) => { try { if (!rowToUpdate.value) return; rowToUpdate.value = null; + sale.isNew = false; await updateQuantity(sale); } catch (e) { const { quantity } = tableRef.value.CrudModelRef.originalData.find( @@ -214,9 +214,6 @@ const updateQuantity = async ({ quantity, id }) => { }; const addSale = async (sale) => { - if (isLoading.value) return; - - isLoading.value = true; const params = { barcode: sale.itemFk, quantity: sale.quantity, @@ -237,6 +234,7 @@ const addSale = async (sale) => { sale.item = newSale.item; notify('globals.dataSaved', 'positive'); + sale.isNew = false; arrayData.fetch({}); }; @@ -754,6 +752,7 @@ watch( option-label="name" option-value="id" v-model="row.itemFk" + :use-like="false" @update:model-value="updateItem(row)" > diff --git a/src/pages/Ticket/Card/TicketService.vue b/src/pages/Ticket/Card/TicketService.vue index 950e6e8be..18dcaea7e 100644 --- a/src/pages/Ticket/Card/TicketService.vue +++ b/src/pages/Ticket/Card/TicketService.vue @@ -166,6 +166,7 @@ async function handleSave() { v-model="row.ticketServiceTypeFk" :options="ticketServiceOptions" option-label="name" + :roles-allowed-to-create="['administrative']" option-value="id" hide-selected > diff --git a/src/pages/Travel/TravelList.vue b/src/pages/Travel/TravelList.vue index 67fdb3254..c976678e0 100644 --- a/src/pages/Travel/TravelList.vue +++ b/src/pages/Travel/TravelList.vue @@ -79,6 +79,13 @@ const columns = computed(() => [ cardVisible: true, create: true, }, + { + align: 'left', + name: 'awb', + label: t('travel.travelList.tableVisibleColumns.awb'), + columnFilter: false, + format: (row) => row.awbCode, + }, { align: 'left', name: 'warehouseInFk', diff --git a/src/pages/Worker/Card/WorkerPda.vue b/src/pages/Worker/Card/WorkerPda.vue index 3ceee2493..c1beef40d 100644 --- a/src/pages/Worker/Card/WorkerPda.vue +++ b/src/pages/Worker/Card/WorkerPda.vue @@ -27,7 +27,7 @@ const initialData = computed(() => { return { userFk: routeId.value, deviceProductionFk: null, - simSerialNumber: null, + simFk: null, }; }); @@ -42,7 +42,7 @@ const deallocatePDA = async (deviceProductionFk) => { function reloadData() { initialData.value.deviceProductionFk = null; - initialData.value.simSerialNumber = null; + initialData.value.simFk = null; paginate.value.fetch(); } @@ -89,7 +89,7 @@ function reloadData() { /> { year: selectedDateYear.value, week: selectedWeekNumber.value, }; - const mail = ( - await axiosNoError.get(`Workers/${route.params.id}/mail`, { - params: { filter: { where } }, - }) - ).data[0]; + try { + const [{ data: mailData }, { data: countData }] = await Promise.all([ + axiosNoError.get(`Workers/${route.params.id}/mail`, { + params: { filter: { where } }, + }), + axiosNoError.get('WorkerTimeControlMails/count', { params: { where } }), + ]); - if (!mail) state.value = null; - else { - state.value = mail.state; - reason.value = mail.reason; + const mail = mailData[0]; + + state.value = mail?.state; + reason.value = mail?.reason; + canResend.value = !!countData.count; + } catch { + state.value = null; } - - canResend.value = !!( - await axiosNoError.get('WorkerTimeControlMails/count', { params: { where } }) - ).data.count; }; const setHours = (data) => { diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue index 48393a8c7..0b784b993 100644 --- a/src/pages/Worker/WorkerList.vue +++ b/src/pages/Worker/WorkerList.vue @@ -138,7 +138,11 @@ function uppercaseStreetModel(data) { return { get: () => (data.street ? data.street.toUpperCase() : ''), set: (value) => { - data.street = value.toUpperCase(); + if (value) { + data.street = value.toUpperCase(); + } else { + data.street = null; + } }, }; } diff --git a/src/router/modules/entry.js b/src/router/modules/entry.js index 26ce773c5..f362c7653 100644 --- a/src/router/modules/entry.js +++ b/src/router/modules/entry.js @@ -1,50 +1,123 @@ import { RouterView } from 'vue-router'; +const entryCard = { + name: 'EntryCard', + path: ':id', + component: () => import('src/pages/Entry/Card/EntryCard.vue'), + redirect: { name: 'EntrySummary' }, + meta: { + menu: [ + 'EntryBasicData', + 'EntryBuys', + 'EntryNotes', + 'EntryDms', + 'EntryLog', + ], + }, + children: [ + { + path: 'summary', + name: 'EntrySummary', + meta: { + title: 'summary', + icon: 'launch', + }, + component: () => import('src/pages/Entry/Card/EntrySummary.vue'), + }, + { + path: 'basic-data', + name: 'EntryBasicData', + meta: { + title: 'basicData', + icon: 'vn:settings', + }, + component: () => import('src/pages/Entry/Card/EntryBasicData.vue'), + }, + { + path: 'buys', + name: 'EntryBuys', + meta: { + title: 'buys', + icon: 'vn:lines', + }, + component: () => import('src/pages/Entry/Card/EntryBuys.vue'), + }, + { + path: 'buys/import', + name: 'EntryBuysImport', + component: () => import('src/pages/Entry/Card/EntryBuysImport.vue'), + }, + { + path: 'notes', + name: 'EntryNotes', + meta: { + title: 'notes', + icon: 'vn:notes', + }, + component: () => import('src/pages/Entry/Card/EntryNotes.vue'), + }, + { + path: 'dms', + name: 'EntryDms', + meta: { + title: 'dms', + icon: 'smb_share', + }, + component: () => import('src/pages/Entry/Card/EntryDms.vue'), + }, + { + path: 'log', + name: 'EntryLog', + meta: { + title: 'log', + icon: 'vn:History', + }, + component: () => import('src/pages/Entry/Card/EntryLog.vue'), + }, + ], +}; + export default { - path: '/entry', name: 'Entry', + path: '/entry', meta: { title: 'entries', icon: 'vn:entry', moduleName: 'Entry', keyBinding: 'e', - }, - component: RouterView, - redirect: { name: 'EntryMain' }, - menus: { - main: [ + menu: [ 'EntryList', 'MyEntries', 'EntryLatestBuys', 'EntryStockBought', 'EntryWasteRecalc', - ], - card: ['EntryBasicData', 'EntryBuys', 'EntryNotes', 'EntryDms', 'EntryLog'], + ] }, + component: RouterView, + redirect: { name: 'EntryMain' }, children: [ { - path: '', name: 'EntryMain', + path: '', component: () => import('src/components/common/VnModule.vue'), - redirect: { name: 'EntryList' }, + redirect: { name: 'EntryIndexMain' }, children: [ { - path: 'list', - name: 'EntryList', - meta: { - title: 'list', - icon: 'view_list', - }, + path:'', + name: 'EntryIndexMain', + redirect: { name: 'EntryList' }, component: () => import('src/pages/Entry/EntryList.vue'), - }, - { - path: 'my', - name: 'MyEntries', - meta: { - title: 'labeler', - icon: 'sell', - }, - component: () => import('src/pages/Entry/MyEntries.vue'), + children: [ + { + name: 'EntryList', + path: 'list', + meta: { + title: 'list', + icon: 'view_list', + }, + }, + entryCard, + ], }, { path: 'create', @@ -54,6 +127,15 @@ export default { icon: 'add', }, component: () => import('src/pages/Entry/EntryCreate.vue'), + }, + { + path: 'my', + name: 'MyEntries', + meta: { + title: 'labeler', + icon: 'sell', + }, + component: () => import('src/pages/Entry/MyEntries.vue'), }, { path: 'latest-buys', @@ -84,72 +166,5 @@ export default { }, ], }, - { - name: 'EntryCard', - path: ':id', - component: () => import('src/pages/Entry/Card/EntryCard.vue'), - redirect: { name: 'EntrySummary' }, - children: [ - { - name: 'EntrySummary', - path: 'summary', - meta: { - title: 'summary', - icon: 'launch', - }, - component: () => import('src/pages/Entry/Card/EntrySummary.vue'), - }, - { - path: 'basic-data', - name: 'EntryBasicData', - meta: { - title: 'basicData', - icon: 'vn:settings', - }, - component: () => import('src/pages/Entry/Card/EntryBasicData.vue'), - }, - { - path: 'buys', - name: 'EntryBuys', - meta: { - title: 'buys', - icon: 'vn:lines', - }, - component: () => import('src/pages/Entry/Card/EntryBuys.vue'), - }, - { - path: 'buys/import', - name: 'EntryBuysImport', - component: () => import('src/pages/Entry/Card/EntryBuysImport.vue'), - }, - { - path: 'notes', - name: 'EntryNotes', - meta: { - title: 'notes', - icon: 'vn:notes', - }, - component: () => import('src/pages/Entry/Card/EntryNotes.vue'), - }, - { - path: 'dms', - name: 'EntryDms', - meta: { - title: 'dms', - icon: 'smb_share', - }, - component: () => import('src/pages/Entry/Card/EntryDms.vue'), - }, - { - path: 'log', - name: 'EntryLog', - meta: { - title: 'log', - icon: 'vn:History', - }, - component: () => import('src/pages/Entry/Card/EntryLog.vue'), - }, - ], - }, ], -}; +}; \ No newline at end of file diff --git a/test/cypress/integration/claim/claimPhoto.spec.js b/test/cypress/integration/claim/claimPhoto.spec.js index 9b2978b19..0a7320060 100755 --- a/test/cypress/integration/claim/claimPhoto.spec.js +++ b/test/cypress/integration/claim/claimPhoto.spec.js @@ -1,5 +1,6 @@ /// -describe('ClaimPhoto', () => { +// redmine.verdnatura.es/issues/8417 +describe.skip('ClaimPhoto', () => { beforeEach(() => { const claimId = 1; cy.login('developer'); diff --git a/test/cypress/integration/entry/myEntry.spec.js b/test/cypress/integration/entry/myEntry.spec.js index 4addec1c4..c25476419 100644 --- a/test/cypress/integration/entry/myEntry.spec.js +++ b/test/cypress/integration/entry/myEntry.spec.js @@ -8,8 +8,8 @@ describe('EntryMy when is supplier', () => { }, }); }); - - it('should open buyLabel when is supplier', () => { + // https://redmine.verdnatura.es/issues/8418 + it.skip('should open buyLabel when is supplier', () => { cy.get( '[to="/null/3"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon' ).click(); diff --git a/test/cypress/integration/invoiceIn/invoiceInCorrective.spec.js b/test/cypress/integration/invoiceIn/invoiceInCorrective.spec.js index 0eb873355..c2f111892 100644 --- a/test/cypress/integration/invoiceIn/invoiceInCorrective.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInCorrective.spec.js @@ -1,6 +1,6 @@ /// - -describe('InvoiceInCorrective', () => { +// https://redmine.verdnatura.es/issues/8419 +describe.skip('InvoiceInCorrective', () => { const createCorrective = '.q-menu > .q-list > :nth-child(6) > .q-item__section'; const rectificativeSection = '.q-drawer-container .q-list > a:nth-child(6)'; const saveDialog = '.q-card > .q-card__actions > .q-btn--standard '; diff --git a/test/cypress/integration/invoiceIn/invoiceInList.spec.js b/test/cypress/integration/invoiceIn/invoiceInList.spec.js index d9ab3f7e7..0eb495419 100644 --- a/test/cypress/integration/invoiceIn/invoiceInList.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInList.spec.js @@ -21,8 +21,8 @@ describe('InvoiceInList', () => { cy.url().should('include', `/invoice-in/${id}/summary`); }); }); - - it('should open the details', () => { + // https://redmine.verdnatura.es/issues/8420 + it.skip('should open the details', () => { cy.get(firstDetailBtn).click(); cy.get(summaryHeaders).eq(1).contains('Basic data'); cy.get(summaryHeaders).eq(4).contains('Vat'); diff --git a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js index b7fd11307..27f887eeb 100644 --- a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js +++ b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js @@ -35,8 +35,8 @@ describe('InvoiceOut summary', () => { cy.dataCy('VnConfirm_confirm').click(); cy.checkNotification('InvoiceOut deleted'); }); - - it('should transfer the invoice ', () => { + // https://redmine.verdnatura.es/issues/8415 + it.skip('should transfer the invoice ', () => { cy.typeSearchbar('T1111111{enter}'); cy.dataCy('descriptor-more-opts').click(); cy.get('.q-menu > .q-list > :nth-child(1)').click(); diff --git a/test/cypress/integration/item/itemList.spec.js b/test/cypress/integration/item/itemList.spec.js index 49e393451..97e85a212 100644 --- a/test/cypress/integration/item/itemList.spec.js +++ b/test/cypress/integration/item/itemList.spec.js @@ -15,8 +15,8 @@ describe('Item list', () => { cy.get('.q-menu .q-item').contains('Anthurium').click(); cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click(); }); - - it('should create an item', () => { + // https://redmine.verdnatura.es/issues/8421 + it.skip('should create an item', () => { const data = { Description: { val: `Test item` }, Type: { val: `Crisantemo`, type: 'select' }, diff --git a/test/cypress/integration/item/itemTag.spec.js b/test/cypress/integration/item/itemTag.spec.js index c2de93068..28e0a747f 100644 --- a/test/cypress/integration/item/itemTag.spec.js +++ b/test/cypress/integration/item/itemTag.spec.js @@ -18,8 +18,8 @@ describe('Item tag', () => { +cy.dataCy('crudModelDefaultSaveBtn').click(); cy.checkNotification("The tag or priority can't be repeated for an item"); }); - - it('should add a new tag', () => { + // https://redmine.verdnatura.es/issues/8422 + it.skip('should add a new tag', () => { cy.get('.q-page').should('be.visible'); cy.get('.q-page-sticky > div').click(); cy.get('.q-page-sticky > div').click(); diff --git a/test/cypress/integration/ticket/ticketExpedition.spec.js b/test/cypress/integration/ticket/ticketExpedition.spec.js index d74a122a1..d957f2136 100644 --- a/test/cypress/integration/ticket/ticketExpedition.spec.js +++ b/test/cypress/integration/ticket/ticketExpedition.spec.js @@ -1,6 +1,6 @@ /// - -describe('Ticket expedtion', () => { +// https://redmine.verdnatura.es/issues/8423 +describe.skip('Ticket expedtion', () => { const tableContent = '.q-table .q-virtual-scroll__content'; const stateTd = 'td:nth-child(9)'; diff --git a/test/cypress/integration/ticket/ticketList.spec.js b/test/cypress/integration/ticket/ticketList.spec.js index e273825c0..3337287c4 100644 --- a/test/cypress/integration/ticket/ticketList.spec.js +++ b/test/cypress/integration/ticket/ticketList.spec.js @@ -30,8 +30,8 @@ describe('TicketList', () => { cy.get(firstRow).find('.q-btn:first').click(); cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/); }); - - it('should open ticket summary', () => { + // https://redmine.verdnatura.es/issues/8424 + it.skip('should open ticket summary', () => { searchResults(); cy.get(firstRow).find('.q-btn:last').click(); cy.dataCy('ticketSummary').should('exist'); diff --git a/test/cypress/integration/vnComponent/VnLocation.spec.js b/test/cypress/integration/vnComponent/VnLocation.spec.js index 14eb0f978..09665a816 100644 --- a/test/cypress/integration/vnComponent/VnLocation.spec.js +++ b/test/cypress/integration/vnComponent/VnLocation.spec.js @@ -53,7 +53,8 @@ describe('VnLocation', () => { cy.waitForElement('.q-card'); cy.get(inputLocation).click(); }); - it('Show all options', function () { + // https://redmine.verdnatura.es/issues/8436 + it.skip('Show all options', function () { cy.get(locationOptions).should('have.length.at.least', 5); }); it('input filter location as "al"', function () { diff --git a/test/cypress/integration/zone/zoneWarehouse.spec.js b/test/cypress/integration/zone/zoneWarehouse.spec.js index 817e26312..a55a5619e 100644 --- a/test/cypress/integration/zone/zoneWarehouse.spec.js +++ b/test/cypress/integration/zone/zoneWarehouse.spec.js @@ -18,8 +18,8 @@ describe('ZoneWarehouse', () => { cy.get(saveBtn).click(); cy.checkNotification(dataError); }); - - it('should create & remove a warehouse', () => { + // https://redmine.verdnatura.es/issues/8425 + it.skip('should create & remove a warehouse', () => { cy.addBtnClick(); cy.fillInForm(data); cy.get(saveBtn).click();