if(row.Part_Description != null)
{
	match_data = Materials[ID == row.Part_Description && Status == "Active"];
	row.Rate=ifnull(match_data.Purchase_Price,0.0);
	row.Part_No=match_data.ID;
	row.Mfr_Part_No=ifnull(match_data.ID,"");
	row.Specification=match_data.Specification;
	row.Brand=match_data.Brand_Name;
	row.Ordered_Qty=ifnull(match_data.MOQ,0);
	row.UoM=row.Part_Description.Primary_UoM;
	//checking with vendor location with Uttar Pradesh 
	if(input.Vendor_Name.Place_of_Supply.Destination != "Uttar Pradesh")
	{
		row.Tax=Materials[ID == row.Part_Description].IGST_Details;
	}
	else
	{
		row.Tax=Materials[ID == row.Part_Description].GST_Details;
	}
	row.Available_Qty=ifnull(Inventory[Part_Description == row.Part_Description].sum(Available_Qty),0.0);
	row.MOQ_Qty=ifnull(Materials[ID == row.Part_Description].MOQ,0.0);
	//load the rate,moq from the vendor pricing master if available
	getvendcust = Vendor_Contract[Vendor_Name == input.Vendor_Name && Status == "Active"];
	if(getvendcust.count() > 0)
	{
		ven_pricing = Vendor_Contract_Subform[Vendor_Name == input.Vendor_Name && Part_Description == row.Part_Description && Effective_From <= zoho.currentdate && Effective_To >= zoho.currentdate && sf_Status == "Active"];
		//info ven_pricing.count();
		if(ven_pricing.count(ID) == 1)
		{
			row.Rate=null;
			row.MOQ_Qty=null;
			row.Ordered_Qty=null;
			row.Rate=ifnull(ven_pricing.Unit_Price,0.0);
			row.MOQ_Qty=ifnull(ven_pricing.MOQ,0.0);
			row.Ordered_Qty=ifnull(ven_pricing.MOQ,0.0);
			if(row.Rate != ven_pricing.Unit_Price)
			{
				row.Vendor_contract_Price_check=false;
			}
			else
			{
				row.Vendor_contract_Price_check=true;
			}
		}
	}
	row.Sub_Total=row.Ordered_Qty * row.Rate;
}
else
{
	row.Part_No=null;
	row.Available_Qty=null;
	row.Ordered_Qty=null;
	row.Specification=null;
	row.MOQ_Qty=null;
}
//For testing Purpose only Part number created for testing should be selected.
if(input.Vendor_Name != null)
{
	if(Vendor_Name.Vendor_Name.startsWithIgnoreCase("Test") == True)
	{
		if(row.Part_Description != null)
		{
			if(row.Part_Description.Part_Description.startsWithIgnoreCase("Test") == false)
			{
				alert "Use Test Part No for Testing";
				row.Part_No=null;
				row.Part_Description=null;
			}
		}
	}
}