Client Intelligence CRM Portal
Auto-calculated from uploaded data
Click on any row to drill down into client list
Click bars to filter · Click rows to view 360°
Select template → select client → Outlook opens with pre-filled email
Upload report → D column client name match → preview → single or all-client email
Fill details → Live preview → Send via Outlook
Naya Excel data upload karo — purana data replace ho jayega. Sirf Admin ke liye.
Client-wise Mutual Fund, Term Insurance, Health Insurance and other investment/product details
All uploaded PAN, Aadhaar, Account Opening, Cheque and Other documents
Add SIP, Health Insurance, Term Insurance and other product entries manually
Meeting notes, client discussion, purpose and next follow-up
Assigned work, progress, pending reasons and daily work report
');} else {w.document.write('
');} w.document.close(); } }else alert('Old entry me file preview available nahi hai. Please upload again.'); } function delClientDoc(id,idx){ if(!confirm('Delete this document entry?'))return; var o=getDocStore(); if(o[id]){o[id].splice(idx,1); setDocStore(o);} if(T('pg-documents') && T('pg-documents').classList.contains('on')) renderDocumentsTab(); else view360(id,'360'); } function renderProductWiseInvestment(id,cF,cS,cI){ var act=cS.filter(function(x){return x.status==='Active';}); var mfMonthly=act.reduce(function(a,x){return a+(Number(x.sipAmount)||0);},0); var insTotal=cI.reduce(function(a,x){return a+(Number(x.premium)||0);},0); var rows=[]; if(cF.length||cS.length){ rows.push({product:'Mutual Fund',count:cF.length+' Folios / '+act.length+' Active SIP',amt:mfMonthly,sub:'Monthly SIP Investment',tag:'MF',cls:'bl'}); } var term=cI.filter(function(x){return String(x.type||x.policy||'').toLowerCase().indexOf('term')>=0;}); var health=cI.filter(function(x){return String(x.type||x.policy||'').toLowerCase().indexOf('term')<0;}); if(term.length){rows.push({product:'Term Insurance',count:term.length+' Policies',amt:term.reduce(function(a,x){return a+(Number(x.premium)||0);},0),sub:'Cover / Premium Value',tag:'Term',cls:'vi'});} if(health.length){rows.push({product:'Health Insurance',count:health.length+' Policies',amt:health.reduce(function(a,x){return a+(Number(x.premium)||0);},0),sub:'Cover / Premium Value',tag:'Health',cls:'pi'});} if(!rows.length){ rows.push({product:'No Product',count:'0 Records',amt:0,sub:'No investment/product found',tag:'Pending',cls:'rd'}); } var total=rows.reduce(function(a,x){return a+(Number(x.amt)||0);},0); var html='
| Product | Investment / Value | Records | Details |
|---|---|---|---|
| '+bd(r.tag,r.cls)+' '+r.product+' | '+fmt(r.amt)+' '+r.sub+' | '+r.count+' | '+pct+'% of total visible value |
'; return html; } function renderClientDocuments(id){ var docs=getClientDocs(id); var html='
| Type | Document Name | File Name | Uploaded On | View | Action |
|---|---|---|---|---|---|
| '+docIcon(d.type)+' '+escHtml(d.type)+' | '+escHtml(d.name)+' | '+escHtml(d.file)+' '+Math.round((d.size||0)/1024)+' KB | '+escHtml(d.date)+' |
'; return html; } // ════════════════════════════════════════════════ // MANUAL PRODUCT ENTRY MODULE + EXCEL DOWNLOAD // ════════════════════════════════════════════════ let editPEId = null; function getPEStore(){try{return JSON.parse(localStorage.getItem('ONECALL_PRODUCT_ENTRIES')||'[]');}catch(e){return [];}} function setPEStore(a){localStorage.setItem('ONECALL_PRODUCT_ENTRIES',JSON.stringify(a||[]));} function allProductEntries(){return getPEStore();} function clientById(id){return CLIENTS.filter(function(c){return String(c.id)===String(id);})[0]||{};} function productBaseRows(){ var cl=visCL(), ids=new Set(cl.map(function(c){return c.id;})), rows=[]; SIPS.filter(function(s){return ids.has(s.clientId);}).forEach(function(s){var c=clientById(s.clientId);rows.push({id:'SIP_'+s.clientId+'_'+(s.folio||''),source:'System',clientId:s.clientId,client:c.name||'',pan:c.pan||'',mobile:c.mobile||'',rm:c.rm||'',product:'Mutual Fund SIP',scheme:s.scheme||'',folio:s.folio||'',amount:Number(s.sipAmount)||0,frequency:'Monthly',startDate:s.startDate||'',endDate:s.endDate||'',status:s.status||'',notes:''});}); INSURANCE.filter(function(i){return ids.has(i.clientId);}).forEach(function(i){var c=clientById(i.clientId);var isTerm=String(i.type||i.policy||'').toLowerCase().indexOf('term')>=0;rows.push({id:'INS_'+i.clientId+'_'+(i.policyNo||''),source:'System',clientId:i.clientId,client:c.name||'',pan:c.pan||'',mobile:c.mobile||'',rm:c.rm||i.rm||'',product:isTerm?'Term Insurance':'Health Insurance',scheme:i.policy||'',folio:i.policyNo||'',amount:Number(i.premium)||0,frequency:'Yearly',startDate:'',endDate:i.renewalDate||'',status:'Active',notes:''});}); return rows; } function manualProductRows(){ var ids=new Set(visCL().map(function(c){return c.id;})); return getPEStore().filter(function(e){return ids.has(Number(e.clientId));}).map(function(e){var c=clientById(e.clientId);return Object.assign({},e,{source:'Manual',client:c.name||e.client||'',pan:c.pan||e.pan||'',mobile:c.mobile||'',rm:c.rm||e.rm||''});}); } function allProductRows(){return productBaseRows().concat(manualProductRows());} function showProductEntryForm(edit,id){ var e={}; editPEId=null; if(edit){var a=getPEStore(); e=a.filter(function(x){return String(x.id)===String(id);})[0]||{}; editPEId=e.id;} var opts=visCL().map(function(c){return '';}).join(''); T('peFormCard').style.display='block'; T('peFormCard').innerHTML='
'+ '
';
}
function saveProductEntry(){
var cid=Number(T('pe_clientId').value), c=clientById(cid), a=getPEStore();
var e={id:editPEId||Date.now(),clientId:cid,client:c.name||'',pan:c.pan||'',rm:c.rm||'',product:T('pe_product').value,scheme:T('pe_scheme').value,folio:T('pe_folio').value,amount:Number(T('pe_amount').value)||0,frequency:T('pe_frequency').value,startDate:T('pe_startDate').value,endDate:T('pe_endDate').value,status:T('pe_status').value,notes:T('pe_notes').value,updatedOn:new Date().toLocaleString('en-IN')};
if(editPEId){for(var i=0;i ';
rows.forEach(function(r){html+='Client PAN Product Scheme / Policy Folio / Policy No Amount Frequency Date Status Action ';});
T('peTbl').innerHTML=html+'';
}
function renderProductWiseTab(){
var q=(T('pwSrch')?T('pwSrch').value:'').toLowerCase();
var rows=allProductRows().filter(function(r){var t=[r.client,r.pan,r.mobile,r.rm,r.product,r.scheme,r.folio,r.status,r.source].join(' ').toLowerCase();return !q||t.indexOf(q)>=0;});
var total=rows.reduce(function(a,r){return a+(Number(r.amount)||0);},0);
var mf=rows.filter(function(r){return String(r.product).toLowerCase().indexOf('mutual')>=0;}).reduce(function(a,r){return a+(Number(r.amount)||0);},0);
var health=rows.filter(function(r){return String(r.product).toLowerCase().indexOf('health')>=0;}).reduce(function(a,r){return a+(Number(r.amount)||0);},0);
var term=rows.filter(function(r){return String(r.product).toLowerCase().indexOf('term')>=0;}).reduce(function(a,r){return a+(Number(r.amount)||0);},0);
T('pwKpi').innerHTML=[['Total Records',rows.length,'#1B4FD8'],['MF SIP',fmt(mf),'#16a34a'],['Health',fmt(health),'#EC4899'],['Term',fmt(term),'#7C3AED']].map(function(k){return ''+escHtml(r.client)+' '+escHtml(r.pan||'')+' '+bd(escHtml(r.product||''),'bl')+' '+escHtml(r.scheme||'')+' '+escHtml(r.folio||'')+' '+fmt(r.amount)+' '+escHtml(r.frequency||'')+' '+escHtml((r.startDate||'')+' → '+(r.endDate||''))+' '+bd(escHtml(r.status||''),r.status==='Active'?'gr':(r.status==='Expired'?'rd':'am'))+' ';
rows.forEach(function(r){html+='Client PAN Mobile RM Product Scheme / Policy Folio / Policy No Amount Frequency Status Source ';});
T('pwTbl').innerHTML=html+'';
}
function tableToExcel(tableId, filename){
var tbl=T(tableId); if(!tbl){alert('No table found.');return;}
var html=''+escHtml(r.client)+' '+escHtml(r.pan||'')+' '+escHtml(r.mobile||'')+' '+bd(escHtml((r.rm||'').split(' ')[0]),'bl')+' '+bd(escHtml(r.product||''),String(r.product).toLowerCase().indexOf('health')>=0?'pi':(String(r.product).toLowerCase().indexOf('term')>=0?'vi':'gr'))+' '+escHtml(r.scheme||'')+' '+escHtml(r.folio||'')+' '+fmt(r.amount)+' '+escHtml(r.frequency||'')+' '+bd(escHtml(r.status||''),r.status==='Active'?'gr':(r.status==='Expired'?'rd':'am'))+' '+escHtml(r.source||'')+' '+tbl.innerHTML+'