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