#7134 SupplierBalance #905

Open
jsegarra wants to merge 46 commits from 7134-supplierBalance into dev
3 changed files with 72 additions and 3 deletions
Showing only changes of commit 34d08e4bfe - Show all commits

View File

@ -1,4 +1,5 @@
<script setup>
import RightMenu from 'src/components/common/RightMenu.vue';
import { computed, onBeforeMount, ref } from 'vue';
import { useI18n } from 'vue-i18n';
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 InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
import SupplierBalanceFilter from './SupplierBalanceFilter.vue';
import { onMounted } from 'vue';
const { openConfirmationModal } = useVnConfirm();
const { sendEmail, openReport } = usePrintService();
@ -40,7 +42,7 @@ const companyUser = ref(user.value.companyFk);
const bankUser = ref(user.value.localBankFk);
const balances = ref([]);
const vnFilterRef = ref({});
const filter = computed(() => {
const userParams = computed(() => {
return {
supplierId: route.params.id,
companyId: companyId.value ?? companyUser.value,
@ -150,6 +152,14 @@ onBeforeMount(() => {
companyId.value = companyUser.value;
});
jsegarra marked this conversation as resolved
Review

el redondeo lo hace el toCurrency creo que tiene un parametro para los decimales

el redondeo lo hace el toCurrency creo que tiene un parametro para los decimales
Review

Pero por defecto es 2
toCurrency =>(value, symbol = 'EUR', fractionSize = 2)

Pero por defecto es 2 toCurrency =>(value, symbol = 'EUR', fractionSize = 2)
onMounted(() => {
Object.assign(userParams, {
supplierId: route.params.id,
companyId: companyId.value ?? companyUser.value,
isConciliated: false,
});
});
async function getSupplierRisks() {
const filter = {
where: { supplierFk: route.params.id, companyFk: companyUser.value },
@ -226,12 +236,13 @@ function round(value) {
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
<SupplierBalanceFilter data-key="SupplierBalance" />
</QDrawer>
{{ userParams }}
<VnTable
ref="tableRef"
data-key="SupplierBalance"
url="Suppliers/receipts"
search-url="balance"
:user-params="filter"
:user-params="userParams"
:columns="columns"
:right-search="false"
:is-editable="false"
@ -239,6 +250,7 @@ function round(value) {
@on-fetch="onFetch"
:disable-option="{ card: true }"
:footer="true"
data-cy="supplierBalanceTable"
auto-load
>
<template #column-balance="{ rowIndex }">

View File

@ -314,7 +314,7 @@ async function getAmountPaid() {
<VnRow class="row">
<VnSelect
v-if="$props.extraFields.includes('currencyFk')"
:label="t('currencyFk')"
:label="t('Currency')"
v-model="data.currencyFk"
:options="currenciesOptions"
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 ==== */
});
});