#7936 improve InvoiceIn #1004
|
@ -176,15 +176,13 @@ async function saveChanges(data) {
|
|||
const changes = data || getChanges();
|
||||
try {
|
||||
await axios.post($props.saveUrl || $props.url + '/crud', changes);
|
||||
} catch (e) {
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
throw e;
|
||||
}
|
||||
originalData.value = JSON.parse(JSON.stringify(formData.value));
|
||||
if (changes.creates?.length) await vnPaginateRef.value.fetch();
|
||||
|
||||
hasChanges.value = false;
|
||||
isLoading.value = false;
|
||||
emit('saveChanges', data);
|
||||
quasar.notify({
|
||||
type: 'positive',
|
||||
|
|
|
@ -298,9 +298,9 @@ defineExpose({ opts: myOptions });
|
|||
@virtual-scroll="onScroll"
|
||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"
|
||||
>
|
||||
<template v-if="isClearable" #append>
|
||||
<template #append>
|
||||
<QIcon
|
||||
v-show="value"
|
||||
v-show="isClearable && value"
|
||||
name="close"
|
||||
@click="
|
||||
() => {
|
||||
|
@ -313,7 +313,22 @@ defineExpose({ opts: myOptions });
|
|||
/>
|
||||
</template>
|
||||
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
|
||||
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||
<div v-if="slotName == 'append'">
|
||||
<QIcon
|
||||
v-show="isClearable && value"
|
||||
name="close"
|
||||
@click.stop="
|
||||
() => {
|
||||
value = null;
|
||||
emit('remove');
|
||||
}
|
||||
"
|
||||
class="cursor-pointer"
|
||||
size="xs"
|
||||
/>
|
||||
<slot name="append" v-if="$slots.append" v-bind="slotData ?? {}" />
|
||||
</div>
|
||||
<slot v-else :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||
</template>
|
||||
<template #option="{ opt, itemProps }">
|
||||
<QItem v-bind="itemProps">
|
||||
|
|
|
@ -779,7 +779,7 @@ travel:
|
|||
thermographs: Thermographs
|
||||
hb: HB
|
||||
basicData:
|
||||
daysInForward: Days in forward
|
||||
daysInForward: Automatic movement (Raid)
|
||||
isRaid: Raid
|
||||
thermographs:
|
||||
temperature: Temperature
|
||||
|
|
|
@ -771,7 +771,7 @@ travel:
|
|||
thermographs: Termógrafos
|
||||
hb: HB
|
||||
basicData:
|
||||
daysInForward: Días redada
|
||||
daysInForward: Desplazamiento automatico (redada)
|
||||
isRaid: Redada
|
||||
thermographs:
|
||||
temperature: Temperatura
|
||||
|
|
|
@ -66,6 +66,7 @@ const insertTag = (rows) => {
|
|||
<FetchData
|
||||
url="Tags"
|
||||
:filter="{ fields: ['id', 'name', 'isFree', 'sourceTable'] }"
|
||||
sort-by="name"
|
||||
@on-fetch="(data) => (tagOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
|
|
|
@ -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)
|
||||
);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
ref="bankEntitiesRef"
|
||||
url="BankEntities"
|
||||
@on-fetch="(data) => (bankEntitiesOptions = data)"
|
||||
@on-fetch="
|
||||
(data) => {
|
||||
(bankEntitiesOptions = data), (filteredBankEntitiesOptions = data);
|
||||
}
|
||||
"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
|
@ -98,6 +122,7 @@ const setWireTransfer = async () => {
|
|||
<VnInput
|
||||
:label="t('supplier.accounts.iban')"
|
||||
v-model="row.iban"
|
||||
@update:model-value="(value) => findBankFk(value, row)"
|
||||
:required="true"
|
||||
>
|
||||
<template #append>
|
||||
|
@ -109,7 +134,9 @@ const setWireTransfer = async () => {
|
|||
<VnSelectDialog
|
||||
:label="t('worker.create.bankEntity')"
|
||||
v-model="row.bankEntityFk"
|
||||
:options="bankEntitiesOptions"
|
||||
:options="filteredBankEntitiesOptions"
|
||||
:default-filter="false"
|
||||
@filter="(val, update) => bankEntityFilter(val, update)"
|
||||
option-label="bic"
|
||||
option-value="id"
|
||||
hide-selected
|
||||
|
|
|
@ -471,7 +471,7 @@ const qCheckBoxController = (sale, action) => {
|
|||
url="Shelvings"
|
||||
hide-selected
|
||||
option-label="code"
|
||||
option-value="code"
|
||||
option-value="id"
|
||||
v-model="row.shelvingFk"
|
||||
@update:model-value="updateShelving(row)"
|
||||
style="max-width: 120px"
|
||||
|
|
|
@ -104,7 +104,7 @@ const warehousesOptionsIn = ref([]);
|
|||
|
||||
<i18n>
|
||||
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
|
||||
</i18n>
|
||||
|
|
|
@ -3,6 +3,7 @@ describe('VnBreadcrumbs', () => {
|
|||
const firstCard = '.q-infinite-scroll > :nth-child(1)';
|
||||
const lastBreadcrumb = '.q-breadcrumbs--last > .q-breadcrumbs__el';
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit('/');
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue