From 67c257ce0eda180dc7a88bd7691797a7f0445d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Thu, 28 Nov 2024 19:24:13 +0100 Subject: [PATCH 01/10] fix: translations travel --- src/i18n/locale/en.yml | 2 +- src/i18n/locale/es.yml | 2 +- src/pages/Travel/Card/TravelBasicData.vue | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index e2e0e4238..31a6931a4 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -766,7 +766,7 @@ travel: thermographs: Thermographs hb: HB basicData: - daysInForward: Days in forward + daysInForward: Automatic movement (Raid) isRaid: Raid thermographs: temperature: Temperature diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 58ddc98ef..ccc21e225 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -760,7 +760,7 @@ travel: thermographs: Termógrafos hb: HB basicData: - daysInForward: Días redada + daysInForward: Desplazamiento automatico (redada) isRaid: Redada thermographs: temperature: Temperatura diff --git a/src/pages/Travel/Card/TravelBasicData.vue b/src/pages/Travel/Card/TravelBasicData.vue index fd02b28cd..4b9aa28ed 100644 --- a/src/pages/Travel/Card/TravelBasicData.vue +++ b/src/pages/Travel/Card/TravelBasicData.vue @@ -104,7 +104,7 @@ const warehousesOptionsIn = ref([]); es: - raidDays: Si se marca "Redada", la fecha de entrega se moverá automáticamente los días indicados. + raidDays: El travel se desplaza automáticamente cada día para estar desde hoy al número de días indicado. Si se deja vacio no se moverá en: - raidDays: If "Raid" is checked, the landing date will automatically shift by the specified number of days. + raidDays: The travel adjusts itself daily to match the number of days set, starting from today. If left blank, it won’t move From d364e30cf0a87cb2e311fcaf357be0e7dbf6b565 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 29 Nov 2024 09:38:58 +0100 Subject: [PATCH 02/10] feat(SupplierAccount): add autoBic when change bankEntity --- src/components/CrudModel.vue | 4 +-- src/components/common/VnSelect.vue | 21 +++++++++++-- src/pages/Supplier/Card/SupplierAccounts.vue | 33 ++++++++++++++++++-- 3 files changed, 50 insertions(+), 8 deletions(-) diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 1234ce123..b770e591f 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -176,8 +176,8 @@ async function saveChanges(data) { const changes = data || getChanges(); try { await axios.post($props.saveUrl || $props.url + '/crud', changes); - } catch (e) { - return (isLoading.value = false); + } finally { + isLoading.value = false; } originalData.value = JSON.parse(JSON.stringify(formData.value)); if (changes.creates?.length) await vnPaginateRef.value.fetch(); diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index f24f054a5..14005e1cc 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -284,9 +284,9 @@ async function onScroll({ to, direction, from, index }) { :loading="isLoading" @virtual-scroll="onScroll" > - diff --git a/src/pages/Supplier/Card/SupplierAccounts.vue b/src/pages/Supplier/Card/SupplierAccounts.vue index 428ab05c2..c2934830a 100644 --- a/src/pages/Supplier/Card/SupplierAccounts.vue +++ b/src/pages/Supplier/Card/SupplierAccounts.vue @@ -24,13 +24,14 @@ const supplier = ref(null); const supplierAccountRef = ref(null); const wireTransferFk = ref(null); const bankEntitiesOptions = ref([]); +const filteredBankEntitiesOptions = ref([]); const onBankEntityCreated = async (dataSaved, rowData) => { await bankEntitiesRef.value.fetch(); rowData.bankEntityFk = dataSaved.id; }; -const onChangesSaved = () => { +const onChangesSaved = async () => { if (supplier.value.payMethodFk !== wireTransferFk.value) quasar .dialog({ @@ -55,12 +56,35 @@ const setWireTransfer = async () => { await axios.patch(`Suppliers/${route.params.id}`, params); notify('globals.dataSaved', 'positive'); }; + +function findBankFk(value, row) { + row.bankEntityFk = null; + if (!value) return; + + const bankEntityFk = bankEntitiesOptions.value.find((b) => b.id == value.slice(4, 8)); + if (bankEntityFk) row.bankEntityFk = bankEntityFk.id; +} + +function bankEntityFilter(val, update) { + update(() => { + const needle = val.toLowerCase(); + filteredBankEntitiesOptions.value = bankEntitiesOptions.value.filter( + (bank) => + bank.bic.toLowerCase().startsWith(needle) || + bank.name.toLowerCase().includes(needle) + ); + }); +}