diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 100% rename from .eslintrc.js rename to .eslintrc.cjs diff --git a/CHANGELOG.md b/CHANGELOG.md index 119f702f7..47f2f49d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,169 @@ +# Version 24.28 - 2024-07-09 + +### Added 🆕 + +- Change header titles style by:wbuezas +- chore: refs #7436 fix e2e (origin/7436-showQCheckbox) by:jorgep +- feat: #7196 eslint (origin/7196-cjsToEsm) by:jgallego +- feat: adapt tu VnTable → CrudModel by:alexm +- feat(CustomerFIlter): use correct table by:alexm +- feat(customerList): add searchbar by:alexm +- feat: customerList is customerExtendedList by:alexm +- feat: fixes #7196 by:jgallego +- feat: refs #6739 transferInvoice new checkbox and functionality by:Jon +- feat: refs #6825 create vnTable and add in CustomerExtendedList by:alexm +- feat: refs #6825 create vnTableColumn, cardActions by:alexm +- feat: refs #6825 fix modes by:alexm +- feat: refs #6825 qchip color by:alexm +- feat: refs #6825 right filter panel (6825-vnTable) by:alexm +- feat: refs #6825 scroll for table mode by:alexm +- feat: refs #6825 share filters, create popup by:alexm +- feat: refs #6825 VnComponent mix component and attrs Form to create new row by:alexm +- feat: refs #6825 VnTableFilter and VnPanelFilter init by:alexm +- feat: refs #6826 added rol summary link by:Jon +- feat: refs #6896 created VnImg and added to order module by:Jon +- feat: refs #6896 new filters by:Jon +- feat: refs #7129 fix some code and add order by:pablone +- feat: refs #7436 show checkbox by:jorgep +- feat: refs #7545 Deleted hasIncoterms client column (origin/7545-hasIncoterms) by:guillermo +- feat(TicketService): use correct format by:alexm +- feat(url): sepate filters by:alexm +- feat(VnFilter): merge objects by:alexm +- feat(VnTable): is-editable and use-model. fix: checkbox by:alexm +- feat(VnTable): refs #6825 actions sticky by:alexm +- feat(VnTable): refs #6825 addInWhere by:alexm +- feat(VnTable): refs #6825 dinamic columns by:alexm +- feat(VnTable): refs #6825 execute function when create by:alexm +- feat(VnTable): refs #6825 fix ellipsis and add titles by:alexm +- feat(VnTable): refs #6825 merge where's by:alexm +- feat(VnTable): refs #6825 move to folder. fix checkboxs by:alexm +- feat(VnTable): refs #6825 remove field prop. Add actions in table by:alexm +- feat(VnTable): refs #6825 use checkbox if startsWith 'is' or 'has' by:alexm +- feat(VnTable): refs #6825 VnTableChip component by:alexm +- feat(vnTable): reload data when change url by:alexm +- feat(WorkerFormation): add columnFilter by:alexm +- feat(WorkerFormation): is-editable and use-model by:alexm +- fix: notify icon style by:Javier Segarra +- refactor: refs #6896 fixed styles by:Jon +- Revert "feat: fixes #7196" by:alexm +- style: refs #6464 changed checkbox and qbtn styles by:Jon + +### Changed 📦 + +- perf: Remove div.col by:Javier Segarra +- perf: remove ItemPicture by:Javier Segarra +- perf: replace ItemPicture in favour of VnImg by:Javier Segarra +- refactor by:wbuezas +- refactor: refs #5447 changed warehouse filter by:Jon +- refactor: refs #5447 changed warehouse out filter behavior by:Jon +- refactor: refs #5447 fixed filter if continent not selected by:Jon +- refactor: refs #5447 fix request by:Jon +- refactor: refs #5447 refactor filters by:Jon +- refactor: refs #6739 changed invoice functions' name by:Jon +- refactor: refs #6739 changed router.push by:Jon +- refactor: refs #6739 deleted useless const by:Jon +- refactor: refs #6739 fix redirect transferInvoice by:Jon +- refactor: refs #6739 new confirmation window by:Jon +- refactor: refs #6739 requested changes by:Jon +- refactor: refs #6739 updated transferInvoice function by:Jon +- refactor: refs #6896 changes requested in PR by:Jon +- refactor: refs #6896 end migration orders by:Jon +- refactor: refs #6896 fixed styles by:Jon +- refactor: refs #6896 fix qdrawer by:Jon +- refactor: refs #6896 refactor VnImg by:Jon +- refactor: refs #6896 requested changes by:Jon +- refactor: refs #6977 fix VnImg props (origin/6977-ClonedURL) by:Jon +- refactor: refs #6977 refactor VnImg by:Jon +- refactor: refs #6977 use VnImg by:Jon +- refactors by:alexm + +### Fixed 🛠️ + +- chore: refs #7436 fix e2e (origin/7436-showQCheckbox) by:jorgep +- feat: fixes #7196 by:jgallego +- feat: refs #6825 fix modes by:alexm +- feat: refs #7129 fix some code and add order by:pablone +- feat(VnTable): is-editable and use-model. fix: checkbox by:alexm +- feat(VnTable): refs #6825 fix ellipsis and add titles by:alexm +- feat(VnTable): refs #6825 move to folder. fix checkboxs by:alexm +- fix(ArrayData): refs #6825 router.replace and use filter.where by:alexm +- fix: bug replace by:alexm +- fix: column hidden v-if by:Javier Segarra +- fix: comment 4 by:Javier Segarra +- fix: comments by:Javier Segarra +- fix: cypress.config to mjs by:alexm +- fix(EntryBuys): fix VnSubtoolbar by:alexm +- fixes: fix vnFilter params and redirect by:alexm +- fix: fix warnings by:alexm +- fix: invoiceDueDay test by:alexm +- fix log view not refreshing when changing id param by:wbuezas +- fix: map selected by:Javier Segarra +- fix: merge dev by:Javier Segarra +- fix: notify icon style by:Javier Segarra +- fix: point 1 by:Javier Segarra +- fix: point 3 by:Javier Segarra +- fix: refs #5447 deleted console.log by:Jon +- fix: refs 6464 deleted useless class in checkbox by:Jon +- fix: refs #6464 fix error isLoading by:Jon +- fix: refs #6739 changed checkbox field by:Jon +- fix: refs #6825 css by:carlossa +- fix: refs #6826 fix redirect by:Jon +- fix: refs #6826 fix roleDescriptor by:Jon +- fix: refs #7129 fix e2e by:pablone +- fix: refs #7129 fix module routes by:pablone +- fix: refs #7129 fix some issues on load and tools by:pablone +- fix: refs #7129 remove consoleLog by:pablone +- fix: refs #7129 remove fix from claim lines by:pablone +- fix: refs #7274 fix duplicate rows by:jorgep +- fix: refs #7433 skeleton by:jorgep +- fix: refs #7623 bugs & tests by:jorgep +- fix: refs #7623 disable router update by:jorgep +- fix: refs #7623 redirect by:jorgep +- fix: refs #7623 test by:jorgep +- fix: refs #7623 update add updateRoute prop in VnPaginate by:jorgep +- fix: refs #7623 updating skip param by:jorgep +- fix: revert cypress mjs by:alexm +- fix: SkeletonTable by:alexm +- fix: state translations by:Javier Segarra +- fix: ticket order by:Javier Segarra +- fix(ticket router): typo by:alexm +- fix(TicketService): pay use selected by:alexm +- fix: TravelLog by:Javier Segarra +- fix(url): filter by:alexm +- fix(url): redirect by:alexm +- fix(VnFilter): filter with params by:alexm +- fix(VnFilterPanel): remove key by:alexm +- fix(VnTable): create scss by:alexm +- fix(VnTable): duplicate fetch by:alexm +- fix(VnTable): Qtable v-bind by:alexm +- fix(VnTable): refs #6825 checkbox align and color by:alexm +- fix(VnTable): refs #6825 fix click sticky column by:alexm +- fix(VnTable): refs #6825 fix events and css by:alexm +- fix(VnTable): refs #6825 VnInputDate by:alexm +- fix(VnTable): showLabel by:alexm +- fix(VnTable): warns by:alexm +- fix: WorkerNotificationsManager test by:alexm +- fix: WorkerSelect option format by:Javier Segarra +- refactor: refs #5447 fixed filter if continent not selected by:Jon +- refactor: refs #5447 fix request by:Jon +- refactor: refs #6739 fix redirect transferInvoice by:Jon +- refactor: refs #6896 fixed styles by:Jon +- refactor: refs #6896 fix qdrawer by:Jon +- refactor: refs #6977 fix VnImg props (origin/6977-ClonedURL) by:Jon +- refs #6504 fix formModel claimFilter claimCard (origin/6504-fixCardClaim) by:carlossa +- refs #7406 fix components by:carlossa +- refs #7406 fix pr by:carlossa +- refs #7406 fix props by:carlossa +- refs #7406 fix Tb components create by:carlossa +- refs #7406 fix trad by:carlossa +- refs #7406 fix url by:carlossa +- refs #7406 fix VnTable columns by:carlossa +- refs #7409 fix balance and formation by:carlossa +- refs #7409 fix trad by:carlossa +- Revert "feat: fixes #7196" by:alexm +- test: fix intermitent e2e by:alexm +- test: fix vnSearchbar adapt to vnTable (origin/7648_dev_customerEntries) by:alexm + # Version 24.24 - 2024-06-11 ### Added 🆕 diff --git a/package.json b/package.json index cdb185ba1..4668d2d56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.26.2", + "version": "24.28.1", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", diff --git a/src/boot/axios.js b/src/boot/axios.js index e3e7289af..4fd83ddea 100644 --- a/src/boot/axios.js +++ b/src/boot/axios.js @@ -1,11 +1,10 @@ import axios from 'axios'; -import { Notify } from 'quasar'; import { useSession } from 'src/composables/useSession'; import { Router } from 'src/router'; -import { i18n } from './i18n'; +import useNotify from 'src/composables/useNotify.js'; const session = useSession(); -const { t } = i18n.global; +const { notify } = useNotify(); axios.defaults.baseURL = '/api/'; @@ -27,10 +26,7 @@ const onResponse = (response) => { const isSaveRequest = method === 'patch'; if (isSaveRequest) { - Notify.create({ - message: t('globals.dataSaved'), - type: 'positive', - }); + notify('globals.dataSaved', 'positive'); } return response; @@ -67,10 +63,7 @@ const onResponseError = (error) => { return Promise.reject(error); } - Notify.create({ - message: t(message), - type: 'negative', - }); + notify(message, 'negative'); return Promise.reject(error); }; diff --git a/src/boot/qformMixin.js b/src/boot/qformMixin.js index a809140b0..0bf1f9795 100644 --- a/src/boot/qformMixin.js +++ b/src/boot/qformMixin.js @@ -27,7 +27,6 @@ export default { this.$el.addEventListener('keyup', function (evt) { if (evt.key === 'Enter') { const input = evt.target; - console.log('input', input); if (input.type == 'textarea' && evt.shiftKey) { evt.preventDefault(); let { selectionStart, selectionEnd } = input; diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 406516d46..d5d8e2a91 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -67,6 +67,10 @@ const $props = defineProps({ default: '', description: 'It is used for redirect on click "save and continue"', }, + hasSubtoolbar: { + type: Boolean, + default: true, + }, }); const isLoading = ref(false); @@ -75,6 +79,7 @@ const originalData = ref(); const vnPaginateRef = ref(); const formData = ref(); const saveButtonRef = ref(null); +const watchChanges = ref(); const formUrl = computed(() => $props.url); const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']); @@ -89,6 +94,7 @@ defineExpose({ saveChanges, getChanges, formData, + vnPaginateRef, }); async function fetch(data) { @@ -97,19 +103,26 @@ async function fetch(data) { data.map((d) => (d.$index = $index++)); } - originalData.value = data && JSON.parse(JSON.stringify(data)); - formData.value = data && JSON.parse(JSON.stringify(data)); - watch(formData, () => (hasChanges.value = true), { deep: true }); + resetData(data); emit('onFetch', data); return data; } +function resetData(data) { + if (!data) return; + originalData.value = JSON.parse(JSON.stringify(data)); + formData.value = JSON.parse(JSON.stringify(data)); + + if (watchChanges.value) watchChanges.value(); //destoy watcher + watchChanges.value = watch(formData, () => (hasChanges.value = true), { deep: true }); +} + async function reset() { await fetch(originalData.value); hasChanges.value = false; } -// eslint-disable-next-line vue/no-dupe-keys + function filter(value, update, filterOptions) { update( () => { @@ -271,8 +284,9 @@ function isEmpty(obj) { if (obj.length > 0) return false; } -async function reload() { - vnPaginateRef.value.fetch(); +async function reload(params) { + const data = await vnPaginateRef.value.fetch(params); + fetch(data); } watch(formUrl, async () => { @@ -284,10 +298,11 @@ watch(formUrl, async () => { - - + +
+
@@ -332,7 +339,7 @@ defineExpose({
- + { - if (closeButton.value) closeButton.value.click(); +const selectedClient = (client) => { + transferInvoiceParams.selectedClientData = client; }; -const transferInvoice = async () => { +const makeInvoice = async () => { + const hasToInvoiceByAddress = + transferInvoiceParams.selectedClientData.hasToInvoiceByAddress; + + const params = { + id: transferInvoiceParams.id, + cplusRectificationTypeFk: transferInvoiceParams.cplusRectificationTypeFk, + invoiceCorrectionTypeFk: transferInvoiceParams.invoiceCorrectionTypeFk, + newClientFk: transferInvoiceParams.newClientFk, + refFk: transferInvoiceParams.refFk, + siiTypeInvoiceOutFk: transferInvoiceParams.siiTypeInvoiceOutFk, + makeInvoice: checked.value, + }; + try { - const { data } = await axios.post( - 'InvoiceOuts/transferInvoice', - transferInvoiceParams - ); + if (checked.value && hasToInvoiceByAddress) { + const response = await new Promise((resolve) => { + quasar + .dialog({ + component: VnConfirm, + componentProps: { + title: t('Bill destination client'), + message: t('transferInvoiceInfo'), + }, + }) + .onOk(() => { + resolve(true); + }) + .onCancel(() => { + resolve(false); + }); + }); + if (!response) { + return; + } + } + + const { data } = await axios.post('InvoiceOuts/transferInvoice', params); notify(t('Transferred invoice'), 'positive'); - closeForm(); - router.push('InvoiceOutSummary', { id: data.id }); + const id = data?.[0]; + if (id) router.push({ name: 'InvoiceOutSummary', params: { id } }); } catch (err) { console.error('Error transfering invoice', err); } @@ -52,22 +85,30 @@ const transferInvoice = async () => { +en: + checkInfo: New tickets from the destination customer will be generated in the consignee by default. + transferInvoiceInfo: Destination customer is marked to bill in the consignee + confirmTransferInvoice: The destination customer has selected to bill in the consignee, do you want to continue? es: Transfer invoice: Transferir factura Transfer client: Transferir cliente @@ -157,4 +215,7 @@ es: Class: Clase Type: Tipo Transferred invoice: Factura transferida + Bill destination client: Facturar cliente destino + transferInvoiceInfo: Los nuevos tickets del cliente destino, serán generados en el consignatario por defecto. + confirmTransferInvoice: El cliente destino tiene marcado facturar por consignatario, desea continuar? diff --git a/src/components/UserPanel.vue b/src/components/UserPanel.vue index 691d3db8f..9c3b456b1 100644 --- a/src/components/UserPanel.vue +++ b/src/components/UserPanel.vue @@ -11,6 +11,7 @@ import VnSelect from 'src/components/common/VnSelect.vue'; import VnRow from 'components/ui/VnRow.vue'; import FetchData from 'components/FetchData.vue'; import { useClipboard } from 'src/composables/useClipboard'; +import VnImg from 'src/components/ui/VnImg.vue'; const state = useState(); const session = useSession(); @@ -47,7 +48,6 @@ const darkMode = computed({ }); const user = state.getUser(); -const token = session.getTokenMultimedia(); const warehousesData = ref(); const companiesData = ref(); const accountBankData = ref(); @@ -149,10 +149,7 @@ function saveUserData(param, value) {
- +
diff --git a/src/components/VnTable/VnChip.vue b/src/components/VnTable/VnChip.vue new file mode 100644 index 000000000..74207b943 --- /dev/null +++ b/src/components/VnTable/VnChip.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/components/VnTable/VnColumn.vue b/src/components/VnTable/VnColumn.vue new file mode 100644 index 000000000..6cd62d83e --- /dev/null +++ b/src/components/VnTable/VnColumn.vue @@ -0,0 +1,161 @@ + + diff --git a/src/components/VnTable/VnFilter.vue b/src/components/VnTable/VnFilter.vue new file mode 100644 index 000000000..3d489cf73 --- /dev/null +++ b/src/components/VnTable/VnFilter.vue @@ -0,0 +1,146 @@ + + diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue new file mode 100644 index 000000000..493f1480e --- /dev/null +++ b/src/components/VnTable/VnTable.vue @@ -0,0 +1,628 @@ + + + +en: + status: Status +es: + status: Estados + + + diff --git a/src/components/common/VnCard.vue b/src/components/common/VnCard.vue index b04478070..8517525df 100644 --- a/src/components/common/VnCard.vue +++ b/src/components/common/VnCard.vue @@ -1,6 +1,6 @@