|
|
|
|
@ -11,7 +11,7 @@ import 'package:test_sa/models/timer_model.dart';
|
|
|
|
|
|
|
|
|
|
class ServiceReport {
|
|
|
|
|
int id;
|
|
|
|
|
String operatingHours;
|
|
|
|
|
double operatingHours;
|
|
|
|
|
DateTime visitDate;
|
|
|
|
|
DateTime endDate;
|
|
|
|
|
DateTime startDate;
|
|
|
|
|
@ -26,7 +26,7 @@ class ServiceReport {
|
|
|
|
|
String workPreformed;
|
|
|
|
|
|
|
|
|
|
//String workHours;
|
|
|
|
|
String travelingHours;
|
|
|
|
|
double travelingHours;
|
|
|
|
|
String invoiceNumber;
|
|
|
|
|
String invoiceCode;
|
|
|
|
|
List<Part> parts;
|
|
|
|
|
@ -93,7 +93,14 @@ class ServiceReport {
|
|
|
|
|
_map["endofWorkTime"] = (timer.endAt ?? DateTime.now()).toIso8601String();
|
|
|
|
|
_map["workingHours"] = (timer.durationInSecond / 60 / 60).toStringAsFixed(5);
|
|
|
|
|
}
|
|
|
|
|
if (travelingHours != null && travelingHours.isNotEmpty) _map["traveling_hours"] = travelingHours;
|
|
|
|
|
if (travelingHours != null && travelingHours.toString().isNotEmpty) _map["traveling_hours"] = travelingHours;
|
|
|
|
|
// if(workPreformed != null && workPreformed.isNotEmpty){
|
|
|
|
|
// _map["faultDescription"] = {
|
|
|
|
|
// //"id":faultDescriptionId ?? 0,
|
|
|
|
|
// "workPerformed":workPreformed
|
|
|
|
|
// };
|
|
|
|
|
// }
|
|
|
|
|
if (travelingHours != null) _map["traveling_hours"] = travelingHours;
|
|
|
|
|
if (workPreformed != null && workPreformed.isNotEmpty) {
|
|
|
|
|
_map["faultDescription"] = faultDescription.toJson();
|
|
|
|
|
}
|
|
|
|
|
@ -170,7 +177,7 @@ class ServiceReport {
|
|
|
|
|
reason: Lookup.fromJson(parsedJson["reason"]),
|
|
|
|
|
status: Lookup.fromJson(parsedJson["status"]),
|
|
|
|
|
type: Lookup.fromJson(parsedJson["typeOfWO"]),
|
|
|
|
|
//faultDescriptionId: parsedJson["fault_description"],
|
|
|
|
|
faultDescriptionId: parsedJson["fault_description"],
|
|
|
|
|
endDate: DateTime.tryParse(parsedJson["endofWorkTime"]),
|
|
|
|
|
//invoiceCode: parsedJson["invoice_code"],
|
|
|
|
|
//invoiceNumber: parsedJson["invoice_no"],
|
|
|
|
|
|