Merge branch 'dev' into 8224-contextMenu
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Alex Moreno 2025-05-07 10:39:50 +00:00
commit b8231c4878
13 changed files with 71 additions and 35 deletions

View File

@ -25,6 +25,9 @@ describe('VnDmsList', () => {
deleteModel: 'WorkerDms', deleteModel: 'WorkerDms',
downloadModel: 'WorkerDms', downloadModel: 'WorkerDms',
}, },
global: {
stubs: ['VnUserLink'],
},
}).vm; }).vm;
}); });

View File

@ -90,7 +90,7 @@ describe('VnLog', () => {
vm = createWrapper(VnLog, { vm = createWrapper(VnLog, {
global: { global: {
stubs: ['FetchData', 'vue-i18n'], stubs: ['FetchData', 'vue-i18n', 'VnUserLink'],
mocks: { mocks: {
fetch: vi.fn(), fetch: vi.fn(),
}, },

View File

@ -1,12 +1,27 @@
<script setup> <script setup>
import AccountDescriptorProxy from 'src/pages/Account/Card/AccountDescriptorProxy.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import { ref, onMounted } from 'vue';
defineProps({ import axios from 'axios';
const $props = defineProps({
name: { type: String, default: null }, name: { type: String, default: null },
tag: { type: String, default: null }, tag: { type: String, default: null },
workerId: { type: Number, default: null }, workerId: { type: Number, default: null },
defaultName: { type: Boolean, default: false }, defaultName: { type: Boolean, default: false },
}); });
const isWorker = ref(false);
onMounted(async () => {
try {
const {
data: { exists },
} = await axios(`/Workers/${$props.workerId}/exists`);
isWorker.value = exists;
} catch (error) {
if (error.status === 403) return;
throw error;
}
});
</script> </script>
<template> <template>
<slot name="link"> <slot name="link">
@ -14,5 +29,10 @@ defineProps({
{{ defaultName ? (name ?? $t('globals.system')) : name }} {{ defaultName ? (name ?? $t('globals.system')) : name }}
</span> </span>
</slot> </slot>
<WorkerDescriptorProxy v-if="workerId" :id="workerId" /> <WorkerDescriptorProxy
v-if="isWorker"
:id="workerId"
@on-fetch="(data) => (isWorker = data?.workerId !== undefined)"
/>
<AccountDescriptorProxy v-else :id="workerId" />
</template> </template>

View File

@ -17,6 +17,7 @@ import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.v
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import VnSelect from 'components/common/VnSelect.vue'; import VnSelect from 'components/common/VnSelect.vue';
import VnInputDate from 'components/common/VnInputDate.vue'; import VnInputDate from 'components/common/VnInputDate.vue';
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
const arrayData = useArrayData('Customer'); const arrayData = useArrayData('Customer');
const { t } = useI18n(); const { t } = useI18n();
@ -50,7 +51,7 @@ const columns = computed(() => [
label: t('globals.ticket'), label: t('globals.ticket'),
cardVisible: true, cardVisible: true,
columnFilter: { columnFilter: {
inWhere: true, name: 'ticketId',
}, },
}, },
{ {
@ -84,7 +85,8 @@ const columns = computed(() => [
label: t('globals.description'), label: t('globals.description'),
columnClass: 'expand', columnClass: 'expand',
columnFilter: { columnFilter: {
inWhere: true, name: 'description',
}, },
}, },
{ {
@ -92,17 +94,10 @@ const columns = computed(() => [
label: t('globals.quantity'), label: t('globals.quantity'),
cardVisible: true, cardVisible: true,
visible: true, visible: true,
columnFilter: { columnFilter: false
inWhere: true,
},
},
{
name: 'grouped',
label: t('Group by items'),
component: 'checkbox',
visible: false,
orderBy: false,
}, },
]); ]);
onBeforeMount(async () => { onBeforeMount(async () => {
@ -218,9 +213,9 @@ const updateDateParams = (value, params) => {
<div v-if="row.subName" class="subName"> <div v-if="row.subName" class="subName">
{{ row.subName }} {{ row.subName }}
</div> </div>
<FetchedTags :item="row" /> <FetchedTags :item="row" :columns="6"/>
</template> </template>
<template #moreFilterPanel="{ params }"> <template #moreFilterPanel="{ params, searchFn}">
<div class="column no-wrap flex-center q-gutter-y-md q-mt-xs q-pr-xl"> <div class="column no-wrap flex-center q-gutter-y-md q-mt-xs q-pr-xl">
<VnSelect <VnSelect
:filled="true" :filled="true"
@ -290,6 +285,13 @@ const updateDateParams = (value, params) => {
class="q-px-xs q-pt-none fit" class="q-px-xs q-pt-none fit"
dense dense
/> />
<VnCheckbox
v-model="params.grouped"
:label="t('Group by items')"
class="q-px-xs q-pt-none fit"
dense
@update:modelValue="() => searchFn()"
/>
</div> </div>
</template> </template>
</VnTable> </VnTable>

View File

@ -117,8 +117,6 @@ async function acceptPropagate({ isEqualizated }) {
option-value="id" option-value="id"
v-model="data.sageTaxTypeFk" v-model="data.sageTaxTypeFk"
data-cy="sageTaxTypeFk" data-cy="sageTaxTypeFk"
:required="data.isTaxDataChecked"
:rules="[(val) => validations.required(data.isTaxDataChecked, val)]"
/> />
<VnSelect <VnSelect
:label="t('Sage transaction type')" :label="t('Sage transaction type')"
@ -128,10 +126,6 @@ async function acceptPropagate({ isEqualizated }) {
option-value="id" option-value="id"
data-cy="sageTransactionTypeFk" data-cy="sageTransactionTypeFk"
v-model="data.sageTransactionTypeFk" v-model="data.sageTransactionTypeFk"
:required="data.isTaxDataChecked"
:rules="[
(val) => validations.required(data.sageTransactionTypeFk, val),
]"
> >
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">

View File

@ -222,6 +222,7 @@ async function getAmountPaid() {
clearable clearable
v-model.number="data.amountPaid" v-model.number="data.amountPaid"
data-cy="paymentAmount" data-cy="paymentAmount"
:positive="false"
/> />
</VnRow> </VnRow>
<VnRow> <VnRow>

View File

@ -123,3 +123,4 @@ customer:
ticketFk: Ticket Id ticketFk: Ticket Id
description: Description description: Description
quantity: Quantity quantity: Quantity
ticketId: Ticket

View File

@ -123,3 +123,4 @@ customer:
ticketFk: Id Ticket ticketFk: Id Ticket
description: Descripción description: Descripción
quantity: Cantidad quantity: Cantidad
ticketId: Ticket

View File

@ -89,7 +89,7 @@ defineExpose({ save });
</div> </div>
<div v-if="newPrice" class="column items-center q-mt-lg"> <div v-if="newPrice" class="column items-center q-mt-lg">
<span class="text-primary">{{ t('New price') }}</span> <span class="text-primary">{{ t('basicData.newPrice') }}</span>
<span class="text-subtitle1">{{ toCurrency(newPrice) }}</span> <span class="text-subtitle1">{{ toCurrency(newPrice) }}</span>
</div> </div>
</div> </div>
@ -135,3 +135,4 @@ defineExpose({ save });
min-width: 230px; min-width: 230px;
} }
</style> </style>
<

View File

@ -314,7 +314,7 @@ const changePrice = async (sale) => {
const updatePrice = async (sale, newPrice) => { const updatePrice = async (sale, newPrice) => {
try { try {
await axios.post(`Sales/${sale.id}/updatePrice`, { await axios.post(`Sales/${sale.id}/updatePrice`, {
newPrice: newPrice, newPrice,
componentId: componentId.value, componentId: componentId.value,
}); });
notify('globals.dataSaved', 'positive'); notify('globals.dataSaved', 'positive');

View File

@ -13,12 +13,14 @@ import { useArrayData } from 'composables/useArrayData';
import useNotify from 'src/composables/useNotify.js'; import useNotify from 'src/composables/useNotify.js';
import axios from 'axios'; import axios from 'axios';
import VnTable from 'src/components/VnTable/VnTable.vue'; import VnTable from 'src/components/VnTable/VnTable.vue';
import FetchData from 'src/components/FetchData.vue';
const stateStore = useStateStore(); const stateStore = useStateStore();
const { t } = useI18n(); const { t } = useI18n();
const { notify } = useNotify(); const { notify } = useNotify();
const { openConfirmationModal } = useVnConfirm(); const { openConfirmationModal } = useVnConfirm();
const allColumnNames = ref([]); const allColumnNames = ref([]);
const agencies = ref([]);
const arrayData = useArrayData('WeeklyTickets'); const arrayData = useArrayData('WeeklyTickets');
const { store } = arrayData; const { store } = arrayData;
@ -51,11 +53,16 @@ const columns = computed(() => [
isTitle: true, isTitle: true,
cardVisible: true, cardVisible: true,
component: 'select', component: 'select',
columnFilter: {
name: 'id',
component: 'select',
alias: 'c',
attrs: { attrs: {
url: 'Clients', url: 'Clients',
optionLabel: 'name', optionLabel: 'name',
optionValue: 'id', optionValue: 'id',
isWhere: true, inWhere: true,
},
}, },
columnField: { columnField: {
component: null, component: null,
@ -170,6 +177,11 @@ onMounted(async () => {
</script> </script>
<template> <template>
<FetchData
url="AgencyModes/isActive"
@on-fetch="(data) => (agencies = data)"
auto-load
/>
<VnSearchbar <VnSearchbar
data-key="WeeklyTickets" data-key="WeeklyTickets"
:label="t('weeklyTickets.search')" :label="t('weeklyTickets.search')"
@ -203,7 +215,7 @@ onMounted(async () => {
</template> </template>
<template #column-agencyModeFk="{ row }"> <template #column-agencyModeFk="{ row }">
<VnSelectCache <VnSelectCache
url="AgencyModes/isActive" :options="agencies"
:row="row" :row="row"
:find="['agencyModeFk', 'agencyModeName']" :find="['agencyModeFk', 'agencyModeName']"
v-model="row.agencyModeFk" v-model="row.agencyModeFk"

View File

@ -5,7 +5,7 @@ describe('Client fiscal data', () => {
cy.login('developer'); cy.login('developer');
cy.visit('#/customer/1107/fiscal-data'); cy.visit('#/customer/1107/fiscal-data');
}); });
it('Should change required value when change customer', () => { it.skip('Should change required value when change customer', () => {
cy.get('.q-card').should('be.visible'); cy.get('.q-card').should('be.visible');
cy.dataCy('sageTaxTypeFk').filter('input').should('not.have.attr', 'required'); cy.dataCy('sageTaxTypeFk').filter('input').should('not.have.attr', 'required');
cy.get('#searchbar input').clear(); cy.get('#searchbar input').clear();

View File

@ -116,10 +116,11 @@ Cypress.Commands.add('waitSpinner', (_spinner = 'navBar') => {
// Fill Inputs // Fill Inputs
Cypress.Commands.add('selectOption', (selector, option, timeout = 2500) => { Cypress.Commands.add('selectOption', (selector, option, timeout = 2500) => {
cy.get(selector).should('exist').scrollIntoView();
cy.waitForElement(selector, timeout); cy.waitForElement(selector, timeout);
cy.get(selector, { timeout }) cy.get(selector, { timeout })
.should('exist')
.should('be.visible') .should('be.visible')
.click() .click()
.then(($el) => { .then(($el) => {