From 7dbe5c24ec2e349e32ecd7dae53dc71d6e3eb8ef Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 12 May 2025 13:17:07 +0200 Subject: [PATCH] fix: refs #8388 update format functions to handle empty values and adjust column widths --- src/pages/InvoiceIn/Card/InvoiceInIntrastat.vue | 11 ++++------- src/pages/InvoiceIn/Card/InvoiceInVat.vue | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/pages/InvoiceIn/Card/InvoiceInIntrastat.vue b/src/pages/InvoiceIn/Card/InvoiceInIntrastat.vue index c989f94e4..04c84edc2 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInIntrastat.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInIntrastat.vue @@ -28,9 +28,10 @@ const columns = computed(() => [ sortBy: 'id', fields: ['id', 'description'], }, - format: getCode, + format: (row, dashIfEmpty) => dashIfEmpty(getCode(row)), create: true, isEditable: true, + width: 'max-content', }, { name: 'amount', @@ -39,7 +40,6 @@ const columns = computed(() => [ create: true, isEditable: true, columnFilter: false, - width: '30px', }, { name: 'net', @@ -48,7 +48,6 @@ const columns = computed(() => [ create: true, isEditable: true, columnFilter: false, - width: '30px', }, { name: 'stems', @@ -57,7 +56,6 @@ const columns = computed(() => [ create: true, isEditable: true, columnFilter: false, - width: '30px', }, { name: 'countryFk', @@ -70,7 +68,6 @@ const columns = computed(() => [ create: true, isEditable: true, columnFilter: false, - width: '30px', }, ]); @@ -79,8 +76,8 @@ const tableRows = computed( ); function getCode(row) { - const { id, description } = intrastats.value.find(({ id }) => id === row.intrastatFk); - return `${id}: ${description}`; + const code = intrastats.value.find(({ id }) => id === row.intrastatFk); + return code ? `${code.id}: ${code.description}` : null; }