diff --git a/src/pages/Customer/Card/CustomerFiscalData.vue b/src/pages/Customer/Card/CustomerFiscalData.vue
index b45df2e0f..fbb155cd3 100644
--- a/src/pages/Customer/Card/CustomerFiscalData.vue
+++ b/src/pages/Customer/Card/CustomerFiscalData.vue
@@ -62,6 +62,15 @@ async function acceptPropagate({ isEqualizated }) {
});
notify(t('Equivalent tax spreaded'), 'warning');
}
+const isTaxDataChecked = ref(false);
+
+function isRequired({ isTaxDataChecked: taxDataChecked }) {
+ if (!isTaxDataChecked.value) {
+ return false;
+ } else {
+ return taxDataChecked;
+ }
+}
@@ -111,21 +120,27 @@ async function acceptPropagate({ isEqualizated }) {
@@ -151,11 +166,11 @@ async function acceptPropagate({ isEqualizated }) {
/>
-
-
+
+
-
+
-
-
+
@@ -177,16 +192,18 @@ async function acceptPropagate({ isEqualizated }) {
:label="t('Is equalizated')"
:info="t('inOrderToInvoice')"
/>
-
+
-
+
diff --git a/test/cypress/integration/customer/clientFiscalData.spec.js b/test/cypress/integration/customer/clientFiscalData.spec.js
index 2200802ca..e2c51ed85 100644
--- a/test/cypress/integration/customer/clientFiscalData.spec.js
+++ b/test/cypress/integration/customer/clientFiscalData.spec.js
@@ -1,37 +1,53 @@
///
+function checkSageFields(isRequired = false) {
+ const haveAttr = isRequired ? 'have.attr' : 'not.have.attr';
+ cy.dataCy('sageTaxTypeFk').filter('input').should(haveAttr, 'required');
+ cy.dataCy('sageTransactionTypeFk').filter('input').should(haveAttr, 'required');
+}
describe('Client fiscal data', () => {
- beforeEach(() => {
- cy.viewport(1280, 720);
- cy.login('developer');
- cy.visit('#/customer/1107/fiscal-data');
- });
- it.skip('Should change required value when change customer', () => {
- cy.get('.q-card').should('be.visible');
- cy.dataCy('sageTaxTypeFk').filter('input').should('not.have.attr', 'required');
- cy.get('#searchbar input').clear();
- cy.get('#searchbar input').type('1{enter}');
- cy.get('.q-item > .q-item__label').should('have.text', ' #1');
- cy.dataCy('sageTaxTypeFk').filter('input').should('have.attr', 'required');
+ describe('#1008', () => {
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit('#/customer/1108/fiscal-data');
+ });
+ it('Should change required value when change customer', () => {
+ cy.get('.q-card').should('be.visible');
+ checkSageFields();
+ cy.get('[data-cy="vnCheckboxVerified data"]').click();
+ checkSageFields(true);
+ cy.get('#searchbar input').clear();
+ cy.get('#searchbar input').type('1{enter}');
+ cy.get('.q-item > .q-item__label').should('have.text', ' #1');
+ checkSageFields();
+ });
});
+ describe('#1007', () => {
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit('#/customer/1107/fiscal-data');
+ });
- it('check as equalizated', () => {
- cy.get(
- ':nth-child(1) > .q-checkbox > .q-checkbox__inner > .q-checkbox__bg',
- ).click();
- cy.get('.q-btn-group > .q-btn--standard > .q-btn__content').click();
+ it('check as equalizated', () => {
+ cy.get(
+ ':nth-child(1) > .q-checkbox > .q-checkbox__inner > .q-checkbox__bg',
+ ).click();
+ cy.get('.q-btn-group > .q-btn--standard > .q-btn__content').click();
- cy.get('.q-card > :nth-child(1) > span').should(
- 'contain',
- 'You changed the equalization tax',
- );
+ cy.get('.q-card > :nth-child(1) > span').should(
+ 'contain',
+ 'You changed the equalization tax',
+ );
- cy.get('.q-card > :nth-child(2) > span').should(
- 'have.text',
- 'Do you want to spread the change?',
- );
- cy.get('[data-cy="VnConfirm_confirm"] > .q-btn__content > .block').click();
- cy.get(
- '.bg-warning > .q-notification__wrapper > .q-notification__content > .q-notification__message',
- ).should('have.text', 'Equivalent tax spreaded');
+ cy.get('.q-card > :nth-child(2) > span').should(
+ 'have.text',
+ 'Do you want to spread the change?',
+ );
+ cy.get('[data-cy="VnConfirm_confirm"] > .q-btn__content > .block').click();
+ cy.get(
+ '.bg-warning > .q-notification__wrapper > .q-notification__content > .q-notification__message',
+ ).should('have.text', 'Equivalent tax spreaded');
+ });
});
});