function loadTatal(productId,subdoing,implcit)
{
             document.getElementsByTagName("totPeriod"+productId)[0].value=0;
             document.getElementsByName("totRateCard"+productId)[0].value=0;
             document.getElementsByName("totSDiscount"+productId)[0].value=0;
             document.getElementsByName("totAComm"+productId)[0].value=0;
             document.getElementsByName("totNetNetPrice"+productId)[0].value=0;
             document.getElementsByName("totOtherTaxes"+productId)[0].value=0;
             document.getElementsByName("totIllum"+productId)[0].value=0;
             document.getElementsByName("totAddCost"+productId)[0].value=0;
             document.getElementsByName("totToal"+productId)[0].value=0;
            for(var subProductId=0;subProductId<ListOfProdcutALL[productId].length;subProductId++)
            {
                 var values="chekthis"+productId+subProductId;
                 var nms=document.getElementsByName(values)[0].checked;
                if(nms==true)
                {
                        document.getElementsByName("totPeriod"+productId)[0].value= parseFloat(document.getElementsByName("totPeriod"+productId)[0].value)+parseFloat(ListOfProdcutALL[productId][subProductId][0]);
                          
                         var a=
                         (( parseFloat(ListOfProdcutALL[productId][subProductId][1]) * parseFloat(ListOfProdcutALL[productId][subProductId][2]) )+
                         ( parseFloat(document.getElementsByName("totSDiscount"+productId)[0].value) * parseFloat(document.getElementsByName("totRateCard"+productId)[0].value) ) )       ;
                          var b=parseFloat(document.getElementsByName("totRateCard"+productId)[0].value)+parseFloat(ListOfProdcutALL[productId][subProductId][1]);
                         document.getElementsByName("totSDiscount"+productId)[0].value=a/b;
                         var c=
                         (( parseFloat(ListOfProdcutALL[productId][subProductId][1]) * parseFloat(ListOfProdcutALL[productId][subProductId][3]) )+
                         ( parseFloat(document.getElementsByName("totAComm"+productId)[0].value) * parseFloat(document.getElementsByName("totRateCard"+productId)[0].value) ) )       ;
                        var d=parseFloat(document.getElementsByName("totRateCard"+productId)[0].value)+parseFloat(ListOfProdcutALL[productId][subProductId][1]);
                        document.getElementsByName("totAComm"+productId)[0].value=c/d;
                         document.getElementsByName("totNetNetPrice"+productId)[0].value=format(parseFloat(CurrentCoff)*(parseFloat(document.getElementsByName("totNetNetPrice"+productId)[0].value)+parseFloat(CurrentCoff)*parseFloat(ListOfProdcutALL[productId][subProductId][4])),0,'');
                         document.getElementsByName("totOtherTaxes"+productId)[0].value=format((parseFloat(document.getElementsByName("totOtherTaxes"+productId)[0].value)+parseFloat(CurrentCoff)*parseFloat(ListOfProdcutALL[productId][subProductId][5])),0,'');
                         document.getElementsByName("totIllum"+productId)[0].value=format((parseFloat(document.getElementsByName("totIllum"+productId)[0].value)+parseFloat(CurrentCoff)*parseFloat(ListOfProdcutALL[productId][subProductId][6])),0,'');
                         document.getElementsByName("totAddCost"+productId)[0].value=format((parseFloat(document.getElementsByName("totAddCost"+productId)[0].value)+parseFloat(CurrentCoff)*parseFloat(ListOfProdcutALL[productId][subProductId][7])),0,'');
                         document.getElementsByName("totToal"+productId)[0].value=format((parseFloat(document.getElementsByName("totToal"+productId)[0].value)+parseFloat(CurrentCoff)*parseFloat(ListOfProdcutALL[productId][subProductId][8])),0,''); 
                         document.getElementsByName("totRateCard"+productId)[0].value=format((parseFloat(document.getElementsByName("totRateCard"+productId)[0].value)+parseFloat(CurrentCoff)*parseFloat(ListOfProdcutALL[productId][subProductId][1])),0,''); 
              }
        }
}
			
		
 
	
Partager