Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //========================-NEW CLAIM-=================================
- if (document.URL.toLowerCase().indexOf("newclaim")>-1) {
- var lossDesc = document.getElementById("lossDescription");
- lossDesc.insertAdjacentHTML('afterend',
- '<div id="PopulateOpts" align="left">'+
- '<button type="button"'+
- 'onclick="displayFactors()">CFactors</button>'+
- '</div>');
- var lossDate=document.getElementById("lossdate");
- lossDate.insertAdjacentHTML('beforebegin',
- '<button type="button"'+
- 'onclick="'+
- 'populateNewClaim();" style="display:inline">FILL'+
- '</button> ');//to onclick itan searchLOSS()
- lossDate.style.width = "175px";
- var mylossType=document.getElementById('losstype');
- mylossType.insertAdjacentHTML('beforebegin','<div>'+
- '<button type="button" onclick="mylossType.value=948;">PD</button> '+
- '<button type="button" onclick="mylossType.value=945;">NF</button> '+
- '<button type="button" onclick="mylossType.value=1079;">SUB</button> '+
- '<button type="button" onclick="mylossType.value=969;">BI</button> '+
- '<button type="button" onclick="mylossType.value=966;">LOSS</button>'+
- '</div>');
- }
- function populateNewClaim(){
- var insId=document.getElementById('insurer').value;
- //insID will be: LUX:9215 EDGE:9213 TOWER:9211
- var cids= [];//url for calling Populate from contact window
- cids["9215"] = "Insured&pact=pop&cid=34389";//LUX
- cids["9213"] = "Insured&pact=pop&cid=34332";//EDGE
- cids["9211"] = "Insured&strFind=tower";//TOWER
- cids["9217"] = "Insured&pact=pop&cid=34433";//BSD TWO
- cids["9218"] = "Insured&pact=pop&cid=34494";//DADEX
- cids["9216"] = "Insured&pact=pop&cid=34412";//GET
- //populate Insured Details
- ShowContactSelector(337,cids[insId]);
- //populate Loss Details
- document.getElementById('timeofloss').value =':';
- //Additional Notes template
- if (document.getElementById('losstype').value == 945)
- document.getElementById('additionalnotes').value = "IVD: \nREGISTRANT: ";
- else
- document.getElementById('additionalnotes').value = "REGISTRANT: ";
- //populate Assignment Information
- document.getElementById('claimteam').value ='36';//FIRST REPORT
- document.getElementById('assignedto').value ='4755';//Chris Matkaris, hidden select
- //display hidden tr
- document.getElementById('trDirectAssign').style.display = 'block';
- }
- //========================-NEW CLAIM-=================================
- function copyToClipboard(txtToCopy){
- var dummy = document.createElement("textarea");
- document.body.appendChild(dummy);
- dummy.value=txtToCopy;
- //dummy.setAttribute('value', txtToCopy);
- dummy.select();
- document.execCommand("copy");
- document.body.removeChild(dummy);
- }
- //========================-CLAIM VIEWER-==============================
- if (document.URL.toLowerCase().indexOf("claims/viewer")>-1) {
- var claimNoElm = document.getElementsByClassName("truncate")[0];
- var claimNo = claimNoElm.innerHTML.slice(-9);
- var insured = getInsured();
- var toCopy= claimNo + ', ' + insured + ', ' ;
- //an einai sto tab general antigrafei kai tin DOL
- if (document.URL.toLowerCase().indexOf("claims/viewer/general")>-1)
- toCopy+=document.getElementById('dol').value;
- claimNoElm.insertAdjacentHTML('beforeend',
- ' <button type="button"'+
- 'onclick="copyToClipboard(toCopy)">Copy fwd email title'+
- '</button>');
- }
- function getInsured(){
- var
- insured=document.getElementsByClassName('ClaimSliderDetails')[0].innerText;
- if (insured.toUpperCase().indexOf("DADEX")>-1)
- insured="DADEX";
- else if (insured.toUpperCase().indexOf("GET CARS")>-1)
- insured="GET CARS";
- else if (insured.toUpperCase().indexOf("BSD TWO")>-1)
- insured="BSD TWO";
- return insured;
- }
- //========================-CLAIM VIEWER-==============================
- //========================-GENERAL TAB-==============================
- if (document.URL.toLowerCase().indexOf("claims/viewer/general")>-1) {
- var generalTabBtns = document.getElementById("claimtabsrow");
- generalTabBtns.insertAdjacentHTML('afterend',
- '<div id="PopulateOpts">'+
- '<button type="button"'+
- 'onclick="'+
- "document.getElementsByName('severity')[0].value = '1';"+
- "document.getElementsByName('statusid')[0].value = '1396';"+
- "document.getElementsByName('lossProv')[0].value = '94';"+
- "document.forms[0].submit();"+
- '">1st Update</button>'+
- '</div>');
- }
- //========================-GENERAL TAB-==============================
- //========================-COVERAGE TAB-=================================
- if (document.URL.toLowerCase().indexOf("coverage")>-1) {
- var coverageTabBtns = document.getElementsByClassName("ContainerLight")[1];
- coverageTabBtns.insertAdjacentHTML('beforebegin',
- ' <button type="button" onclick="populateCoverage();">Broker & Period </button>'
- );
- }
- function populateCoverage(){
- //populate Broker Details
- var brokerGroupId=349;
- ShowContactSelector(349,'Brokers&pact=pop&cid=34148');
- //get policy# and policy year (2 last chars in policy#)
- var policy = document.getElementsByName('policynumber')[0].value;
- policy = policy.replace(/\s+/g, '');//remove spaces
- document.getElementsByName('policynumber')[0].value=policy;
- var policyYear = policy.slice(-2);
- //State of Filing same for all: New York
- document.getElementById('StateOFFiling').value = 94;
- //populate Policy Details depending policy#
- if (policy.indexOf("2432")>-1){// LUX Credit
- //set policy dates
- document.getElementById('binddate').value = '3/1/20'+policyYear;
- document.getElementById('expirydate').value = '3/1/20'+(parseInt(policyYear)+1);
- }
- if (policy.indexOf("2327")>-1){// EDGE
- //set policy dates
- document.getElementById('binddate').value = '4/30/20'+policyYear;
- document.getElementById('expirydate').value = '4/30/20'+(parseInt(policyYear)+1);
- }
- if (policy.indexOf("2558")>-1){// BSD TWO lower
- //populate Broker Details
- ShowContactSelector(brokerGroupId,'Brokers&pact=pop&cid=34358');
- //set policy dates
- document.getElementById('binddate').value = '05/18/20'+policyYear;
- document.getElementById('expirydate').value = '04/25/20'+(parseInt(policyYear)+1);
- }
- if (policy.indexOf("2490")>-1){// BSD TWO Higher
- //populate Broker Details
- ShowContactSelector(brokerGroupId,'Brokers&pact=pop&cid=34358');
- //set policy dates
- document.getElementById('binddate').value = '04/25/20'+policyYear;
- document.getElementById('expirydate').value = '04/25/20'+(parseInt(policyYear)+1);
- }
- if (policy.indexOf("2403")>-1){// LUXURY ONE
- //populate Broker Details
- ShowContactSelector(brokerGroupId,'Brokers&pact=pop&cid=34358');
- //set policy dates
- document.getElementById('binddate').value = '07/01/20'+policyYear;
- document.getElementById('expirydate').value = '07/01/20'+(parseInt(policyYear)+1);
- }
- if (policy.indexOf("2416")>-1 || policy.indexOf("2431")>-1){// GET CARS
- //populate Broker Details
- ShowContactSelector(brokerGroupId,'Brokers&pact=pop&cid=34425');
- //set policy dates
- document.getElementById('binddate').value = '3/1/20'+policyYear;
- document.getElementById('expirydate').value = '3/1/20'+(parseInt(policyYear)+1);
- }
- if (policy.indexOf("2545")>-1){// DADEX
- //populate Broker Details
- ShowContactSelector(brokerGroupId,'Brokers&pact=pop&cid=34425');
- //set policy dates
- document.getElementById('binddate').value = '09/30/20'+policyYear;
- document.getElementById('expirydate').value = '09/30/20'+(parseInt(policyYear)+1);
- }
- }
- //========================-COVERAGE TAB-=================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement