From 804d98aa8cd564a8c4b454a3a8f4eee25b8e61e6 Mon Sep 17 00:00:00 2001 From: velz Date: Mon, 2 Mar 2026 10:37:59 +0530 Subject: [PATCH 1/7] FIX_OUTDATE_COMPONENTS --- app/Views/gsheet_editor.php | 8 ++++---- app/Views/layout/footer.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Views/gsheet_editor.php b/app/Views/gsheet_editor.php index e3c9f316..df694995 100644 --- a/app/Views/gsheet_editor.php +++ b/app/Views/gsheet_editor.php @@ -12,7 +12,7 @@ -

Google Sheet Editor

+

Edit RFQ

@@ -44,9 +44,9 @@ function createRfq() {
- + @@ -146,7 +146,7 @@ - + \ No newline at end of file diff --git a/app/Views/leads_non_eb.php b/app/Views/leads_non_eb.php index c6749816..c4caca5f 100644 --- a/app/Views/leads_non_eb.php +++ b/app/Views/leads_non_eb.php @@ -410,6 +410,12 @@ +
@@ -1258,4 +1264,63 @@ } }); + $(document).ready(function() { + + var actual_lead_client_details = ; + var actual_lead_contact_person_details = ; + + // ------------------------------- + // CLIENT DETAILS AUTO FILL + // ------------------------------- + if (actual_lead_client_details) { + + $('#client_name').val(actual_lead_client_details.company_name || ''); + + $('#gst').val(actual_lead_client_details.gst_number || ''); + + // 🔥 Important: + // Only auto-generate short name IF empty (avoid overwrite in edit) + if (!$('#client_short_name').val()) { + $('#client_name').trigger('input'); + } else { + // Run duplicate validation once + validateInput($('#client_short_name')[0], "clients", "short_name"); + } + } + + // ------------------------------- + // CONTACT PERSON AUTO FILL + // ------------------------------- + if (actual_lead_contact_person_details) { + + $('#contact_person_name').val(actual_lead_contact_person_details.name || ''); + + $('#contact_person_mobile').val(actual_lead_contact_person_details.mobile || ''); + + $('#contact_person_email').val(actual_lead_contact_person_details.email || ''); + } + + + $('#lead_status').change(function() { + if ($(this).val() === 'lost') { + $('#lost_reason_div').show(); + $('#lost_reason').attr('required', 'required'); + } else { + $('#lost_reason_div').hide(); + $('#lost_reason').val(""); + $('#lost_reason').removeAttr('required'); + } + }); + + // Check on page load + if ($('#lead_status').val() === 'lost') { + $('#lost_reason_div').show(); + $('#lost_reason').attr('required', 'required'); + } else { + // Ensure it's hidden and not required if the initial value is not 'lost' + $('#lost_reason_div').hide(); + $('#lost_reason').val(""); + $('#lost_reason').removeAttr('required'); + } + }); \ No newline at end of file diff --git a/app/Views/sales/activity_view.php b/app/Views/sales/activity_view.php index 3edb0181..da457b03 100644 --- a/app/Views/sales/activity_view.php +++ b/app/Views/sales/activity_view.php @@ -10,6 +10,8 @@ .btn-complete:hover { background: #4caf50; transform: translateY(-1px); } .btn-view { background: #f0f0f0; color: #666; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; transition: all 0.2s;} .btn-view:hover { background: #f0f0f0; transform: translateY(-1px); } + .btn-close { background: none; border: none; font-size: 22px; cursor: pointer; color: #888; width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: background .2s; } + .btn-close:hover { background: #f0f0f0; color: #333; } /* Filter Tabs */ .filter-tabs { display: flex; gap: 10px; padding: 20px 30px; } @@ -68,6 +70,7 @@ .activity-meta { display: flex; gap: 20px; font-size: 13px; color: #999; margin-top: 10px;} .lead-status { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 500; margin-top: 5px; } + .opportunity-status-badge { padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 500;} .status-new { background: #e3f2fd; color: #1976d2; } .status-potential { background: #fff3e0; color: #f57c00; } @@ -76,6 +79,10 @@ .status-pending { background: #fff3e0; color: #f57c00; } .status-completed { background: #e8f5e9; color: #388e3c; } .status-unknown { background: #000; color: #fff; } + .status-text-unknown { color: #000; font-weight: bold; } + .status-text-lost { color: #d32f2f; font-weight: bold; } + .status-text-won { color: #388e3c; font-weight: bold; } + /* Modals */ .modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 2000; align-items: center; justify-content: center; } @@ -124,6 +131,9 @@ .opportunity-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 15px;} .opportunity-detail-item { font-size: 13px; color: #666;} .opportunity-footer { margin-top: 15px; padding-top: 15px; border-top: 1px solid #f0f0f0; font-size: 13px; color: #666; } + .lost-reason { margin-bottom: 8px; color: #c0392b; /* soft red for lost */ } + .footer-divider { border-top: 1px dashed #ddd; margin: 8px 0; } + .notes { color: #555; } /* Base style for both tabs */ .tab-item { cursor: pointer; padding-bottom: 10px; margin: 0; font-size: 16px; color: #999; /* Default grey for unselected */ border-bottom: 2px solid transparent; transition: all 0.2s ease; } @@ -142,6 +152,21 @@ outline: none; } +.select2-container--default +.select2-selection--multiple +.select2-selection__choice { + background-color: #02a8b5 !important; + border: none !important; + border-color: #fff !important; + color: #fff !important; +} +.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { + color: #fff !important; +} +.modal .select2-container--default .select2-selection--multiple { + background-color: #fff !important; +} + @@ -159,7 +184,7 @@
+ placeholder="Search activities..." onkeyup="fetchActivities(false)" style="width: 300px !important;"> @@ -191,7 +216,7 @@

Lead Detail

- +

@@ -368,7 +409,7 @@
- @@ -133,6 +133,9 @@
--> + + + '📞', 'Email' => '✉️', 'Meeting' => '📅', 'Visit' => '🚗', 'Demo' => '🖥️', 'Share Docs' => '📄', 'To Do' => '✓' ]; $icon = $activityIcons[$u['activity_type']] ?? '📌'; @@ -160,11 +163,19 @@ + + +
+ No Upcoming Activities for this Financial Year. +
+ +

My Recent Leads

+
+ placeholder="Search leads..." onkeyup="fetchLeads(false)" style="width: 300px !important;"> @@ -166,7 +189,7 @@ @@ -228,7 +251,7 @@

Lead Detail

- +