diff --git a/src/components/common/VnLocation.vue b/src/components/common/VnLocation.vue
index 9ed48ca15..fc19e509f 100644
--- a/src/components/common/VnLocation.vue
+++ b/src/components/common/VnLocation.vue
@@ -1,18 +1,23 @@
- handleFetch(data)"
- />
-
+
{{ opt.code }}
- {{ showLabel(opt) }}
+ {{ opt.label }}
diff --git a/src/pages/Customer/Card/CustomerFiscalData.vue b/src/pages/Customer/Card/CustomerFiscalData.vue
index a7cdfafc5..d05e4fa01 100644
--- a/src/pages/Customer/Card/CustomerFiscalData.vue
+++ b/src/pages/Customer/Card/CustomerFiscalData.vue
@@ -95,9 +95,9 @@ function handleLocation(data, location) {
handleLocation(data, location)"
+ :location="data"
+ postal-code-key="postcode"
+ @update:selected="(location) => handleLocation(data, location)"
>
diff --git a/src/pages/Supplier/Card/SupplierFiscalData.vue b/src/pages/Supplier/Card/SupplierFiscalData.vue
index 179c6f5e6..61077d48e 100644
--- a/src/pages/Supplier/Card/SupplierFiscalData.vue
+++ b/src/pages/Supplier/Card/SupplierFiscalData.vue
@@ -17,11 +17,10 @@ const sageTaxTypesOptions = ref([]);
const sageWithholdingsOptions = ref([]);
const sageTransactionTypesOptions = ref([]);
const supplierActivitiesOptions = ref([]);
-const postcodesOptions = ref([]);
function handleLocation(data, location) {
- const { town, code, provinceFk, countryFk } = location ?? {};
- data.postCode = code;
+ const { town, label, provinceFk, countryFk } = location ?? {};
+ data.postCode = label;
data.city = town;
data.provinceFk = provinceFk;
data.countryFk = countryFk;
@@ -131,9 +130,8 @@ function handleLocation(data, location) {
handleLocation(data, location)"
+ :location="data"
+ @update:selected="(location) => handleLocation(data, location)"
>
diff --git a/test/cypress/integration/vnComponent/vnLocation.spec.js b/test/cypress/integration/vnComponent/vnLocation.spec.js
index 6719d8391..c465b152c 100644
--- a/test/cypress/integration/vnComponent/vnLocation.spec.js
+++ b/test/cypress/integration/vnComponent/vnLocation.spec.js
@@ -17,7 +17,7 @@ describe('VnLocation', () => {
cy.get(inputLocation).click();
cy.get(inputLocation).clear();
cy.get(inputLocation).type('al');
- cy.get(locationOptions).should('have.length.at.least', 3);
+ cy.get(locationOptions).should('have.length.at.least', 4);
});
it('input filter location as "ecuador"', function () {
cy.get(inputLocation).click();