41 lines
986 B
Dart
41 lines
986 B
Dart
class RequisitionItem {
|
|
int? itemId;
|
|
int? mrId;
|
|
int? materialId;
|
|
String? materialCode;
|
|
String? materialName;
|
|
String? uom;
|
|
double? qtyRequired;
|
|
String? remarks;
|
|
|
|
RequisitionItem({
|
|
this.itemId,
|
|
this.mrId,
|
|
this.materialId,
|
|
this.materialCode,
|
|
this.materialName,
|
|
this.uom,
|
|
this.qtyRequired,
|
|
this.remarks,
|
|
});
|
|
|
|
factory RequisitionItem.fromJson(Map<String, dynamic> json) => RequisitionItem(
|
|
itemId: json['item_id'],
|
|
mrId: json['mr_id'],
|
|
materialId: json['material_id'],
|
|
materialCode: json['material_code'],
|
|
materialName: json['material_name'],
|
|
uom: json['uom'],
|
|
qtyRequired: double.tryParse(json['quantity_required'].toString()) ?? 0,
|
|
remarks: json['remarks'],
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
'item_id': itemId,
|
|
'mr_id': mrId,
|
|
'material_id': materialId,
|
|
'quantity_required': qtyRequired,
|
|
'remarks': remarks,
|
|
};
|
|
}
|