Open ktaranek opened 6 years ago
Oh
That might be a bug
Thank you for reporting
Sent from my iPhone
On 16 Jul 2018, at 16:11, ktaranek notifications@github.com wrote:
Hello!
I have encountered error while running carry-over-allowance script in my installation. The error says:
Unhandled rejection TypeError: user.promise_number_of_days_available_in_allowance is not a function
Here is the full output.
npm run-script carry-over-allowance
TimeOff.Management@0.10.0 carry-over-allowance /srv/timeoff/timeoff-management node bin/calculate_carry_over_allowance_for_all_users.js
Executing (default): SELECT
id
,password
,name
,lastname
,activated
,admin
,auto_approve
,start_date
,end_date
,createdAt
,updatedAt
,companyId
,DepartmentId
FROMUsers
ASUser
; Executing (default): SELECTLeave
.id
,Leave
.status
,Leave
.employee_comment
,Leave
.approver_comment
,Leave
.decided_at
,Leave
.date_start
,Leave
.day_part_start
,Leave
.date_end
,Leave
.day_part_end
,Leave
.createdAt
,Leave
.updatedAt
,Leave
.userId
,Leave
.approverId
,Leave
.leaveTypeId
,leave_type
.id
ASleave_type.id
,leave_type
.name
ASleave_type.name
,leave_type
.color
ASleave_type.color
,leave_type
.use_allowance
ASleave_type.use_allowance
,leave_type
.limit
ASleave_type.limit
,leave_type
.sort_order
ASleave_type.sort_order
,leave_type
.createdAt
ASleave_type.createdAt
,leave_type
.updatedAt
ASleave_type.updatedAt
,leave_type
.companyId
ASleave_type.companyId
,user
.id
ASuser.id
,user
.user.email
,user
.password
ASuser.password
,user
.name
ASuser.name
,user
.lastname
ASuser.lastname
,user
.activated
ASuser.activated
,user
.admin
ASuser.admin
,user
.auto_approve
ASuser.auto_approve
,user
.start_date
ASuser.start_date
,user
.end_date
ASuser.end_date
,user
.createdAt
ASuser.createdAt
,user
.updatedAt
ASuser.updatedAt
,user
.companyId
ASuser.companyId
,user
.DepartmentId
ASuser.DepartmentId
,user.company
.id
ASuser.company.id
,user.company
.name
ASuser.company.name
,user.company
.country
ASuser.company.country
,user.company
.start_of_new_year
ASuser.company.start_of_new_year
,user.company
.share_all_absences
ASuser.company.share_all_absences
,user.company
.ldap_auth_enabled
ASuser.company.ldap_auth_enabled
,user.company
.ldap_auth_config
ASuser.company.ldap_auth_config
,user.company
.date_format
ASuser.company.date_format
,user.company
.company_wide_message
ASuser.company.company_wide_message
,user.company
.mode
ASuser.company.mode
,user.company
.timezone
ASuser.company.timezone
,user.company
.createdAt
ASuser.company.createdAt
,user.company
.updatedAt
ASuser.company.updatedAt
,user.company.bank_holidays
.id
ASuser.company.bank_holidays.id
,user.company.bank_holidays
.name
ASuser.company.bank_holidays.name
,user.company.bank_holidays
.date
ASuser.company.bank_holidays.date
,user.company.bank_holidays
.createdAt
ASuser.company.bank_holidays.createdAt
,user.company.bank_holidays
.updatedAt
ASuser.company.bank_holidays.updatedAt
,user.company.bank_holidays
.companyId
ASuser.company.bank_holidays.companyId
FROMLeaves
ASLeave
LEFT OUTER JOINLeaveTypes
ASleave_type
ONLeave
.leaveTypeId
=leave_type
.id
LEFT OUTER JOINUsers
ASuser
ONLeave
.userId
=user
.id
LEFT OUTER JOINCompanies
ASuser.company
ONuser
.companyId
=user.company
.id
LEFT OUTER JOINBankHolidays
ASuser.company.bank_holidays
ONuser.company
.id
=user.company.bank_holidays
.companyId
WHERE (Leave
.userId
= 1 AND (Leave
.status
IN (2, 1, 4) AND (Leave
.date_start
BETWEEN '2018-01-01' AND '2018-12-31 23:59' ORLeave
.date_end
BETWEEN '2018-01-01' AND '2018-12-31 23:59'))); Executing (default): SELECTid
,name
,allowance
,include_public_holidays
,is_accrued_allowance
,createdAt
,updatedAt
,companyId
,bossId
FROMDepartments
ASDepartment
WHEREDepartment
.id
= 4; Executing (default): SELECTid
,monday
,tuesday
,wednesday
,thursday
,friday
,saturday
,sunday
,created_at
,updated_at
,company_id
,user_id
FROMschedule
ASSchedule
WHERE (Schedule
.user_id
= 1 ORSchedule
.company_id
= 1); Executing (default): SELECTUser
.id
,User
.User
.password
,User
.name
,User
.lastname
,User
.activated
,User
.admin
,User
.auto_approve
,User
.start_date
,User
.end_date
,User
.createdAt
,User
.updatedAt
,User
.companyId
,User
.DepartmentId
,company
.id
AScompany.id
,company
.name
AScompany.name
,company
.country
AScompany.country
,company
.start_of_new_year
AScompany.start_of_new_year
,company
.share_all_absences
AScompany.share_all_absences
,company
.ldap_auth_enabled
AScompany.ldap_auth_enabled
,company
.ldap_auth_config
AScompany.ldap_auth_config
,company
.date_format
AScompany.date_format
,company
.company_wide_message
AScompany.company_wide_message
,company
.mode
AScompany.mode
,company
.timezone
AScompany.timezone
,company
.createdAt
AScompany.createdAt
,company
.updatedAt
AScompany.updatedAt
,company.bank_holidays
.id
AScompany.bank_holidays.id
,company.bank_holidays
.name
AScompany.bank_holidays.name
,company.bank_holidays
.date
AScompany.bank_holidays.date
,company.bank_holidays
.createdAt
AScompany.bank_holidays.createdAt
,company.bank_holidays
.updatedAt
AScompany.bank_holidays.updatedAt
,company.bank_holidays
.companyId
AScompany.bank_holidays.companyId
FROMUsers
ASUser
LEFT OUTER JOINCompanies
AScompany
ONUser
.companyId
=company
.id
LEFT OUTER JOINBankHolidays
AScompany.bank_holidays
ONcompany
.id
=company.bank_holidays
.companyId
WHEREUser
.id
= 1; Unhandled rejection TypeError: user.promise_number_of_days_available_in_allowance is not a function at user.reload_with_leave_details.then.user (/srv/timeoff/timeoff-management/bin/calculate_carry_over_allowance_for_all_users.js:31:29) at tryCatcher (/srv/timeoff/timeoff-management/node_modules/bluebird/js/main/util.js:26:23) at Promise._settlePromiseFromHandler (/srv/timeoff/timeoff-management/node_modules/bluebird/js/main/promise.js:510:31) at Promise._settlePromiseAt (/srv/timeoff/timeoff-management/node_modules/bluebird/js/main/promise.js:584:18) at Promise._settlePromises (/srv/timeoff/timeoff-management/node_modules/bluebird/js/main/promise.js:700:14) at Async._drainQueue (/srv/timeoff/timeoff-management/node_modules/bluebird/js/main/async.js:123:16) at Async._drainQueues (/srv/timeoff/timeoff-management/node_modules/bluebird/js/main/async.js:133:10) at Immediate.Async.drainQueues [as _onImmediate] (/srv/timeoff/timeoff-management/node_modules/bluebird/js/main/async.js:15:14) at runCallback (timers.js:756:18) at tryOnImmediate (timers.js:717:5) at processImmediate [as _immediateCallback] (timers.js:697:5) Any ideas where should I look into? Thanks.— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
if the field for "carried over" would be editable it wouldnt be a problem. we're thinking about using this tool but currently we can only do individual adjustments for every employee to insert the carried over of 2017.. 👎
Hello!
I have encountered error while running carry-over-allowance script in my installation. The error says:
Here is the full output.
Any ideas where should I look into? Thanks.