Ejemplo n.º 1
0
		$params = array ( "CURRENT_RUN" => $currentRun, "WASHING" => $with_out_washing, "RUN_AT_YEAR" => $run_at_year,"YEARS_OF_WORK" => $years_of_work );

		try{

			$result ["TO"] = GetTO( $propramTOID, $chId, true, $with_out_washing );
			calcCostTOWorks( $result ["TO"] );
			countTO  ( $result["TO"] , $years_of_work * $run_at_year, $currentRun );
			calcByTo ( $result , $run_at_year, $years_of_work , $currentRun );

		}catch(exception $e){
			$e->getMessage();
		}
	}

//		Если тип контракта «Гарантия+» или «Комплекс» добавляю стоимость DLP в стоимость контракта
		$DLP = IBlockContractHandler::getDLPConditions ( $chId , intval ( $_REQUEST['years_of_work']), $cntrct_transport_task );
	

	/*	Если машин >1 умножаю результат расчета на кол-во машин. */
	setlocale(LC_MONETARY, 'ru_RU');
	if( isset( $_REQUEST["cars"] ) && is_array ( $_REQUEST["cars"] ) && count($_REQUEST["cars"]) > 0 ){
		$k = count( $_REQUEST["cars"] );
		$for_one = $result["RESULTS"];	
		
		foreach ( $result["RESULTS"] as $field => &$val){
			$val = sprintf("%01.2f", $val * $k) ;
		}
	}

	$print = $result["RESULTS"];
	$print["FIRST_TO"] = $result["FIRST_TO"]["NAME"];