function addMuteDetect() {
	//var title = "Assays in Tubes";
	var title = "Single Tube Assays - Inventoried";
	var format = "";
	var spno = 6;
	var noofreactions = getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples') * getExperimentInfo('nooftargets');
	var noofreactionspertarget = getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples');
	var noofreftragets = getExperimentInfo('noofreftargets');
	var refunitsreactions = getExperimentInfo('noofreftargets') * getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples');
	//var formatObj = findApproximateCopyNumberPre(noofreactionspertarget);
    var formatObj = findApproximateMuteDetection("TaqMan Mutation Detection Assays (mutant allele assays and wild type allele assays)");
	format = formatObj.get("concatenate");
	
	format = format.replace(/_/gi,' ');
	format = format.replace(/Gene Expression/gi, 'Gene Expression Assays, ');
	format = format.replace(/miRNA/gi, 'MicroRNA Assays, ');
	format = format.replace(/small/gi, 'Small, ');
	format = format.replace(/Medium/gi, 'Medium, ');
	format = format.replace(/Large/gi, 'Large, ');
	format = format.replace("TaqMan","TaqMan®");
	format = format.replace("QuantStudio TM","QuantStudio™");

	//format = "TaqMan " + format;
	var tubenoofreactions = formatObj.get('numberofreactions');
	
	var noofunits = getExperimentInfo('nooftargets');
	var wellNum = 96;
	var assayrefobject = findApproximateMuteDetectionRefAssay("TaqMan Mutation Detection Reference Assays (gene reference assays)");
	var assaypartnumber = assayrefobject.get('partnumber');
	//var assayrefobject = copyrefassayModel.findRecord('partnumber',assaypartnumber);
	
	if (getExperimentInfo('equipment') == '96-well') {
		tubenoofunits = Math.ceil(noofreactionspertarget/ formatObj.get('96-wellnumberofreactions'));
		var refassayreaction = assayrefobject.get('96-wellnumberofreactions'); 
	} else if (getExperimentInfo('equipment') == '384-well') {
		wellNum = 384;
		tubenoofunits = Math.ceil(noofreactionspertarget
				/ formatObj.get('384-wellnumberofreactions'));
		var refassayreaction = assayrefobject.get('384-wellnumberofreactions'); 
	} else {
		wellNum = 384;
		var refassayreaction = assayrefobject.get('384-wellnumberofreactions');
		tubenoofunits = Math.ceil(noofreactionspertarget / tubenoofreactions);
		//alert("no " + noofunits);
	}
	
	var noofunits_new = tubenoofunits * noofunits;
	refassayunits = Math.ceil(refunitsreactions / refassayreaction);
	
	//var priceperrefassayUnit = assayrefobject.regions().findRecord('region', region).prices().findRecord('countrycode', currency).get('value');
	
	var priceperrefassayUnit = pricelist.findRecord('partnumber', assaypartnumber).regions().findRecord('region', region + "-" + currency).get('price');
	var refassayname = assayrefobject.get('concatenate');
	var refassayquantity = refassayunits;
	
	
	
	var isIPC = false;
	if (Ext.get('ipcchk').dom.checked) {
		isIPC = true;
	} else {
		isIPC = false;
	}
	
	var ipcobject = findApproximateMuteDetectionRefAssay("TaqMan Mutation Detection IPC Reagent Kit");
	var ipcunits = isIPC ? 1:0;
	var totalrefreactions = (noofreactions + refunitsreactions);
	var ipctype = "IPC Kit";
	var ipcname = ipcobject.get("concatenate");
	var ipcpartnumber = ipcobject.get("partnumber");
	//var ipcprice = ipcobject.regions().findRecord('region', region).prices().findRecord('countrycode', currency).get('value');;
	var ipcprice = pricelist.findRecord('partnumber', ipcpartnumber).regions().findRecord('region', region + "-" + currency).get('price');
	var ipcqty = isIPC ? findIPCQty(totalrefreactions,getExperimentInfo('equipment')) : 0;
	
	//var ipcqty = "1";
	
	
	var ipcnetprice = (ipcqty*ipcprice);
	var ipcpersample = ipcnetprice/getExperimentInfo('noofsamples');
	var mvolume = 0;
	
	
	if (getExperimentInfo('equipment') == '96-well') {
		mvolume = masterMixRequirements.wellplate96 * (noofreactions + refunitsreactions) / 1000;
	} else if (getExperimentInfo('equipment') == '384-well') {
		mvolume = masterMixRequirements.wellplate384 * (noofreactions + refunitsreactions) / 1000;
	} else {
		mvolume = masterMixRequirements.tubes * (noofreactions + refunitsreactions) / 1000;
	}
	
	var hours = Math.ceil((62 / 60 / wellNum)
			* getExperimentInfo('nooftargets')
			* getExperimentInfo('noofreplicates')
			* getExperimentInfo('noofsamples'));
	
	
	//var mastermixObj = findOptimumCopyNumberMicroMMXTubeRecord(mvolume);
	var isOtherMMFormat = getExperimentInfo('isOtherMMFormat');
	if( isOtherMMFormat === "YES" ){
		spno = getExperimentInfo('otherFmPano');
		var selOtherForVal = getExperimentInfo('selOtherFormatMMValue');
		var selOtherForPd = getExperimentInfo('selOtherFormatMMProd');
		var mastermixObj = findAppTapRecForOtherMMFormat(genoMasterMix, 'productname', selOtherForPd);
		var mastermix = mastermixObj.get('productname');
		var mnoofunits = Math.ceil((mvolume * 1000) / mastermixObj.get('volume'));
		var masterMixPartNumber = mastermixObj.get('partnumber');
		var masterMixCostPerUnit = pricelist.findRecord('partnumber', masterMixPartNumber).regions().findRecord('region',region + "-" + currency).get('price');
		var masterperc = (Ext.get('masterperc').dom.value).split('%')[0];
		var totalMasterMixCost = masterMixCostPerUnit * mnoofunits * (1 - (masterperc / 100));
		var masterMixCostPerReaction = totalMasterMixCost / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction1 = 0;
		var masterMixCostPerReaction2 = 0;
		var masterMixCostPerReaction3 = 0;
		var mmixCostPerSample = totalMasterMixCost / getExperimentInfo('noofsamples');
		var mmixCostPerSample1 = 0;
		var mmixCostPerSample2 = 0;
		var mmixCostPerSample3 = 0;
		var totalMasterMixCost1 = 0;
		var totalMasterMixCost2 = 0;
		var totalMasterMixCost3 = 0;
	}else{
		// Master Mix Combination starts here
		totalQty = [];
		allCombination = [];
		var totQty = Math.ceil((mvolume * 1000) / 1000 );
		var toGetCombinationVal = pbRatio(0, totQty, (mvolume * 1000), CopyMasterMix);
		var selMM = toGetOptimumPrice(toGetCombinationVal, cnvMasterMix);
		var mastermixObj = selMM;
		
		var mastermix = mastermixObj['Product Name1'];
		var mastermix1 = mastermixObj['Product Name2'];
		var mastermix2 = mastermixObj['Product Name3'];
		var mastermix3 = mastermixObj['Product Name4'];

		var mnoofunits = mastermixObj['qty1'];
		var mnoofunits1 = mastermixObj['qty2'];
		if(mnoofunits1 != undefined){
			mnoofunits1 = mnoofunits1;
		} else {
			mnoofunits1 = 0;
		}
		var mnoofunits2 = mastermixObj['qty3'];
		if(mnoofunits2 != undefined){
			mnoofunits2 = mnoofunits2;
		} else {
			mnoofunits2 = 0;
		}
		var mnoofunits3 = mastermixObj['qty4'];
		if(mnoofunits3 != undefined){
			mnoofunits3 = mnoofunits3;
		} else {
			mnoofunits3 = 0;
		}
		
		var masterMixPartNumber = mastermixObj["Part Number1"];
		var masterMixPartNumber1 = mastermixObj["Part Number2"];
		if(masterMixPartNumber1 != undefined){
			masterMixPartNumber1 = masterMixPartNumber1;
		} else {
			masterMixPartNumber1 = 0;
		}
		var masterMixPartNumber2 = mastermixObj["Part Number3"];
		if(masterMixPartNumber2 != undefined){
			masterMixPartNumber2 = masterMixPartNumber2;
		} else {
			masterMixPartNumber2 = 0;
		}
		var masterMixPartNumber3 = mastermixObj["Part Number4"];
		if(masterMixPartNumber3 != undefined){
			masterMixPartNumber3 = masterMixPartNumber3;
		} else {
			masterMixPartNumber3 = 0;
		}
		
		
		var masterMixCostPerUnit = pricelist.findRecord('partnumber', masterMixPartNumber).regions().findRecord('region', region + "-" + currency).get('price');
		
		if(masterMixPartNumber1 != 0){
			var masterMixCostPerUnit1 = pricelist.findRecord('partnumber', masterMixPartNumber1).regions().findRecord('region', region + "-" + currency).get('price');
		} else {
			var masterMixCostPerUnit1 = 0;
		}
		if(masterMixPartNumber2 != 0){
			var masterMixCostPerUnit2 = pricelist.findRecord('partnumber', masterMixPartNumber2).regions().findRecord('region', region + "-" + currency).get('price');
		} else {
			var masterMixCostPerUnit2 = 0;
		}
		if(masterMixPartNumber3 != 0){
			var masterMixCostPerUnit3 = pricelist.findRecord('partnumber', masterMixPartNumber3).regions().findRecord('region', region + "-" + currency).get('price');
		} else {
			var masterMixCostPerUnit3 = 0;
		}
		
		var masterperc = (Ext.get('masterperc').dom.value).split('%')[0];
		var totalMasterMixCost = masterMixCostPerUnit * mnoofunits * (1 - (masterperc / 100));
		var totalMasterMixCost1 = masterMixCostPerUnit1 * mnoofunits1 * (1 - (masterperc / 100));
		var totalMasterMixCost2 = masterMixCostPerUnit2 * mnoofunits2 * (1 - (masterperc / 100));
		var totalMasterMixCost3 = masterMixCostPerUnit3 * mnoofunits3 * (1 - (masterperc / 100));
		
		var masterMixCostPerReaction = (totalMasterMixCost) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction1 = (totalMasterMixCost1) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction2 = (totalMasterMixCost2) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction3 = (totalMasterMixCost3) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		
		var mmixCostPerSample = totalMasterMixCost / getExperimentInfo('noofsamples');
		var mmixCostPerSample1 = totalMasterMixCost1 / getExperimentInfo('noofsamples');
		var mmixCostPerSample2 = totalMasterMixCost2 / getExperimentInfo('noofsamples');
		var mmixCostPerSample3 = totalMasterMixCost3 / getExperimentInfo('noofsamples');
		
		// Master Mix Combination ends here	
	}
	
	var partNumber = formatObj.get('partnumber');
    var assayCostPerUnit = pricelist.findRecord('partnumber', partNumber).regions().findRecord('region', region + "-" + currency).get('price');
					
					
	newTotalCost = assayCostPerUnit * noofunits * tubenoofunits;
	totalNewCostPerReaction = newTotalCost/noofreactions;
	totalNewCostPerSample = newTotalCost/getExperimentInfo('noofsamples');
	
		
	var volumeDiscount = 0;
	var costWithVolDisc = noofunits * assayCostPerUnit* (1 - (volumeDiscount / 100))*tubenoofunits;
	var assayperc = (Ext.get('assayperc').dom.value).split('%')[0];
	var totalAssayCost = costWithVolDisc * (1 - (assayperc / 100));
	//var totalrefcost = refassayquantity * priceperrefassayUnit * noofunits * (1 - (assayperc / 100));
	var totalrefcost = refassayunits * priceperrefassayUnit * (1 - (assayperc / 100));
	
	var totalMasterMixCost = masterMixCostPerUnit * mnoofunits
			* (1 - (masterperc / 100));
	
	var totalCost = totalAssayCost + totalMasterMixCost + totalMasterMixCost1 + totalMasterMixCost2 + totalrefcost+ipcnetprice;
	totalNewCostPerReaction = totalCost/noofreactions;
	totalNewCostPerSample = totalCost/getExperimentInfo('noofsamples');
	var assayCostPerReaction = totalAssayCost
			/ (getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
				
	var optimizationCostPerReaction = 0;
	var ipcperreaction = ipcnetprice/totalrefreactions;
	
    var refassayperreaction = totalrefcost/(getExperimentInfo('noofreftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	var totalCostPerReaction = assayCostPerReaction + masterMixCostPerReaction + masterMixCostPerReaction1 + masterMixCostPerReaction2 + optimizationCostPerReaction+ipcperreaction+refassayperreaction;
	
	var productUrl = "";
	if (getExperimentInfo('type') == "Gene Expression") {
		productUrl = "http://www.invitrogen.com/site/us/en/home/Products-and-Services/Applications/PCR/real-time-pcr/real-time-pcr-assays/taqman-gene-expression/single-tube-taqman-gene-expression-analysis.html";
	} else {
		productUrl = "http://www.invitrogen.com/site/us/en/home/Products-and-Services/Applications/PCR/real-time-pcr/real-time-pcr-assays/taqman-mutation-detection-assays/single-tube-taqman-mutation.html?ICID=search-product";
	}
	
	var assayCostPerSample = totalAssayCost / getExperimentInfo('noofsamples');
	var refCostPerSample = totalrefcost/getExperimentInfo('noofsamples');
	var totalCostPerSample = assayCostPerSample + mmixCostPerSample + mmixCostPerSample1 + mmixCostPerSample2 + refCostPerSample;
	
	var totalCostPreDisc = costWithVolDisc
			+ (masterMixCostPerUnit * mnoofunits);
	var totalDiscount = 100 - (totalCost * 100 / totalCostPreDisc);
    	
	
	outputList.add({
		pno : spno,
		title : title,
		partnumber : partNumber,
		format : format,
		noofunits : noofunits_new,
		noofreactions : noofreactions,
		mastermix : mastermix,
		mastermix1 : mastermix1,
		mastermix2 : mastermix2,
		mastermix3 : mastermix3,
		mnoofunits : mnoofunits,
		mnoofunits1 : mnoofunits1,
		mnoofunits2 : mnoofunits2,
		mnoofunits3 : mnoofunits3,
		totalcost : roundNumber(totalCost, 2),
		//totalcost : roundNumber(newTotalCost,2),
		volumediscount : volumeDiscount,
		mvolumediscount : masterperc,
		assayscost : roundNumber(costWithVolDisc, 2),
		assayscostperunit : roundNumber(assayCostPerUnit, 2),
		assayscostwithvoldisc : roundNumber(totalAssayCost, 2),
		mastermixvol : roundNumber(mvolume, 2),
		mastermixcostperunit : masterMixCostPerUnit,
		mastermixcostperunit1 : roundNumber(masterMixCostPerUnit1, 2),
		mastermixcostperunit2 : roundNumber(masterMixCostPerUnit2, 2),
		mastermixcostperunit3 : roundNumber(masterMixCostPerUnit3, 2),
		mastermixdisc : masterperc,
		mastermixcostwithdisc : roundNumber(totalMasterMixCost, 2),
		mastermixcostwithdisc1: roundNumber(totalMasterMixCost1, 2),
		mastermixcostwithdisc2: roundNumber(totalMasterMixCost2, 2),
		mastermixcostwithdisc3: roundNumber(totalMasterMixCost3, 2),
		mastermixcostpredisc : roundNumber((masterMixCostPerUnit * mnoofunits),2),
		mastermixcostpredisc1 : roundNumber((masterMixCostPerUnit1 * mnoofunits1), 2),
		mastermixcostpredisc2 : roundNumber((masterMixCostPerUnit2 * mnoofunits2), 2),
		mastermixcostpredisc3 : roundNumber((masterMixCostPerUnit3 * mnoofunits3), 2),
		mastermixcost : roundNumber(masterMixCostPerUnit * mnoofunits, 2),
		mastermixcost1 : roundNumber(masterMixCostPerUnit1 * mnoofunits1, 2),
		mastermixcost2 : roundNumber(masterMixCostPerUnit2 * mnoofunits2, 2),
		mastermixcost3 : roundNumber(masterMixCostPerUnit3 * mnoofunits3, 2),
		mastermixpartnumber : masterMixPartNumber,
		mastermixpartnumber1 : masterMixPartNumber1,
		mastermixpartnumber2 : masterMixPartNumber2,
		mastermixpartnumber3 : masterMixPartNumber3,
		mmxcostpersample : roundNumber(mmixCostPerSample, 2),
		mmxcostpersample1 : roundNumber(mmixCostPerSample1,2),
		mmxcostpersample2 : roundNumber(mmixCostPerSample2,2),
		mmxcostpersample3 : roundNumber(mmixCostPerSample3,2),
		assaycostpersample : roundNumber(assayCostPerSample, 2),
		totalcostpersample : roundNumber(totalNewCostPerSample, 2),
		totalcostpredisc : roundNumber(totalCostPreDisc, 2),
		totaldiscount : roundNumber(totalDiscount, 2),
		noofhours : hours,
		assaycostperreaction : assayCostPerReaction,
		mastermixcostperreaction : masterMixCostPerReaction,
		mastermixcostperreaction1 : roundNumber(masterMixCostPerReaction1, 2),
		mastermixcostperreaction2 : roundNumber(masterMixCostPerReaction2, 2),
		mastermixcostperreaction3 : roundNumber(masterMixCostPerReaction3, 2),
		optimizationcostperreaction : roundNumber(optimizationCostPerReaction,2),
		totalcostperreaction : totalCostPerReaction,
		totalcostpersample : roundNumber(totalNewCostPerSample, 2),
		producturl : productUrl,
		refassayname : refassayname,
		ipcunits:ipcunits,
		ipctype :ipctype,
		ipcname : ipcname,
		ipcpartnumber  : ipcpartnumber,
		ipcprice  : ipcprice,
		ipcqty :ipcqty,
		ipcpersample : ipcpersample,
		ipcnetprice : ipcnetprice,
		ipcperreaction:ipcperreaction,
		refassaypartnumber : assaypartnumber,
		refunitsreactions:refunitsreactions,
		refassayqty : refassayunits,
		refassaycost : totalrefcost,
		refassaypercost : priceperrefassayUnit,
		refassayperreaction : refassayperreaction,
		refassaycostpersample : refCostPerSample,
		totalrefreactions:totalrefreactions,
		reqnoofunits : noofunits,
		fnName:'addMuteDetect',
		type : 'tube'
	});
}
function findIPCQty(value,wellplate){
	
	
	if(wellplate == '96-well')
	{
		var DNAQty = Math.ceil((value * 0.4)/200);
	}else{
		var DNAQty = Math.ceil((value * 0.2)/200);
	}
	if(wellplate == '96-well')
	{
		var IPCMixQty = Math.ceil((value * .002)/1);
	}else
	{
		var IPCMixQty = Math.ceil((value * .001)/1);
	}
	
	if(IPCMixQty > DNAQty)
	{
		var qty = IPCMixQty
	}else
	{
		var qty = DNAQty
	}
	return qty;
	
}
function addMuteDetectEGFR() {
	//var title = "Assays in Tubes";
	var title = "Single Tube Assays - Custom Plus";
	var format = "";
	var noofreactions = getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples') * getExperimentInfo('nooftargets');
	var noofreactionspertarget = getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples');
	var noofreftragets = getExperimentInfo('noofreftargets');
	var refunitsreactions = getExperimentInfo('noofreftargets') * getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples');
	//var formatObj = findApproximateCopyNumberPre(noofreactionspertarget);
    var formatObj = findApproximateMuteDetection("TaqMan EGFR Exon 19 Deletions Assay (mutant allele assay to 19 different EGFR exon 19 deletions)");
	format = formatObj.get("concatenate");
	var spno = 7;
	format = format.replace(/_/gi,' ');
	format = format.replace(/Gene Expression/gi, 'Gene Expression Assays, ');
	format = format.replace(/miRNA/gi, 'MicroRNA Assays, ');
	format = format.replace(/small/gi, 'Small, ');
	format = format.replace(/Medium/gi, 'Medium, ');
	format = format.replace(/Large/gi, 'Large, ');
	format = format.replace("TaqMan","TaqMan®");
	format = format.replace("QuantStudio TM","QuantStudio™");
	
	//format = "TaqMan " + format;
	var tubenoofreactions = formatObj.get('numberofreactions');
	
	var noofunits = getExperimentInfo('nooftargets');
	var wellNum = 96;
	var assayrefobject = findApproximateMuteDetectionRefAssay("TaqMan Mutation Detection Reference Assays (gene reference assays)");
	var assaypartnumber = assayrefobject.get('partnumber');
	//var assayrefobject = copyrefassayModel.findRecord('partnumber',assaypartnumber);
	
	if (getExperimentInfo('equipment') == '96-well') {
		tubenoofunits = Math.ceil(noofreactionspertarget/ formatObj.get('96-wellnumberofreactions'));
		var refassayreaction = assayrefobject.get('96-wellnumberofreactions'); 
	} else if (getExperimentInfo('equipment') == '384-well') {
		wellNum = 384;
		tubenoofunits = Math.ceil(noofreactionspertarget
				/ formatObj.get('384-wellnumberofreactions'));
		var refassayreaction = assayrefobject.get('384-wellnumberofreactions'); 
	} else {
		wellNum = 384;
		var refassayreaction = assayrefobject.get('384-wellnumberofreactions');
		tubenoofunits = Math.ceil(noofreactionspertarget / tubenoofreactions);
		//alert("no " + noofunits);
	}
	
    var noofunits_new = tubenoofunits * noofunits;
	refassayunits = Math.ceil(refunitsreactions / refassayreaction);
	//var priceperrefassayUnit = assayrefobject.regions().findRecord('region', region).prices().findRecord('countrycode', currency).get('value');
	var priceperrefassayUnit = pricelist.findRecord('partnumber', assaypartnumber).regions().findRecord('region', region + "-" + currency).get('price');
	var refassayname = assayrefobject.get('concatenate');
	var refassayquantity = refassayunits;
	
	
	
	var isIPC = false;
	if (Ext.get('ipcchk').dom.checked) {
		isIPC = true;
	} else {
		isIPC = false;
	}
	
	var ipcobject = findApproximateMuteDetectionRefAssay("TaqMan Mutation Detection IPC Reagent Kit");
	var ipcunits = isIPC ? 1:0;
	var totalrefreactions = (noofreactions + refunitsreactions);
	var ipctype = "IPC Kit";
	var ipcname = ipcobject.get("concatenate");
	var ipcpartnumber = ipcobject.get("partnumber");
	//var ipcprice = ipcobject.regions().findRecord('region', region).prices().findRecord('countrycode', currency).get('value');;
	var ipcprice = pricelist.findRecord('partnumber', ipcpartnumber).regions().findRecord('region', region + "-" + currency).get('price');
	var ipcqty = isIPC ? findIPCQty(totalrefreactions,getExperimentInfo('equipment')):0;
	
	//var ipcqty = "1";
	//var ipcpersample = ipcprice/getExperimentInfo('noofsamples');
	var ipcnetprice = (ipcqty*ipcprice);
	var ipcperreaction = ipcnetprice/(getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	var ipcpersample = ipcnetprice/getExperimentInfo('noofsamples');
	var mvolume = 0;
	
	
	if (getExperimentInfo('equipment') == '96-well') {
		mvolume = masterMixRequirements.wellplate96 * (noofreactions + refunitsreactions) / 1000;
	} else if (getExperimentInfo('equipment') == '384-well') {
		mvolume = masterMixRequirements.wellplate384 * (noofreactions + refunitsreactions) / 1000;
	} else {
		mvolume = masterMixRequirements.tubes * (noofreactions + refunitsreactions) / 1000;
	}
	
	
	//var mastermixObj = findOptimumCopyNumberMicroMMXTubeRecord(mvolume);
	var isOtherMMFormat = getExperimentInfo('isOtherMMFormat');
	if( isOtherMMFormat === "YES" ){
		spno = getExperimentInfo('otherFmPano');
		var selOtherForVal = getExperimentInfo('selOtherFormatMMValue');
		var selOtherForPd = getExperimentInfo('selOtherFormatMMProd');
		var mastermixObj = findAppTapRecForOtherMMFormat(genoMasterMix, 'productname', selOtherForPd);
		var mastermix = mastermixObj.get('productname');
		var mnoofunits = Math.ceil((mvolume * 1000) / mastermixObj.get('volume'));
		var masterMixPartNumber = mastermixObj.get('partnumber');
		var masterMixCostPerUnit = pricelist.findRecord('partnumber', masterMixPartNumber).regions().findRecord('region',region + "-" + currency).get('price');
		var masterperc = (Ext.get('masterperc').dom.value).split('%')[0];
		var totalMasterMixCost = masterMixCostPerUnit * mnoofunits * (1 - (masterperc / 100));
		var masterMixCostPerReaction = totalMasterMixCost / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction1 = 0;
		var masterMixCostPerReaction2 = 0;
		var masterMixCostPerReaction3 = 0;
		var mmixCostPerSample = totalMasterMixCost / getExperimentInfo('noofsamples');
		var mmixCostPerSample1 = 0;
		var mmixCostPerSample2 = 0;
		var mmixCostPerSample3 = 0;
		var totalMasterMixCost1 = 0;
		var totalMasterMixCost2 = 0;
		var totalMasterMixCost3 = 0;
	}else{
		// Master Mix Combination starts here
		totalQty = [];
		allCombination = [];
		var totQty = Math.ceil((mvolume * 1000) / 1000 );
		var toGetCombinationVal = pbRatio(0, totQty, (mvolume * 1000), CopyMasterMix);
		var selMM = toGetOptimumPrice(toGetCombinationVal, cnvMasterMix);
		var mastermixObj = selMM;
		
		var mastermix = mastermixObj['Product Name1'];
		var mastermix1 = mastermixObj['Product Name2'];
		var mastermix2 = mastermixObj['Product Name3'];
		var mastermix3 = mastermixObj['Product Name4'];

		var mnoofunits = mastermixObj['qty1'];
		var mnoofunits1 = mastermixObj['qty2'];
		if(mnoofunits1 != undefined){
			mnoofunits1 = mnoofunits1;
		} else {
			mnoofunits1 = 0;
		}
		var mnoofunits2 = mastermixObj['qty3'];
		if(mnoofunits2 != undefined){
			mnoofunits2 = mnoofunits2;
		} else {
			mnoofunits2 = 0;
		}
		var mnoofunits3 = mastermixObj['qty4'];
		if(mnoofunits3 != undefined){
			mnoofunits3 = mnoofunits3;
		} else {
			mnoofunits3 = 0;
		}
		
		var masterMixPartNumber = mastermixObj["Part Number1"];
		var masterMixPartNumber1 = mastermixObj["Part Number2"];
		if(masterMixPartNumber1 != undefined){
			masterMixPartNumber1 = masterMixPartNumber1;
		} else {
			masterMixPartNumber1 = 0;
		}
		var masterMixPartNumber2 = mastermixObj["Part Number3"];
		if(masterMixPartNumber2 != undefined){
			masterMixPartNumber2 = masterMixPartNumber2;
		} else {
			masterMixPartNumber2 = 0;
		}
		var masterMixPartNumber3 = mastermixObj["Part Number4"];
		if(masterMixPartNumber3 != undefined){
			masterMixPartNumber3 = masterMixPartNumber3;
		} else {
			masterMixPartNumber3 = 0;
		}
		
		
		var masterMixCostPerUnit = pricelist.findRecord('partnumber', masterMixPartNumber).regions().findRecord('region', region + "-" + currency).get('price');
		
		if(masterMixPartNumber1 != 0){
			var masterMixCostPerUnit1 = pricelist.findRecord('partnumber', masterMixPartNumber1).regions().findRecord('region', region + "-" + currency).get('price');
		} else {
			var masterMixCostPerUnit1 = 0;
		}
		if(masterMixPartNumber2 != 0){
			var masterMixCostPerUnit2 = pricelist.findRecord('partnumber', masterMixPartNumber2).regions().findRecord('region', region + "-" + currency).get('price');
		} else {
			var masterMixCostPerUnit2 = 0;
		}
		if(masterMixPartNumber3 != 0){
			var masterMixCostPerUnit3 = pricelist.findRecord('partnumber', masterMixPartNumber3).regions().findRecord('region', region + "-" + currency).get('price');
		} else {
			var masterMixCostPerUnit3 = 0;
		}
		
		var masterperc = (Ext.get('masterperc').dom.value).split('%')[0];
		var totalMasterMixCost = masterMixCostPerUnit * mnoofunits * (1 - (masterperc / 100));
		var totalMasterMixCost1 = masterMixCostPerUnit1 * mnoofunits1 * (1 - (masterperc / 100));
		var totalMasterMixCost2 = masterMixCostPerUnit2 * mnoofunits2 * (1 - (masterperc / 100));
		var totalMasterMixCost3 = masterMixCostPerUnit3 * mnoofunits3 * (1 - (masterperc / 100));
		
		var masterMixCostPerReaction = (totalMasterMixCost) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction1 = (totalMasterMixCost1) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction2 = (totalMasterMixCost2) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		var masterMixCostPerReaction3 = (totalMasterMixCost3) / (getExperimentInfo('nooftargets')	* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
		
		var mmixCostPerSample = totalMasterMixCost / getExperimentInfo('noofsamples');
		var mmixCostPerSample1 = totalMasterMixCost1 / getExperimentInfo('noofsamples');
		var mmixCostPerSample2 = totalMasterMixCost2 / getExperimentInfo('noofsamples');
		var mmixCostPerSample3 = totalMasterMixCost3 / getExperimentInfo('noofsamples');
		
		// Master Mix Combination ends here	
	}
	var partNumber = formatObj.get('partnumber');
    var assayCostPerUnit = pricelist.findRecord('partnumber', partNumber).regions().findRecord('region', region + "-" + currency).get('price');
										
	newTotalCost = assayCostPerUnit * noofunits * tubenoofunits;
			
	var volumeDiscount = 0;
	var costWithVolDisc = noofunits * assayCostPerUnit* (1 - (volumeDiscount / 100))*tubenoofunits;
	
	var assayperc = (Ext.get('assayperc').dom.value).split('%')[0];
	var totalAssayCost = costWithVolDisc * (1 - (assayperc / 100));
	var totalrefcost = refassayunits * priceperrefassayUnit * (1 - (assayperc / 100));
	
	var totalMasterMixCost = masterMixCostPerUnit * mnoofunits
			* (1 - (masterperc / 100));
	var hours = Math.ceil((62 / 60 / wellNum)
			* getExperimentInfo('nooftargets')
			* getExperimentInfo('noofreplicates')
			* getExperimentInfo('noofsamples'));
	var totalCost = totalAssayCost + totalMasterMixCost + totalMasterMixCost1 + totalMasterMixCost2 +totalrefcost+ipcnetprice;
	totalNewCostPerReaction = totalCost/noofreactions;
	totalNewCostPerSample = totalCost/getExperimentInfo('noofsamples');
	var assayCostPerReaction = totalAssayCost
			/ (getExperimentInfo('nooftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	
	
	var refassayperreaction = totalrefcost/(getExperimentInfo('noofreftargets')
					* getExperimentInfo('noofreplicates') * getExperimentInfo('noofsamples'));
	var ipcperreaction = ipcnetprice/totalrefreactions;					
	var optimizationCostPerReaction = 0;
	var totalCostPerReaction = assayCostPerReaction + masterMixCostPerReaction
			+ optimizationCostPerReaction+refassayperreaction+ipcperreaction;
	var productUrl = "";
	if (getExperimentInfo('type') == "Gene Expression") {
		productUrl = "http://www.invitrogen.com/site/us/en/home/Products-and-Services/Applications/PCR/real-time-pcr/real-time-pcr-assays/taqman-gene-expression/single-tube-taqman-gene-expression-analysis.html";
	} else {
		productUrl = "http://www.invitrogen.com/site/us/en/home/Products-and-Services/Applications/PCR/real-time-pcr/real-time-pcr-assays/taqman-mutation-detection-assays/single-tube-taqman-mutation.html?ICID=search-product";
	}
	
  	
	var assayCostPerSample = totalAssayCost / getExperimentInfo('noofsamples');
	var refCostPerSample = totalrefcost/getExperimentInfo('noofsamples')
	var totalCostPerSample = assayCostPerSample + mmixCostPerSample  + mmixCostPerSample1 + mmixCostPerSample2 +refCostPerSample;
	
	var totalCostPreDisc = costWithVolDisc
			+ (masterMixCostPerUnit * mnoofunits);
	var totalDiscount = 100 - (totalCost * 100 / totalCostPreDisc);
    
	
	
	
	outputList.add({
		pno : spno,
		title : title,
		partnumber : partNumber,
		format : format,
		noofunits : noofunits_new,
		noofreactions : noofreactions,
		mastermix : mastermix,
		mastermix1 : mastermix1,
		mastermix2 : mastermix2,
		mastermix3 : mastermix3,
		mnoofunits : mnoofunits,
		mnoofunits1 : mnoofunits1,
		mnoofunits2 : mnoofunits2,
		mnoofunits3 : mnoofunits3,
		totalcost : roundNumber(totalCost, 2),
		//totalcost : roundNumber(newTotalCost,2),
		volumediscount : volumeDiscount,
		mvolumediscount : masterperc,
		assayscost : roundNumber(costWithVolDisc, 2),
		assayscostperunit : roundNumber(assayCostPerUnit, 2),
		assayscostwithvoldisc : roundNumber(totalAssayCost, 2),
		mastermixvol : roundNumber(mvolume, 2),
		mastermixcostperunit : masterMixCostPerUnit,
		mastermixcostperunit1 : roundNumber(masterMixCostPerUnit1, 2),
		mastermixcostperunit2 : roundNumber(masterMixCostPerUnit2, 2),
		mastermixcostperunit3 : roundNumber(masterMixCostPerUnit3, 2),
		mastermixdisc : masterperc,
		mastermixcostwithdisc : roundNumber(totalMasterMixCost, 2),
		mastermixcostwithdisc1: roundNumber(totalMasterMixCost1, 2),
		mastermixcostwithdisc2: roundNumber(totalMasterMixCost2, 2),
		mastermixcostwithdisc3: roundNumber(totalMasterMixCost3, 2),
		mastermixcostpredisc : roundNumber((masterMixCostPerUnit * mnoofunits),2),
		mastermixcostpredisc1 : roundNumber((masterMixCostPerUnit1 * mnoofunits1), 2),
		mastermixcostpredisc2 : roundNumber((masterMixCostPerUnit2 * mnoofunits2), 2),
		mastermixcostpredisc3 : roundNumber((masterMixCostPerUnit3 * mnoofunits3), 2),
		mastermixcost : roundNumber(masterMixCostPerUnit * mnoofunits, 2),
		mastermixcost1 : roundNumber(masterMixCostPerUnit1 * mnoofunits1, 2),
		mastermixcost2 : roundNumber(masterMixCostPerUnit2 * mnoofunits2, 2),
		mastermixcost3 : roundNumber(masterMixCostPerUnit3 * mnoofunits3, 2),
		mastermixpartnumber : masterMixPartNumber,
		mastermixpartnumber1 : masterMixPartNumber1,
		mastermixpartnumber2 : masterMixPartNumber2,
		mastermixpartnumber3 : masterMixPartNumber3,
		mmxcostpersample : roundNumber(mmixCostPerSample, 2),
		mmxcostpersample1 : roundNumber(mmixCostPerSample1,2),
		mmxcostpersample2 : roundNumber(mmixCostPerSample2,2),
		mmxcostpersample3 : roundNumber(mmixCostPerSample3,2),
		assaycostpersample : assayCostPerSample,
		totalcostpersample : totalNewCostPerSample,
		totalcostpredisc : totalCostPreDisc,
		totaldiscount : totalDiscount,
		noofhours : hours,
		assaycostperreaction : assayCostPerReaction,
		mastermixcostperreaction : masterMixCostPerReaction,
		mastermixcostperreaction1 : roundNumber(masterMixCostPerReaction1, 2),
		mastermixcostperreaction2 : roundNumber(masterMixCostPerReaction2, 2),
		mastermixcostperreaction3 : roundNumber(masterMixCostPerReaction3, 2),
		optimizationcostperreaction : roundNumber(optimizationCostPerReaction,2),
		totalcostperreaction : totalCostPerReaction,
		totalcostpersample : totalNewCostPerSample,
		producturl : productUrl,
		refassayname : refassayname,
		ipcunits:ipcunits,
		ipctype :ipctype,
		ipcname : ipcname,
		ipcpartnumber  : ipcpartnumber,
		ipcprice  : ipcprice,
		ipcqty :ipcqty,
		ipcpersample : ipcpersample,
		ipcperreaction:ipcperreaction,
		ipcnetprice : ipcnetprice,
		refassaypartnumber : assaypartnumber,
		refassayqty : refassayunits,
		refunitsreactions:refunitsreactions,
		refassaycost : totalrefcost,
		refassaypercost : priceperrefassayUnit,
		refassayperreaction : refassayperreaction,
		refassaycostpersample : refCostPerSample,
		totalrefreactions:totalrefreactions,
		reqnoofunits : noofunits,
		fnName:'addMuteDetectEGFR',
		type : 'tube'
	});
}
function findApproximateMuteDetection(value) {
	var record = null;
	var name = value;
	var prevRecord = null;
	return muteModel.findRecord('concatenate', name);
}
function findApproximateMuteDetectionRefAssay(value) {
	var record = null;
	var name = value;
	var prevRecord = null;
	return muteModel.findRecord('concatenate', name);
}