 _;
 ,,,, ActDate,DatePotr,DatePost;
 person_id,UserPass, UName,nDocType;
 _;
 ;
 __, ;
 ;
//_____________________________________________________________________________

 (,)
	=(".");
	.();
	 (..());

//_____________________________________________________________________________
 ()
	(_69,0);
	

//_____________________________________________________________________________

 ()
	 (()=0)  (()=0) 
		 ("  !",40);
		;
	;
	 ()=1 
		 ("  !",40);
		;
	;
	 ()=1 
		 ("  !",40);
		;
	;
	=("");
	
	 = .(.());
	=.((1998,12,1),(), ());
	 .()>0 
		 .() = 1  ; ;
		=0;
		();
		 ()>0  
			 _69=.() 
				_ = .N_;
				 = .;
				= .("");
				= ?(=2,.("_"),.("_"))+ .;
				= ?(=2,.,.);
				;
			;
			= +1;
		;
		 =() 
			();
			_ = .N_;
			 = .;
			_69 = .();
			= .("");
			= ?(=2,.("_"),.("_"))+ .;
			= ?(=2,.,.);
		;
	;
	 ("     ?",4)=7 
		=("._");
		.(,);
		 .()>0 
			 .() = 1  ; ;
			 =2 
				=.;
			 =.;
			;
			  ((( = )  ((.)=1) ))
			 (. = ()) 
				=0;
				();
				 ()>0  
					 _69=.() 
						_ = .N_;
						 = .;
						= .("") ;
						= ?(=2,.("_"),.("_"))+ .;
						= ?(=2,.,.);
						;
					;
					= +1;
				;
				 =() 
					();
					_ = .N_;
					 = .;
					_69 = .();
					= .("") ;
					= ?(=2,.("_"),.("_"))+ .;
					= ?(=2,.,.);
				;
			;
		;
	;

//_____________________________________________________________________________

 ()
	2 = .(.());
	 2 <>   = 2; ;
	 =2 
		=1;
		nDocType=100;
	
		=0;
		nDocType=101;
	;
	..();
	..();
	..();
	

//_____________________________________________________________________________

 ()
	 =.();
	
	.(1);
	 =1 
		 = ();
		 = ();
	;
	=(());
	=..;
	
	.(2,"");
	.(3,"");
	.(1," .  ");
	.(2," ");
	.(3,"   /.");
	.(4," ");
	 =0 
		.(1);
	
		.(.());
		 =3 
			..(0);
			..(0);
		;
	;
	();
	

//_____________________________________________________________________________

 ()
	=("._");
	();
	 ()>0  
		.(_69);
		.=();
		_ = .N_;
		 = .;
		= .("");
		= ?(=2,.,.);
		= ?(=2,.("_"),.("_"))+ .;
		.();
	;

//_____________________________________________________________________________

 ()
	//	();

//_____________________________________________________________________________
 ()
	="";

//_____________________________________________________________________________
 ()
	=;
	 = "";
	 (.)<>"" 
		=;
		=.;
		=.;
	
		=;
	;
	 ("    ?",4)=6 
		 () = "" 
			 = (".");
			.();
			 .()>0 
				.();
				.();
				.();
				 = .();
			
				=;
			;
			
		;
		 = ("._");
		();
		 () =1 
			.(_69);
			  = 2 
				 . <>  
					. = ;
					.N___ =;
					.=;
					.=;
					.();
				;
			  = 3 
				 . <>  
					. = ;
					.N___ =;
					.=;
					.=;
					//_69. = ;
					.();
				;
			;
		;
		("!",40);
	;

//_____________________________________________________________________________

 ()
	OraDatabase.Parameters.Remove("nActionID");
	OraDatabase.Parameters.Remove("PriceDate");
	OraDatabase.Parameters.Remove("nCarID");
	OraDatabase.Parameters.Remove("nGoodsID");
	OraDatabase.Parameters.Remove("Price");
	OraDatabase.Parameters.Remove("Pr_BEZ_NDS");
	OraDatabase.Parameters.Remove("InclNDS");
	OraDatabase.Parameters.Remove("Is_Set");
	OraDatabase.Parameters.Remove("CurrID");
	OraDatabase.Parameters.Remove("PrError");
	OraDatabase.Parameters.Remove("NormZagr");
	OraDatabase.Parameters.Remove("Incl_ZDT");

//_____________________________________________________________________________
 (CompID,ReestrNum,nDocType)
	 ,,,,,,_,,_,__,,IsPrihod;
	 ;

	 OraDatabase.Parameters.Count>2 
		();
	;
	OraDynaset = OraDatabase.DbCreateDynaset("select is_prihod from doc_type_1s where doc_type="+nDocType , 0);
	IsPrihod=(OraDynaset.Fields("is_prihod").Value);
	 IsPrihod=0 
        SQL_="select t.KOD_VAG_1S,c.contract_id as contract,decode(e1.subconto3,0,action_buy,c.contract_id) as action,"+
        "action_buy as ActionBuy,action_sell as ActionSell,"+
        "NVL(real_company_buy,0) as real_comp,nvl(station_otgr,0) as station,"+
        "decode("+CompID+"-c.we,0,c.partner,c.we) as partner,car.full_zdt as full_zdt, t.car_id as car_id "+
        "from contract c,doc_1s_table t,doc_1s_header h,car,entry e1,entry e2 "+
        "where"+
        " t.doc_id=h.doc_id and company_id="+CompID+" and reestr_number="+ReestrNum+" and doc_type="+nDocType+
         " and t.car_id=car.car_id"+
         " and  (t.STATE=-2 or t.E_CAR_REALIZED=1)"+
         " and e1.subconto3=e2.subconto3-1 and e1.doc_id=e2.doc_id"+
         " and e1.registr='' and e2.registr='' and e1.doc_vid='CAR' and e2.doc_vid='CAR'"+
         " and e1.partion_id=e2.partion_id and decode(e1.is_debt,-1,e1.subconto2,e1.we)="+CompID+
         " and e1.subconto1=c.contract_id and e1.doc_id=t.car_id"+
         " and is_invoice_buy=0 and is_invoice_sell=0";
    
		SQL_="select t.KOD_VAG_1S,c.contract_id as contract,decode(e2.subconto3,nvl(ch.max_no+1,1),action_sell,c.contract_id) as action,"+
        "action_buy as ActionBuy,action_sell as ActionSell,"+
        "NVL(real_company_sell,0) as real_comp,nvl(station_pryb,0) as station,"+
        "decode("+CompID+"-c.we,0,c.partner,c.we) as partner,car.full_zdt as full_zdt, t.car_id as car_id "+
        "from contract c,doc_1s_table t,doc_1s_header h,car,entry e1,entry e2,(select chain_id,max(chain_contract_no) max_no from chain_contract group by chain_id) ch "+
        "where"+
        " t.doc_id=h.doc_id and company_id="+CompID+" and reestr_number="+ReestrNum+" and doc_type="+nDocType+
         " and t.car_id=car.car_id"+
         " and  (t.STATE=-2 or t.E_CAR_REALIZED=1)"+
         " and e1.subconto3=e2.subconto3-1 and e1.doc_id=e2.doc_id"+
         " and e1.registr='' and e2.registr='' and e1.doc_vid='CAR' and e2.doc_vid='CAR'"+
         " and e1.partion_id=e2.partion_id and decode(e2.is_debt,-1,e2.we,e2.subconto2)="+CompID+
         " and e2.subconto1=c.contract_id and e2.doc_id=t.car_id"+
		 " and car.chain_id=ch.chain_id(+)"+
         " and is_invoice_buy=0 and is_invoice_sell=0";
	;
	("CompID=" +CompID + " ReestrNum="+ReestrNum+"  nDocType="+nDocType);
	
//	
      OraDynaset = OraDatabase.DbCreateDynaset(SQL_, 0);
	  Count_Vag =OraDynaset.RecordCount;
//	 
	//  ((SQL_,1,100));
	//  ((SQL_,101,100));
	//  ((SQL_,201,100));
	//  ((SQL_,301,100));
	//  ((SQL_,401,100));
	//  ((SQL_,501,100));
	//  ((SQL_,601));
	//  Count_Vag=0;
	//; 	
	// Count_Vag =OraDynaset.RecordCount; 
	 
	 = (".");
	 = ("._");
	= (".");
	 = (".");
	(" "+ ?(IsPrihod=0,"","")+" :  " + OraDynaset.RecordCount+" ");
	 = ();
	 =1  Count_Vag //OraDynaset.RecordCount   //    

		 = (".");
		=OraDynaset.Fields("KOD_VAG_1S").Value;
		Car_ID= (OraDynaset.Fields("CAR_ID").Value);
		Tarif=(OraDynaset.Fields("FULL_ZDT").Value);
        ActionBuy=(OraDynaset.Fields("ActionBuy").Value);
        ActionSell=(OraDynaset.Fields("ActionSell").Value);
		=.(,(0));
		 <>1 
			("    " + + "  !");
			OraDynaset.DbMoveNext();
			;
		 . <>  
			(" " + .N_ + "    " + + "   !");
			OraDynaset.DbMoveNext();
			;
		;
		//   
		=OraDynaset.Fields("PARTNER").Value;
		=.();
		 <>1 
			(" " + .N_ +" (_"++"):   " + + "    1!");
			OraDynaset.DbMoveNext();
			;
		;
		 =.();
		.();
		=0;
		 = (OraDynaset.Fields("CONTRACT").Value);
		(" ="++";  ="+ +";="+);
		= .();
		//  =0  ("    "++" ="+.);;
		 .()=1 
			 ((.)=)	     // (.()=1)
				=1;
				;
			;
		;

		      // =.(OraDynaset.Fields("CONTRACT").Value,1);
		  =0 
			("     " + +"   "++"!");
			        // =.(,0);
			        //  =1 
			        //("   - ....");
			        //;
		;
		//		   	OraDynaset.DbMoveNext();
		//;
		 = .();
		 () ="" 
			("     " + OraDynaset.Fields("CONTRACT").Value+"!");
		;
		 OraDynaset.Fields("CONTRACT").Value= OraDynaset.Fields("ACTION").Value 
			 = ;
			Action=OraDynaset.Fields("CONTRACT").Value; 
			IS_CHECK = 1;
		
			.();
			Action=OraDynaset.Fields("ACTION").Value;
			 =.(Action,1);
			IS_CHECK = 0;
			 =1 
				 .()=0 
					 = .();
				
					//("      " + RstTable("ACTION_POST"));
					(" " + .N_ +"-"++" (_"++"):      " + OraDynaset.Fields("ACTION").Value);
					OraDynaset.DbMoveNext();
					; //    
				;
			
				(" " + .N_ +"-"++" (_"++"):      " + OraDynaset.Fields("ACTION").Value);
				OraDynaset.DbMoveNext();
				; //    
			;
		;
		=.(OraDynaset.Fields("REAL_COMP").Value);
		 <>1 
			(" " + .N_ +"-"++" (_"++"):-/.   " +OraDynaset.Fields("REAL_COMP").Value + "    1!");
		;
         = (OraDynaset.Fields("STATION").Value);
		= .();
         = 0;
		//  =0  ("  ");;
		 .()=1 
			 (((./10))=)	
                 = (.);
                 =1;
				;
			;
		;
		//=.(OraDynaset.Fields("STATION").Value);
		 <>1 
			(" " + .N_ +"-"++" (_"++"):   " +OraDynaset.Fields("STATION").Value + "  !");
             = 0;
		;
		 IsPrihod=0 
			. = ;
			. = ;
			.N___ = ;
			. =.();
			.=;
			.=..;
		
			. = ;
			. = ;
			.N___ = ;
			. =.();
			.=;
			.=..;
		;
		 ((.=0)  ((.)=1)) 
			.=Tarif;
		;
		=.;

         =.(.);
		__=;//..(.);

		// , -  
		.();
		=.("");
		 .()=1 
			=0;
			=0;
			=0;
			=0;
			=0;
			_=0;
			=0;
			_=0;
			__=0;
			=0;
			=..;
			 =; //..(.);
			 (.N___. = ..)
			 (.N___. = ..)
			 (.. = ..)
			 (.. = ..) 
				=0;
			;

            OraDynaset2 = OraDatabase.DbCreateDynaset("select goods_shortname from goods_dict where goods_id="+(..) , 0);
            GoodsName=OraDynaset2.Fields("goods_shortname").Value;
            //OraDatabase.Parameters("nGoodsID").Value =(..) ;

             IS_CHECK = 1   
				OraDatabase.Parameters.Add ("p",-1,1);
				OraDatabase.Parameters.Add ("n",-1,1);
				OraDatabase.Parameters.Add ("c","-1",2);  
				OraDatabase.DbExecuteSQL ("begin params.set_p_number(2,-1); end;");
				OraDatabase.DbExecuteSQL ("begin params.set_p_number(3,-1); end;");
				OraDatabase.DbExecuteSQL ("begin params.set_p_char(4,'-1'); end;");
    			OraDatabase.DbExecuteSQL ("begin Realize1S.price_inner1s("+Car_ID+","++",'"+GoodsName+"',to_date('"+.+"','dd.mm.rr'),"+
                    ActionBuy+","+ActionSell+",NULL,NULL,NULL,NULL,NULL,NULL,"+.+",:p,:n,:c);end;");
				OraDynaset2 = OraDatabase.DbCreateDynaset ("select params.p_number(2) as Price_Inner,params.p_number(3) as Norma_Zagr,decode(params.p_char(4),'RUR',1,'USD',2,'DEM',3,'EUR',4,0) as CurrID from dual",0);
				=(OraDynaset2.Fields("Price_Inner").Value);
				=(OraDynaset2.Fields("Norma_Zagr").Value); 
				=(OraDynaset2.Fields("CurrID").Value);
				InclNDS=0;  
				InclZDT=0;                  
				OraDatabase.Parameters.Remove ("p");
				OraDatabase.Parameters.Remove ("n");
				OraDatabase.Parameters.Remove ("c");
			
			    SQL_Par=Action+","++",'"+GoodsName+"',to_date('"+.+"','dd.mm.rr'),"+
                    ActionBuy+","+ActionSell+",NULL,NULL,NULL,NULL,NULL,NULL";
                OraDynaset2 = OraDatabase.DbCreateDynaset("select GetPrice.Price("+SQL_Par+") Price from dual",0); 
                =(OraDynaset2.Fields("Price").Value);
                OraDynaset2 = OraDatabase.DbCreateDynaset("select GetPrice.Incl_Nds("+SQL_Par+") InclNds from dual",0);
                InclNDS=(OraDynaset2.Fields("InclNds").Value);
                OraDynaset2 = OraDatabase.DbCreateDynaset("select GetPrice.How_Pay_Zdt("+SQL_Par+") InclZDT from dual",0);
                InclZDT=(OraDynaset2.Fields("InclZDT").Value);
                OraDynaset2 = OraDatabase.DbCreateDynaset("select decode(GetPrice.Currency("+SQL_Par+"),'RUR',1,'USD',2,'DEM',3,'EUR',4,0) CurrID from dual",0);
                =(OraDynaset2.Fields("CurrID").Value);
                OraDynaset2 = OraDatabase.DbCreateDynaset("select GetPrice.Norma_Zagr("+SQL_Par+") NormaZagr from dual",0);
                =(OraDynaset2.Fields("NormaZagr").Value);
			;	
              <> -1     
				=(?(IsPrihod=0,...,...));
				 <>  
					 =1  =1  =(,.);;
						 =1  =1  =(,.);;
							=?(=0,0,*/);
						;
						 = .*;
						//***************    ************************/
						  InclZDT = 0 
							 = ..;
							=0;
                         InclZDT = 1 
							 = ..;
							 = . * . /;
						  //-1,-2
							 = ..;
							 =0   = 50; ;
							 = . / ;
							  >1  =1;;
							  > (. / )  =. /  ;;
							 = . * ;
						;
						  >    =; ;
						 =  -  ;
						//*********************************************************************************/
						  InclNDS = 1 
							_ = ..;
							 = .* +  *(1+__/100) ;
							_ = .**/( + 100);
							 =  - _;
						
							_ = ..;
							 = .*  *(1+/100) +  *(1+__/100) ;
							_= .*  *(/100);
						;
						__ = *(__/100) ; //     ""
						 = _ + __ ;
						 IsPrihod=0 
							._=;
							._=;
							._=;
							._=;
							._=;
							.__=_;
							._=;
							.__=_;
							.__=__;
							._=;
						
							._=;
							._=;
							._=;
							._=;
							._=;
							.__=_;
							._=;
							.__=_;
							.___=__;
							._=;
						;
					
						(" " + .N_ +"-"++" (_"++"):     "+GoodsName);
					;
				;//   
				. = 1;
				.();
				//  
				();
				 = 0;
				 () = 1  //   
					 _69 = .() 
						 = 1;  = .N_; =.; =;
						;
					;
				; //   
				  = 0 
					 = (" "+.N_+"    ,
					|      !
					|   ?" ,4);
					  =6 
						();
						_69 = .();
						 = .N_; =.;
						=;
					;
				;

				OraDynaset.DbMoveNext();
				 ="";
    ;  //  
//			();

		
		//_____________________________________________________________________
		 ()
			
			 ,SQL_rep,,Err;
			// ;
			
			=("");
			.("");
			=();
			=();
			.("");
			//    OraSession = CreateObject("OracleInProcServer.XOraSession");
			//  OraDatabase = OraSession.OpenDatabase("orax", UName+"/"+UserPass, 0);
			SQL_rep="select reestr_number,reestr_date,shortname,nvl(car_number,'.')  car_number,nvl(to_char(date_post_1s,'dd.mm.yyyy'),'') date_post_1s ,nvl(to_char(date_post_gupta, 'dd.mm.yyyy'),'') date_post_gupta,nvl(nvl(act_number,nacladn),'') as act_number "+
			",nvl(to_char(act_date, 'dd.mm.yyyy'),'') act_date,nvl(goods_shortname,'') goods_shortname,nvl(weight,0) weight,nvl(price_1s,0) price_1s,nvl(price_gupta,0) price_gupta,e_car_realized,e_car_closed,e_dif_post_date,e_price,e_no_weight, e_potr_le_post,e_act_g_reestr from v_car_analize_res1 where company_id="++" and reestr_number="++" order by shortname,reestr_number,car_number";
			
			OraDynaset = OraDatabase.DbCreateDynaset(SQL_rep, 0);
			="";
			For Rownum = 1 To OraDynaset.RecordCount  do
				=OraDynaset.Fields("reestr_number").Value;
				  <> 
					.("_");
					=;
				;
				="";
				  OraDynaset.Fields("e_car_realized").Value="1" 
					="+";
				;
				
				.("");
				 (OraDynaset.Fields("e_potr_le_post").Value)=1  ("  "+OraDynaset.Fields("car_number").Value +"  :      !"); ;
				 (OraDynaset.Fields("e_act_g_reestr").Value)=1  ("  "+OraDynaset.Fields("car_number").Value +"  :      !"); ;
				 (OraDynaset.Fields("e_dif_post_date").Value)=1  ("  "+OraDynaset.Fields("car_number").Value +"  :    1   ORACLE !"); ;
				OraDynaset.DbMoveNext();
			EndDo;
			.(0,0,0,0);
			.(1);
			.();
			
			
			
		
		//_____________________________________________________________________________
		 ()
			
			 ,SQL_rep,,Err;
			//	 ;
			=("");
			.("");
			=();
			=();
			.("");
			SQL_rep="select reestr_number,reestr_date,shortname,nvl(car_number,'') car_number,nvl(to_char(date_post, 'dd.mm.yyyy'),'') date_post,nvl(nvl(act_number,nacladn),'') as act_number, "+
			"nvl(to_char(act_date, 'dd.mm.yyyy'),'') act_date,error from v_car_search_res where company_id="++"and reestr_number="++" order by shortname,reestr_number,error,car_number";
			OraDynaset = OraDatabase.DbCreateDynaset(SQL_rep, 0);
			
			="";
			For Rownum = 1 To OraDynaset.RecordCount  do
				=OraDynaset.Fields("reestr_number").Value;
				  <> 
					.("_");
					=;
				;
				Err=OraDynaset.Fields("error").Value;
				 Err = "1"  Err= "   ";
				 Err = "2"  Err= "     ";
				 Err = "3"  Err= "    ";
				 Err = "4"  Err= "  ";
				 Err = "5"  Err= "   ";
				 Err = "6"  Err= "   ";
				 Err = "7"  Err= "   ";
				 Err = "8"  Err= "     ";
				  Err = "";
				;
				
				.("");
				OraDynaset.DbMoveNext();
			EndDo;
			.(0,0,0,0);
			.(1);
			.();
		
		//__________________________________________________________________________________________
		 ()
			 (+"
			| ?",4)=6 
				 1;
			
				();
				 0 ;
			;
		
		//_____________________________________________________________________________
		 ()
			 (.)=1 
				ActDate="null";
			
				ActDate=" to_date('"+. +"','dd.mm.rr')";
			;
			 (.)=1 
				DatePotr="null";
			
				DatePotr=" to_date('"+. +"','dd.mm.rr')";
			;
			 (.)=1 
				DatePost="null";
			
				DatePost=" to_date('"+.+"','dd.mm.rr')";
			;
			
			   ((((.)=0)  ((.)=0))  ((.N__)=0)) 
				 (" "+.()+"   
				| -          !");
			;
			 (.N_)=1 
				 (" "+.()+"    -   !");
			;
			 0;
		
		
		//_____________________________________________________________________________
		 ()
			 doc_id,,;
			
			 ()=1 
				 ("  . !",40);
				;
			;
			();
			
			 OraDatabase.Parameters.Count<>0 
				OraDatabase.Parameters.Remove("err_msg");
				OraDatabase.Parameters.Remove("Count");
			;
			("   ORACLE");
			OraDatabase.Parameters.Add ("err_msg","",2);
			OraDatabase.DbExecuteSQL ("begin Realize1S.del_from_doc_1s("++","++"); end;");
			
			SQL_Header="begin insert into doc_1s_header (doc_id,doc_type,company_id,reestr_number,reestr_date,old_reestr_id,partner,contract_id,LINK_PARTNER,LINK_CONTRACT) values (sqdoc_1s_header.NEXTVAL,"+nDocType+","++",'"++"', to_date('"+ +"','dd.mm.rr'),"+().ORACLE+","+()..+","+()..+",1,1); exception when others then :err_msg:=SQLERRM; end; ";
			OraDatabase.DbExecuteSQL (SQL_Header);
			 OraDatabase.Parameters("err_msg").Value<>"" 
				("    :"+OraDatabase.Parameters("err_msg").Value);
				("!   ",40);
			
				=("._");
				SQL_Table="";
				();
				 ()>0  
					.(_69);
					 ()=1 
						();
						OraDatabase.Parameters.Remove("err_msg");
						;
					;
					//=(".");
					//.("_");
					//=.();
					// =..(.);
					 =.(.);
					OraDatabase.Parameters("err_msg").Value="";
					SQL_Table="begin insert into doc_1s_table (row_id,doc_id,car_number,date_post_1s,date_potr_1s,act_number,act_date,nacladn,action_id,kod_vag_1s,full_tarif, DOP_RASH) values (SQDOC_1S_TABLE.NEXTVAL,sqdoc_1s_header.CURRVAL,LTRIM(RTRIM('"+.N_+"')),"+DatePost+","+DatePotr+",LTRIM(RTRIM('"+.+"')),"+ActDate +","+"LTRIM(RTRIM('"+.N__+"')),"+?(nDocType=100,.N___.,.N___.)+","+.+","+.+","+.+");"+
					" exception when others then :err_msg:=SQLERRM; end; ";
					OraDatabase.DbExecuteSQL (SQL_Table);
					 OraDatabase.Parameters("err_msg").Value<>"" 
						("      "+.N_+":"+OraDatabase.Parameters("err_msg").Value);
						;
					;
					SQL_Item="";
					.();
					 .()>0 
						=?(nDocType=100,._,._);
						 ?(nDocType=100,.__,.__)=.. 
							=/(1+*0.01);
						;
						 (.)=1  ; ;
						OraDatabase.Parameters("err_msg").Value="";
						SQL_Item="begin insert into doc_1s_item (row_id,row_number,goods_id,zdt,price_1s,weight) values (SQDOC_1S_TABLE.CURRVAL,"+(.-1)+","+..+","+?(nDocType=100,._,._)+","++","+.+"); exception when others then :err_msg:=SQLERRM; end; ";
						OraDatabase.DbExecuteSQL (SQL_Item);
						 OraDatabase.Parameters("err_msg").Value<>"" 
							("       "+.N_+":"+OraDatabase.Parameters("err_msg").Value);
							;
						;
					;
				;
				(" ");
				OraDatabase.DbExecuteSQL ("begin Realize1S.Check_Reestr_1S75("++","++"); end;");
				(" ");
				OraDatabase.DbExecuteSQL ("begin Realize1S.Check_Car_1S75("++","++"); end;");
				("   ORACLE ");
				OraDatabase.DbExecuteSQL ("begin Realize1S.Find_By_Number75("++","++"); end;");
				("  1     ORACLE");
				OraDatabase.DbExecuteSQL ("begin Realize1S.Get_Car_Info75("++","++"); end;");
				("   ORACLE    1,   ");
				OraDatabase.DbExecuteSQL ("begin Realize1S.Check_Car_Item_1S75("++","++"); end;");
				(" ");
				OraDatabase.Parameters.Add ("Count",0,1);  
				OraDatabase.DbExecuteSQL ("begin params.set_p_number(1,0); end;");
				OraDatabase.DbExecuteSQL ("begin Realize1S.Realize_Car_1S75("++","++","+_+",:Count); end;");
				OraDynaset = OraDatabase.DbCreateDynaset ("select params.p_number(1) as Cnt from dual",0);
				CountCar = (OraDynaset.Fields("Cnt").Value);
				
				OraDynaset = OraDatabase.DbCreateDynaset("select doc_id,old_reestr_id from doc_1s_header where company_id="++" and reestr_number="+ , 0);
				ORACLE=OraDynaset.Fields("old_reestr_id").Value;
				doc_id=OraDynaset.Fields("doc_id").Value;
				("     1");
				EmpDynaset = OraDatabase.CreateDynaset("select kod_vag_1s , car_id from doc_1s_table where e_car_search=0 and doc_id="+doc_id, 0);
				=("._");
				For Rownum = 1 To EmpDynaset.RecordCount  do
					.(EmpDynaset.Fields("kod_vag_1s").Value,(0));
					.=EmpDynaset.Fields("car_id").Value ;
					.();
					EmpDynaset.DbMoveNext();
				EndDo;
				("   /");
				(,,nDocType);
				 CountCar<>() 
					// __________   ___________________________________
					();
					();
				;
			;
			OraDatabase.Parameters.Remove("err_msg");
			OraDatabase.Parameters.Remove("Count");
			("");
			C = "#" ;   
		
		
		
		//_____________________________________________________________________________
		 ()
			();
			();
			();
		
		//_____________________________________________________________________________
		 ()
			
			 (()) = "" 
				("    (),       !",40);
				(0);
				;
			;
			 = ("._");
			.();
			. = ();
			. = ;
			. = .. ;
			. = ..;
			. = ;
			 =2 
				. =  ;
				. =  ;
				. = ;
				.=.;
				. = .;
			  =3  
				. =  ;
				. =  ;
				. = ;
				.=.;
				. = .;
			;
			 = (".");
			.();
			
			  .()=1 
				.();
				.();
				 .()=1 
					=.();
				
					=;
				;
			
				=;
			;
			  =2 
				.N___ = ;
			
				.N___ = ;
			;
			.();
			();
			_69 = .();
			(.(),0);
			//("");
		
		//_____________________________________________________________________________
		 ()
			 ,,,,,,,,, ;
			 , , ,,, ;
			
			 = .(.());
			
			=((.));
			=.;
			=(".");
			=(".");
			.(.);
			.(..);
			=((.));
			=("");
			 =3 
				.(()+"mxl\akt_PPC.mxl");
			
				.(()+"mxl\akt_PP.mxl");
			;
			.("");
			.(9,9);
			.("_");
			=("._");
			=(".");
			=0;
			=0;
			=0;
			=0;
			=0;
			=0;
			=0;
			=0;
			();
			.("");
			.();
			 .()>0  
				. = (._69.);
			;
			//(,"");
			.("");
			//(,"");
			//();
			.();
			 .()>0  
				.(._69);
				//=(".");
				//.("_");
				//=.();
				// =..(.);
				 =.(.);
				 =3 
					 (.)<>"" 
						.(.);
						=.;
						=.;
					;
				;
				=+.;
				=+.;
				=0;
				.();
				 .()>0 
					=+.;
				;
				//("="+);
				.();
				 .()>0 
					=?(=2,._,._);
					 ?(=2,.__,.__)=.. 
						=?(=2,._,._)/(1+*0.01);
					;
					=?(=2,?(._=..,?(=4,.*./.(""),._),._),._);
					=?(=0,0,.*./);
					=?(=0,0,.*./);
					=+1;
					=+.;
					//=+?(=2,._,._);
					=+?(=2,._,._);
					//=+?(=2,._,._);
					=+;
					=+?(=2,._,._);
					.("");
				;
			;
			 = 	 - ;
			.("");
			
			
			.(0,0,0,0);
			.(0);
			.();
			
		
		//_____________________________________________________________________________
		 ()
			=("   ?","+") ;
			 ( = "") 
				(0);
			;
		
		//_____________________________________________________________________________
		 ()
			
			 = ("._");
			.(_69);
			=("    .    ?",3) ;
			//(" = " + );
			 ( = 6)  ( = 7) 
				();
				. = "";
				.();
				 =6  .(0); ;
			
				// 	(" " );
				;
			;
			 = "#" ;
			
		
		
		//_____________________________________________________________________________
		 ()
			  , ;
			=.();
			 =1   
				.();
				.();
				.();
			;
		
		//_____________________________________________________________________________
		 (,)
			 , ;
			 = ("");
			.("");
			.("");
			.("");
			.("");
			 = ("");
			 = ("");
			69 = ("");
			 = 1;  ="";
			
			();
			 ()>0  
				69.(_69);
				69.();
				 =1 
					 =1  .() 
						 = .();
						=+?(=1,"",",")+;
					;
					.();
					.();
					.("");
				;
				 =  .();
				  = 1  .() 
					.();
					. = 69.;
				;
				.(,+1,,);
				.();
				. = 69.;
				. = 69.;
				. = 69.;
				. = 69.;
				
				=+1;
			;
			
			
			.("",",,");
			.(",,_",",_,_,_,_,_,___,__,__,__,_,_");
			
			//(,"");
			
			 = ("");
			.();
			 .() = 1 
				
				
				 =1 
					.();
				
					 .()<>1 
						(+"  !!");
						;
					
						();
					;
				;
				
				
				=.;
				 =2  // 
					. = .;
					. = ;
					. = ;
					.=" "+.+"  "+..;
				 // 
					. =;
					. =  ..;
					. = ..;
					.=" "+.+"  "+.. ;
				;
				
				
				
				="";
				=0; =0; =0;
				. = .;
				.=.;
				.=.;
				.=.;
				. = ;
				
				.(); 
		//(,"");
				//*    
~1:			 =  .(); 
				  = 1    
					//("*"+);
					.(); 
					 (.<>.)  (.=0) 
						.();
						//=1;   = .(); 
						 ~1;
					;
				;
				
				
				  =2 
					.20 = .("_") + .("_");
					. = .("_");
					.= .("___");
				
					.20 = .("_") + .("_");
					. = .("_");
					.= .("__");
				;
				. = ..;
				
				20_ = 0;
				10_ = 0;
				
				.();
				 .() = 1 
					.();
					. = ..;
					. = .;
					. = ..;
					. = ..;
					. = .;
					
					  =2   
						. = ._/.;
						. = .__;
						. = ._-._-.___;
					
						. = ._/.;
						. = .__;
						. = ._-._-.__;
						
					;
					
					. = .;
					. = . - .;
					20_ = 20_ + .;
					
				;
				
				(); ="";
				 () = 1 
					 _69. = . 
						=+?(="","",?(_69.N_="","",", "))+(_69.N_);
					;
				;
				.=;
				
				.20 = 20_;
				.10 = 10_;
				. = ;
				
				.();
				.(.());
				
			;
			
			
			
			// ,   ,   
			=("");
			1=("");
			 = (".");
			();
			 ()>0  
				 = _69;
				.();
				 = .();
				 (.)<>"" 
					 = .(.);
					 =0 
						 .(.)=1 
							.(0);
						;
					;
				;
				
				 = .;
				
				 =1  .() 
					 = .();
					1.();
					 = 1.();
					 . =  
						.=;
						.();
						;
					;
				;
				
			;
			
			
			 =1 
				 =2 
					=.();
					();
				;
			;
			
			
			
		
		
		
		
		
		//___________________________________________________
		 ()
			  , ;
			 ()>0 
				("   !"++"     !",40);
				=();
				 =1   
					();
					();
					();
				;
				
			;
			 ()<>"" 
				="";
			;
			=1;
		
		
		//_____________________________________________________________________________
		 ()
			=0;
			=1;
			
			
			=(".");
			
			 ( = 1)  (()="")   //   
				=1; //   
			 .()=0 
				=1;
			
				=0;
			;
			 =1 
				=(" -?",4);
				  =6  // 
					=1;
					(,1);
				;
			;
			
			
		
		//_____________________________________________________________________________
		 ()
			 .()=1 
				
			;
			.();
		
		//_____________________________________________________________________________
		 ()
			 ;
			//	();
			//	  <> 1   //   
			(, );
			//	;
			();
			//. = ""+ N_+ "/"+ . +"/"+ ;
			  (()<>"")  (()=1) 
				  = ("  .  -?",4,20);
				  = 6 
					=(".");
					(,0);
				;
			;
		
		//_____________________________________________________________________________
		 ()
			 ()<>"" 
				=(".");
				 .()=1 
					 = ("  - " + (.) +"  " + (.),4);
					 =6 
						.(0);
						="";
						 = "#" ;
					;
				;
			;
		
		//_____________________________________________________________________________
		
		 ()
			//=(".");
			();
			//();
		
		//_____________________________________________________________________________
		 ()
			 (=2)  (()=1) 
				 ("   -!",40);
				;
			;
			=("");
			=(".");
			//.("_");
			// ("  ?",4,20)=6 
			.(()+"mxl\schf_rn.mxl");
			//
			//	.(()+"mxl\schf_r.mxl");
			//;
			 = ("");
			 =2  // 
				.();
			
				();
				 () = 1 
					 (_69..()=1) 
						 (.(_69.)=0) 
							.(_69.);
						;
					
						("  "+_69+"   -!");
					;
				;
			;
			
			 = ("");
			.("");
			.("");
			.("");
			.("");
			
			 = 1  .() 
				 = .();
				//.();
				.("");
				.("_");
				();
				 () = 1 
					 (_69.=)  (=2) 
						.();
						.=_69.;
						.=_69.N_;
						.=(_69.("_")+_69.("_"),"14.2-'");
						.=(_69.("_")+_69.("_")+_69.("_"),"14.2-'");
					;
				;
				 = .();
				.();
				 =1  ( ( - 1) / 3 ) + 1 
					 = *3-2;
					1=""; 1="";  1=""; 1="";
					2=""; 2="";  2=""; 2="";
					3=""; 3="";  3=""; 3="";
					  <=  
						.();
						1=.;
						1=.;
						1=.;
						1=.;
					;
					 +1 <=  
						.(+1);
						2=.;
						2=.;
						2=.;
						2=.;
					;
					 +2 <=  
						.(+2);
						3=.;
						3=.;
						3=.;
						3=.;
					;
					
					.("_");
				;
				
				.("_");
				.();
				=0;
				 .()=1 
					=+1;
					 = ; //....();
					.("");
				;
				 (.) >0 
					.("_4");
				;
				 (.) >0 
					.("_11");
				;
				
				.("");
				.();
				
				
			;
			
			.(0,0,0,0,"");
			.(0);
			.(" -","");
			
		
		//_____________________________________________________________________________
		
		 ()            // ()
			 ,,, ;
			=" "+.;
			=(".");
			=(".");
			//=(".");
			=("._");
			=("");
			=("");
			 =2 
				//.("1");
				.(()+"mxl\reestr1.mxl");
			
				//.("2");
				.(()+"mxl\reestr2.mxl");
			;
			=((. ));
			
			 = .(.());
			 =("");
			=();
			="//{{(qq)
			| ;
			| ;
			|    ;
			|=._."+?(=2,"","")+";
			| = ._.;
			| = ._.;
			| = ._.;
			| ;
			| ;
			| ( = );
			|"//}}
			;
			=1;
			.();
			 .("")=1 
				=.;
				 >1 
					.("");
					.();
				;
				.(..);
				.(..);
				=((.));
				.("");
				=0;
				=0;
				=0;
				=0;
				=0;
				=0;
				=0;
				=0;
				=0;
				 .("")=1 
					.(.);
					=+1;
					//=(".");
					//.("_");
					//=.();
					// =..(.);
					 =.(.);
					 = .("");
					.();
					 .()>0 
						=?(=2,._,._);
						 ?(=2,.__,.__)=.. 
							=/(1+*0.01);
						;
						=.*./;
						=.*./;
						=+1;
						=+.;
						=+?(=2,._,._);
						=+?(=2,._,._);
						=+?(=2,._,._);
						=+?(=2,._,._);
						=+;
						=+;
						
						.("");
					;
				;
				=+1;
			;
			.("");
			.(0,0,0,0,"");
			.(0);
			.(?(=2,"   ","   "),"");
		
		//_____________________________________________________________________________
		
		 ()
			(0);
		
		//_____________________________________________________________________________
		 1()
			 ;
			 (=2)  (()=1) 
				 ("   -!",40);
				;
			;
			=("");
			=(".");
			=("._");
			//.("_");
			.(()+"mxl\schf_rn.mxl");
			.();
			.("");
			.("_8");
			.("_");
			
			//=(".");
			//.("_");
			//=.();
			
			();
			 ()>0  
				// =..(.);
				 =.(.);
				.(_69);
				.();
				 .()>0 
					=._;
					 .__=.. 
						=/(1+*0.01);
					;
					 = ;//....(.);
					=._+.__;
					//(.("_")+.("___")); //*./.("");
					=0;
					=0;
					.("_9");
				;
				 . <>0 
					.("_12");
				;
				
				 .("_")<>0 
					.("_10");
				;
				
				
			;
			.("");
			
			.(0,0,0,0,"");
			.(0);
			.(" -","");
			
		
		//_____________________________________________________________________________
		
		 ()
			();
			=("._");
			 () = 1 
				 .(_69)=1 
					.();
				;
			;
			
		
		//_____________________________________________________________________________
		 ()
			 ;
			 = (".");
			=(".");
			//=(".");
			//.("_");
			//=.();
			.(.);
			.();
			.();
			 =.(.);
			 = ;// ..(.);
			.=;
			.=(.)+"/"+((.,"",""));
			.=;
			.=("");
			.=("")*/(100+);
			
			.="     "++" "+.+" ."++
			" - "+ ()+"  "++ " . (.-." +(.) +"  "+.+ " .)" ;
			.();
			 = .();
			
			(.(),0);
			
		
		//_____________________________________________________________________________
		 ()
			(,0);
		
		//_____________________________________________________________________________
		 ()
			 ()<>"" 
				=(".");
				 .()=1 
					 = ("  . . " + (.) +"  " + (.),4);
					 =6 
						.(0);
						="";
						 = "#" ;
					;
				;
			;
		
		//_____________________________________________________________________________
		// ()
		//
		//************************************
		//_____________________________________________________________________________
		 ()
			 = ("._");
			 = .("_");
			.();
			//. = .;
			. = .;
			
			 (.. = ..)
			 (.. = ..) 
				=1;
			
				=0;
			;
			
			  = 1  .() 
				 = .().;
				 ="" 
					 = ();
					;
				 (="")  (="")
				 (="")  (="") 
					;
				
					 = .();
				;
				.(,);
			;
			
			
			.();
			 .() = 1 
				.();
				  = 1  .() 
					 = .().;
					 = .();
					.(,);
				;
			;
			.();
			("  < >  "+.+"  "+.);
			 ;
		 //
		//_____________________________________________________________________________
		 ()
			 .()<>"" 
				(0);
				;
			;
			
			
				();
				 = .("");
				  = 1  .() 
					 = .().;
					 ="" 
						 = "ORACLE";
					 (="")  (="") 
						;
					
						 = ;
					;
					 =  .();
					(,);
				;
				
				//();
				
				.();
				 .() = 1 
					();
					  = 1  .() 
						 = .().;
						 ="" 
							 = "_";
						 (="") 
							;
						 (="") 
							 =  .();
							 =  ();
							("_69",.());
							;
						
							 = ;
						;
						 =  .();
						(,);
					;
				;
				
				 = .();
				();
			
				();
				("     - "+(),"!");
				("    !");
			;
		 //()
		
		
		//**************************************************
		//**************************************************
		 = ("");
		
		
		
		
		
		
		
		
		
