FIX_PolicyValidationAndEnquiryInline
This commit is contained in:
parent
4227ce34d7
commit
acf540fe1d
@ -879,7 +879,7 @@ class _SubRowWidgetState extends ConsumerState<SubRowWidget> {
|
|||||||
decoratorProps: DropDownDecoratorProps(
|
decoratorProps: DropDownDecoratorProps(
|
||||||
decoration:
|
decoration:
|
||||||
AppInputDecorations.dropdownDecoration(
|
AppInputDecorations.dropdownDecoration(
|
||||||
label: "Select Staff Member",
|
label: "Select Staff Member **",
|
||||||
).copyWith(
|
).copyWith(
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor:
|
fillColor:
|
||||||
|
|||||||
@ -1245,12 +1245,22 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
|
|
||||||
Future<void> handleDeleteEnq(Map<String, dynamic> item) async {
|
Future<void> handleDeleteEnq(Map<String, dynamic> item) async {
|
||||||
final id = int.tryParse(item['id'].toString()) ?? 0;
|
final id = int.tryParse(item['id'].toString()) ?? 0;
|
||||||
|
|
||||||
|
// Note: Avoid setting idPrimary here if you are just deleting,
|
||||||
|
// unless your UI specifically needs to highlight it.
|
||||||
idPrimary = item['id'];
|
idPrimary = item['id'];
|
||||||
|
|
||||||
print("handleDeleteEnq - $idPrimary");
|
print("handleDeleteEnq - $idPrimary");
|
||||||
final res = await apiService.deleteEnquiy(id, 0);
|
final res = await apiService.deleteEnquiy(id, 0);
|
||||||
|
|
||||||
if (res['status'] == 'success') {
|
if (res['status'] == 'success') {
|
||||||
|
// RESET THE ID HERE
|
||||||
|
setState(() {
|
||||||
|
idPrimary = null;
|
||||||
|
selectedId = null;
|
||||||
|
isEditingRow[id] = false;
|
||||||
|
});
|
||||||
|
|
||||||
autoRefrshfilterDateRange();
|
autoRefrshfilterDateRange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1345,7 +1355,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void handleSave(dynamic id) {
|
void handleSave(dynamic id) {
|
||||||
print('SAVE -- $id');
|
print('#enquiry SAVE -- $id');
|
||||||
// final ids = int.tryParse(id.toString()) ?? 0;
|
// final ids = int.tryParse(id.toString()) ?? 0;
|
||||||
|
|
||||||
idPrimary = id;
|
idPrimary = id;
|
||||||
@ -1555,6 +1565,9 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> createUserData(Map<String, dynamic> userData) async {
|
Future<void> createUserData(Map<String, dynamic> userData) async {
|
||||||
|
|
||||||
|
print('#enquiry userData: $userData ');
|
||||||
|
|
||||||
final bool isNewRow =
|
final bool isNewRow =
|
||||||
idPrimary != null &&
|
idPrimary != null &&
|
||||||
int.tryParse(idPrimary.toString()) != null &&
|
int.tryParse(idPrimary.toString()) != null &&
|
||||||
@ -1563,11 +1576,9 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
final bool isUpdating =
|
final bool isUpdating =
|
||||||
idPrimary != null && idPrimary != 'null' && !isNewRow;
|
idPrimary != null && idPrimary != 'null' && !isNewRow;
|
||||||
|
|
||||||
print('isNewRow: $isNewRow, isUpdating: $isUpdating');
|
|
||||||
|
|
||||||
// final bool isUpdating = idPrimary != 'null';
|
// final bool isUpdating = idPrimary != 'null';
|
||||||
final id = idPrimary;
|
final id = idPrimary;
|
||||||
print('UPDId- $id');
|
|
||||||
|
|
||||||
// final bool isUpdating = false;
|
// final bool isUpdating = false;
|
||||||
final uri = Uri.parse(
|
final uri = Uri.parse(
|
||||||
@ -1592,7 +1603,6 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
request.fields['created_by'] = userId!.toString();
|
request.fields['created_by'] = userId!.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
print("USerDAta - $userData");
|
|
||||||
|
|
||||||
// userData.forEach((key, value) {
|
// userData.forEach((key, value) {
|
||||||
// request.fields[key] = value.toString();
|
// request.fields[key] = value.toString();
|
||||||
|
|||||||
@ -2183,6 +2183,7 @@ class _policyValidationState extends ConsumerState<policyValidation> {
|
|||||||
'Policy Number *',
|
'Policy Number *',
|
||||||
controllers['policyNumber']!,
|
controllers['policyNumber']!,
|
||||||
required: true,
|
required: true,
|
||||||
|
readOnly: true,
|
||||||
// rightLabel: selectedInsurerName,
|
// rightLabel: selectedInsurerName,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -2639,6 +2640,7 @@ class _policyValidationState extends ConsumerState<policyValidation> {
|
|||||||
'Broker (as per Document) *',
|
'Broker (as per Document) *',
|
||||||
controllers['broker_name']!,
|
controllers['broker_name']!,
|
||||||
required: true,
|
required: true,
|
||||||
|
readOnly: true,
|
||||||
highlight: isMismatched, // 👈 Passes true/false to your _buildInput
|
highlight: isMismatched, // 👈 Passes true/false to your _buildInput
|
||||||
onChanged: (val) {
|
onChanged: (val) {
|
||||||
_validateBrokerMatch();
|
_validateBrokerMatch();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user