var no_of_pgxsamples =0;
function addPgxCNV() {
	
	//var title = "Assays in Tubes";
	var pgxsnpassaytype = Ext.get("pgxcnvassaytype").dom;
	var pgxsnpassaytypeObjValue = pgxsnpassaytype.options[pgxsnpassaytype.selectedIndex].value;
	
	var format = "";
	//var noofreplicates = Ext.get('pgxsnpreplicates').dom.value;
	var noofreplicates = 1;
	//var noofreactions = noofreplicates	* Number(Ext.get("hdpgxsampleval").dom. value);
	//var noofreactions = getExperimentInfo('noofreplicates')* getExperimentInfo('noofsamples') * getExperimentInfo('nooftargets');
	var nooftargets = Ext.get("pgxcnasample").dom.value;
	no_of_pgxsamples = Ext.get("no_of_pgxsamples").dom.value;
	var pgxsamplecalctype = Ext.get("pgxsamplecombobox").dom;
    var selectpgxsampleObjValue = pgxsamplecalctype.options[pgxsamplecalctype.selectedIndex].value;
	var no_of_reagentsmonths = Ext.get("no_of_reagentsmonths").dom.value;
	
	no_of_pgxsamples = no_of_pgxsamples * no_of_reagentsmonths;
	/*if(selectpgxsampleObjValue == "days"){
		no_of_pgxsamples = no_of_pgxsamples * no_of_reagentsmonths;
	}else if(selectpgxsampleObjValue == "weeks"){
		no_of_pgxsamples = no_of_pgxsamples * (no_of_reagentsmonths * 7);
	}else if(selectpgxsampleObjValue == "months"){
		no_of_pgxsamples = no_of_pgxsamples * (no_of_reagentsmonths * 31);
	}else if(selectpgxsampleObjValue == "years"){
		no_of_pgxsamples = no_of_pgxsamples * (no_of_reagentsmonths * 365);
	}*/
	
	var noofreactions = noofreplicates	* no_of_pgxsamples * nooftargets;
	
	var noofreactionspertarget = noofreplicates * no_of_pgxsamples;
	
	if(pgxsnpassaytypeObjValue == "Pre-designed"){		
		var title = "Single Tube Assays -  Made-to-order";
		var formatObj = findPGxOptimumCopyNumberTubeRecord(noofreactionspertarget,'Pre-designed assays');
	} else if(pgxsnpassaytypeObjValue == "Custom"){
		var title = "Single Tube Assays -  Custom";
		var formatObj = findPGxOptimumCopyNumberTubeRecord(noofreactionspertarget,'Custom assays');
	} else {
		var title = "Single Tube Assays -  Custom Plus";
		var formatObj = findPGxOptimumCopyNumberTubeRecord(noofreactionspertarget,'Custom Plus 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 = "TaqMan " + format;
	
	var refassayObj = Ext.get('referenceassay').dom; 
    var assaypartoption = "TaqMan Copy Number Reference Assay RNAse P";//refassayObj.options[refassayObj.selectedIndex].value;
	var tubenoofreactions = formatObj.get('numberofreactions');
	
	var noofunits = nooftargets;
	var wellNum = 96;
	
	var pgxopenarraycalctypeobj = Ext.get("pgxcnainstrumentsneedtouse").dom;
	var selectpgxsnpopenarrayInstValue = pgxopenarraycalctypeobj.options[pgxopenarraycalctypeobj.selectedIndex].value;
	var equipment = "";
	
	var pgxopenarraycalctypeobj1 = Ext.get("pgxsnpformatneed").dom;
	var selectpgxsnpopenarrayInstValue1 = pgxopenarraycalctypeobj1.options[pgxopenarraycalctypeobj1.selectedIndex].value;
	
	if(selectpgxsnpopenarrayInstValue === "96-well Standard" || selectpgxsnpopenarrayInstValue === "96-well Fast"){
		equipment = "96-well";
	} else if(selectpgxsnpopenarrayInstValue === "384-well"){
		equipment = "384-well";
	} else if( selectpgxsnpopenarrayInstValue === "Same block as SNP analysis" ){
		equipment = selectpgxsnpopenarrayInstValue1;
	}
	
	var assaypartnumber = PGxfindOptimumCopyNumberRefAssay(noofreactions,assaypartoption,'Human');
	var assayrefobject = copyrefassayModel.findRecord('partnumber',assaypartnumber);
	
	if (equipment == '96-well') {
		tubenoofunits = Math.ceil(noofreactionspertarget/ formatObj.get('96-wellnumberofreactions'));
		var refassayreaction = assayrefobject.get('96-wellnumberofreactions'); 		
	} else if (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);		
	}
	    
    var noofunits_new = tubenoofunits * noofunits;
	var refassayunits = Math.ceil(noofreactions / 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 mvolume = 0;
	if (equipment == '96-well') {
		mvolume = masterMixRequirements.wellplate96
				* nooftargets
				* noofreplicates
				* no_of_pgxsamples / 1000;
	} else if (equipment == '384-well') {
		mvolume = masterMixRequirements.wellplate384
				* nooftargets
				* noofreplicates
				* no_of_pgxsamples / 1000;
	} else {
		mvolume = masterMixRequirements.tubes
				* nooftargets
				* noofreplicates
				* no_of_pgxsamples / 1000;
	}
	
	
	
	
	var mastermixObj = findPGxOptimumCopyNumberMicroMMXTubeRecord(mvolume);
	var mastermix = mastermixObj.get('productname');
	var mnoofunits = Math.ceil(mvolume / mastermixObj.get('volume'));
	var partNumber = formatObj.get('partnumber');
    var assayCostPerUnit = pricelist.findRecord('partnumber', partNumber)
			.regions().findRecord('region', region + "-" + currency).get(
					'price');
					
					
	newTotalCost = assayCostPerUnit * noofunits * tubenoofunits;
	
	totalNewCostPerSample = newTotalCost/no_of_pgxsamples;
	
	var volumeDiscount = 0;
	var costWithVolDisc = noofunits * assayCostPerUnit* (1 - (volumeDiscount / 100));
	var assayperc = 0; //(Ext.get('assayperc').dom.value).split('%')[0];
	var totalAssayCost = costWithVolDisc * (1 - (assayperc / 100));
	var totalrefcost = refassayquantity * priceperrefassayUnit * (1 - (assayperc / 100));
	var masterMixPartNumber = mastermixObj.get('partnumber');
	var masterMixCostPerUnit = pricelist.findRecord('partnumber',
			masterMixPartNumber).regions().findRecord('region',
			region + "-" + currency).get('price');
	var masterperc = 0; //(Ext.get('masterperc').dom.value).split('%')[0];
	var totalMasterMixCost = masterMixCostPerUnit * mnoofunits
			* (1 - (masterperc / 100));
	
	var numPlates = Math.ceil(nooftargets
			* noofreplicates
			* no_of_pgxsamples/wellNum);
	
	var hours = Math.ceil(65/60 * 1.2 * numPlates);

//	var hours = Math.ceil((60 / 60 / wellNum) * nooftargets
//			* noofreplicates
//			* Number(Ext.get("hdpgxsampleval").dom. value));
	var totalCost = totalAssayCost + totalMasterMixCost+totalrefcost;
	
	var assayCostPerReaction = totalAssayCost
			/ (nooftargets
					* noofreplicates * no_of_pgxsamples);
	
	var masterMixCostPerReaction = totalMasterMixCost
			/ (nooftargets
					* noofreplicates * no_of_pgxsamples);
	var optimizationCostPerReaction = 0;
	var totalCostPerReaction = assayCostPerReaction + masterMixCostPerReaction
			+ optimizationCostPerReaction;
	var productUrl = producturls.findRecord('partNumber', partNumber).get('productURL');
	
	

	var mmixCostPerSample = totalMasterMixCost
			/ no_of_pgxsamples;
	var assayCostPerSample = totalAssayCost / no_of_pgxsamples;
	var refCostPerSample = totalrefcost/no_of_pgxsamples;
	var totalCostPerSample = assayCostPerSample + mmixCostPerSample+refCostPerSample;
	var refassayperreaction = totalrefcost/(nooftargets
					* noofreplicates * no_of_pgxsamples);
	var totalCostPreDisc = costWithVolDisc
			+ (masterMixCostPerUnit * mnoofunits);
			
	totalNewCostPerReaction = totalCost/noofreactions;
	var totalDiscount = 100 - (totalCost * 100 / totalCostPreDisc);
    
	refassayname = refassayname.replace("TaqMan","TaqMan®");
	
	
	
	outputList.add({
		pno : 101,
		title : title,
		partnumber : partNumber,
		format : format.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		noofunits : noofunits_new,
		noofreactions : noofreactions,
		mastermix : mastermix.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mnoofunits : mnoofunits,
		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,
		mastermixdisc : masterperc,
		mastermixcostwithdisc : roundNumber(totalMasterMixCost, 2),
		mastermixcostpredisc : roundNumber((masterMixCostPerUnit * mnoofunits),
				2),
		mastermixcost : roundNumber(masterMixCostPerUnit * mnoofunits, 2),
		mastermixpartnumber : masterMixPartNumber,
		mmxcostpersample : roundNumber(mmixCostPerSample, 2),
		assaycostpersample : roundNumber(assayCostPerSample, 2),
		totalcostpersample : totalCostPerSample,
		totalcostpredisc : roundNumber(totalCostPreDisc, 2),
		totaldiscount : roundNumber(totalDiscount, 2),
		noofhours : hours,
		assaycostperreaction : assayCostPerReaction,
		mastermixcostperreaction : masterMixCostPerReaction,
		optimizationcostperreaction : roundNumber(optimizationCostPerReaction,
				2),
		totalcostperreaction : totalNewCostPerReaction,
		totalcostpersample : totalCostPerSample,
		producturl : productUrl,
		refassayname : refassayname,
		refassaypartnumber : assaypartnumber,
		refassayqty : refassayquantity,
		refassaycost : totalrefcost,
		refassaypercost : priceperrefassayUnit,
		refassayperreaction:refassayperreaction,
		refassaycostpersample : roundNumber(refCostPerSample, 2),
		reqnoofunits : noofunits,
		fnName:'addPgxCNV',
		type : 'tube'
	});

}

function findPGxOptimumCopyNumberTubeRecord(noofreactions, type) {
	var recordIndex = 0;
	var price = 0;
	var count = 0;
	
	var pgxopenarraycalctypeobj = Ext.get("pgxcnainstrumentsneedtouse").dom;
	var selectpgxsnpopenarrayInstValue = pgxopenarraycalctypeobj.options[pgxopenarraycalctypeobj.selectedIndex].value;
	var equipment = "";
	
	var pgxopenarraycalctypeobj1 = Ext.get("pgxsnpformatneed").dom;
	var selectpgxsnpopenarrayInstValue1 = pgxopenarraycalctypeobj1.options[pgxopenarraycalctypeobj1.selectedIndex].value;
	
	if(selectpgxsnpopenarrayInstValue === "96-well Standard" || selectpgxsnpopenarrayInstValue === "96-well Fast"){
		equipment = "96-well";
	}else{
		equipment = selectpgxsnpopenarrayInstValue;
	}
	
	if( selectpgxsnpopenarrayInstValue === "Same block as SNP analysis" ){
		equipment = selectpgxsnpopenarrayInstValue1;
	}
	
	copyModel
			.each(function(e) {
				
				var partNumber = e.get('partnumber');
				var application = type;
				var factor = (e.get('concatenate').indexOf('Extra') != -1 || e.get('concatenate').indexOf('small') != -1) ? 3 : 1;
				if (e.get('concatenate').indexOf(application) != -1
						&& e.get('concatenate').indexOf(type) != -1) {
					var mnoofunits = 0;
					if (equipment == '96-well') {
						
						mnoofunits = Math.ceil(noofreactions * (1)
									/ e.get('96-wellnumberofreactions'));
					} else if (equipment == '384-well') {
						mnoofunits = Math.ceil(noofreactions * (1)
								/ e.get('384-wellnumberofreactions'));
					} else {
						mnoofunits = Math.ceil(noofreactions * (1)
								/ e.get('numberofreactions'));
					}
					var mprice = mnoofunits
							* pricelist.findRecord('partnumber', partNumber)
									.regions().findRecord('region',
											region + "-" + currency).get(
											'price');
					if (price == 0) {
						price = mprice;
						recordIndex = count;
					}
					if (mprice < price) {
						price = mprice;
						recordIndex = count;
					}

				}
				count++;
			});

	return copyModel.getAt(recordIndex);
}

function PGxfindOptimumCopyNumberRefAssay(mvolume,type,species){
	//type ="TaqMan Copy Number Reference Assay RNase P";
	
	var type1 = type+",750 reactions";
	var assayrefobject1 = copyrefassayModel.findRecord('concatenate',type1);
	var type2 = type+",3000 reactions";
	var assayrefobject2 = copyrefassayModel.findRecord('concatenate',type2);
	var price1 = getPGxCopyPrice(assayrefobject1);
	var price2 = getPGxCopyPrice(assayrefobject2);
	
	if(price1>price2)
	{
		var partnumber = assayrefobject2.get('partnumber');	
	}else{
		var partnumber = assayrefobject1.get('partnumber');
	}
	
	return partnumber;
	
}

function getPGxCopyPrice(assayrefobject){
	
	var noofreactionspertarget = 2 * no_of_pgxsamples;
	
	var noofunits = noofreactionspertarget * Ext.get("pgxcnasample").dom.value;
	var pgxopenarraycalctypeobj = Ext.get("pgxcnainstrumentsneedtouse").dom;
	var selectpgxsnpopenarrayInstValue = pgxopenarraycalctypeobj.options[pgxopenarraycalctypeobj.selectedIndex].value;
	var equipment = "";
	
	var pgxopenarraycalctypeobj1 = Ext.get("pgxsnpformatneed").dom;
	var selectpgxsnpopenarrayInstValue1 = pgxopenarraycalctypeobj1.options[pgxopenarraycalctypeobj1.selectedIndex].value;
	
	if(selectpgxsnpopenarrayInstValue === "96-well Standard" || selectpgxsnpopenarrayInstValue === "96-well Fast"){
		equipment = "96-well";
	}else{
		equipment = selectpgxsnpopenarrayInstValue;
	}
	if( selectpgxsnpopenarrayInstValue === "Same block as SNP analysis" ){
		equipment = selectpgxsnpopenarrayInstValue1;
	}
	
	if (equipment == '96-well') {		
		var refassayreaction = assayrefobject.get('96-wellnumberofreactions'); 
	} else if (equipment == '384-well') {
		wellNum = 384;		
		var refassayreaction = assayrefobject.get('384-wellnumberofreactions'); 
	}
	
	var pn = assayrefobject.get('partnumber');
	var priceperrefassayUnit = pricelist.findRecord('partnumber', pn)
			.regions().findRecord('region', region + "-" + currency).get(
					'price');
	var Units = Math.ceil(noofunits/refassayreaction);
	return Units * priceperrefassayUnit;
}

function findPGxOptimumCopyNumberMicroMMXTubeRecord(mvolume) {
	var recordIndex = 0;
	var price = 0;
	var count = 0;
	var chem = getExperimentInfo('method') == 'Fast' ? "Fast" : "Universal";
	copymastermixModel.each(function(e) {
		
			var mnoofunits = Math.ceil(mvolume / e.get('volume'));
			var partNumber = e.get('partnumber');
			var mprice = mnoofunits
					* pricelist.findRecord('partnumber', partNumber).regions()
							.findRecord('region', region + "-" + currency).get(
									'price');
			if (price == 0) {
				price = mprice;
				recordIndex = count;
			}
			if (mprice < price) {
				price = mprice;
				recordIndex = count;
			}
		
		count++;
	});
	return copymastermixModel.getAt(recordIndex);
}
/*
function addPgxCNV() {
	
	var title = "Single Tube Assays - Made-to-order";
	var format = "";
	var noofreplicates = 2;
	var noofreactions = noofreplicates	* Number(Ext.get("hdpgxsampleval").dom. value);
	var nooftargets = Ext.get("pgxcnasample").dom.value;
	var formatObj = findOptimumCopyNumberTubeRecord(noofreactionspertarget,'Pre-designed assays');
	//alert(formatObj);
	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 = "TaqMan® " + format;
	
	var tubenoofreactions = formatObj.get('numberofreactions');
	var noofunits = 0;
	var wellNum = 96;
	var pgxopenarraycalctypeobj = Ext.get("pgxcnainstrumentsneedtouse").dom;
	var selectpgxsnpopenarrayInstValue = pgxopenarraycalctypeobj.options[pgxopenarraycalctypeobj.selectedIndex].value;
	var equipment = "";
	
	var pgxopenarraycalctypeobj1 = Ext.get("pgxsnpformatneed").dom;
	var selectpgxsnpopenarrayInstValue1 = pgxopenarraycalctypeobj1.options[pgxopenarraycalctypeobj1.selectedIndex].value;
	
	if(selectpgxsnpopenarrayInstValue === "96-well Standard" || selectpgxsnpopenarrayInstValue === "96-well Fast"){
		equipment = "96-well";
	}else{
		equipment = selectpgxsnpopenarrayInstValue;
	}
	
	if( selectpgxsnpopenarrayInstValue === "Same block than SNP analysis" ){
		equipment = selectpgxsnpopenarrayInstValue1;
	}
	if (equipment == '96-well') {
		noofunits = Math.ceil(noofreactions
				/ formatObj.get('96-wellnumberofreactions'))
				* nooftargets;
	} else if (equipment == '384-well') {
		wellNum = 384;
		noofunits = Math.ceil(noofreactions
				/ formatObj.get('384-wellnumberofreactions'))
				* nooftargets;
	}
	
	noofunits = Math.ceil(noofreactions / tubenoofreactions);
	var mvolume = 0;
	if (equipment == '96-well') {
		mvolume = masterMixRequirements.wellplate96
				* nooftargets
				* noofreplicates
				* Number(Ext.get("hdpgxsampleval").dom. value) / 1000;
	} else if (equipment == '384-well') {
		mvolume = masterMixRequirements.wellplate384
				* nooftargets
				* noofreplicates
				* Number(Ext.get("hdpgxsampleval").dom. value) / 1000;
	} else {
		mvolume = masterMixRequirements.tubes
				* nooftargets
				* noofreplicates
				* Number(Ext.get("hdpgxsampleval").dom. value) / 1000;
	}
	var mastermixObj = findOptimumGeneMicroMMXTubeRecord(mvolume);
	var mastermix = mastermixObj.get('product');

	var mnoofunits = Math.ceil(mvolume / mastermixObj.get('volume'));
	var partNumber = formatObj.get('partnumber');
	var assayCostPerUnit = pricelist.findRecord('partnumber', partNumber)
			.regions().findRecord('region', region + "-" + currency).get(
					'price');
	//alert(assayCostPerUnit);
	newTotalCost = assayCostPerUnit * noofunits;
	
	totalNewCostPerReaction = newTotalCost/noofreactions;
	totalNewCostPerSample = newTotalCost/Number(Ext.get("hdpgxsampleval").dom. value);
	//alert(totalNewCostPerSample);
	var volumeDiscount = 0;
	var costWithVolDisc = noofunits * assayCostPerUnit
			* (1 - (volumeDiscount / 100));
	var assayperc = 0;//(Ext.get('assayperc').dom.value).split('%')[0];
	var totalAssayCost = costWithVolDisc * (1 - (assayperc / 100));
	var masterMixPartNumber = mastermixObj.get('partnumber');
	var masterMixCostPerUnit = pricelist.findRecord('partnumber',
			masterMixPartNumber).regions().findRecord('region',
			region + "-" + currency).get('price');
	var masterperc = 0;//(Ext.get('masterperc').dom.value).split('%')[0];
	var totalMasterMixCost = masterMixCostPerUnit * mnoofunits
			* (1 - (masterperc / 100));
	
	var numPlates = Math.ceil(nooftargets
			* noofreplicates
			* Number(Ext.get("hdpgxsampleval").dom. value)/wellNum);
	//console.log("Number of plates: " + numPlates);
	var hours = Math.ceil(65/60 * 1.2 * numPlates);
	
	var totalCost = totalAssayCost + totalMasterMixCost;

	var assayCostPerReaction = totalAssayCost
			/ (nooftargets
					* noofreplicates * Number(Ext.get("hdpgxsampleval").dom. value));
	var masterMixCostPerReaction = totalMasterMixCost
			/ (nooftargets
					* noofreplicates * Number(Ext.get("hdpgxsampleval").dom. value));
	var optimizationCostPerReaction = 0;
	var totalCostPerReaction = assayCostPerReaction + masterMixCostPerReaction
			+ optimizationCostPerReaction;
	var productUrl = producturls.findRecord('partNumber', partNumber).get('productURL');

	var mmixCostPerSample = totalMasterMixCost
			/ Number(Ext.get("hdpgxsampleval").dom. value);
	var assayCostPerSample = totalAssayCost / Number(Ext.get("hdpgxsampleval").dom. value);
	
	var totalCostPerSample = assayCostPerSample + mmixCostPerSample;

	var totalCostPreDisc = costWithVolDisc
			+ (masterMixCostPerUnit * mnoofunits);
	var totalDiscount = 100 - (totalCost * 100 / totalCostPreDisc);
	
	outputList.add({
		pno : 101,
		title : title,
		partnumber : partNumber,
		format : format.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		noofunits : noofunits,
		noofreactions : noofreactions * nooftargets,
		mastermix : mastermix.replace(/�/gi, '<sup>&reg;</sup>&nbsp;'),
		mnoofunits : mnoofunits,
		//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,
		mastermixdisc : masterperc,
		mastermixcostwithdisc : roundNumber(totalMasterMixCost, 2),
		mastermixcostpredisc : roundNumber((masterMixCostPerUnit * mnoofunits),
				2),
		mastermixcost : roundNumber(masterMixCostPerUnit * mnoofunits, 2),
		mastermixpartnumber : masterMixPartNumber,
		mmxcostpersample : roundNumber(mmixCostPerSample, 2),
		assaycostpersample : roundNumber(assayCostPerSample, 2),
		totalcostpersample : roundNumber(totalNewCostPerSample, 2),
		totalcostpredisc : roundNumber(totalCostPreDisc, 2),
		totaldiscount : roundNumber(totalDiscount, 2),
		noofhours : hours,
		assaycostperreaction : assayCostPerReaction,
		mastermixcostperreaction : masterMixCostPerReaction,
		optimizationcostperreaction : roundNumber(optimizationCostPerReaction,
				2),
		totalcostperreaction : totalNewCostPerReaction,
		totalcostpersample : totalNewCostPerSample,
		producturl : productUrl,

		type : 'tube'
	});

}*/