Advertisement
Guest User

Untitled

a guest
Nov 17th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.11 KB | None | 0 0
  1. //========================-NEW CLAIM-=================================
  2. if (document.URL.toLowerCase().indexOf("newclaim")>-1) {
  3. var lossDesc = document.getElementById("lossDescription");
  4. lossDesc.insertAdjacentHTML('afterend',
  5. '<div id="PopulateOpts" align="left">'+
  6. '<button type="button"'+
  7. 'onclick="displayFactors()">CFactors</button>'+
  8. '</div>');
  9.  
  10. var lossDate=document.getElementById("lossdate");
  11. lossDate.insertAdjacentHTML('beforebegin',
  12. '<button type="button"'+
  13. 'onclick="'+
  14. 'populateNewClaim();" style="display:inline">FILL'+
  15. '</button> ');//to onclick itan searchLOSS()
  16. lossDate.style.width = "175px";
  17.  
  18. var mylossType=document.getElementById('losstype');
  19. mylossType.insertAdjacentHTML('beforebegin','<div>'+
  20. '<button type="button" onclick="mylossType.value=948;">PD</button>&emsp;'+
  21. '<button type="button" onclick="mylossType.value=945;">NF</button>&emsp;'+
  22. '<button type="button" onclick="mylossType.value=1079;">SUB</button>&emsp;'+
  23. '<button type="button" onclick="mylossType.value=969;">BI</button>&emsp;'+
  24. '<button type="button" onclick="mylossType.value=966;">LOSS</button>'+
  25. '</div>');
  26.  
  27. }
  28.  
  29. function populateNewClaim(){
  30. var insId=document.getElementById('insurer').value;
  31.  
  32. //insID will be: LUX:9215 EDGE:9213 TOWER:9211
  33. var cids= [];//url for calling Populate from contact window
  34. cids["9215"] = "Insured&pact=pop&cid=34389";//LUX
  35. cids["9213"] = "Insured&pact=pop&cid=34332";//EDGE
  36. cids["9211"] = "Insured&strFind=tower";//TOWER
  37. cids["9217"] = "Insured&pact=pop&cid=34433";//BSD TWO
  38. cids["9218"] = "Insured&pact=pop&cid=34494";//DADEX
  39. cids["9216"] = "Insured&pact=pop&cid=34412";//GET
  40.  
  41. //populate Insured Details
  42. ShowContactSelector(337,cids[insId]);
  43.  
  44. //populate Loss Details
  45. document.getElementById('timeofloss').value =':';
  46.  
  47. //Additional Notes template
  48.  
  49. if (document.getElementById('losstype').value == 945)
  50. document.getElementById('additionalnotes').value = "IVD: \nREGISTRANT: ";
  51. else
  52. document.getElementById('additionalnotes').value = "REGISTRANT: ";
  53. //populate Assignment Information
  54. document.getElementById('claimteam').value ='36';//FIRST REPORT
  55. document.getElementById('assignedto').value ='4755';//Chris Matkaris, hidden select
  56. //display hidden tr
  57. document.getElementById('trDirectAssign').style.display = 'block';
  58. }
  59. //========================-NEW CLAIM-=================================
  60.  
  61. function copyToClipboard(txtToCopy){
  62. var dummy = document.createElement("textarea");
  63. document.body.appendChild(dummy);
  64. dummy.value=txtToCopy;
  65. //dummy.setAttribute('value', txtToCopy);
  66. dummy.select();
  67. document.execCommand("copy");
  68. document.body.removeChild(dummy);
  69. }
  70.  
  71. //========================-CLAIM VIEWER-==============================
  72. if (document.URL.toLowerCase().indexOf("claims/viewer")>-1) {
  73. var claimNoElm = document.getElementsByClassName("truncate")[0];
  74. var claimNo = claimNoElm.innerHTML.slice(-9);
  75. var insured = getInsured();
  76. var toCopy= claimNo + ', ' + insured + ', ' ;
  77. //an einai sto tab general antigrafei kai tin DOL
  78. if (document.URL.toLowerCase().indexOf("claims/viewer/general")>-1)
  79. toCopy+=document.getElementById('dol').value;
  80. claimNoElm.insertAdjacentHTML('beforeend',
  81. ' <button type="button"'+
  82. 'onclick="copyToClipboard(toCopy)">Copy fwd email title'+
  83. '</button>');
  84. }
  85.  
  86. function getInsured(){
  87. var
  88. insured=document.getElementsByClassName('ClaimSliderDetails')[0].innerText;
  89. if (insured.toUpperCase().indexOf("DADEX")>-1)
  90. insured="DADEX";
  91. else if (insured.toUpperCase().indexOf("GET CARS")>-1)
  92. insured="GET CARS";
  93. else if (insured.toUpperCase().indexOf("BSD TWO")>-1)
  94. insured="BSD TWO";
  95. return insured;
  96. }
  97.  
  98. //========================-CLAIM VIEWER-==============================
  99.  
  100. //========================-GENERAL TAB-==============================
  101. if (document.URL.toLowerCase().indexOf("claims/viewer/general")>-1) {
  102. var generalTabBtns = document.getElementById("claimtabsrow");
  103. generalTabBtns.insertAdjacentHTML('afterend',
  104. '<div id="PopulateOpts">'+
  105. '<button type="button"'+
  106. 'onclick="'+
  107. "document.getElementsByName('severity')[0].value = '1';"+
  108. "document.getElementsByName('statusid')[0].value = '1396';"+
  109. "document.getElementsByName('lossProv')[0].value = '94';"+
  110. "document.forms[0].submit();"+
  111. '">1st Update</button>'+
  112. '</div>');
  113. }
  114. //========================-GENERAL TAB-==============================
  115.  
  116. //========================-COVERAGE TAB-=================================
  117. if (document.URL.toLowerCase().indexOf("coverage")>-1) {
  118. var coverageTabBtns = document.getElementsByClassName("ContainerLight")[1];
  119. coverageTabBtns.insertAdjacentHTML('beforebegin',
  120. ' <button type="button" onclick="populateCoverage();">Broker & Period </button>'
  121. );
  122.  
  123. }
  124.  
  125. function populateCoverage(){
  126. //populate Broker Details
  127. var brokerGroupId=349;
  128. ShowContactSelector(349,'Brokers&pact=pop&cid=34148');
  129.  
  130. //get policy# and policy year (2 last chars in policy#)
  131. var policy = document.getElementsByName('policynumber')[0].value;
  132. policy = policy.replace(/\s+/g, '');//remove spaces
  133. document.getElementsByName('policynumber')[0].value=policy;
  134. var policyYear = policy.slice(-2);
  135. //State of Filing same for all: New York
  136. document.getElementById('StateOFFiling').value = 94;
  137. //populate Policy Details depending policy#
  138. if (policy.indexOf("2432")>-1){// LUX Credit
  139. //set policy dates
  140. document.getElementById('binddate').value = '3/1/20'+policyYear;
  141. document.getElementById('expirydate').value = '3/1/20'+(parseInt(policyYear)+1);
  142. }
  143. if (policy.indexOf("2327")>-1){// EDGE
  144. //set policy dates
  145. document.getElementById('binddate').value = '4/30/20'+policyYear;
  146. document.getElementById('expirydate').value = '4/30/20'+(parseInt(policyYear)+1);
  147. }
  148. if (policy.indexOf("2558")>-1){// BSD TWO lower
  149. //populate Broker Details
  150. ShowContactSelector(brokerGroupId,'Brokers&pact=pop&cid=34358');
  151. //set policy dates
  152. document.getElementById('binddate').value = '05/18/20'+policyYear;
  153. document.getElementById('expirydate').value = '04/25/20'+(parseInt(policyYear)+1);
  154. }
  155. if (policy.indexOf("2490")>-1){// BSD TWO Higher
  156. //populate Broker Details
  157. ShowContactSelector(brokerGroupId,'Brokers&pact=pop&cid=34358');
  158. //set policy dates
  159. document.getElementById('binddate').value = '04/25/20'+policyYear;
  160. document.getElementById('expirydate').value = '04/25/20'+(parseInt(policyYear)+1);
  161. }
  162. if (policy.indexOf("2403")>-1){// LUXURY ONE
  163. //populate Broker Details
  164. ShowContactSelector(brokerGroupId,'Brokers&pact=pop&cid=34358');
  165. //set policy dates
  166. document.getElementById('binddate').value = '07/01/20'+policyYear;
  167. document.getElementById('expirydate').value = '07/01/20'+(parseInt(policyYear)+1);
  168. }
  169. if (policy.indexOf("2416")>-1 || policy.indexOf("2431")>-1){// GET CARS
  170. //populate Broker Details
  171. ShowContactSelector(brokerGroupId,'Brokers&pact=pop&cid=34425');
  172. //set policy dates
  173. document.getElementById('binddate').value = '3/1/20'+policyYear;
  174. document.getElementById('expirydate').value = '3/1/20'+(parseInt(policyYear)+1);
  175. }
  176. if (policy.indexOf("2545")>-1){// DADEX
  177. //populate Broker Details
  178. ShowContactSelector(brokerGroupId,'Brokers&pact=pop&cid=34425');
  179. //set policy dates
  180. document.getElementById('binddate').value = '09/30/20'+policyYear;
  181. document.getElementById('expirydate').value = '09/30/20'+(parseInt(policyYear)+1);
  182. }
  183. }
  184. //========================-COVERAGE TAB-=================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement