From 76ff6330f9da79698256bb106f12bb1b329c7f1f Mon Sep 17 00:00:00 2001 From: vicent Date: Mon, 25 Apr 2022 12:23:03 +0200 Subject: [PATCH] feat(supllier.summary): add two fields --- db/changes/10451-april/00-aclSupplierActivity.sql | 2 ++ modules/supplier/back/methods/supplier/getSummary.js | 10 +++++++++- .../supplier/back/methods/supplier/updateFiscalData.js | 8 ++++++++ modules/supplier/front/fiscal-data/index.html | 8 ++++---- modules/supplier/front/fiscal-data/locale/es.yml | 2 ++ modules/supplier/front/summary/index.html | 7 +++++++ modules/supplier/front/summary/locale/es.yml | 4 +++- 7 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 db/changes/10451-april/00-aclSupplierActivity.sql diff --git a/db/changes/10451-april/00-aclSupplierActivity.sql b/db/changes/10451-april/00-aclSupplierActivity.sql new file mode 100644 index 000000000..5d91a1357 --- /dev/null +++ b/db/changes/10451-april/00-aclSupplierActivity.sql @@ -0,0 +1,2 @@ +INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, 'principalId') +VALUES('SupplierActivity', '*', '*', 'ALLOW', 'ROLE', 'employee'); diff --git a/modules/supplier/back/methods/supplier/getSummary.js b/modules/supplier/back/methods/supplier/getSummary.js index 67f5267b6..ad8417d89 100644 --- a/modules/supplier/back/methods/supplier/getSummary.js +++ b/modules/supplier/back/methods/supplier/getSummary.js @@ -41,7 +41,9 @@ module.exports = Self => { 'sageTaxTypeFk', 'sageTransactionTypeFk', 'sageWithholdingFk', - 'workerFk' + 'workerFk', + 'supplierActivityFk', + 'healthRegister' ], include: [ { @@ -98,6 +100,12 @@ module.exports = Self => { } } }, + { + relation: 'supplierActivity', + scope: { + fields: ['code', 'name'] + } + } ] }; let supplier = await Self.app.models.Supplier.findOne(filter); diff --git a/modules/supplier/back/methods/supplier/updateFiscalData.js b/modules/supplier/back/methods/supplier/updateFiscalData.js index daa602af0..4604b3f91 100644 --- a/modules/supplier/back/methods/supplier/updateFiscalData.js +++ b/modules/supplier/back/methods/supplier/updateFiscalData.js @@ -56,6 +56,14 @@ module.exports = Self => { { arg: 'countryFk', type: 'any' + }, + { + arg: 'supplierActivityFk', + type: 'string' + }, + { + arg: 'healthRegister', + type: 'string' }], returns: { arg: 'res', diff --git a/modules/supplier/front/fiscal-data/index.html b/modules/supplier/front/fiscal-data/index.html index a3a634f7d..ea42aed20 100644 --- a/modules/supplier/front/fiscal-data/index.html +++ b/modules/supplier/front/fiscal-data/index.html @@ -32,8 +32,8 @@ + url="SupplierActivities" + data="supplierActivities">
@@ -95,8 +95,8 @@ diff --git a/modules/supplier/front/fiscal-data/locale/es.yml b/modules/supplier/front/fiscal-data/locale/es.yml index 8b98a91af..4cb537198 100644 --- a/modules/supplier/front/fiscal-data/locale/es.yml +++ b/modules/supplier/front/fiscal-data/locale/es.yml @@ -1,3 +1,5 @@ Sage tax type: Tipo de impuesto Sage Sage transaction type: Tipo de transacción Sage Sage withholding: Retención Sage +Supplier activity: Actividad proveedor +Healt register: Pasaporte sanitario diff --git a/modules/supplier/front/summary/index.html b/modules/supplier/front/summary/index.html index 51ebde695..161c7081c 100644 --- a/modules/supplier/front/summary/index.html +++ b/modules/supplier/front/summary/index.html @@ -118,6 +118,13 @@ label="Sage withholding" value="{{::$ctrl.summary.sageWithholding.withholding}}"> + + + diff --git a/modules/supplier/front/summary/locale/es.yml b/modules/supplier/front/summary/locale/es.yml index 512b75f9d..35291e579 100644 --- a/modules/supplier/front/summary/locale/es.yml +++ b/modules/supplier/front/summary/locale/es.yml @@ -7,4 +7,6 @@ Sage tax type: Tipo de impuesto Sage Sage transaction type: Tipo de transacción Sage Sage withholding: Retencion Sage Go to the supplier: Ir al proveedor -Responsible: Responsable \ No newline at end of file +Responsible: Responsable +Supplier activity: Actividad proveedor +Healt register: Pasaporte sanitario \ No newline at end of file