|
|
|
|
@ -65,7 +65,6 @@ class PlanPreventiveVisit {
|
|
|
|
|
List<TimerModel>? timerModelList = [];
|
|
|
|
|
TimerModel? ppMTimePicker;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PlanPreventiveVisit(
|
|
|
|
|
{this.id,
|
|
|
|
|
this.visitNo,
|
|
|
|
|
@ -109,14 +108,14 @@ class PlanPreventiveVisit {
|
|
|
|
|
this.timerModelList,
|
|
|
|
|
this.ppMTimePicker,
|
|
|
|
|
this.activities,
|
|
|
|
|
this.labourCost,
|
|
|
|
|
this.sparePartCost,
|
|
|
|
|
this.travelCost,
|
|
|
|
|
this.qAmount,
|
|
|
|
|
this.prNo,
|
|
|
|
|
this.poNo,
|
|
|
|
|
this.mrNo,
|
|
|
|
|
this.exchangeCost,
|
|
|
|
|
this.labourCost,
|
|
|
|
|
this.sparePartCost,
|
|
|
|
|
this.travelCost,
|
|
|
|
|
this.qAmount,
|
|
|
|
|
this.prNo,
|
|
|
|
|
this.poNo,
|
|
|
|
|
this.mrNo,
|
|
|
|
|
this.exchangeCost,
|
|
|
|
|
this.preventiveVisitSuppliers});
|
|
|
|
|
|
|
|
|
|
PlanPreventiveVisit.fromJson(Map<String, dynamic> json) {
|
|
|
|
|
@ -153,14 +152,14 @@ class PlanPreventiveVisit {
|
|
|
|
|
safety = json['safety'] != null ? Lookup.fromJson(json['safety']) : null;
|
|
|
|
|
engSignature = json['engSignature'];
|
|
|
|
|
nurseSignature = json['nurseSignature'];
|
|
|
|
|
travelCost= json['travelCost'];
|
|
|
|
|
sparePartCost= json['sparePartCost'];
|
|
|
|
|
labourCost =json['laborCost'];
|
|
|
|
|
qAmount= json['qAmount'];
|
|
|
|
|
prNo= json['prNo'];
|
|
|
|
|
poNo= json['poNo'];
|
|
|
|
|
mrNo= json['mrNo'];
|
|
|
|
|
exchangeCost= json['exchangeCost'];
|
|
|
|
|
travelCost = json['travelCost'];
|
|
|
|
|
sparePartCost = json['sparePartCost'];
|
|
|
|
|
labourCost = json['laborCost'];
|
|
|
|
|
qAmount = json['qAmount'];
|
|
|
|
|
prNo = json['prNo'];
|
|
|
|
|
poNo = json['poNo'];
|
|
|
|
|
mrNo = json['mrNo'];
|
|
|
|
|
exchangeCost = json['exchangeCost'];
|
|
|
|
|
if (json['preventiveVisitAttachments'] != null) {
|
|
|
|
|
preventiveVisitAttachments = <GenericAttachmentModel>[];
|
|
|
|
|
json['preventiveVisitAttachments'].forEach((v) {
|
|
|
|
|
@ -487,7 +486,7 @@ class PMSparePartActivityModel {
|
|
|
|
|
String? comment;
|
|
|
|
|
dynamic price;
|
|
|
|
|
|
|
|
|
|
List<SparePartAttachments> activitySparePartPPMAttachments;
|
|
|
|
|
List<GenericAttachmentModel> activitySparePartPPMAttachments;
|
|
|
|
|
|
|
|
|
|
PMSparePartActivityModel({
|
|
|
|
|
this.id,
|
|
|
|
|
@ -498,7 +497,7 @@ class PMSparePartActivityModel {
|
|
|
|
|
this.returnQty,
|
|
|
|
|
this.comment,
|
|
|
|
|
this.price,
|
|
|
|
|
List<SparePartAttachments>? activitySparePartPPMAttachments,
|
|
|
|
|
List<GenericAttachmentModel>? activitySparePartPPMAttachments,
|
|
|
|
|
}) : activitySparePartPPMAttachments = activitySparePartPPMAttachments ?? [];
|
|
|
|
|
|
|
|
|
|
PMSparePartActivityModel.fromJson(Map<String, dynamic> json) : activitySparePartPPMAttachments = [] {
|
|
|
|
|
@ -516,13 +515,9 @@ class PMSparePartActivityModel {
|
|
|
|
|
price = json['price'];
|
|
|
|
|
|
|
|
|
|
// Handle typo in API response: "acitiySparePartPPMAttachments" instead of "activitySparePartPPMAttachments"
|
|
|
|
|
final attachmentsKey = json.containsKey('acitiySparePartPPMAttachments')
|
|
|
|
|
? 'acitiySparePartPPMAttachments'
|
|
|
|
|
: 'activitySparePartPPMAttachments';
|
|
|
|
|
final attachmentsKey = json.containsKey('acitiySparePartPPMAttachments') ? 'acitiySparePartPPMAttachments' : 'activitySparePartPPMAttachments';
|
|
|
|
|
|
|
|
|
|
activitySparePartPPMAttachments = json[attachmentsKey] == null
|
|
|
|
|
? []
|
|
|
|
|
: List.from(json[attachmentsKey]).map((e) => SparePartAttachments.fromJson(e)).toList();
|
|
|
|
|
activitySparePartPPMAttachments = json[attachmentsKey] == null ? [] : List.from(json[attachmentsKey]).map((e) => GenericAttachmentModel.fromJson(e)).toList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
|
|