This commit is contained in:
parent
b64f6d8489
commit
677764f302
|
@ -231,23 +231,6 @@ export default {
|
|||
saveButton: 'button[type=submit]',
|
||||
watcher: 'vn-client-fiscal-data vn-watcher'
|
||||
},
|
||||
clientBillingData: {
|
||||
payMethod: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.payMethodFk"]',
|
||||
IBAN: 'vn-client-billing-data vn-textfield[ng-model="$ctrl.client.iban"]',
|
||||
dueDay: 'vn-client-billing-data vn-input-number[ng-model="$ctrl.client.dueDay"]',
|
||||
receivedCoreLCRCheckbox: 'vn-client-billing-data vn-check[label="Received LCR"]',
|
||||
receivedCoreVNLCheckbox: 'vn-client-billing-data vn-check[label="Received core VNL"]',
|
||||
receivedB2BVNLCheckbox: 'vn-client-billing-data vn-check[label="Received B2B VNL"]',
|
||||
swiftBic: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"]',
|
||||
newBankEntityButton: 'vn-client-billing-data vn-icon-button[vn-tooltip="New bank entity"] > button',
|
||||
newBankEntityName: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.data.name"]',
|
||||
newBankEntityBIC: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.data.bic"]',
|
||||
newBankEntityCountry: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.data.countryFk"]',
|
||||
newBankEntityCode: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.data.id"]',
|
||||
acceptBankEntityButton: '.vn-dialog.shown button[response="accept"]',
|
||||
saveButton: 'vn-client-billing-data button[type=submit]',
|
||||
watcher: 'vn-client-billing-data vn-watcher'
|
||||
},
|
||||
clientAddresses: {
|
||||
addressesButton: 'vn-left-menu a[ui-sref="client.card.address.index"]',
|
||||
createAddress: 'vn-client-address-index vn-float-button',
|
||||
|
|
|
@ -15,81 +15,55 @@ describe('SmartTable SearchBar integration', () => {
|
|||
await browser.close();
|
||||
});
|
||||
|
||||
describe('as filters in smart-table section', () => {
|
||||
it('should search by type in searchBar', async() => {
|
||||
await page.waitToClick(selectors.itemsIndex.openAdvancedSearchButton);
|
||||
await page.autocompleteSearch(selectors.itemsIndex.advancedSearchItemType, 'Anthurium');
|
||||
await page.waitToClick(selectors.itemsIndex.advancedSearchButton);
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 3);
|
||||
it('should search by type in searchBar, reload page and have same results', async() => {
|
||||
await page.waitToClick(selectors.itemsIndex.openAdvancedSearchButton);
|
||||
await page.autocompleteSearch(selectors.itemsIndex.advancedSearchItemType, 'Anthurium');
|
||||
await page.waitToClick(selectors.itemsIndex.advancedSearchButton);
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 3);
|
||||
|
||||
await page.reload({
|
||||
waitUntil: 'networkidle2'
|
||||
});
|
||||
|
||||
it('should reload page and have same results', async() => {
|
||||
await page.reload({
|
||||
waitUntil: 'networkidle2'
|
||||
});
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 3);
|
||||
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 3);
|
||||
await page.waitToClick(selectors.itemsIndex.advancedSmartTableButton);
|
||||
await page.write(selectors.itemsIndex.advancedSmartTableGrouping, '1');
|
||||
await page.keyboard.press('Enter');
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 2);
|
||||
|
||||
await page.reload({
|
||||
waitUntil: 'networkidle2'
|
||||
});
|
||||
|
||||
it('should search by grouping in smartTable', async() => {
|
||||
await page.waitToClick(selectors.itemsIndex.advancedSmartTableButton);
|
||||
await page.write(selectors.itemsIndex.advancedSmartTableGrouping, '1');
|
||||
await page.keyboard.press('Enter');
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 2);
|
||||
});
|
||||
|
||||
it('should now reload page and have same results', async() => {
|
||||
await page.reload({
|
||||
waitUntil: 'networkidle2'
|
||||
});
|
||||
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 2);
|
||||
});
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 2);
|
||||
});
|
||||
|
||||
describe('as filters in section without smart-table', () => {
|
||||
it('go to zone section', async() => {
|
||||
await page.loginAndModule('salesPerson', 'zone');
|
||||
await page.waitToClick(selectors.globalItems.searchButton);
|
||||
});
|
||||
it('should filter in section without smart-table and search in searchBar go to zone section', async() => {
|
||||
await page.loginAndModule('salesPerson', 'zone');
|
||||
await page.waitToClick(selectors.globalItems.searchButton);
|
||||
|
||||
it('should search in searchBar first time', async() => {
|
||||
await page.doSearch('A');
|
||||
const count = await page.countElement(selectors.zoneIndex.searchResult);
|
||||
await page.doSearch('A');
|
||||
const firstCount = await page.countElement(selectors.zoneIndex.searchResult);
|
||||
|
||||
expect(count).toEqual(7);
|
||||
});
|
||||
await page.doSearch('A');
|
||||
const secondCount = await page.countElement(selectors.zoneIndex.searchResult);
|
||||
|
||||
it('should search in searchBar second time', async() => {
|
||||
await page.doSearch('A');
|
||||
const count = await page.countElement(selectors.zoneIndex.searchResult);
|
||||
|
||||
expect(count).toEqual(7);
|
||||
});
|
||||
|
||||
it('should search in searchBar third time', async() => {
|
||||
await page.doSearch('A');
|
||||
const count = await page.countElement(selectors.zoneIndex.searchResult);
|
||||
|
||||
expect(count).toEqual(7);
|
||||
});
|
||||
expect(firstCount).toEqual(7);
|
||||
expect(secondCount).toEqual(7);
|
||||
});
|
||||
|
||||
describe('as orders', () => {
|
||||
it('should order by first id', async() => {
|
||||
await page.loginAndModule('developer', 'item');
|
||||
await page.accessToSection('item.fixedPrice');
|
||||
await page.keyboard.press('Enter');
|
||||
it('should order orders by first id and order by last id, reload page and have same order', async() => {
|
||||
await page.loginAndModule('developer', 'item');
|
||||
await page.accessToSection('item.fixedPrice');
|
||||
await page.keyboard.press('Enter');
|
||||
|
||||
await page.waitForTextInField(selectors.itemFixedPrice.firstItemID, '1');
|
||||
});
|
||||
await page.waitForTextInField(selectors.itemFixedPrice.firstItemID, '1');
|
||||
|
||||
it('should order by last id, reload page and have same order', async() => {
|
||||
await page.waitToClick(selectors.itemFixedPrice.orderColumnId);
|
||||
await page.reload({
|
||||
waitUntil: 'networkidle2'
|
||||
});
|
||||
await page.waitForTextInField(selectors.itemFixedPrice.firstItemID, '13');
|
||||
await page.waitToClick(selectors.itemFixedPrice.orderColumnId);
|
||||
await page.reload({
|
||||
waitUntil: 'networkidle2'
|
||||
});
|
||||
await page.waitForTextInField(selectors.itemFixedPrice.firstItemID, '13');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -171,100 +171,40 @@ describe('Client Edit fiscalData path', () => {
|
|||
expect(result).toEqual('SMASH');
|
||||
});
|
||||
|
||||
it('should confirm the fiscal id have been edited', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.fiscalId, 'value');
|
||||
it('should confirm the fiscal data have been edited', async() => {
|
||||
const fiscalId = await page.waitToGetProperty(selectors.clientFiscalData.fiscalId, 'value');
|
||||
const address = await page.waitToGetProperty(selectors.clientFiscalData.address, 'value');
|
||||
const postcode = await page.waitToGetProperty(selectors.clientFiscalData.postcode, 'value');
|
||||
const sageTax = await page.waitToGetProperty(selectors.clientFiscalData.sageTax, 'value');
|
||||
const sageTransaction = await page.waitToGetProperty(selectors.clientFiscalData.sageTransaction, 'value');
|
||||
const city = await page.waitToGetProperty(selectors.clientFiscalData.city, 'value');
|
||||
const province = await page.waitToGetProperty(selectors.clientFiscalData.province, 'value');
|
||||
const country = await page.waitToGetProperty(selectors.clientFiscalData.country, 'value');
|
||||
const active = await page.checkboxState(selectors.clientFiscalData.activeCheckbox);
|
||||
const frozen = await page.checkboxState(selectors.clientFiscalData.frozenCheckbox);
|
||||
const hasToInvoice = await page.checkboxState(selectors.clientFiscalData.hasToInvoiceCheckbox);
|
||||
const vies = await page.checkboxState(selectors.clientFiscalData.viesCheckbox);
|
||||
const notifyByMail = await page.checkboxState(selectors.clientFiscalData.notifyByMailCheckbox);
|
||||
const invoiceByAddress = await page.checkboxState(selectors.clientFiscalData.invoiceByAddressCheckbox);
|
||||
const equalizationTax = await page.checkboxState(selectors.clientFiscalData.equalizationTaxCheckbox);
|
||||
const verifiedData = await page.checkboxState(selectors.clientFiscalData.verifiedDataCheckbox);
|
||||
|
||||
expect(result).toEqual('94980061C');
|
||||
});
|
||||
|
||||
it('should confirm the address have been edited', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.address, 'value');
|
||||
|
||||
expect(result).toEqual('Somewhere edited');
|
||||
});
|
||||
|
||||
it('should confirm the postcode have been edited', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.postcode, 'value');
|
||||
|
||||
expect(result).toContain('46000');
|
||||
});
|
||||
|
||||
it('should confirm the sageTax have been edited', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.sageTax, 'value');
|
||||
|
||||
expect(result).toEqual('Operaciones no sujetas');
|
||||
});
|
||||
|
||||
it('should confirm the sageTransaction have been edited', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.sageTransaction, 'value');
|
||||
|
||||
expect(result).toEqual('36: Regularización de inversiones');
|
||||
});
|
||||
|
||||
it('should confirm the city have been autocompleted', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.city, 'value');
|
||||
|
||||
expect(result).toEqual('Valencia');
|
||||
});
|
||||
|
||||
it(`should confirm the province have been autocompleted`, async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.province, 'value');
|
||||
|
||||
expect(result).toContain('Province one');
|
||||
});
|
||||
|
||||
it('should confirm the country have been autocompleted', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.country, 'value');
|
||||
|
||||
expect(result).toEqual('España');
|
||||
});
|
||||
|
||||
it('should confirm active checkbox is unchecked', async() => {
|
||||
const result = await page.checkboxState(selectors.clientFiscalData.activeCheckbox);
|
||||
|
||||
expect(result).toBe('unchecked');
|
||||
});
|
||||
|
||||
it('should confirm frozen checkbox is checked', async() => {
|
||||
const result = await page.checkboxState(selectors.clientFiscalData.frozenCheckbox);
|
||||
|
||||
expect(result).toBe('checked');
|
||||
});
|
||||
|
||||
it('should confirm Has to invoice checkbox is unchecked', async() => {
|
||||
const result = await page.checkboxState(selectors.clientFiscalData.hasToInvoiceCheckbox);
|
||||
|
||||
expect(result).toBe('unchecked');
|
||||
});
|
||||
|
||||
it('should confirm Vies checkbox is checked', async() => {
|
||||
const result = await page.checkboxState(selectors.clientFiscalData.viesCheckbox);
|
||||
|
||||
expect(result).toBe('checked');
|
||||
});
|
||||
|
||||
it('should confirm Notify by email checkbox is unchecked', async() => {
|
||||
const result = await page.checkboxState(selectors.clientFiscalData.notifyByMailCheckbox);
|
||||
|
||||
expect(result).toBe('unchecked');
|
||||
});
|
||||
|
||||
it('should confirm invoice by address checkbox is checked', async() => {
|
||||
const result = await page.checkboxState(selectors.clientFiscalData.invoiceByAddressCheckbox);
|
||||
|
||||
expect(result).toBe('checked');
|
||||
});
|
||||
|
||||
it('should confirm Equalization tax checkbox is unchecked', async() => {
|
||||
const result = await page.checkboxState(selectors.clientFiscalData.equalizationTaxCheckbox);
|
||||
|
||||
expect(result).toBe('unchecked');
|
||||
});
|
||||
|
||||
it('should confirm Verified data checkbox is checked', async() => {
|
||||
const result = await page.checkboxState(selectors.clientFiscalData.verifiedDataCheckbox);
|
||||
|
||||
expect(result).toBe('checked');
|
||||
expect(fiscalId).toEqual('94980061C');
|
||||
expect(address).toEqual('Somewhere edited');
|
||||
expect(postcode).toContain('46000');
|
||||
expect(sageTax).toEqual('Operaciones no sujetas');
|
||||
expect(sageTransaction).toEqual('Regularización de inversiones');
|
||||
expect(city).toEqual('Valencia');
|
||||
expect(province).toContain('Province one');
|
||||
expect(country).toEqual('España');
|
||||
expect(active).toBe('unchecked');
|
||||
expect(frozen).toBe('checked');
|
||||
expect(hasToInvoice).toBe('unchecked');
|
||||
expect(vies).toBe('checked');
|
||||
expect(notifyByMail).toBe('unchecked');
|
||||
expect(invoiceByAddress).toBe('checked');
|
||||
expect(equalizationTax).toBe('unchecked');
|
||||
expect(verifiedData).toBe('checked');
|
||||
});
|
||||
|
||||
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 1
|
||||
|
|
|
@ -1,6 +1,23 @@
|
|||
import selectors from '../../helpers/selectors';
|
||||
import getBrowser from '../../helpers/puppeteer';
|
||||
|
||||
const $ = {
|
||||
payMethod: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.payMethodFk"]',
|
||||
IBAN: 'vn-client-billing-data vn-textfield[ng-model="$ctrl.client.iban"]',
|
||||
dueDay: 'vn-client-billing-data vn-input-number[ng-model="$ctrl.client.dueDay"]',
|
||||
receivedCoreLCRCheckbox: 'vn-client-billing-data vn-check[label="Received LCR"]',
|
||||
receivedCoreVNLCheckbox: 'vn-client-billing-data vn-check[label="Received core VNL"]',
|
||||
receivedB2BVNLCheckbox: 'vn-client-billing-data vn-check[label="Received B2B VNL"]',
|
||||
swiftBic: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"]',
|
||||
newBankEntityButton: 'vn-client-billing-data vn-icon-button[vn-tooltip="New bank entity"] > button',
|
||||
newBankEntityName: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.data.name"]',
|
||||
newBankEntityBIC: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.data.bic"]',
|
||||
newBankEntityCountry: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.data.countryFk"]',
|
||||
newBankEntityCode: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.data.id"]',
|
||||
acceptBankEntityButton: '.vn-dialog.shown button[response="accept"]',
|
||||
saveButton: 'vn-client-billing-data button[type=submit]',
|
||||
watcher: 'vn-client-billing-data vn-watcher'
|
||||
};
|
||||
|
||||
describe('Client Edit billing data path', () => {
|
||||
let browser;
|
||||
let page;
|
||||
|
@ -17,93 +34,72 @@ describe('Client Edit billing data path', () => {
|
|||
});
|
||||
|
||||
it(`should attempt to edit the billing data without an IBAN but fail`, async() => {
|
||||
await page.autocompleteSearch(selectors.clientBillingData.payMethod, 'PayMethod with IBAN');
|
||||
await page.autocompleteSearch(selectors.clientBillingData.swiftBic, 'BBKKESMMMMM');
|
||||
await page.clearInput(selectors.clientBillingData.dueDay);
|
||||
await page.write(selectors.clientBillingData.dueDay, '60');
|
||||
await page.waitForTextInField(selectors.clientBillingData.dueDay, '60');
|
||||
await page.waitToClick(selectors.clientBillingData.receivedCoreLCRCheckbox);
|
||||
await page.waitToClick(selectors.clientBillingData.receivedCoreVNLCheckbox);
|
||||
await page.waitToClick(selectors.clientBillingData.receivedB2BVNLCheckbox);
|
||||
await page.waitToClick(selectors.clientBillingData.saveButton);
|
||||
await page.autocompleteSearch($.payMethod, 'PayMethod with IBAN');
|
||||
await page.autocompleteSearch($.swiftBic, 'BBKKESMMMMM');
|
||||
await page.clearInput($.dueDay);
|
||||
await page.write($.dueDay, '60');
|
||||
await page.waitForTextInField($.dueDay, '60');
|
||||
await page.waitToClick($.receivedCoreLCRCheckbox);
|
||||
await page.waitToClick($.receivedCoreVNLCheckbox);
|
||||
await page.waitToClick($.receivedB2BVNLCheckbox);
|
||||
await page.waitToClick($.saveButton);
|
||||
const message = await page.waitForSnackbar();
|
||||
|
||||
expect(message.text).toContain('That payment method requires an IBAN');
|
||||
});
|
||||
|
||||
it(`should create a new BIC code`, async() => {
|
||||
await page.waitToClick(selectors.clientBillingData.newBankEntityButton);
|
||||
await page.write(selectors.clientBillingData.newBankEntityName, 'Gotham City Bank');
|
||||
await page.write(selectors.clientBillingData.newBankEntityBIC, 'GTHMCT');
|
||||
await page.autocompleteSearch(selectors.clientBillingData.newBankEntityCountry, 'España');
|
||||
await page.write(selectors.clientBillingData.newBankEntityCode, '9999');
|
||||
await page.waitToClick(selectors.clientBillingData.acceptBankEntityButton);
|
||||
await page.waitToClick($.newBankEntityButton);
|
||||
await page.write($.newBankEntityName, 'Gotham City Bank');
|
||||
await page.write($.newBankEntityBIC, 'GTHMCT');
|
||||
await page.autocompleteSearch($.newBankEntityCountry, 'España');
|
||||
await page.write($.newBankEntityCode, '9999');
|
||||
await page.waitToClick($.acceptBankEntityButton);
|
||||
const message = await page.waitForSnackbar();
|
||||
await page.waitForTextInField(selectors.clientBillingData.swiftBic, 'Gotham City Bank');
|
||||
const newcode = await page.waitToGetProperty(selectors.clientBillingData.swiftBic, 'value');
|
||||
|
||||
expect(newcode).toEqual('GTHMCT Gotham City Bank');
|
||||
await page.waitForTextInField($.swiftBic, 'GTHMCT');
|
||||
const newcode = await page.waitToGetProperty($.swiftBic, 'value');
|
||||
|
||||
expect(newcode).toEqual('GTHMCT');
|
||||
expect(message.text).toContain('Data saved!');
|
||||
});
|
||||
|
||||
it(`should confirm the IBAN pay method was sucessfully saved`, async() => {
|
||||
const payMethod = await page.waitToGetProperty(selectors.clientBillingData.payMethod, 'value');
|
||||
const payMethod = await page.waitToGetProperty($.payMethod, 'value');
|
||||
|
||||
expect(payMethod).toEqual('PayMethod with IBAN');
|
||||
});
|
||||
|
||||
it(`should clear the BIC code field, update the IBAN to see how he BIC code autocompletes`, async() => {
|
||||
await page.write(selectors.clientBillingData.IBAN, 'ES9121000418450200051332');
|
||||
await page.write($.IBAN, 'ES9121000418450200051332');
|
||||
await page.keyboard.press('Tab');
|
||||
await page.keyboard.press('Tab');
|
||||
await page.waitForTextInField(selectors.clientBillingData.swiftBic, 'caixesbb');
|
||||
let automaticCode = await page.waitToGetProperty(selectors.clientBillingData.swiftBic, 'value');
|
||||
await page.waitForTextInField($.swiftBic, 'caixesbb');
|
||||
let automaticCode = await page.waitToGetProperty($.swiftBic, 'value');
|
||||
|
||||
expect(automaticCode).toEqual('CAIXESBB Caixa Bank');
|
||||
expect(automaticCode).toEqual('CAIXESBB');
|
||||
});
|
||||
|
||||
it(`should save the form with all its new data`, async() => {
|
||||
await page.waitForWatcherData(selectors.clientBillingData.watcher);
|
||||
await page.waitToClick(selectors.clientBillingData.saveButton);
|
||||
await page.waitForWatcherData($.watcher);
|
||||
await page.waitToClick($.saveButton);
|
||||
const message = await page.waitForSnackbar();
|
||||
|
||||
expect(message.text).toContain('Notification sent!');
|
||||
});
|
||||
|
||||
it('should confirm the due day have been edited', async() => {
|
||||
const dueDate = await page.waitToGetProperty(selectors.clientBillingData.dueDay, 'value');
|
||||
it('should confirm the billing data have been edited', async() => {
|
||||
const dueDate = await page.waitToGetProperty($.dueDay, 'value');
|
||||
const IBAN = await page.waitToGetProperty($.IBAN, 'value');
|
||||
const swiftBic = await page.waitToGetProperty($.swiftBic, 'value');
|
||||
const receivedCoreLCR = await page.checkboxState($.receivedCoreLCRCheckbox);
|
||||
const receivedCoreVNL = await page.checkboxState($.receivedCoreVNLCheckbox);
|
||||
const receivedB2BVNL = await page.checkboxState($.receivedB2BVNLCheckbox);
|
||||
|
||||
expect(dueDate).toEqual('60');
|
||||
});
|
||||
|
||||
it('should confirm the IBAN was saved', async() => {
|
||||
const IBAN = await page.waitToGetProperty(selectors.clientBillingData.IBAN, 'value');
|
||||
|
||||
expect(IBAN).toEqual('ES9121000418450200051332');
|
||||
});
|
||||
|
||||
it('should confirm the swift / BIC code was saved', async() => {
|
||||
const code = await page.waitToGetProperty(selectors.clientBillingData.swiftBic, 'value');
|
||||
|
||||
expect(code).toEqual('CAIXESBB Caixa Bank');
|
||||
});
|
||||
|
||||
it('should confirm Received LCR checkbox is checked', async() => {
|
||||
const result = await page.checkboxState(selectors.clientBillingData.receivedCoreLCRCheckbox);
|
||||
|
||||
expect(result).toBe('checked');
|
||||
});
|
||||
|
||||
it('should confirm Received core VNL checkbox is unchecked', async() => {
|
||||
const result = await page.checkboxState(selectors.clientBillingData.receivedCoreVNLCheckbox);
|
||||
|
||||
expect(result).toBe('unchecked');
|
||||
});
|
||||
|
||||
it('should confirm Received B2B VNL checkbox is unchecked', async() => {
|
||||
const result = await page.checkboxState(selectors.clientBillingData.receivedB2BVNLCheckbox);
|
||||
|
||||
expect(result).toBe('unchecked');
|
||||
expect(swiftBic).toEqual('CAIXESBB');
|
||||
expect(receivedCoreLCR).toBe('checked');
|
||||
expect(receivedCoreVNL).toBe('unchecked');
|
||||
expect(receivedB2BVNL).toBe('unchecked');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
label="Swift / BIC"
|
||||
url="BankEntities"
|
||||
ng-model="$ctrl.client.bankEntityFk"
|
||||
fields="['name']"
|
||||
fields="['name', 'bic']"
|
||||
initial-data="$ctrl.client.bankEntityFk"
|
||||
on-change="$ctrl.autofillBic()"
|
||||
search-function="{or: [{bic: {like: $search +'%'}}, {name: {like: '%'+ $search +'%'}}]}"
|
||||
|
@ -54,7 +54,10 @@
|
|||
show-field="bic"
|
||||
vn-acl="salesAssistant, hr"
|
||||
disabled="$ctrl.ibanCountry == 'ES'">
|
||||
<tpl-item>{{bic}} {{name}}</tpl-item>
|
||||
<tpl-item>
|
||||
<div>{{::bic}}</div>
|
||||
<div class="text-secondary text-caption">{{::name}}</div>
|
||||
</tpl-item>
|
||||
<append>
|
||||
<vn-icon-button
|
||||
vn-auto
|
||||
|
@ -105,4 +108,4 @@
|
|||
<vn-new-bank-entity
|
||||
vn-id="bankEntity"
|
||||
on-accept="$ctrl.onAccept($data)">
|
||||
</vn-new-bank-entity>
|
||||
</vn-new-bank-entity>
|
||||
|
|
|
@ -1,52 +1,111 @@
|
|||
<mg-ajax path="Clients/{{patch.params.id}}/updateFiscalData" options="vnPatch"></mg-ajax>
|
||||
<vn-watcher vn-id="watcher" data="$ctrl.client" id-field="id" form="form" save="patch">
|
||||
<vn-watcher
|
||||
vn-id="watcher"
|
||||
data="$ctrl.client"
|
||||
id-field="id"
|
||||
form="form"
|
||||
save="patch">
|
||||
</vn-watcher>
|
||||
<vn-crud-model auto-load="true" url="Provinces/location" data="provincesLocation" order="name">
|
||||
<vn-crud-model
|
||||
auto-load="true"
|
||||
url="Provinces/location"
|
||||
data="provincesLocation"
|
||||
order="name">
|
||||
</vn-crud-model>
|
||||
<vn-crud-model auto-load="true" url="Countries" data="countries" order="country">
|
||||
<vn-crud-model
|
||||
auto-load="true"
|
||||
url="Countries"
|
||||
data="countries"
|
||||
order="country">
|
||||
</vn-crud-model>
|
||||
<vn-crud-model auto-load="true" url="SageTaxTypes" data="sageTaxTypes" order="vat">
|
||||
<vn-crud-model
|
||||
auto-load="true"
|
||||
url="SageTaxTypes"
|
||||
data="sageTaxTypes"
|
||||
order="vat">
|
||||
</vn-crud-model>
|
||||
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
||||
<vn-card class="vn-pa-lg">
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-two vn-focus label="Social name" ng-model="$ctrl.client.socialName" rule
|
||||
info="Only letters, numbers and spaces can be used" required="true">
|
||||
<vn-textfield
|
||||
vn-focus
|
||||
label="Social name"
|
||||
ng-model="$ctrl.client.socialName"
|
||||
info="Only letters, numbers and spaces can be used"
|
||||
required="true"
|
||||
rule>
|
||||
</vn-textfield>
|
||||
<vn-textfield vn-one label="Tax number" ng-model="$ctrl.client.fi" rule>
|
||||
<vn-textfield
|
||||
label="Tax number"
|
||||
ng-model="$ctrl.client.fi"
|
||||
rule>
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-two label="Street" ng-model="$ctrl.client.street" rule>
|
||||
<vn-textfield
|
||||
vn-two
|
||||
label="Street"
|
||||
ng-model="$ctrl.client.street"
|
||||
rule>
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-autocomplete vn-one ng-model="$ctrl.client.sageTaxTypeFk" data="sageTaxTypes" show-field="vat"
|
||||
value-field="id" label="Sage tax type" vn-acl="salesAssistant" rule>
|
||||
<vn-autocomplete
|
||||
ng-model="$ctrl.client.sageTaxTypeFk"
|
||||
data="sageTaxTypes"
|
||||
show-field="vat"
|
||||
value-field="id"
|
||||
label="Sage tax type"
|
||||
vn-acl="salesAssistant"
|
||||
rule>
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete vn-one ng-model="$ctrl.client.sageTransactionTypeFk" url="SageTransactionTypes"
|
||||
show-field="transaction" value-field="id" label="Sage transaction type"
|
||||
<vn-autocomplete
|
||||
ng-model="$ctrl.client.sageTransactionTypeFk"
|
||||
url="SageTransactionTypes"
|
||||
show-field="transaction"
|
||||
value-field="id"
|
||||
label="Sage transaction type"
|
||||
search-function="{or: [{id: $search}, {transaction: {like: '%'+ $search +'%'}}]}"
|
||||
vn-acl="salesAssistant" order="transaction" rule>
|
||||
vn-acl="salesAssistant"
|
||||
order="transaction"
|
||||
rule>
|
||||
<tpl-item>{{id}}: {{transaction}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-datalist vn-one label="Postcode" ng-model="$ctrl.client.postcode" selection="$ctrl.postcode"
|
||||
url="Postcodes/location" fields="['code','townFk']" order="code, townFk" value-field="code"
|
||||
show-field="code" rule>
|
||||
<vn-datalist
|
||||
label="Postcode"
|
||||
ng-model="$ctrl.client.postcode"
|
||||
selection="$ctrl.postcode"
|
||||
url="Postcodes/location"
|
||||
fields="['code','townFk']"
|
||||
order="code, townFk"
|
||||
value-field="code"
|
||||
show-field="code"
|
||||
rule>
|
||||
<tpl-item>
|
||||
{{code}} - {{town.name}} ({{town.province.name}},
|
||||
{{town.province.country.country}})
|
||||
</tpl-item>
|
||||
<append>
|
||||
<vn-icon-button icon="add_circle" vn-tooltip="New postcode" ng-click="postcode.open()"
|
||||
vn-acl="deliveryBoss" vn-acl-action="remove">
|
||||
<vn-icon-button
|
||||
icon="add_circle"
|
||||
vn-tooltip="New postcode"
|
||||
ng-click="postcode.open()"
|
||||
vn-acl="deliveryBoss"
|
||||
vn-acl-action="remove">
|
||||
</vn-icon-button>
|
||||
</append>
|
||||
</vn-datalist>
|
||||
<vn-datalist vn-id="town" vn-one label="City" ng-model="$ctrl.client.city" selection="$ctrl.town"
|
||||
url="Towns/location" fields="['id', 'name', 'provinceFk']" show-field="name" value-field="name">
|
||||
<vn-datalist
|
||||
vn-id="town"
|
||||
label="City"
|
||||
ng-model="$ctrl.client.city"
|
||||
selection="$ctrl.town"
|
||||
url="Towns/location"
|
||||
fields="['id', 'name', 'provinceFk']"
|
||||
show-field="name"
|
||||
value-field="name">
|
||||
<tpl-item>
|
||||
{{name}}, {{province.name}}
|
||||
({{province.country.country}})
|
||||
|
@ -54,48 +113,83 @@
|
|||
</vn-datalist>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-autocomplete vn-id="province" vn-one label="Province" ng-model="$ctrl.client.provinceFk"
|
||||
selection="$ctrl.province" data="provincesLocation" fields="['id', 'name', 'countryFk']"
|
||||
show-field="name" value-field="id" rule>
|
||||
<vn-autocomplete
|
||||
vn-one
|
||||
vn-id="province"
|
||||
label="Province"
|
||||
ng-model="$ctrl.client.provinceFk"
|
||||
selection="$ctrl.province"
|
||||
data="provincesLocation"
|
||||
fields="['id', 'name', 'countryFk']"
|
||||
show-field="name"
|
||||
value-field="id"
|
||||
rule>
|
||||
<tpl-item>{{name}} ({{country.country}})</tpl-item>
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete vn-id="country" vn-one ng-model="$ctrl.client.countryFk" data="countries"
|
||||
show-field="country" value-field="id" label="Country" rule>
|
||||
<vn-autocomplete
|
||||
vn-one
|
||||
vn-id="country"
|
||||
ng-model="$ctrl.client.countryFk"
|
||||
data="countries"
|
||||
show-field="country"
|
||||
value-field="id"
|
||||
label="Country"
|
||||
rule>
|
||||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-check vn-one label="Active" ng-model="$ctrl.client.isActive">
|
||||
<vn-check
|
||||
label="Active"
|
||||
ng-model="$ctrl.client.isActive">
|
||||
</vn-check>
|
||||
<vn-check vn-one label="Frozen" ng-model="$ctrl.client.isFreezed">
|
||||
<vn-check
|
||||
label="Frozen"
|
||||
ng-model="$ctrl.client.isFreezed">
|
||||
</vn-check>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-check vn-one label="Has to invoice" ng-model="$ctrl.client.hasToInvoice">
|
||||
<vn-check
|
||||
label="Has to invoice"
|
||||
ng-model="$ctrl.client.hasToInvoice">
|
||||
</vn-check>
|
||||
<vn-check vn-one label="Vies"
|
||||
info="When activating it, do not enter the country code in the ID field."
|
||||
ng-model="$ctrl.client.isVies">
|
||||
<vn-check
|
||||
label="Vies"
|
||||
info="When activating it, do not enter the country code in the ID field."
|
||||
ng-model="$ctrl.client.isVies">
|
||||
</vn-check>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-check vn-one label="Notify by email" ng-model="$ctrl.client.isToBeMailed">
|
||||
<vn-check
|
||||
label="Notify by email"
|
||||
ng-model="$ctrl.client.isToBeMailed">
|
||||
</vn-check>
|
||||
<vn-check vn-one label="Invoice by address" ng-model="$ctrl.client.hasToInvoiceByAddress">
|
||||
<vn-check
|
||||
label="Invoice by address"
|
||||
ng-model="$ctrl.client.hasToInvoiceByAddress">
|
||||
</vn-check>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-check vn-one label="Is equalizated" ng-model="$ctrl.client.isEqualizated"
|
||||
<vn-check
|
||||
label="Is equalizated"
|
||||
ng-model="$ctrl.client.isEqualizated"
|
||||
info="In order to invoice, this field is not consulted, but the consignee's ET. When modifying this field if the invoice by address option is not checked, the change will be automatically propagated to all addresses, otherwise the user will be asked if he wants to propagate it or not."
|
||||
on-change="$ctrl.onChangeEqualizated(value)">
|
||||
</vn-check>
|
||||
<vn-check vn-one label="Verified data" ng-model="$ctrl.client.isTaxDataChecked" vn-acl="salesAssistant">
|
||||
<vn-check
|
||||
label="Verified data"
|
||||
ng-model="$ctrl.client.isTaxDataChecked"
|
||||
vn-acl="salesAssistant">
|
||||
</vn-check>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-check vn-one label="Incoterms authorization" ng-model="$ctrl.client.hasIncoterms"
|
||||
<vn-check
|
||||
label="Incoterms authorization"
|
||||
ng-model="$ctrl.client.hasIncoterms"
|
||||
vn-acl="administrative">
|
||||
</vn-check>
|
||||
<vn-check vn-one label="Electronic invoice" ng-model="$ctrl.client.hasElectronicInvoice"
|
||||
<vn-check
|
||||
label="Electronic invoice"
|
||||
ng-model="$ctrl.client.hasElectronicInvoice"
|
||||
vn-acl="administrative">
|
||||
</vn-check>
|
||||
</vn-horizontal>
|
||||
|
@ -103,17 +197,26 @@
|
|||
<vn-button-bar>
|
||||
<vn-submit disabled="!watcher.dataChanged()" label="Save">
|
||||
</vn-submit>
|
||||
<vn-button class="cancel" label="Undo changes" disabled="!watcher.dataChanged()"
|
||||
<vn-button
|
||||
class="cancel"
|
||||
label="Undo changes"
|
||||
disabled="!watcher.dataChanged()"
|
||||
ng-click="watcher.loadOriginalData()">
|
||||
</vn-button>
|
||||
</vn-button-bar>
|
||||
</form>
|
||||
<vn-confirm vn-id="propagate-isEqualizated" question="You changed the equalization tax"
|
||||
message="Do you want to spread the change?" on-accept="$ctrl.onAcceptEt()">
|
||||
<vn-confirm
|
||||
vn-id="propagate-isEqualizated"
|
||||
question="You changed the equalization tax"
|
||||
message="Do you want to spread the change?"
|
||||
on-accept="$ctrl.onAcceptEt()">
|
||||
</vn-confirm>
|
||||
<vn-confirm vn-id="confirm-duplicatedClient" message="Found a client with this data"
|
||||
<vn-confirm
|
||||
vn-id="confirm-duplicatedClient"
|
||||
message="Found a client with this data"
|
||||
on-accept="$ctrl.onAcceptDuplication()">
|
||||
</vn-confirm>
|
||||
<!-- New postcode dialog -->
|
||||
<vn-geo-postcode vn-id="postcode" on-response="$ctrl.onResponse($response)">
|
||||
</vn-geo-postcode>
|
||||
<vn-geo-postcode
|
||||
vn-id="postcode"
|
||||
on-response="$ctrl.onResponse($response)">
|
||||
</vn-geo-postcode>
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
class="dense"
|
||||
url="Items/withName"
|
||||
ng-model="price.itemFk"
|
||||
show-field="name"
|
||||
show-field="id"
|
||||
value-field="id"
|
||||
search-function="$ctrl.itemSearchFunc($search)"
|
||||
on-change="$ctrl.upsertPrice(price, true)"
|
||||
|
|
Loading…
Reference in New Issue