moved transferor from fiscal data to basic data + e2e
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2021-06-02 17:35:30 +02:00
parent e2ec78461a
commit 86631c84d0
7 changed files with 31 additions and 26 deletions

View File

@ -151,6 +151,7 @@ export default {
mobile: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.mobile"]', mobile: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.mobile"]',
salesPerson: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]', salesPerson: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
channel: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.contactChannelFk"]', channel: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.contactChannelFk"]',
transferor: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.transferorFk"]',
saveButton: 'vn-client-basic-data button[type=submit]' saveButton: 'vn-client-basic-data button[type=submit]'
}, },
clientFiscalData: { clientFiscalData: {
@ -162,7 +163,6 @@ export default {
postcode: 'vn-client-fiscal-data vn-datalist[ng-model="$ctrl.client.postcode"]', postcode: 'vn-client-fiscal-data vn-datalist[ng-model="$ctrl.client.postcode"]',
sageTax: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.sageTaxTypeFk"]', sageTax: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.sageTaxTypeFk"]',
sageTransaction: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.sageTransactionTypeFk"]', sageTransaction: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.sageTransactionTypeFk"]',
transferor: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.transferorFk"]',
city: 'vn-client-fiscal-data vn-datalist[ng-model="$ctrl.client.city"]', city: 'vn-client-fiscal-data vn-datalist[ng-model="$ctrl.client.city"]',
province: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.provinceFk"]', province: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.provinceFk"]',
country: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.countryFk"]', country: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.countryFk"]',

View File

@ -34,6 +34,7 @@ describe('Client Edit basicData path', () => {
await page.clearInput(selectors.clientBasicData.email); await page.clearInput(selectors.clientBasicData.email);
await page.write(selectors.clientBasicData.email, 'PWallace@verdnatura.es'); await page.write(selectors.clientBasicData.email, 'PWallace@verdnatura.es');
await page.autocompleteSearch(selectors.clientBasicData.channel, 'Rumors on the streets'); await page.autocompleteSearch(selectors.clientBasicData.channel, 'Rumors on the streets');
await page.autocompleteSearch(selectors.clientBasicData.transferor, 'Max Eisenhardt');
await page.waitToClick(selectors.clientBasicData.saveButton); await page.waitToClick(selectors.clientBasicData.saveButton);
const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();
@ -67,6 +68,13 @@ describe('Client Edit basicData path', () => {
expect(result).toEqual('Rumors on the streets'); expect(result).toEqual('Rumors on the streets');
}); });
it('should confirm the previous client have been selected', async() => {
const result = await page
.waitToGetProperty(selectors.clientBasicData.transferor, 'value');
expect(result).toEqual('Max Eisenhardt');
});
}); });
describe('as salesAssistant', () => { describe('as salesAssistant', () => {

View File

@ -68,7 +68,6 @@ describe('Client Edit fiscalData path', () => {
await page.write(selectors.clientFiscalData.city, 'Valencia'); await page.write(selectors.clientFiscalData.city, 'Valencia');
await page.autocompleteSearch(selectors.clientFiscalData.sageTax, 'operaciones no sujetas'); await page.autocompleteSearch(selectors.clientFiscalData.sageTax, 'operaciones no sujetas');
await page.autocompleteSearch(selectors.clientFiscalData.sageTransaction, 'regularización de inversiones'); await page.autocompleteSearch(selectors.clientFiscalData.sageTransaction, 'regularización de inversiones');
await page.autocompleteSearch(selectors.clientFiscalData.transferor, 'Max Eisenhardt');
await page.clearInput(selectors.clientFiscalData.postcode); await page.clearInput(selectors.clientFiscalData.postcode);
await page.write(selectors.clientFiscalData.postcode, '46000'); await page.write(selectors.clientFiscalData.postcode, '46000');
await page.waitToClick(selectors.clientFiscalData.activeCheckbox); await page.waitToClick(selectors.clientFiscalData.activeCheckbox);
@ -202,12 +201,6 @@ describe('Client Edit fiscalData path', () => {
expect(result).toEqual('36: Regularización de inversiones'); expect(result).toEqual('36: Regularización de inversiones');
}); });
it('should confirm the transferor have been edited', async() => {
const result = await page.waitToGetProperty(selectors.clientFiscalData.transferor, 'value');
expect(result).toEqual('Max Eisenhardt');
});
it('should confirm the city have been autocompleted', async() => { it('should confirm the city have been autocompleted', async() => {
const result = await page.waitToGetProperty(selectors.clientFiscalData.city, 'value'); const result = await page.waitToGetProperty(selectors.clientFiscalData.city, 'value');

View File

@ -69,6 +69,19 @@
label="Channel"> label="Channel">
</vn-autocomplete> </vn-autocomplete>
</vn-horizontal> </vn-horizontal>
<vn-horizontal>
<vn-autocomplete
ng-model="$ctrl.client.transferorFk"
url="Clients/isActive"
search-function="$ctrl.transferorSearchFunction($search)"
where="{id: {neq: $ctrl.client.id}}"
show-field="name"
value-field="id"
label="Previous client"
info="In case of a company succession, specify the grantor company"
rule>
</vn-autocomplete>
</vn-horizontal>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>
<vn-submit <vn-submit

View File

@ -1,9 +1,17 @@
import ngModule from '../module'; import ngModule from '../module';
import Section from 'salix/components/section'; import Section from 'salix/components/section';
export default class Controller extends Section {
transferorSearchFunction($search) {
return /^\d+$/.test($search)
? {id: $search}
: {name: {like: '%' + $search + '%'}};
}
}
ngModule.vnComponent('vnClientBasicData', { ngModule.vnComponent('vnClientBasicData', {
template: require('./index.html'), template: require('./index.html'),
controller: Section, controller: Controller,
bindings: { bindings: {
client: '<' client: '<'
} }

View File

@ -73,17 +73,6 @@
rule> rule>
<tpl-item>{{id}}: {{transaction}}</tpl-item> <tpl-item>{{id}}: {{transaction}}</tpl-item>
</vn-autocomplete> </vn-autocomplete>
<vn-autocomplete vn-one
ng-model="$ctrl.client.transferorFk"
url="Clients/isActive"
search-function="$ctrl.transferorSearchFunction($search)"
where="{id: {neq: $ctrl.client.id}}"
show-field="name"
value-field="id"
label="Previous client"
info="In case of a company succession, specify the grantor company"
rule>
</vn-autocomplete>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-datalist vn-one <vn-datalist vn-one

View File

@ -173,12 +173,6 @@ export default class Controller extends Section {
this.client.provinceFk = response.provinceFk; this.client.provinceFk = response.provinceFk;
this.client.countryFk = response.countryFk; this.client.countryFk = response.countryFk;
} }
transferorSearchFunction($search) {
return /^\d+$/.test($search)
? {id: $search}
: {name: {like: '%' + $search + '%'}};
}
} }
ngModule.vnComponent('vnClientFiscalData', { ngModule.vnComponent('vnClientFiscalData', {