diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js
index f5f2c4050..d0d5be5d5 100644
--- a/e2e/helpers/selectors.js
+++ b/e2e/helpers/selectors.js
@@ -421,6 +421,10 @@ export default {
moreMenuRestoreTicket: '.vn-menu [name="restoreTicket"]',
moreMenuMakeInvoice: '.vn-menu [name="makeInvoice"]',
moreMenuChangeShippedHour: '.vn-menu [name="changeShipped"]',
+ moreMenuPaymentSMS: '.vn-menu [name="sendPaymentSms"]',
+ moreMenuSendImportSms: '.vn-menu [name="sendImportSms"]',
+ SMStext: 'textarea[name="message"]',
+ sendSMSbutton: 'button[response="accept"]',
changeShippedHourDialog: '.vn-dialog.shown',
changeShippedHour: '.vn-dialog.shown vn-input-time[ng-model="$ctrl.newShipped"]',
addStowawayDialogFirstTicket: '.vn-dialog.shown vn-table vn-tbody vn-tr',
@@ -936,7 +940,7 @@ export default {
},
supplierBasicData: {
alias: 'vn-supplier-basic-data vn-textfield[ng-model="$ctrl.supplier.nickname"]',
- isOfficial: 'vn-supplier-basic-data vn-check[ng-model="$ctrl.supplier.isOfficial"]',
+ isSerious: 'vn-supplier-basic-data vn-check[ng-model="$ctrl.supplier.isSerious"]',
isActive: 'vn-supplier-basic-data vn-check[ng-model="$ctrl.supplier.isActive"]',
notes: 'vn-supplier-basic-data vn-textarea[ng-model="$ctrl.supplier.note"]',
saveButton: 'vn-supplier-basic-data button[type="submit"]',
diff --git a/e2e/paths/05-ticket/12_descriptor.spec.js b/e2e/paths/05-ticket/12_descriptor.spec.js
index dda549edd..c1258f973 100644
--- a/e2e/paths/05-ticket/12_descriptor.spec.js
+++ b/e2e/paths/05-ticket/12_descriptor.spec.js
@@ -39,7 +39,7 @@ describe('Ticket descriptor path', () => {
expect(result).toContain('08:15');
});
- it('should delete the ticket using the descriptor more menu', async() => {
+ it('should delete the ticket using the descriptor menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuDeleteTicket);
await page.waitToClick(selectors.ticketDescriptor.acceptDialog);
@@ -64,7 +64,7 @@ describe('Ticket descriptor path', () => {
});
describe('Restore ticket', () => {
- it('should restore the ticket using the descriptor more menu', async() => {
+ it('should restore the ticket using the descriptor menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuRestoreTicket);
await page.waitToClick(selectors.ticketDescriptor.acceptDialog);
@@ -148,7 +148,7 @@ describe('Ticket descriptor path', () => {
expect(result).toEqual('-');
});
- it('should invoice the ticket using the descriptor more menu', async() => {
+ it('should invoice the ticket using the descriptor menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitForContentLoaded();
await page.waitToClick(selectors.ticketDescriptor.moreMenuMakeInvoice);
@@ -165,4 +165,30 @@ describe('Ticket descriptor path', () => {
expect(result).toEqual('T4444445');
});
});
+
+ describe('SMS', () => {
+ it('should send the payment SMS using the descriptor menu', async() => {
+ await page.waitToClick(selectors.ticketDescriptor.moreMenu);
+ await page.waitForContentLoaded();
+ await page.waitToClick(selectors.ticketDescriptor.moreMenuPaymentSMS);
+ await page.waitForSelector(selectors.ticketDescriptor.SMStext);
+ await page.waitPropertyLength(selectors.ticketDescriptor.SMStext, 'value', 128);
+ await page.waitToClick(selectors.ticketDescriptor.sendSMSbutton);
+ const message = await page.waitForSnackbar();
+
+ expect(message.text).toContain('SMS sent!');
+ });
+
+ it('should send the import SMS using the descriptor menu', async() => {
+ await page.waitToClick(selectors.ticketDescriptor.moreMenu);
+ await page.waitForContentLoaded();
+ await page.waitToClick(selectors.ticketDescriptor.moreMenuSendImportSms);
+ await page.waitForSelector(selectors.ticketDescriptor.SMStext);
+ await page.waitPropertyLength(selectors.ticketDescriptor.SMStext, 'value', 144);
+ await page.waitToClick(selectors.ticketDescriptor.sendSMSbutton);
+ const message = await page.waitForSnackbar();
+
+ expect(message.text).toContain('SMS sent!');
+ });
+ });
});
diff --git a/e2e/paths/13-supplier/02_basic_data.spec.js b/e2e/paths/13-supplier/02_basic_data.spec.js
index 9620af98f..319130b98 100644
--- a/e2e/paths/13-supplier/02_basic_data.spec.js
+++ b/e2e/paths/13-supplier/02_basic_data.spec.js
@@ -20,7 +20,7 @@ describe('Supplier basic data path', () => {
it('should edit the basic data', async() => {
await page.clearInput(selectors.supplierBasicData.alias);
await page.write(selectors.supplierBasicData.alias, 'Plants Nick SL');
- await page.waitToClick(selectors.supplierBasicData.isOfficial);
+ await page.waitToClick(selectors.supplierBasicData.isSerious);
await page.waitToClick(selectors.supplierBasicData.isActive);
await page.write(selectors.supplierBasicData.notes, 'Some notes');
@@ -40,8 +40,8 @@ describe('Supplier basic data path', () => {
expect(result).toEqual('Plants Nick SL');
});
- it('should check the isOffical checkbox is now unchecked', async() => {
- const result = await page.checkboxState(selectors.supplierBasicData.isOfficial);
+ it('should check the isSerious checkbox is now unchecked', async() => {
+ const result = await page.checkboxState(selectors.supplierBasicData.isSerious);
expect(result).toBe('unchecked');
});
diff --git a/modules/client/front/descriptor/index.html b/modules/client/front/descriptor/index.html
index 1eee5d853..634436395 100644
--- a/modules/client/front/descriptor/index.html
+++ b/modules/client/front/descriptor/index.html
@@ -79,13 +79,20 @@
+
+
+
+
-
+
{
expect(controller.save).not.toHaveBeenCalledWith();
expect(controller.checkExistingClient).toHaveBeenCalledWith();
});
+
+ it('should enable the hasToInvoice property any time the form activates the client with isActive', () => {
+ $scope.watcher.orgData.isActive = false;
+ controller.client.isActive = true;
+ controller.client.hasToInvoice = false;
+
+ controller.onSubmit();
+
+ expect(controller.client.hasToInvoice).toBe(true);
+ });
});
describe('checkExistingClient()', () => {
diff --git a/modules/supplier/back/methods/supplier/getSummary.js b/modules/supplier/back/methods/supplier/getSummary.js
index 24a592acf..e6509eaa2 100644
--- a/modules/supplier/back/methods/supplier/getSummary.js
+++ b/modules/supplier/back/methods/supplier/getSummary.js
@@ -25,7 +25,7 @@ module.exports = Self => {
'id',
'name',
'nickname',
- 'isOfficial',
+ 'isSerious',
'isActive',
'note',
'nif',
@@ -39,6 +39,9 @@ module.exports = Self => {
'payDay',
'account',
'isFarmer',
+ 'sageTaxTypeFk',
+ 'sageTransactionTypeFk',
+ 'sageWithholdingFk',
],
include: [
{
@@ -64,10 +67,27 @@ module.exports = Self => {
scope: {
fields: ['id', 'payDem']
}
+ },
+ {
+ relation: 'sageTaxType',
+ scope: {
+ fields: ['id', 'vat']
+ }
+ },
+ {
+ relation: 'sageTransactionType',
+ scope: {
+ fields: ['id', 'transaction']
+ }
+ },
+ {
+ relation: 'sageWithholding',
+ scope: {
+ fields: ['id', 'withholding']
+ }
}
]
};
-
let supplier = await Self.app.models.Supplier.findOne(filter);
return supplier;
};
diff --git a/modules/supplier/back/models/supplier-contact.json b/modules/supplier/back/models/supplier-contact.json
index accb2acd6..104a3a404 100644
--- a/modules/supplier/back/models/supplier-contact.json
+++ b/modules/supplier/back/models/supplier-contact.json
@@ -1,6 +1,10 @@
{
"name": "SupplierContact",
- "base": "VnModel",
+ "base": "Loggable",
+ "log": {
+ "model":"SupplierLog",
+ "relation": "supplier"
+ },
"options": {
"mysql": {
"table": "supplierContact"
diff --git a/modules/supplier/back/models/supplier.json b/modules/supplier/back/models/supplier.json
index 596aad745..eb3c5989e 100644
--- a/modules/supplier/back/models/supplier.json
+++ b/modules/supplier/back/models/supplier.json
@@ -51,6 +51,9 @@
"isOfficial": {
"type": "Boolean"
},
+ "isSerious": {
+ "type": "Boolean"
+ },
"note": {
"type": "String"
},
@@ -123,7 +126,22 @@
"model": "Client",
"foreignKey": "nif",
"primaryKey": "fi"
- }
+ },
+ "sageTaxType": {
+ "type": "belongsTo",
+ "model": "SageTaxType",
+ "foreignKey": "sageTaxTypeFk"
+ },
+ "sageTransactionType": {
+ "type": "belongsTo",
+ "model": "SageTransactionType",
+ "foreignKey": "sageTransactionTypeFk"
+ },
+ "sageWithholding": {
+ "type": "belongsTo",
+ "model": "SageWithholding",
+ "foreignKey": "sageWithholdingFk"
+ }
},
"acls": [
{
diff --git a/modules/supplier/front/basic-data/index.html b/modules/supplier/front/basic-data/index.html
index 03622cf38..a39f07da2 100644
--- a/modules/supplier/front/basic-data/index.html
+++ b/modules/supplier/front/basic-data/index.html
@@ -18,8 +18,8 @@
+ label="Verified"
+ ng-model="$ctrl.supplier.isSerious">
diff --git a/modules/supplier/front/descriptor/index.html b/modules/supplier/front/descriptor/index.html
index 5e7225e1c..c98a8e001 100644
--- a/modules/supplier/front/descriptor/index.html
+++ b/modules/supplier/front/descriptor/index.html
@@ -29,9 +29,9 @@
ng-class="{bright: $ctrl.supplier.isActive == false}">
+ vn-tooltip="Verified supplier"
+ icon="verified_user"
+ ng-class="{bright: $ctrl.supplier.isSerious == true}">
diff --git a/modules/supplier/front/descriptor/index.js b/modules/supplier/front/descriptor/index.js
index 42513a56a..197285f57 100644
--- a/modules/supplier/front/descriptor/index.js
+++ b/modules/supplier/front/descriptor/index.js
@@ -40,7 +40,7 @@ class Controller extends Descriptor {
'payDemFk',
'payDay',
'isActive',
- 'isOfficial',
+ 'isSerious',
'account'
],
include: [
diff --git a/modules/supplier/front/descriptor/index.spec.js b/modules/supplier/front/descriptor/index.spec.js
index 58f0fac86..8926fa4d1 100644
--- a/modules/supplier/front/descriptor/index.spec.js
+++ b/modules/supplier/front/descriptor/index.spec.js
@@ -26,7 +26,7 @@ describe('Supplier Component vnSupplierDescriptor', () => {
'payDemFk',
'payDay',
'isActive',
- 'isOfficial',
+ 'isSerious',
'account'
],
include: [
diff --git a/modules/supplier/front/descriptor/locale/es.yml b/modules/supplier/front/descriptor/locale/es.yml
index c92a917c7..dbab87a77 100644
--- a/modules/supplier/front/descriptor/locale/es.yml
+++ b/modules/supplier/front/descriptor/locale/es.yml
@@ -1,5 +1,5 @@
Tax number: NIF / CIF
All entries with current supplier: Todas las entradas con el proveedor actual
Go to client: Ir al cliente
-Official supplier: Proveedor oficial
+Verified supplier: Proveedor verificado
Inactive supplier: Proveedor inactivo
\ No newline at end of file
diff --git a/modules/supplier/front/fiscal-data/index.html b/modules/supplier/front/fiscal-data/index.html
index 1ea3695d6..a17a47319 100644
--- a/modules/supplier/front/fiscal-data/index.html
+++ b/modules/supplier/front/fiscal-data/index.html
@@ -90,6 +90,15 @@
rule>
+
+
+
+
-
+
diff --git a/modules/supplier/front/index/index.js b/modules/supplier/front/index/index.js
index f4a3d7c6d..77b2e8347 100644
--- a/modules/supplier/front/index/index.js
+++ b/modules/supplier/front/index/index.js
@@ -1,7 +1,16 @@
import ngModule from '../module';
import Section from 'salix/components/section';
-export default class Controller extends Section {}
+export default class Controller extends Section {
+ openSummary(supplier, event) {
+ if (event.defaultPrevented) return;
+ event.preventDefault();
+ event.stopPropagation();
+
+ this.supplierSelected = supplier;
+ this.$.dialogSummarySupplier.show();
+ }
+}
ngModule.vnComponent('vnSupplierIndex', {
template: require('./index.html'),
diff --git a/modules/supplier/front/main/index.html b/modules/supplier/front/main/index.html
index 7d7f92cf0..04d7aa0ad 100644
--- a/modules/supplier/front/main/index.html
+++ b/modules/supplier/front/main/index.html
@@ -1,8 +1,7 @@
+ limit="20">
- {{$ctrl.summary.name}} - {{$ctrl.summary.id}}
+ {{::$ctrl.summary.name}} - {{::$ctrl.summary.id}}
Basic data
-
-
-
-
-
-
-
-
-
-
-
-
- Fiscal address
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
Billing data
-
+
-
+
-
+
-
+
+
+
+ Fiscal data
+
+
+
+
+
+
+
+
+
+
+ Fiscal address
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/supplier/front/summary/locale/es.yml b/modules/supplier/front/summary/locale/es.yml
index abdb4d1c7..d39d107f8 100644
--- a/modules/supplier/front/summary/locale/es.yml
+++ b/modules/supplier/front/summary/locale/es.yml
@@ -1,5 +1,8 @@
-Is official: Es oficial
+Verified: Verificado
Country: País
Tax number: NIF / CIF
Search suppliers by id, name or alias: Busca proveedores por id, nombre o alias
-Is Farmer: Es agrícola
\ No newline at end of file
+Is Farmer: Es agrícola
+Sage tax type: Tipo de impuesto Sage
+Sage transaction type: Tipo de transacción Sage
+Sage withholding: Retencion Sage
\ No newline at end of file
diff --git a/modules/ticket/front/descriptor-menu/index.html b/modules/ticket/front/descriptor-menu/index.html
index 1ff1c14e3..70d213c7e 100644
--- a/modules/ticket/front/descriptor-menu/index.html
+++ b/modules/ticket/front/descriptor-menu/index.html
@@ -46,11 +46,13 @@
SMS Pending payment
SMS Minimum import