half day leave bug fixed

pull/15/head
Sultan khan 2 years ago
parent a2ed4e52f3
commit d4a795dda1

@ -1,6 +1,6 @@
class CalculateAbsenceDuration { class CalculateAbsenceDuration {
num? pABSENCEDAYS; double? pABSENCEDAYS;
num? pABSENCEHOURS; double? pABSENCEHOURS;
String? pRETURNMSG; String? pRETURNMSG;
String? pRETURNSTATUS; String? pRETURNSTATUS;

@ -40,7 +40,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
GetAbsenceAttendanceTypesList? selectedAbsenceType; GetAbsenceAttendanceTypesList? selectedAbsenceType;
DateTime? startDateTime; DateTime? startDateTime;
DateTime? endDateTime; DateTime? endDateTime;
int? totalDays; double? totalDays;
String comment = ""; String comment = "";
ReplacementList? selectedReplacementEmployee; ReplacementList? selectedReplacementEmployee;
String? selectedEmp; String? selectedEmp;
@ -90,7 +90,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
Utils.showLoading(context); Utils.showLoading(context);
CalculateAbsenceDuration duration = await LeaveBalanceApiClient() CalculateAbsenceDuration duration = await LeaveBalanceApiClient()
.calculateAbsenceDuration(selectedAbsenceType!.aBSENCEATTENDANCETYPEID!, Utils.getMonthNamedFormat(startDateTime!), Utils.getMonthNamedFormat(endDateTime!), -999, empID: selectedEmp); .calculateAbsenceDuration(selectedAbsenceType!.aBSENCEATTENDANCETYPEID!, Utils.getMonthNamedFormat(startDateTime!), Utils.getMonthNamedFormat(endDateTime!), -999, empID: selectedEmp);
totalDays = duration.pABSENCEDAYS?.toInt(); totalDays = duration.pABSENCEDAYS?.toDouble();
Utils.hideLoading(context); Utils.hideLoading(context);
setState(() {}); setState(() {});
} catch (ex) { } catch (ex) {
@ -232,7 +232,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
isInputTypeNum: true, isInputTypeNum: true,
isEnable: false, isEnable: false,
onChange: (input) { onChange: (input) {
totalDays = int.parse(input); totalDays = double.tryParse(input);
}, },
), ),
12.height, 12.height,

Loading…
Cancel
Save