diff --git a/db/versions/11463-chocolateChrysanthemum/00-firstScript.sql b/db/versions/11463-chocolateChrysanthemum/00-firstScript.sql new file mode 100644 index 0000000000..637357323f --- /dev/null +++ b/db/versions/11463-chocolateChrysanthemum/00-firstScript.sql @@ -0,0 +1,2 @@ +ALTER TABLE cache.last_buy + DROP FOREIGN KEY IF EXISTS last_buy_FK_1; diff --git a/modules/worker/back/methods/worker/getWorkerBusiness.js b/modules/worker/back/methods/worker/getWorkerBusiness.js index cefde70085..34b4054ad9 100644 --- a/modules/worker/back/methods/worker/getWorkerBusiness.js +++ b/modules/worker/back/methods/worker/getWorkerBusiness.js @@ -18,6 +18,12 @@ module.exports = Self => { type: 'object', description: 'Filter defining where, order, offset, and limit - must be a JSON-encoded string' }, + { + arg: 'isHourlyLabor', + type: 'boolean', + description: 'isHourlyLabor', + http: {source: 'query'} + }, { arg: 'started', type: 'date', @@ -108,6 +114,18 @@ module.exports = Self => { description: 'workerBusinessCategory', http: {source: 'query'} }, + { + arg: 'workerBusinessAgreementFk', + type: 'number', + description: 'workerBusinessAgreementFk', + http: {source: 'query'} + }, + { + arg: 'workerBusinessAgreementName', + type: 'string', + description: 'workerBusinessAgreementName', + http: {source: 'query'} + }, { arg: 'occupationCodeFk', type: 'number', @@ -177,6 +195,7 @@ module.exports = Self => { switch (param) { case 'started': case 'ended': + case 'isHourlyLabor': case 'companyCodeFk': case 'reasonEndFk': case 'reasondEnd': @@ -184,6 +203,8 @@ module.exports = Self => { case 'department': case 'workerBusinessProfessionalCategoryFk': case 'workerBusinessProfessionalCategory': + case 'workerBusinessAgreementFk': + case 'workerBusinessAgreementName': case 'calendarTypeFk': case 'calendarType': case 'workcenterFk': @@ -212,6 +233,7 @@ module.exports = Self => { b.workerFk, b.started, b.ended, + b.isHourlyLabor, b.companyCodeFk, b.reasonEndFk, bre.reason, @@ -229,6 +251,8 @@ module.exports = Self => { py.description payrollDescription, b.workerBusinessTypeFk, wt.name workerBusinessTypeName, + b.workerBusinessAgreementFk, + wba.name workerBusinessAgreementName, b.amount, b.basicSalary, b.notes @@ -240,6 +264,7 @@ module.exports = Self => { JOIN calendarType ct ON ct.id = b.calendarTypeFk LEFT JOIN workCenter wc ON wc.id = b.workcenterFk LEFT JOIN payrollCategories py ON py.id = b.workerBusinessCategoryFk + LEFT JOIN workerBusinessAgreement wba ON wba.id = b.workerBusinessAgreementFk LEFT JOIN workerBusinessType wt ON wt.id = b.workerBusinessTypeFk ) sub `