Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2722-item_log_highlighted_by_clientType
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2021-02-09 10:43:26 +01:00
commit 83ed70abda
10 changed files with 78 additions and 36 deletions

8
Jenkinsfile vendored
View File

@ -49,7 +49,7 @@ pipeline {
NODE_ENV = "" NODE_ENV = ""
} }
steps { steps {
nodejs('node-lts') { nodejs('node-v12') {
sh 'npm install --no-audit --prefer-offline' sh 'npm install --no-audit --prefer-offline'
sh 'gulp install --ci' sh 'gulp install --ci'
} }
@ -66,14 +66,14 @@ pipeline {
parallel { parallel {
stage('Frontend') { stage('Frontend') {
steps { steps {
nodejs('node-lts') { nodejs('node-v12') {
sh 'jest --ci --reporters=default --reporters=jest-junit --maxWorkers=2' sh 'jest --ci --reporters=default --reporters=jest-junit --maxWorkers=2'
} }
} }
} }
// stage('Backend') { // stage('Backend') {
// steps { // steps {
// nodejs('node-lts') { // nodejs('node-v12') {
// sh 'gulp launchBackTest --ci' // sh 'gulp launchBackTest --ci'
// } // }
// } // }
@ -89,7 +89,7 @@ pipeline {
CREDS = credentials('docker-registry') CREDS = credentials('docker-registry')
} }
steps { steps {
nodejs('node-lts') { nodejs('node-v12') {
sh 'gulp build' sh 'gulp build'
} }

View File

@ -38,8 +38,7 @@ module.exports = Self => {
{ {
arg: 'hasFile', arg: 'hasFile',
type: 'Boolean', type: 'Boolean',
description: 'True if has an attached file', description: 'True if has an attached file'
required: true
}, },
{ {
arg: 'hasFileAttached', arg: 'hasFileAttached',

View File

@ -0,0 +1,2 @@
ALTER TABLE `vn`.`supplier` ADD COLUMN `workerFk` INT(11) NULL DEFAULT NULL COMMENT 'Responsible for approving invoices' AFTER `isTrucker`;
ALTER TABLE `vn`.`supplier` ADD CONSTRAINT `supplier_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `vn`.`worker` (`id`) ON UPDATE CASCADE;

View File

@ -1233,11 +1233,11 @@ INSERT INTO `vn`.`annualAverageInvoiced`(`clientFk`, `invoiced`)
(104, 500), (104, 500),
(105, 5000); (105, 5000);
INSERT INTO `vn`.`supplier`(`id`, `name`, `nickname`,`account`,`countryFk`,`nif`,`isFarmer`,`commission`, `created`, `isActive`, `street`, `city`, `provinceFk`, `postCode`, `payMethodFk`, `payDemFk`, `payDay`, `taxTypeSageFk`, `withholdingSageFk`, `transactionTypeSageFk`) INSERT INTO `vn`.`supplier`(`id`, `name`, `nickname`,`account`,`countryFk`,`nif`,`isFarmer`,`commission`, `created`, `isActive`, `street`, `city`, `provinceFk`, `postCode`, `payMethodFk`, `payDemFk`, `payDay`, `taxTypeSageFk`, `withholdingSageFk`, `transactionTypeSageFk`, `workerFk`)
VALUES VALUES
(1, 'Plants SL', 'Plants nick', 4100000001, 1, '06089160W', 0, 0, CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1), (1, 'Plants SL', 'Plants nick', 4100000001, 1, '06089160W', 0, 0, CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1, 18),
(2, 'Farmer King', 'The farmer', 4000020002, 1, '87945234L', 1, 0, CURDATE(), 1, 'supplier address 2', 'SILLA', 2, 43022, 1, 2, 10, 93, 2, 8), (2, 'Farmer King', 'The farmer', 4000020002, 1, '87945234L', 1, 0, CURDATE(), 1, 'supplier address 2', 'SILLA', 2, 43022, 1, 2, 10, 93, 2, 8, 18),
(442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, 0, CURDATE(), 1, 'supplier address 3', 'SILLA', 1, 43022, 1, 2, 15, 6, 9, 3); (442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, 0, CURDATE(), 1, 'supplier address 3', 'SILLA', 1, 43022, 1, 2, 15, 6, 9, 3, 18);
INSERT INTO `vn`.`supplierContact`(`id`, `supplierFk`, `phone`, `mobile`, `email`, `observation`, `name`) INSERT INTO `vn`.`supplierContact`(`id`, `supplierFk`, `phone`, `mobile`, `email`, `observation`, `name`)
VALUES VALUES

View File

@ -42,6 +42,7 @@ module.exports = Self => {
'sageTaxTypeFk', 'sageTaxTypeFk',
'sageTransactionTypeFk', 'sageTransactionTypeFk',
'sageWithholdingFk', 'sageWithholdingFk',
'workerFk'
], ],
include: [ include: [
{ {
@ -85,7 +86,19 @@ module.exports = Self => {
scope: { scope: {
fields: ['id', 'withholding'] fields: ['id', 'withholding']
} }
} },
{
relation: 'worker',
scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}
},
] ]
}; };
let supplier = await Self.app.models.Supplier.findOne(filter); let supplier = await Self.app.models.Supplier.findOne(filter);

View File

@ -11,75 +11,78 @@
}, },
"properties": { "properties": {
"id": { "id": {
"type": "Number", "type": "number",
"id": true, "id": true,
"description": "Identifier" "description": "Identifier"
}, },
"name": { "name": {
"type": "String" "type": "string"
}, },
"account": { "account": {
"type": "String" "type": "string"
}, },
"countryFk": { "countryFk": {
"type": "Number" "type": "number"
}, },
"nif": { "nif": {
"type": "String" "type": "string"
}, },
"isFarmer": { "isFarmer": {
"type": "Boolean" "type": "boolean"
}, },
"phone": { "phone": {
"type": "Number" "type": "number"
}, },
"retAccount": { "retAccount": {
"type": "Number" "type": "number"
}, },
"commission": { "commission": {
"type": "Boolean" "type": "boolean"
}, },
"created": { "created": {
"type": "Date" "type": "date"
}, },
"postcodeFk": { "postcodeFk": {
"type": "Number" "type": "number"
}, },
"isActive": { "isActive": {
"type": "Boolean" "type": "boolean"
}, },
"isOfficial": { "isOfficial": {
"type": "Boolean" "type": "boolean"
}, },
"isSerious": { "isSerious": {
"type": "Boolean" "type": "boolean"
}, },
"note": { "note": {
"type": "String" "type": "string"
}, },
"street": { "street": {
"type": "String" "type": "string"
}, },
"city": { "city": {
"type": "String" "type": "string"
}, },
"provinceFk": { "provinceFk": {
"type": "Number" "type": "number"
}, },
"postCode": { "postCode": {
"type": "String" "type": "string"
}, },
"payMethodFk": { "payMethodFk": {
"type": "Number" "type": "number"
}, },
"payDemFk": { "payDemFk": {
"type": "Number" "type": "number"
}, },
"payDay": { "payDay": {
"type": "Number" "type": "number"
}, },
"nickname": { "nickname": {
"type": "String" "type": "string"
},
"workerFk": {
"type": "number"
}, },
"sageTaxTypeFk": { "sageTaxTypeFk": {
"type": "number", "type": "number",
@ -126,6 +129,11 @@
"model": "Client", "model": "Client",
"foreignKey": "nif", "foreignKey": "nif",
"primaryKey": "fi" "primaryKey": "fi"
},
"worker": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "workerFk"
}, },
"sageTaxType": { "sageTaxType": {
"type": "belongsTo", "type": "belongsTo",

View File

@ -15,6 +15,17 @@
rule rule
vn-focus> vn-focus>
</vn-textfield> </vn-textfield>
<vn-autocomplete
vn-one
ng-model="$ctrl.supplier.workerFk"
url="Clients/activeWorkersWithRole"
search-function="{firstName: $search}"
show-field="nickname"
value-field="id"
where="{role: 'employee'}"
label="Responsible"
info="Responsible for approving invoices">
</vn-autocomplete>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-check <vn-check

View File

@ -1,3 +1,4 @@
Notes: Notas Notes: Notas
Active: Activo Active: Activo
Verified: Verificado Verified: Verificado
Responsible for approving invoices: Responsable de aprobar las facturas

View File

@ -31,6 +31,13 @@
label="Alias" label="Alias"
value="{{::$ctrl.summary.nickname}}"> value="{{::$ctrl.summary.nickname}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Responsible">
<span
ng-click="workerDescriptor.show($event, $ctrl.summary.workerFk)"
class="link">
{{$ctrl.summary.worker.user.nickname}}
</span>
</vn-label-value>
<vn-label-value no-ellipsize <vn-label-value no-ellipsize
label="Notes" label="Notes"
value="{{::$ctrl.summary.note}}"> value="{{::$ctrl.summary.note}}">

View File

@ -7,3 +7,4 @@ Sage tax type: Tipo de impuesto Sage
Sage transaction type: Tipo de transacción Sage Sage transaction type: Tipo de transacción Sage
Sage withholding: Retencion Sage Sage withholding: Retencion Sage
Go to the supplier: Ir al proveedor Go to the supplier: Ir al proveedor
Responsible: Responsable