diff --git a/src/components/VnTable/filters/tableFooter.js b/src/components/VnTable/filters/tableFooter.js new file mode 100644 index 000000000..9c7d080f6 --- /dev/null +++ b/src/components/VnTable/filters/tableFooter.js @@ -0,0 +1,12 @@ +export default function (initialFooter, data) { + const footer = data.reduce( + (acc, row) => { + Object.entries(initialFooter).forEach(([key, initialValue]) => { + acc[key] += row?.[key] !== undefined ? row[key] : initialValue; + }); + return acc; + }, + { ...initialFooter } + ); + return footer; +} diff --git a/src/pages/Department/Card/DepartmentCard.vue b/src/pages/Department/Card/DepartmentCard.vue index 8597e37cf..4b9fe419c 100644 --- a/src/pages/Department/Card/DepartmentCard.vue +++ b/src/pages/Department/Card/DepartmentCard.vue @@ -10,4 +10,4 @@ import DepartmentDescriptor from 'pages/Department/Card/DepartmentDescriptor.vue base-url="Departments" :descriptor="DepartmentDescriptor" /> - \ No newline at end of file + diff --git a/src/pages/Supplier/Card/SupplierBalance.vue b/src/pages/Supplier/Card/SupplierBalance.vue new file mode 100644 index 000000000..87eac2abf --- /dev/null +++ b/src/pages/Supplier/Card/SupplierBalance.vue @@ -0,0 +1,191 @@ + + + + + + + + + + {{ toCurrency(balances[rowIndex]?.balance) }} + + + + {{ dashIfEmpty(row.sref) }} + + + {{ dashIfEmpty(row.sref) }} + + + + + {{ toCurrency(round(tableRef.footer.invoiceEuros)) }} + + + + + {{ toCurrency(round(tableRef.footer.paymentEuros)) }} + + + + + {{ toCurrency(round(tableRef.footer.euroBalance)) }} + + + + + + +es: + Company: Empresa + Total by company: Total por empresa + Date: Fecha + Creation date: Fecha de creación + Reference: Referencia + Bank: Caja + Debit: Debe + Havings: Haber + Balance: Balance + Conciliated: Conciliado + diff --git a/src/pages/Supplier/Card/SupplierBalanceFilter.vue b/src/pages/Supplier/Card/SupplierBalanceFilter.vue new file mode 100644 index 000000000..c4b63d9c8 --- /dev/null +++ b/src/pages/Supplier/Card/SupplierBalanceFilter.vue @@ -0,0 +1,121 @@ + + + + + + + {{ t(`params.${tag.label}`) }}: + {{ formatFn(tag.value) }} + + + + + + + + + + + + + + + + {{ scope.opt.id }} {{ scope.opt.bank }} + + + + + + + + + + + + + + + + + + + + + +en: + params: + search: General search + supplierId: Supplier + categoryId: Category + from: From + to: To + isConciliated: Is conciliated + currencyFk: Currency + bankFk: Bank + companyId: Comapany + isBooked: Is booked +es: + params: + supplierId: Proveedor + isConciliated: Conciliado + currencyFk: Moneda + New payment: Añadir pago + Date: Fecha + from: Desde + to: Hasta + companyId: Empresa + isBooked: Contabilizado + bankFk: Caja + Amount: Importe + Reference: Referencia + Cash: Efectivo + diff --git a/src/router/modules/supplier.js b/src/router/modules/supplier.js index 647f4bdd3..4ece4c784 100644 --- a/src/router/modules/supplier.js +++ b/src/router/modules/supplier.js @@ -21,6 +21,7 @@ export default { 'SupplierAccounts', 'SupplierContacts', 'SupplierAddresses', + 'SupplierBalance', 'SupplierConsumption', 'SupplierAgencyTerm', 'SupplierDms', @@ -144,6 +145,16 @@ export default { component: () => import('src/pages/Supplier/Card/SupplierAddressesCreate.vue'), }, + { + path: 'balance', + name: 'SupplierBalance', + meta: { + title: 'balance', + icon: 'balance', + }, + component: () => + import('src/pages/Supplier/Card/SupplierBalance.vue'), + }, { path: 'consumption', name: 'SupplierConsumption', diff --git a/test/cypress/integration/Supplier/SupplierBalance.spec.js b/test/cypress/integration/Supplier/SupplierBalance.spec.js new file mode 100644 index 000000000..e4a3ee65c --- /dev/null +++ b/test/cypress/integration/Supplier/SupplierBalance.spec.js @@ -0,0 +1,11 @@ +describe('Supplier Balance', () => { + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('developer'); + cy.visit(`/#/supplier/1/balance`); + }); + + it('Should load layout', () => { + cy.get('.q-page').should('be.visible'); + }); +}); diff --git a/test/cypress/integration/client/clientBalance.spec.js b/test/cypress/integration/client/clientBalance.spec.js index dfba56b16..abfa74cec 100644 --- a/test/cypress/integration/client/clientBalance.spec.js +++ b/test/cypress/integration/client/clientBalance.spec.js @@ -3,9 +3,7 @@ describe('Client balance', () => { beforeEach(() => { cy.viewport(1280, 720); cy.login('developer'); - cy.visit('#/customer/1101/balance', { - timeout: 5000, - }); + cy.visit('#/customer/1101/balance'); }); it('Should load layout', () => { cy.get('.q-page').should('be.visible');