Compare commits

..

2 Commits

Author SHA1 Message Date
Sultan khan fb35e256e7 CS Standard Change Request
CR-7260

Fixed Asset Disposal Request amendment
3 weeks ago
Sultan khan c9d5ab98a3 work-list fixes 4 weeks ago

@ -620,5 +620,27 @@
"mazaya": "مازيا",
"benefits": "فوائد",
"mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين",
"viewallofferMazaya" : "أعرض كل المزايا"
"viewallofferMazaya" : "أعرض كل المزايا",
"buyerName": "اسم المشتري",
"buyerNumber": "رقم المشتري",
"highestBidder": "أعلى مزايد",
"remarks": "ملاحظات",
"faHeader": "تفاصيل رأس الصفحة FA",
"bookTypeCode": "رمز نوع الكتاب",
"categoryCode": "رمز الفئة",
"categoryGroup": "مجموعة الفئات",
"faLINES": "تفاصيل الأصول",
"assetNumber": "رقم الأصول",
"assetDescription": "وصف الأصول",
"barCodeNumber": "رقم الباركود",
"datePlaceInService": "تاريخ وضعه في الخدمة",
"serialNumber": "رقم سري",
"disposedDate": "تاريخ التخلص",
"netBookValue": "القيمة الدفترية الصافية",
"purchasedPrice": "سعر الشراء",
"usefulLife": "العمر الإنتاجي",
"yearsUsed": "سنوات الاستخدام",
"faRequest": "طلب التخلص من FA",
"showMore": "عرض المزيد",
"buyerDetails": "تفاصيل المشتري"
}

@ -618,6 +618,27 @@
"mazaya": "MAZAYA",
"benefits": "Benefits",
"mazayaDesc": "Discover special Discounts and offers available to Employees",
"viewallofferMazaya" : "View All Offers"
"viewallofferMazaya" : "View All Offers",
"buyerName": "Buyer Name",
"buyerNumber": "Buyer Number",
"highestBidder": "Highest Bidder",
"remarks": "Remarks",
"faHeader": "FA Header Details",
"bookTypeCode": "Book Type Code",
"categoryCode": "Category Code",
"categoryGroup": "Category Group",
"faLINES": "Asset Details",
"assetNumber": "Asset Number",
"assetDescription": "Asset Description",
"barCodeNumber": "BarCode Number",
"datePlaceInService": "Date place In Service",
"serialNumber": "Serial Number",
"disposedDate": "Disposed Date",
"netBookValue": "Net Book Value",
"purchasedPrice": "Purchased Price",
"usefulLife": "Useful Life",
"yearsUsed": "Years Used",
"faRequest":"FA Disposal Request",
"showMore": "Show More",
"buyerDetails": "Buyer Details"
}

@ -28,6 +28,7 @@ import 'package:mohem_flutter_app/models/notification_get_respond_attributes_lis
import 'package:mohem_flutter_app/models/termination/termination_notification_body.dart';
import 'package:mohem_flutter_app/models/update_user_item_type_list.dart';
import 'package:mohem_flutter_app/models/worklist/GetRFCEmployeeList.dart';
import 'package:mohem_flutter_app/models/worklist/get_fad_notifications.dart';
import 'package:mohem_flutter_app/models/worklist/get_favorite_replacements_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_body_list.dart';
@ -846,4 +847,19 @@ class WorkListApiClient {
postParams,
);
}
Future<GetFaDisposalNtfDetails?> getFADNotificationBody(int? notificationId) async {
String url = "${ApiConsts.erpRest}GetFADisposalNtfDetails";
Map<String, dynamic> postParams = {"P_NOTIFICATION_ID": notificationId, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject(
(json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.getFADisposalNtfDetails;
},
url,
postParams,
);
}
}

@ -4,14 +4,14 @@ class ApiConsts {
// static String baseUrl = "http://10.200.204.11"; // Local server
// static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "http://10.201.204.101:2024";
// static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://hmgwebservices.com"; // Live server
// static String baseUrl = "https://mohemm.hmg.com"; // New Live server
//
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "http://10.20.200.111:1010/";
// static String baseUrl = "https://webservices.hmg.com"; // PreProd

@ -81,28 +81,30 @@ extension EmailValidator on String {
),
);
Widget toText12({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int maxLine = 0}) => Text(
Widget toText12({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int? maxLine, TextOverflow? overflow}) => Text(
this,
textAlign: isCenter ? TextAlign.center : null,
maxLines: (maxLine > 0) ? maxLine : null,
maxLines: maxLine == 0 ? null : maxLine,
style: TextStyle(
fontSize: 12,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
color: color ?? MyColors.darkTextColor,
letterSpacing: -0.72,
decoration: isUnderLine ? TextDecoration.underline : null,
overflow: TextOverflow.visible
),
);
Widget toText12Auto({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int maxLine = 0}) => AutoSizeText(
Widget toText12Auto({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int? maxLine,TextOverflow? overflow}) => AutoSizeText(
this,
textAlign: isCenter ? TextAlign.center : null,
maxLines: (maxLine > 0) ? maxLine : null,
maxLines: maxLine == 0 ? null : maxLine,
minFontSize: 8,
style: TextStyle(
fontSize: 12,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
color: color ?? MyColors.darkTextColor,
overflow: overflow,
letterSpacing: -0.72,
decoration: isUnderLine ? TextDecoration.underline : null,
),

@ -633,7 +633,29 @@ class CodegenLoader extends AssetLoader{
"mazaya": "مازيا",
"benefits": "فوائد",
"mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين",
"viewallofferMazaya": "أعرض كل المزايا"
"viewallofferMazaya": "أعرض كل المزايا",
"buyerName": "اسم المشتري",
"buyerNumber": "رقم المشتري",
"highestBidder": "أعلى مزايد",
"remarks": "ملاحظات",
"faHeader": "تفاصيل رأس الصفحة FA",
"bookTypeCode": "رمز نوع الكتاب",
"categoryCode": "رمز الفئة",
"categoryGroup": "مجموعة الفئات",
"faLINES": "تفاصيل الأصول",
"assetNumber": "رقم الأصول",
"assetDescription": "وصف الأصول",
"barCodeNumber": "رقم الباركود",
"datePlaceInService": "تاريخ وضعه في الخدمة",
"serialNumber": "رقم سري",
"disposedDate": "تاريخ التخلص",
"netBookValue": "القيمة الدفترية الصافية",
"purchasedPrice": "سعر الشراء",
"usefulLife": "العمر الإنتاجي",
"yearsUsed": "سنوات الاستخدام",
"faRequest": "طلب التخلص من FA",
"showMore": "عرض المزيد",
"buyerDetails": "تفاصيل المشتري"
};
static const Map<String,dynamic> _en_US = {
"mohemm": "Mohemm",
@ -1254,7 +1276,29 @@ static const Map<String,dynamic> _en_US = {
"mazaya": "MAZAYA",
"benefits": "Benefits",
"mazayaDesc": "Discover special Discounts and offers available to Employees",
"viewallofferMazaya": "View All Offers"
"viewallofferMazaya": "View All Offers",
"buyerName": "Buyer Name",
"buyerNumber": "Buyer Number",
"highestBidder": "Highest Bidder",
"remarks": "Remarks",
"faHeader": "FA Header Details",
"bookTypeCode": "Book Type Code",
"categoryCode": "Category Code",
"categoryGroup": "Category Group",
"faLINES": "Asset Details",
"assetNumber": "Asset Number",
"assetDescription": "Asset Description",
"barCodeNumber": "BarCode Number",
"datePlaceInService": "Date place In Service",
"serialNumber": "Serial Number",
"disposedDate": "Disposed Date",
"netBookValue": "Net Book Value",
"purchasedPrice": "Purchased Price",
"usefulLife": "Useful Life",
"yearsUsed": "Years Used",
"faRequest": "FA Disposal Request",
"showMore": "Show More",
"buyerDetails": "Buyer Details"
};
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": _ar_SA, "en_US": _en_US};
}

@ -606,5 +606,27 @@ abstract class LocaleKeys {
static const benefits = 'benefits';
static const mazayaDesc = 'mazayaDesc';
static const viewallofferMazaya = 'viewallofferMazaya';
static const buyerName = 'buyerName';
static const buyerNumber = 'buyerNumber';
static const highestBidder = 'highestBidder';
static const remarks = 'remarks';
static const faHeader = 'faHeader';
static const bookTypeCode = 'bookTypeCode';
static const categoryCode = 'categoryCode';
static const categoryGroup = 'categoryGroup';
static const faLINES = 'faLINES';
static const assetNumber = 'assetNumber';
static const assetDescription = 'assetDescription';
static const barCodeNumber = 'barCodeNumber';
static const datePlaceInService = 'datePlaceInService';
static const serialNumber = 'serialNumber';
static const disposedDate = 'disposedDate';
static const netBookValue = 'netBookValue';
static const purchasedPrice = 'purchasedPrice';
static const usefulLife = 'usefulLife';
static const yearsUsed = 'yearsUsed';
static const faRequest = 'faRequest';
static const showMore = 'showMore';
static const buyerDetails = 'buyerDetails';
}

@ -107,6 +107,7 @@ import 'package:mohem_flutter_app/models/vacation_rule/vr_item_types_list_model.
import 'package:mohem_flutter_app/models/vacation_rule/wf_look_up_list_model.dart';
import 'package:mohem_flutter_app/models/validate_eit_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/GetRFCEmployeeList.dart';
import 'package:mohem_flutter_app/models/worklist/get_fad_notifications.dart';
import 'package:mohem_flutter_app/models/worklist/get_favorite_replacements_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_body_list.dart';
@ -386,6 +387,7 @@ class GenericResponseModel {
String? validatePhonesTransactionList;
List<VrItemTypesList>? vrItemTypesList;
List<WFLookUpList>? wFLookUpList;
GetFaDisposalNtfDetails? getFADisposalNtfDetails;
String? eLearningGETEMPLOYEEPROFILEList;
String? eLearningLOGINList;
String? eLearningValidateLoginList;
@ -664,6 +666,7 @@ class GenericResponseModel {
this.ePharmacyGetItemOnHandList,
this.isActiveCode,
this.isSMSSent,
this.getFADisposalNtfDetails
});
GenericResponseModel.fromJson(Map<String, dynamic> json) {
@ -933,6 +936,9 @@ class GenericResponseModel {
});
}
getFADisposalNtfDetails = json['GetFADisposalNtfDetails'] != null ? GetFaDisposalNtfDetails.fromJson(json['GetFADisposalNtfDetails']) : null;
if (json['GetEarningsList'] != null) {
getEarningsList = <GetEarningsList>[];
json['GetEarningsList'].forEach((v) {
@ -1549,6 +1555,7 @@ class GenericResponseModel {
if (this.getActionHistoryList != null) {
data['GetActionHistoryList'] = this.getActionHistoryList!.map((v) => v.toJson()).toList();
}
data['GetFADisposalNtfDetails'] =this.getFADisposalNtfDetails;
data['GetAddressDffStructureList'] = this.getAddressDffStructureList;
data['GetAddressNotificationBodyList'] = this.getAddressNotificationBodyList;

@ -0,0 +1,233 @@
import 'dart:convert';
class GetFaDisposalNtfDetails {
List<PFaBuyer>? pFaBuyers;
List<PFaHeader>? pFaHeader;
List<PFaLine>? pFaLines;
String? pInformation;
dynamic pQuestion;
GetFaDisposalNtfDetails({
this.pFaBuyers,
this.pFaHeader,
this.pFaLines,
this.pInformation,
this.pQuestion,
});
factory GetFaDisposalNtfDetails.fromRawJson(String str) => GetFaDisposalNtfDetails.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory GetFaDisposalNtfDetails.fromJson(Map<String, dynamic> json) => GetFaDisposalNtfDetails(
pFaBuyers: json["P_FA_BUYERS"] == null ? [] : List<PFaBuyer>.from(json["P_FA_BUYERS"]!.map((x) => PFaBuyer.fromJson(x))),
pFaHeader: json["P_FA_HEADER"] == null ? [] : List<PFaHeader>.from(json["P_FA_HEADER"]!.map((x) => PFaHeader.fromJson(x))),
pFaLines: json["P_FA_LINES"] == null ? [] : List<PFaLine>.from(json["P_FA_LINES"]!.map((x) => PFaLine.fromJson(x))),
pInformation: json["P_INFORMATION"],
pQuestion: json["P_QUESTION"],
);
Map<String, dynamic> toJson() => {
"P_FA_BUYERS": pFaBuyers == null ? [] : List<dynamic>.from(pFaBuyers!.map((x) => x.toJson())),
"P_FA_HEADER": pFaHeader == null ? [] : List<dynamic>.from(pFaHeader!.map((x) => x.toJson())),
"P_FA_LINES": pFaLines == null ? [] : List<dynamic>.from(pFaLines!.map((x) => x.toJson())),
"P_INFORMATION": pInformation,
"P_QUESTION": pQuestion,
};
}
class PFaBuyer {
int? amount;
String? buyerName;
String? buyerNumber;
int? fromRowNum;
String? highestBidder;
int? noOfRows;
String? receiptNumber;
String? remarks;
int? requestNo;
int? rowNum;
int? toRowNum;
PFaBuyer({
this.amount,
this.buyerName,
this.buyerNumber,
this.fromRowNum,
this.highestBidder,
this.noOfRows,
this.receiptNumber,
this.remarks,
this.requestNo,
this.rowNum,
this.toRowNum,
});
factory PFaBuyer.fromRawJson(String str) => PFaBuyer.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory PFaBuyer.fromJson(Map<String, dynamic> json) => PFaBuyer(
amount: json["AMOUNT"],
buyerName: json["BUYER_NAME"],
buyerNumber: json["BUYER_NUMBER"],
fromRowNum: json["FROM_ROW_NUM"],
highestBidder: json["HIGHEST_BIDDER"],
noOfRows: json["NO_OF_ROWS"],
receiptNumber: json["RECEIPT_NUMBER"],
remarks: json["REMARKS"],
requestNo: json["REQUEST_NO"],
rowNum: json["ROW_NUM"],
toRowNum: json["TO_ROW_NUM"],
);
Map<String, dynamic> toJson() => {
"AMOUNT": amount,
"BUYER_NAME": buyerName,
"BUYER_NUMBER": buyerNumber,
"FROM_ROW_NUM": fromRowNum,
"HIGHEST_BIDDER": highestBidder,
"NO_OF_ROWS": noOfRows,
"RECEIPT_NUMBER": receiptNumber,
"REMARKS": remarks,
"REQUEST_NO": requestNo,
"ROW_NUM": rowNum,
"TO_ROW_NUM": toRowNum,
};
}
class PFaHeader {
String? bookTypeCode;
String? categoryCode;
String? categoryGroup;
String? comments;
int? requestNo;
String? status;
PFaHeader({
this.bookTypeCode,
this.categoryCode,
this.categoryGroup,
this.comments,
this.requestNo,
this.status,
});
factory PFaHeader.fromRawJson(String str) => PFaHeader.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory PFaHeader.fromJson(Map<String, dynamic> json) => PFaHeader(
bookTypeCode: json["BOOK_TYPE_CODE"],
categoryCode: json["CATEGORY_CODE"],
categoryGroup: json["CATEGORY_GROUP"],
comments: json["COMMENTS"],
requestNo: json["REQUEST_NO"],
status: json["STATUS"],
);
Map<String, dynamic> toJson() => {
"BOOK_TYPE_CODE": bookTypeCode,
"CATEGORY_CODE": categoryCode,
"CATEGORY_GROUP": categoryGroup,
"COMMENTS": comments,
"REQUEST_NO": requestNo,
"STATUS": status,
};
}
class PFaLine {
String? action;
String? assetDescription;
int? assetNumber;
String? barcodeNumber;
String? bme;
String? datePlacedInService;
String? department;
String? disposedDate;
int? fromRowNum;
double? netBookValue;
int? noOfRows;
String? poNumber;
double? purchasePrice;
int? quantity;
int? requestNo;
int? rowNum;
String? serialNumber;
int? toRowNum;
int? usefulLife;
String? yearsUsed;
PFaLine({
this.action,
this.assetDescription,
this.assetNumber,
this.barcodeNumber,
this.bme,
this.datePlacedInService,
this.department,
this.disposedDate,
this.fromRowNum,
this.netBookValue,
this.noOfRows,
this.poNumber,
this.purchasePrice,
this.quantity,
this.requestNo,
this.rowNum,
this.serialNumber,
this.toRowNum,
this.usefulLife,
this.yearsUsed,
});
factory PFaLine.fromRawJson(String str) => PFaLine.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory PFaLine.fromJson(Map<String, dynamic> json) => PFaLine(
action: json["ACTION"],
assetDescription: json["ASSET_DESCRIPTION"],
assetNumber: json["ASSET_NUMBER"],
barcodeNumber: json["BARCODE_NUMBER"],
bme: json["BME"],
datePlacedInService: json["DATE_PLACED_IN_SERVICE"],
department: json["DEPARTMENT"],
disposedDate: json["DISPOSED_DATE"],
fromRowNum: json["FROM_ROW_NUM"],
netBookValue: json["NET_BOOK_VALUE"]?.toDouble(),
noOfRows: json["NO_OF_ROWS"],
poNumber: json["PO_NUMBER"],
purchasePrice: json["PURCHASE_PRICE"]?.toDouble(),
quantity: json["QUANTITY"],
requestNo: json["REQUEST_NO"],
rowNum: json["ROW_NUM"],
serialNumber: json["SERIAL_NUMBER"],
toRowNum: json["TO_ROW_NUM"],
usefulLife: json["USEFUL_LIFE"],
yearsUsed: json["YEARS_USED"],
);
Map<String, dynamic> toJson() => {
"ACTION": action,
"ASSET_DESCRIPTION": assetDescription,
"ASSET_NUMBER": assetNumber,
"BARCODE_NUMBER": barcodeNumber,
"BME": bme,
"DATE_PLACED_IN_SERVICE": datePlacedInService,
"DEPARTMENT": department,
"DISPOSED_DATE": disposedDate,
"FROM_ROW_NUM": fromRowNum,
"NET_BOOK_VALUE": netBookValue,
"NO_OF_ROWS": noOfRows,
"PO_NUMBER": poNumber,
"PURCHASE_PRICE": purchasePrice,
"QUANTITY": quantity,
"REQUEST_NO": requestNo,
"ROW_NUM": rowNum,
"SERIAL_NUMBER": serialNumber,
"TO_ROW_NUM": toRowNum,
"USEFUL_LIFE": usefulLife,
"YEARS_USED": yearsUsed,
};
}

@ -125,6 +125,17 @@ class _WorkListScreenState extends State<WorkListScreen> {
key: 'PAY_REQ',
disable: false,
),
WorkListItemTypeModelData(
value: 0,
name: 'FA Disposal Request ',
fullName: LocaleKeys.faRequest.tr(),
active: false,
color: [Color(0xff42d7bf), Color(0xff42d7bf)],
icon: "assets/images/miss_swipe.svg",
key: 'HMG_FA_D',
disable: false,
),
];
int? workListItemIndex;

@ -25,6 +25,7 @@ import 'package:mohem_flutter_app/models/member_information_list_model.dart';
import 'package:mohem_flutter_app/models/notification_get_respond_attributes_list_model.dart';
import 'package:mohem_flutter_app/models/termination/termination_notification_body.dart';
import 'package:mohem_flutter_app/models/worklist/GetRFCEmployeeList.dart';
import 'package:mohem_flutter_app/models/worklist/get_fad_notifications.dart';
import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_body_list.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart';
@ -92,7 +93,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
GetPrNotificationBodyList? getPrNotificationBody;
GetItemCreationNtfBodyList? getItemCreationNtfBody;
GetPaymentNotificationBodyList? getPaymentNotificationBodyList;
GetFaDisposalNtfDetails? getFADNotificationBody;
bool isCloseAvailable = false;
bool isApproveAvailable = false;
bool isRejectAvailable = false;
@ -177,6 +178,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (workListData!.iTEMTYPE == "PAY_REQ") {
getPaymentNotification();
}
if (workListData!.iTEMTYPE == "HMG_FA_D") {
getFADNotification();
}
if (controller.hasClients) {
controller.jumpToPage(0);
@ -272,6 +276,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
getPrNotificationBodyList: getPrNotificationBody,
getTerminationNotificationBodyList: getTerminationNotificationBodyList,
getPaymentNotificationBodyList: getPaymentNotificationBodyList,
getFADNotificationBodyList: getFADNotificationBody
),
(workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP" || workListData!.iTEMTYPE == "PAY_REQ")
? DetailFragment(workListData, memberInformationListModel)
@ -1036,6 +1041,23 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
}
}
Future<void> getFADNotification() async {
try {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getFADNotificationBody = await WorkListApiClient().getFADNotificationBody(workListData!.nOTIFICATIONID);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
setState(() {});
}
} catch (ex) {
apiCallCount--;
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
void notificationGetRespondAttributes() async {
try {
if (apiCallCount == 0) Utils.showLoading(context);

@ -12,6 +12,7 @@ import 'package:mohem_flutter_app/models/get_po_notification_body_list_model.dar
import 'package:mohem_flutter_app/models/get_pr_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_stamp_ms_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_stamp_ns_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/get_fad_notifications.dart';
import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_body_list.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart';
@ -39,7 +40,7 @@ class InfoFragment extends StatelessWidget {
List<GetAddressNotificationBodyList>? getAddressNotificationBodyList = [];
List<TerminationNotificationBody>? getTerminationNotificationBodyList = [];
GetPaymentNotificationBodyList? getPaymentNotificationBodyList;
GetFaDisposalNtfDetails? getFADNotificationBodyList;
InfoFragment(
{this.workListData,
this.poHeaderList = const <POHeader>[],
@ -54,7 +55,9 @@ class InfoFragment extends StatelessWidget {
this.getPrNotificationBodyList,
this.getAddressNotificationBodyList,
this.getTerminationNotificationBodyList,
this.getPaymentNotificationBodyList});
this.getPaymentNotificationBodyList,
this.getFADNotificationBodyList
});
double itemHeight = 0;
double itemWidth = 0;
@ -129,7 +132,10 @@ class InfoFragment extends StatelessWidget {
getTerminationNotificationBodyList!),
if (getPaymentNotificationBodyList != null)
getPaymentNotificationBodyListWidget(getPaymentNotificationBodyList ??
GetPaymentNotificationBodyList())
GetPaymentNotificationBodyList()),
if (getFADNotificationBodyList != null)
getFANotificationBodyListWidget(getFADNotificationBodyList ??
GetFaDisposalNtfDetails())
.objectContainerView(),
];
return Container(
@ -922,5 +928,125 @@ class InfoFragment extends StatelessWidget {
],
);
}
Widget getFANotificationBodyListWidget(
GetFaDisposalNtfDetails? data) {
return Column(
children: [
12.height,
if (data!.pFaHeader!.isNotEmpty)
Column(
children: [
LocaleKeys.faHeader.tr().toText14(color: MyColors.textMixColor),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.requestNo.tr(),
data.pFaHeader![0].requestNo.toString() ?? ""),
ItemDetailViewCol(
LocaleKeys.stats.tr(), data.pFaHeader![0].status ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.bookTypeCode.tr(), data.pFaHeader![0].bookTypeCode ?? ""),
ItemDetailViewCol(LocaleKeys.categoryCode.tr(),
data.pFaHeader![0].categoryCode ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.categoryGroup.tr(),
data.pFaHeader![0].categoryGroup ?? ""),
ItemDetailViewCol(
LocaleKeys.comments.tr(), data.pFaHeader![0].comments ?? ""),
),
],
).objectContainerView(),
if (data!.pFaLines!.isNotEmpty)
Column(
children: [
LocaleKeys.faLINES.tr().toText14(color: MyColors.textMixColor),
ItemDetailGrid(
ItemDetailViewCol( LocaleKeys.requestNo.tr(),
data.pFaLines![0].requestNo.toString() ?? ""),
ItemDetailViewCol(
LocaleKeys.quantity.tr(), data.pFaLines![0].quantity.toString() ?? "" ),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.assetNumber.tr(), data.pFaLines![0].assetNumber.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.assetDescription.tr(),
data.pFaLines![0].assetDescription ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.barCodeNumber.tr(),
data.pFaLines![0] .barcodeNumber.toString() ?? ""),
ItemDetailViewCol(
LocaleKeys.datePlaceInService.tr(), DateUtil.formatDateToDate(
DateUtil.convertStringToDate( data.pFaLines![0].datePlacedInService ?? ""), false)),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.departmentName.tr(),
data.pFaLines![0].department ?? ""),
ItemDetailViewCol(LocaleKeys.serialNumber.tr(),
data.pFaLines![0].serialNumber ?? "") ,
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.disposedDate.tr(), DateUtil.formatDateToDate(
DateUtil.convertStringToDate( data.pFaLines![0].disposedDate ?? ""), false)),
ItemDetailViewCol(LocaleKeys.netBookValue.tr(),
data.pFaLines![0].netBookValue.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.poNumber.tr(), data.pFaLines![0].poNumber.toString() ?? "" ),
ItemDetailViewCol(LocaleKeys.purchasedPrice.tr(),
data.pFaLines![0].purchasePrice.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.usefulLife.tr(), data.pFaLines![0].usefulLife.toString() ?? "" ),
ItemDetailViewCol(LocaleKeys.yearsUsed.tr(),
data.pFaLines![0].yearsUsed.toString() ?? ""),
),
],
).objectContainerView(),
if (data!.pFaBuyers!.isNotEmpty)
Column(
children: [
LocaleKeys.buyer.tr().toText14(color: MyColors.textMixColor),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.requestNo.tr(), data.pFaBuyers![0].requestNo.toString() ?? ""),
ItemDetailViewCol( LocaleKeys.amount.tr(),
data.pFaBuyers![0].amount.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.buyerNumber.tr(),
data.pFaBuyers![0].buyerName!),
ItemDetailViewCol(
LocaleKeys.buyerNumber.tr(), data.pFaBuyers![0].buyerNumber ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol( LocaleKeys.highestBidder.tr(),
data.pFaBuyers![0].highestBidder ?? ""),
ItemDetailViewCol(
LocaleKeys.remarks.tr(), data.pFaBuyers![0].remarks ?? ""),
),
],
).objectContainerView(),
]);
}
}

@ -1,5 +1,8 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
void showMyBottomSheet(BuildContext context, {required Widget child, required VoidCallback callBackFunc, String? type}) {
showModalBottomSheet<String>(
@ -49,6 +52,82 @@ void showMyBottomSheet(BuildContext context, {required Widget child, required Vo
});
}
Widget openWorkListBottomSheet(BuildContext context, String? val, String? title){
return SafeArea(
child: Container(
padding: const EdgeInsets.all(16),
height: MediaQuery.of(context).size.height * 0.3 , // half-screen height
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// ---- Top Row with Title & Close Button ----
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title ?? "Details",
style: const TextStyle(
color: Color(0xff2BB8A6),
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
IconButton(
icon: const Icon(Icons.close, color: Colors.black54, size: 20),
onPressed: () {
Navigator.pop(context);
},
),
],
),
const Divider(height: 1, color: Colors.grey),
const SizedBox(height: 12),
// ---- Scrollable Content ----
Expanded(
child: SingleChildScrollView(
child: Text(
(val?.isEmpty ?? true)
? "--"
: val.toString(),
style: TextStyle(
color: MyColors.normalTextColor,
fontSize: 14,
height: 1.4,
),
),
),
),
SizedBox(
width: double.infinity,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xff2BB8A6),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
padding: const EdgeInsets.symmetric(vertical: 12),
),
onPressed: () {
Navigator.pop(context);
},
child: Text(
LocaleKeys.close.tr(),
style: const TextStyle(
color: Colors.white,
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
),
);
}
class BottomSheetItem extends StatelessWidget {
final Function onTap;
final IconData icon;

@ -1,11 +1,14 @@
import 'dart:convert';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/itg_forms_models/itg_worklist_table_model.dart';
import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
class ItemDetailView extends StatelessWidget {
final String title;
@ -40,7 +43,7 @@ class ItemDetailViewCol extends StatelessWidget {
children: [
"$title:".toText12(isBold: true, color: const Color(0xff2BB8A6), maxLine: 2),
4.width,
(value.isEmpty ? "--" : value).toText12(color: MyColors.normalTextColor, maxLine: 5),
Flexible(child: (value.isEmpty ? "--" : value).toText12(color: MyColors.normalTextColor, maxLine: null)),
],
);
}
@ -84,18 +87,51 @@ class ItemDetailViewGridItem extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
title != null ? Flexible(child: "$title:".toText12Auto(isBold: true, color: const Color(0xff2BB8A6))) : Container(),
title != null ? Flexible(child: "$title:".toText12(isBold: true, color: const Color(0xff2BB8A6))) : Container(),
4.width,
type != null
? type!.toLowerCase() == "table"
? getStringFromJSON(value!)
// : Flexible(child: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: 5))
: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: maxLine)
: Container(),
type != null
? type!.toLowerCase() == "table"
? getStringFromJSON(value!)
// : Flexible(child: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: 5))
: (value!.isEmpty ? "--" : value).toString().toText12(color: MyColors.normalTextColor, maxLine: 2)
: Container(),
if (value!.length > 100)
GestureDetector(
onTap: () {
showModalBottomSheet(
context: context,
enableDrag: true,
isDismissible: true,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)),
),
backgroundColor: Colors.white,
builder: (context) {
return openWorkListBottomSheet(context, value, title);
},
);
},
child: Padding(
padding: const EdgeInsets.only(top: 4),
child: Text(
LocaleKeys.showMore.tr(),
textAlign: TextAlign.right,
style: const TextStyle(
color: Color(0xff2BB8A6),
fontSize: 12,
fontWeight: FontWeight.w600,
),
),
),
),
],
).paddingOnly(top: showSpaceAfterLine ? 16 : 0),
).paddingOnly(top: showSpaceAfterLine ? 16 : 0, left: 2, right: 2),
);
}
}
class ItemDetailGrid extends StatelessWidget {
@ -153,3 +189,4 @@ Widget getStringFromJSON(String jsonString) {
return Flexible(child: ("-").toString().toText12Auto(color: MyColors.normalTextColor));
}
}

Loading…
Cancel
Save