Enhancements on Add Work Order Screen

merge-requests/31/head
zaid_daoud 2 years ago
parent c0f801c1c1
commit a19bd39516

@ -294,7 +294,7 @@ class ServiceRequestsProvider extends ChangeNotifier {
"id": request.id,
},
"assetType": report.assetType?.toMap(),
"assignedEmployee": {"id": report.engineer.id, "name": report.engineer.name},
"assignedEmployee": {"id": report.engineer?.id, "name": report.engineer?.name ?? ""},
"visitDate": report.visitDate?.toIso8601String() ?? "",
// "assistantEmployees": [
// {"id": report.engineer.id, "name": report.engineer.name},

@ -140,7 +140,7 @@ class ServiceReport {
//if(serviceType == null) return false;
if (status == null) return false;
if (type == null && assetType == null) return false;
if (engineer == null) return false;
// if (engineer == null) return false;
if (callLastSituation == null) return false;
if (callLastSituation?.value == 12) {
// if(invoiceCode != null || invoiceCode?.isEmpty == true) return false;
@ -148,7 +148,7 @@ class ServiceReport {
}
if (parts == null) return false;
//if(endDate == null) return false;
//if(reason == null) return false;
if (reason == null) return false;
//todo uncoment this line
//if((device?.id == null || device.id.isEmpty) && type?.id != 1) return false;
//if(quantity == null || quantity.isEmpty) return false;

@ -402,7 +402,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
hintText: _serviceReport.startDate == null ? "0" : _serviceReport?.endDate?.difference(_serviceReport?.startDate)?.inHours?.toString() ?? "0",
enable: false,
style: Theme.of(context).textTheme.subtitle1,
validator: (value) => Validator.isNumeric(value) ? null : _subtitle.requiredWord,
validator: (value) => Validator.isNumeric(value.isEmpty ? "0" : value) ? null : _subtitle.requiredWord,
textInputType: TextInputType.number,
onSaved: (value) {
// _serviceReport.workHours = value;

Loading…
Cancel
Save