"macos/git@183.82.99.133:saisrinivas/gen_erp_2025.git" did not exist on "fd9465587c3f5bed8db99555043f395933ac50dc"
Commit d006edb4 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

18-06-2025 By Sai Srinivas

Pubspec, Order Module Add and Edit.
parent b06467c3
import 'package:flutter/material.dart';
import 'package:generp/screens/finance/FileViewer.dart';
import 'package:provider/provider.dart';
import '../../Notifiers/VisitDetailsProvider.dart';
......@@ -51,74 +52,74 @@ class _FollowupdetailsState extends State<Followupdetails> {
borderRadius: BorderRadius.circular(20),
),
child: Column(
children: [
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(4, (j) {
final textheads = [
"Name",
"Date",
"Type",
"Time",
"Feedback",
];
final textSubheads = [
"${followups[index].ename}",
"${followups[index].date}",
"${followups[index].type}",
"${followups[index].time}",
"${followups[index].feedback}",
];
return Container(
padding: EdgeInsets.symmetric(vertical: 3),
child: Container(
padding: EdgeInsets.symmetric(
vertical: 3,
horizontal: 0,
),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(textheads[j].toString()),
SizedBox(
// height:45,
width:
MediaQuery.of(
context,
).size.width *
0.8,
child: Text(
textSubheads[j],
maxLines: 2,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF818181),
),
),
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(9, (j) {
final textheads = [
"Employee Name",
"Date",
"Type",
"In Time",
"Out Time",
"Running Hours",
"FSR File",
"FSR Number",
"Feedback",
];
final textSubheads = [
followups[index].ename??"-",
followups[index].date??"-",
followups[index].type??"-",
followups[index].time??"-",
followups[index].outTime??"-",
followups[index].runningHrs??"-",
followups[index].fsrExt??"-",
followups[index].fsrNo??"-",
followups[index].feedback??"-",
];
return Container(
padding: EdgeInsets.symmetric(vertical: 3),
child: Container(
padding: EdgeInsets.symmetric(
vertical: 3,
horizontal: 0,
),
child: Row(
children: [
Expanded(child: Text(textheads[j].toString())),
Expanded(
child: InkResponse(
onTap: () {
if (textheads[j] == "FSR File") {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Fileviewer(
fileName: followups[index].fsrExt!,
fileUrl: "https://erp.gengroup.in/files_genservices/tech_fsr_report/${followups[index].fsrExt!}",
),
],
),
],
),
],
),
);
}
},
child: Text(
textSubheads[j]==""?"-":textSubheads[j],
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color:
textheads[j] == "FSR File"
? AppColors.app_blue
: Color(0xFF818181),
),
),
),
);
}),
),
],
),
],
),
],
),
);
}),
),
);
},
......
......@@ -160,14 +160,14 @@ class _PendingcomplaintsState extends State<Pendingcomplaints> {
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(3, (j) {
final textheads = [
"ID",
"Generator Type",
"Complaint ID",
"Product Name",
"Address",
];
final textSubheads = [
provider
.technician_complaint_list[index]
.genId,
.complaintId,
provider
.technician_complaint_list[index]
.productName,
......
......@@ -15,13 +15,8 @@ class Updatecomplaints extends StatefulWidget {
}
class _UpdatecomplaintsState extends State<Updatecomplaints> {
TextEditingController fsrNumberController = TextEditingController();
TextEditingController runningHoursController = TextEditingController();
TextEditingController feedbackController = TextEditingController();
final List<Map<String, dynamic>> CompletedStatus = [
{"id": "1", "name": "Pending"},
{"id": "2", "name": "Completed"}
];
@override
Widget build(BuildContext context) {
......@@ -78,7 +73,7 @@ class _UpdatecomplaintsState extends State<Updatecomplaints> {
),
],
),
items: CompletedStatus.map(
items: provider.CompletedStatus.map(
(complaintStatus) =>
DropdownMenuItem<String>(
value: complaintStatus['name'],
......@@ -94,6 +89,7 @@ class _UpdatecomplaintsState extends State<Updatecomplaints> {
onChanged: (value) {
if (value != null) {
provider.statusID = value;
provider.statusError = "";
print("statusId:${provider.statusID}");
}
},
......@@ -141,6 +137,9 @@ class _UpdatecomplaintsState extends State<Updatecomplaints> {
),
),
SizedBox(height: 5,),
ErrorWidget(context, provider.statusError),
if(provider.statusID!.isNotEmpty)...[
if(provider.statusID!="Pending")...[
Padding(
padding: const EdgeInsets.only(bottom: 5.0),
child: Text(
......@@ -151,44 +150,51 @@ class _UpdatecomplaintsState extends State<Updatecomplaints> {
),
),
),
Container(
height: 50,
Container(
height: 50,
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius:
BorderRadius.circular(14),
),
child: Padding(
padding:
const EdgeInsets.fromLTRB(
10.0, 0.0, 10, 0),
child: TextFormField(
controller:
fsrNumberController,
keyboardType:
TextInputType.text,
decoration: InputDecoration(
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius:
BorderRadius.circular(14),
),
child: Padding(
padding:
const EdgeInsets.fromLTRB(
10.0, 0.0, 10, 0),
child: TextFormField(
controller:
provider.fsrNumberController,
keyboardType:
TextInputType.text,
onChanged: (value) {
provider.fsrError = "";
},
decoration: InputDecoration(
hintText:
"Enter FSR Number",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
fontSize: 14
),
hintText:
"Enter FSR Number",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
fontSize: 14
),
enabledBorder:
InputBorder.none,
focusedBorder:
InputBorder.none,
),
enabledBorder:
InputBorder.none,
focusedBorder:
InputBorder.none,
),
),
),
),
),
),
SizedBox(height: 5,),
SizedBox(height: 5,),
ErrorWidget(context, provider.fsrError)
]
],
Row(
children: [
Expanded(
......@@ -278,13 +284,16 @@ class _UpdatecomplaintsState extends State<Updatecomplaints> {
10.0, 0.0, 10, 0),
child: TextFormField(
controller:
runningHoursController,
provider.runningHoursController,
keyboardType:
TextInputType.text,
onChanged: (value) {
provider.runningHoursError = "";
},
decoration: InputDecoration(
hintText:
"Enter FSR Number",
"Enter Running Hours",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
......@@ -302,6 +311,7 @@ class _UpdatecomplaintsState extends State<Updatecomplaints> {
),
],
),
ErrorWidget(context, provider.runningHoursError),
InkResponse(
onTap: () {
_showAttachmentSheet(context);
......@@ -373,7 +383,7 @@ class _UpdatecomplaintsState extends State<Updatecomplaints> {
10.0, 0.0, 10, 0),
child: TextFormField(
controller:
feedbackController,
provider.feedbackController,
maxLines: 60,
keyboardType:
TextInputType.text,
......@@ -408,9 +418,9 @@ class _UpdatecomplaintsState extends State<Updatecomplaints> {
provider.UpdateComplaintAPIFunction(
context,
widget.ComplaintID,
feedbackController.text,
fsrNumberController.text,
runningHoursController.text,
provider.feedbackController.text,
provider.fsrNumberController.text,
provider.runningHoursController.text,
provider.statusID);
},
child: Container(
......@@ -446,6 +456,12 @@ class _UpdatecomplaintsState extends State<Updatecomplaints> {
},);
}
Widget ErrorWidget(context, text) {
if (text != null)
return Text(text!, style: TextStyle(color: Colors.red, fontSize: 12));
else
return SizedBox(height: 10);
}
Future<void> _showAttachmentSheet(BuildContext context) {
return showModalBottomSheet(
......
......@@ -62,7 +62,10 @@ import '../Models/loadGeneratorDetailsResponse.dart';
import '../Models/financeModels/financeDashboardPagesResponse.dart';
import '../Models/ordersModels/AddOrderPaymentSelectAccountResponse.dart';
import '../Models/ordersModels/AddOrderPaymentSelectOrderResponse.dart';
import '../Models/ordersModels/AddOrderViewResponse.dart';
import '../Models/ordersModels/addOrderAccontDetailsResponse.dart';
import '../Models/ordersModels/addOrderPaymentViewResponse.dart';
import '../Models/ordersModels/addOrderTpcAgentListResponse.dart';
import '../Models/ordersModels/commonResponse.dart';
import '../Models/ordersModels/ordersAccessiblePagesResponse.dart';
import '../Models/ordersModels/ordersDetailsByModeResponse.dart';
......@@ -734,7 +737,7 @@ class ApiCalling {
};
final res = await post(data, technicianTodayVisitsUrl, {});
if (res != null) {
// debugPrint(res.body);
debugPrint(res.body);
return TodayVisitResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
......@@ -757,7 +760,7 @@ class ApiCalling {
};
final res = await post(data, technicianMonthlyVisitsUrl, {});
if (res != null) {
// debugPrint(res.body);
debugPrint(res.body);
return TodayVisitResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
......@@ -1015,7 +1018,7 @@ class ApiCalling {
};
final res = await post(data, technicianComplaintDetailsUrl, {});
if (res != null) {
// debugPrint(res.body);
debugPrint(res.body);
return ViewVisitDetailsResponseNew.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
......@@ -1040,7 +1043,7 @@ class ApiCalling {
};
final res = await post(data, technicianComplaintFollowUpUrl, {});
if (res != null) {
// debugPrint(res.body);
debugPrint(res.body);
return FollowupListResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
......@@ -2049,6 +2052,185 @@ class ApiCalling {
}
}
static Future<AddOrderViewResponse?> addOrderViewAPI(
empId,
session,
mode
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'mode': (mode).toString(),
};
final res = await post(data, ordersAddOrderViewUrl, {});
if (res != null) {
debugPrint(res.body);
return AddOrderViewResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<addOrderAccontDetailsResponse?> addOrderAccountDetailsAPI(
empId,
session,
account_id
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': (account_id).toString(),
};
final res = await post(data, ordersAddOrderAccountDetailsUrl, {});
if (res != null) {
debugPrint(res.body);
return addOrderAccontDetailsResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<addOrderTpcAgentListResponse?> addOrderTPCAgentListAPI(
empId,
session,
mode,
text
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'mode':mode.toString(),
'text': (text).toString(),
};
final res = await post(data, ordersAddOrderTpcAgentListUrl, {});
if (res != null) {
debugPrint(res.body);
return addOrderTpcAgentListResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<CommonResponse?> addOrderSubmitAPI(
empId,
session,
mode,
sales_person_emp_id,
selected_acc_id,
dispatch_state_id,
dispatch_district_id,
dispatch_sub_location_id,
dispatch_pincode,
dispatch_address,
basic_amount,
cgst_amount,
sgst_amount,
igst_amount,
total_amount,
order_received_date,
note,
unloading,
freight,
erection,
tpc_applicable,
billing_name,
billing_gst_no,
billing_pincode,
billing_address,
billing_state,
billing_district,
billing_sub_locality,
order_products,
lead_id,
feedback,
in_time,
loc,
requested_tpc_amount,
tpc_agent_id,
po
) async {
try {
Map<String, String> data = {
'emp_id':empId.toString(),
'session_id':session.toString(),
'mode':mode.toString(),
'sales_person_emp_id':sales_person_emp_id.toString(),
'selected_acc_id':selected_acc_id.toString(),
'dispatch_state_id':dispatch_state_id.toString(),
'dispatch_district_id':dispatch_district_id.toString(),
'dispatch_sub_location_id':dispatch_sub_location_id.toString(),
'dispatch_pincode':dispatch_pincode.toString(),
'dispatch_address':dispatch_address.toString(),
'basic_amount':basic_amount.toString(),
'cgst_amount':cgst_amount.toString(),
'sgst_amount':sgst_amount.toString(),
'igst_amount':igst_amount.toString(),
'total_amount':total_amount.toString(),
'order_received_date':order_received_date.toString(),
'note':note.toString(),
'unloading':unloading.toString(),
'freight':freight.toString(),
'erection':erection.toString(),
'tpc_applicable':tpc_applicable.toString(),
'billing_name':billing_name.toString(),
'billing_gst_no':billing_gst_no.toString(),
'billing_pincode':billing_pincode.toString(),
'billing_address':billing_address.toString(),
'billing_state':billing_state.toString(),
'billing_district':billing_district.toString(),
'billing_sub_locality':billing_sub_locality.toString(),
'order_products':jsonEncode(order_products).toString(),
'lead_id':lead_id.toString(),
'feedback':feedback.toString(),
'in_time':in_time.toString(),
'loc':loc.toString(),
'requested_tpc_amount':requested_tpc_amount.toString(),
'tpc_agent_id':tpc_agent_id.toString(),
};
var res;
print(data);
if (po != null) {
res = await postImageNew(
data,
{},
ordersAddOrderSubmitUrl,
po,
"po",
);
res = jsonDecode(res);
} else {
res = await post(data, ordersAddOrderSubmitUrl, {});
res = jsonDecode(res.body);
return CommonResponse.fromJson(res);
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<ordersListByModeFilterResponse?> ordersListByModeFilterAPI(
empId,
session,
......@@ -2246,7 +2428,7 @@ class ApiCalling {
}
}
static Future<addOrderPaymentViewResponse?> AddOrderpaymentListViewAPI(
static Future<addOrderPaymentViewResponse?> addOrderpaymentListViewAPI(
empId,
session,
) async {
......@@ -2269,7 +2451,7 @@ class ApiCalling {
}
}
static Future<CommonResponse?> AddOrderpaymentListSubmitAPI(
static Future<CommonResponse?> addOrderpaymentListSubmitAPI(
empId,
session,
account_id,
......@@ -2287,13 +2469,14 @@ class ApiCalling {
'session_id': (session).toString(),
'account_id':account_id.toString(),
'description':description.toString(),
'selected_orders':selected_orders.toString(),
'selected_orders':jsonEncode(selected_orders).toString(),
'payment_amount':payment_amount.toString(),
'payment_date':payment_date.toString(),
'payment_type':payment_type.toString(),
'ref_no':ref_no.toString(),
};
var res;
print(data);
if (attachment != null) {
res = await postImageNew(
data,
......@@ -2314,6 +2497,40 @@ class ApiCalling {
return null;
}
}
static Future<CommonResponse?> ordersEditPaymentDetailsAPI(
empId,
session,
payment_id,
description,
payment_type,
ref_no,
payment_date,
amount
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'payment_id':payment_id.toString(),
'description':description.toString(),
'payment_type':payment_type.toString(),
'payment_date':payment_date.toString(),
'ref_no':ref_no.toString(),
'amount':amount.toString(),
};
var res = await post(data, ordersEditPaymentDetailsUrl, {});
if(res!=null) {
return CommonResponse.fromJson(jsonDecode(res.body));
}else{
debugPrint("Null Response");
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<AddOrderPaymentSelectAccountResponse?> AddOrderPaymentSelectAccountAPI(
empId,
......@@ -2330,7 +2547,8 @@ class ApiCalling {
};
final res = await post(data, ordersAddPaymentSelectAccountForOrderUrl, {});
if (res != null) {
debugPrint(res.body);
print(data);
print("PaymentSeralectAccount${res.body}");
return AddOrderPaymentSelectAccountResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
......@@ -2345,7 +2563,7 @@ class ApiCalling {
static Future<AddOrderPaymentSelectOrderResponse?> AddOrderPaymentSelectOrderAPI(
empId,
session,
account_id,x
account_id,
) async {
try {
Map<String, String> data = {
......@@ -2355,7 +2573,8 @@ class ApiCalling {
};
final res = await post(data, ordersAddPaymentSelectOrderUrl, {});
if (res != null) {
debugPrint(res.body);
print(data);
debugPrint("empty: ${res.body}");
return AddOrderPaymentSelectOrderResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
......
......@@ -95,8 +95,14 @@ const ordersOrderDetailsEditOrderUrl = "${baseUrl_test}crm_edit_order_view";
const ordersOrderDetailsEditOrderSubmitUrl = "${baseUrl_test}crm_edit_order_submit";
const ordersOrderDetailsDispatchProductsUrl = "${baseUrl_test}crm_dispatch_products_data";
const ordersAddOrderViewUrl ="${baseUrl_test}add_crm_order_view";
const ordersAddOrderAccountDetailsUrl ="${baseUrl_test}crm_account_details_for_add_order";
const ordersAddOrderTpcAgentListUrl ="${baseUrl_test}select_tpc_agent_for_add_order";
const ordersAddOrderSubmitUrl ="${baseUrl_test}add_crm_order_submit";
const ordersAddPaymentViewUrl ="${baseUrl_test}crm_add_order_payment_view";
const ordersAddPaymentSubmitUrl ="${baseUrl_test}crm_add_order_payment_submit";
const ordersEditPaymentDetailsUrl ="${baseUrl_test}crm_payment_update_edit_details";
const ordersEditPaymentDetailsAdjustedOrdersUrl ="${baseUrl_test}crm_payment_update_edit_adjusted_orders";
const ordersAddPaymentSelectAccountForOrderUrl ="${baseUrl_test}select_account_for_order_payment";
const ordersAddPaymentSelectOrderUrl ="${baseUrl_test}select_order_for_order_payment";
const ordersPaymentListFilterUrl = "${baseUrl_test}crm_payments_list_view";
......
......@@ -1533,6 +1533,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.10.1"
tuple:
dependency: "direct main"
description:
name: tuple
sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151
url: "https://pub.dev"
source: hosted
version: "2.0.2"
typed_data:
dependency: transitive
description:
......
......@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.82+86
version: 1.0.83+87
environment:
sdk: ^3.7.2
......@@ -78,6 +78,7 @@ dependencies:
pdf: ^3.11.3
printing: ^5.14.2
interactive_slider: ^0.5.1
tuple: ^2.0.2
dev_dependencies:
flutter_test:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment