feat: refs #7134 minor changes

This commit is contained in:
Javier Segarra 2024-12-05 14:54:27 +01:00
parent db00be75ad
commit 34d08e4bfe
3 changed files with 72 additions and 3 deletions

View File

@ -1,4 +1,5 @@
<script setup> <script setup>
import RightMenu from 'src/components/common/RightMenu.vue';
import { computed, onBeforeMount, ref } from 'vue'; import { computed, onBeforeMount, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
@ -21,6 +22,7 @@ import VnFilter from 'components/VnTable/VnFilter.vue';
import SupplierNewPayment from 'src/pages/Supplier/Card/SupplierNewPayment.vue'; import SupplierNewPayment from 'src/pages/Supplier/Card/SupplierNewPayment.vue';
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue'; import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
import SupplierBalanceFilter from './SupplierBalanceFilter.vue'; import SupplierBalanceFilter from './SupplierBalanceFilter.vue';
import { onMounted } from 'vue';
const { openConfirmationModal } = useVnConfirm(); const { openConfirmationModal } = useVnConfirm();
const { sendEmail, openReport } = usePrintService(); const { sendEmail, openReport } = usePrintService();
@ -40,7 +42,7 @@ const companyUser = ref(user.value.companyFk);
const bankUser = ref(user.value.localBankFk); const bankUser = ref(user.value.localBankFk);
const balances = ref([]); const balances = ref([]);
const vnFilterRef = ref({}); const vnFilterRef = ref({});
const filter = computed(() => { const userParams = computed(() => {
return { return {
supplierId: route.params.id, supplierId: route.params.id,
companyId: companyId.value ?? companyUser.value, companyId: companyId.value ?? companyUser.value,
@ -150,6 +152,14 @@ onBeforeMount(() => {
companyId.value = companyUser.value; companyId.value = companyUser.value;
}); });
onMounted(() => {
Object.assign(userParams, {
supplierId: route.params.id,
companyId: companyId.value ?? companyUser.value,
isConciliated: false,
});
});
async function getSupplierRisks() { async function getSupplierRisks() {
const filter = { const filter = {
where: { supplierFk: route.params.id, companyFk: companyUser.value }, where: { supplierFk: route.params.id, companyFk: companyUser.value },
@ -226,12 +236,13 @@ function round(value) {
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer"> <QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
<SupplierBalanceFilter data-key="SupplierBalance" /> <SupplierBalanceFilter data-key="SupplierBalance" />
</QDrawer> </QDrawer>
{{ userParams }}
<VnTable <VnTable
ref="tableRef" ref="tableRef"
data-key="SupplierBalance" data-key="SupplierBalance"
url="Suppliers/receipts" url="Suppliers/receipts"
search-url="balance" search-url="balance"
:user-params="filter" :user-params="userParams"
:columns="columns" :columns="columns"
:right-search="false" :right-search="false"
:is-editable="false" :is-editable="false"
@ -239,6 +250,7 @@ function round(value) {
@on-fetch="onFetch" @on-fetch="onFetch"
:disable-option="{ card: true }" :disable-option="{ card: true }"
:footer="true" :footer="true"
data-cy="supplierBalanceTable"
auto-load auto-load
> >
<template #column-balance="{ rowIndex }"> <template #column-balance="{ rowIndex }">

View File

@ -314,7 +314,7 @@ async function getAmountPaid() {
<VnRow class="row"> <VnRow class="row">
<VnSelect <VnSelect
v-if="$props.extraFields.includes('currencyFk')" v-if="$props.extraFields.includes('currencyFk')"
:label="t('currencyFk')" :label="t('Currency')"
v-model="data.currencyFk" v-model="data.currencyFk"
:options="currenciesOptions" :options="currenciesOptions"
option-value="id" option-value="id"

View File

@ -0,0 +1,57 @@
describe('Supplier Balance', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/supplier/1/balance`);
});
/* ==== Test Created with Cypress Studio ==== */
it('literal', function () {
/* ==== Generated with Cypress Studio ==== */
cy.get('.q-page').click();
// cy.get('.bg-header > :nth-child(1)').click();
cy.get('.q-pa-md > .q-drawer-container > .q-drawer > .q-drawer__content').click();
cy.get('.q-pa-md > #subToolbar').click();
cy.get('.text-bold').should('have.text', 'Total by company');
// cy.get('.q-tr > :nth-child(4) > span').should('have.text', '1181.87');
// cy.get('.q-tr > :nth-child(6)').should('have.text', '-3997.99');
// cy.get(':nth-child(5) > span').should('have.text', '1000');
/* ==== End Cypress Studio ==== */
/* ==== Generated with Cypress Studio ==== */
// cy.get(':nth-child(1) > :nth-child(2) > .row > span').should(
// 'have.text',
// 'S/Fra 1235'
// );
// cy.get(':nth-child(10) > :nth-child(1) > .row > span').should(
// 'have.text',
// '15/09/2024, 00:00'
// );
// cy.get(':nth-child(10) > :nth-child(2) > .row > span').should(
// 'have.text',
// 'PayMethod one'
// );
// cy.get('.q-virtual-scroll__content > :nth-child(10) > :nth-child(3)').should(
// 'have.text',
// '1'
// );
/* ==== End Cypress Studio ==== */
/* ==== Generated with Cypress Studio ==== */
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
cy.fillInForm({
Date: { val: '01-01-2024', type: 'date' },
Company: { val: 'VNL', type: 'select' },
Bank: { val: 1, type: 'select' },
Amount: { val: 1123, type: 'input' },
Reference: { val: 'Test', type: 'input' },
Type: { val: 'issued', type: 'select' },
Currency: { val: 'Euro', type: 'select' },
});
// cy.dataCy('FormModelPopup_save').click();
cy.get('.q-mt-lg > .q-btn--standard').click();
/* ==== End Cypress Studio ==== */
});
});