Commit c7ff2cec authored by Sai Srinivas's avatar Sai Srinivas
Browse files

23-06-2025 By Sai Srinivas

Finance module test cases
parent a7dc0d35
......@@ -105,6 +105,7 @@ class _VisitdetailsState extends State<Visitdetails> {
).size.width *
0.75,
child: Text(
textSubheads[j]==""?"-":
textSubheads[j],
maxLines: 2,
overflow:
......@@ -183,7 +184,7 @@ class _VisitdetailsState extends State<Visitdetails> {
).size.width *
0.8,
child: Text(
textSubheads[j],
textSubheads[j]==""?"-": textSubheads[j],
maxLines: 2,
overflow:
TextOverflow.ellipsis,
......@@ -262,7 +263,7 @@ class _VisitdetailsState extends State<Visitdetails> {
).size.width *
0.8,
child: Text(
textSubheads[j],
textSubheads[j]==""?"-": textSubheads[j],
maxLines: 2,
overflow:
TextOverflow.ellipsis,
......
......@@ -348,7 +348,7 @@ class ApiCalling {
res = jsonDecode(res);
} else {
res = await post(data, employeeChekInUrl, {});
res = jsonDecode(res);
res = jsonDecode(res.body);
}
if (res != null) {
return CheckInResponse.fromJson(res);
......@@ -367,7 +367,7 @@ class ApiCalling {
sessioId,
location,
latlngs,
image,
check_out_pic,
) async {
try {
Map<String, String> data = {
......@@ -377,19 +377,27 @@ class ApiCalling {
'posit': (latlngs).toString(),
};
var res;
if (image != null) {
res = await postImage2(data, {}, employeeCheckOutUrl, image);
// if (image != null) {
// res = await postImage2(data, {}, employeeCheckOutUrl, image);
// res = jsonDecode(res);
// } else {
// res = await post(data, employeeCheckOutUrl, {});
// res = jsonDecode(res);
// }
// if (res != null) {
// return CheckOutResponse.fromJson(res);
// } else {
// debugPrint("Null Response");
// return null;
// }
if (check_out_pic != null) {
res = await postImageNew(data, {}, employeeCheckOutUrl, check_out_pic,'check_out_pic');
res = jsonDecode(res);
} else {
res = await post(data, employeeCheckOutUrl, {});
res = jsonDecode(res);
res = jsonDecode(res.body);
}
if (res != null) {
return CheckOutResponse.fromJson(res);
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
......@@ -915,23 +923,33 @@ class ApiCalling {
'otp_validated_mobile_number': (otp_validated_mobile_number).toString(),
};
var res;
// if (payment_proof != null) {
// res = await postImage3(
// data,
// {},
// technicianAddPaymentCollectionUrl,
// payment_proof,
// );
// res = jsonDecode(res);
// } else {
// res = await post(data, technicianAddPaymentCollectionUrl, {});
// res = jsonDecode(res);
// }
// if (res != null) {
// return TechnicianAddPaymentCollectionResponse.fromJson(res);
// } else {
// debugPrint("Null Response");
// return null;
// }
if (payment_proof != null) {
res = await postImage3(
data,
{},
technicianAddPaymentCollectionUrl,
payment_proof,
);
res = await postImageNew(data, {}, technicianAddPaymentCollectionUrl, payment_proof,'payment_proof');
res = jsonDecode(res);
return TechnicianAddPaymentCollectionResponse.fromJson(res);
} else {
res = await post(data, technicianAddPaymentCollectionUrl, {});
res = jsonDecode(res);
}
if (res != null) {
res = jsonDecode(res.body);
return TechnicianAddPaymentCollectionResponse.fromJson(res);
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
......@@ -1132,12 +1150,15 @@ class ApiCalling {
// print(fsr_file);
var res;
if (fsr_file != null) {
res = await postImage4(data, {}, technicianUpdateVisitUrl, fsr_file);
res = await postImageNew(data, {}, technicianUpdateVisitUrl, fsr_file,'fsr_file');
res = jsonDecode(res);
return UpdateComplaintResponse.fromJson(res);
} else {
res = await post(data, technicianUpdateVisitUrl, {});
res = jsonDecode(res);
res = jsonDecode(res.body);
return UpdateComplaintResponse.fromJson(res);
}
// debugPrint(res);
if (res != null) {
// debugPrint(res);
......@@ -1447,18 +1468,14 @@ class ApiCalling {
"attachment",
);
res = jsonDecode(res);
return addReceiptPaymentResponse.fromJson(res);
} else {
res = await post(data, addPaymentReceiptSubmitUrl, {});
res = jsonDecode(res.body);
return addReceiptPaymentResponse.fromJson(res);
}
if (res != null) {
return res;
} else {
debugPrint("Null Response");
return null;
// return addReceiptPaymentResponse.fromJson(res);
}
return addReceiptPaymentResponse.fromJson(res);
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
......@@ -3218,6 +3235,82 @@ class ApiCalling {
}
}
static Future<CommonResponse?> crmLeadDetailsAddContactAPI(
empId,
session,
acc_id,
name,
mob1,
designation,
mob2,
tel,
email
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'acc_id': (acc_id).toString(),
'name':(name).toString(),
'mob1':(mob1).toString(),
'designation':(designation).toString(),
'mob2':(mob2).toString(),
'tel':(tel).toString(),
'email':(email).toString(),
};
final res = await post(data, crmLeadDetailsAddContactUrl, {});
if (res != null) {
print(data);
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<CommonResponse?> crmLeadDetailsEditContactAPI(
empId,
session,
contact_id,
name,
mob1,
designation,
mob2,
tel,
email
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'contact_id': (contact_id).toString(),
'name':(name).toString(),
'mob1':(mob1).toString(),
'designation':(designation).toString(),
'mob2':(mob2).toString(),
'tel':(tel).toString(),
'email':(email).toString(),
};
final res = await post(data, crmLeadDetailsEditContactUrl, {});
if (res != null) {
print(data);
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
// static Future<CommonResponse?> TpcIssueListApprovalAPI(
// empId,
......
......@@ -128,6 +128,12 @@ const crmLeadListDistrictOnStateUrl = "${baseUrl_test}get_segment_on_team";
const crmLeadListSubLocOnDistrictUrl = "${baseUrl_test}get_sublocation_on_district";
const crmLeadListContactPopUpUrl = "${baseUrl_test}crm_lead_list_contact_popup";
const crmLeadDetailsUrl = "${baseUrl_test}crm_lead_details";
const crmLeadDetailsAddContactUrl = "${baseUrl_test}crm_lead_details_add_account";
const crmLeadDetailsEditContactUrl = "${baseUrl_test}crm_lead_details_edit_contact";
const crmLeadDetailsAddAppointmentUrl = "${baseUrl_test}crm_lead_details_add_appointment";
const crmProspectListViewUrl = "${baseUrl_test}crm_prospect_list_view";
const crmProspectListFilterSubmitUrl = "${baseUrl_test}crm_prospect_list_filter_submit";
const crmCheckAccountFieldsUrl = "${baseUrl_test}check_crm_add_account_fields";
......
......@@ -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.86+90
version: 1.0.87+91
environment:
sdk: ^3.7.2
......
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