# Date: 03/07/06 # Version: 105 $DOC(SD_INDOC) name=Входящий документ class=1 product=ALD_FUND name_formula=$TEXT(11563218) .ITEM_NAME(@indoc_type_id)+' №'+@in_no+' от '+.DATE_TO_STR(@in_date)+ (case when @out_no is not null then ' (исх.№'+@out_no+isnull((' от '+.DATE_TO_STR(@out_date)),'')+')' else '' end) $ENDTEXT(11563218) remark_formula=$TEXT(11563218) .ITEM_NAME(@indoc_type_id)+' №'+@in_no+' от '+.DATE_TO_STR(@in_date)+ (case when @out_no is not null then ' (исх.№'+@out_no+isnull((' от '+.DATE_TO_STR(@out_date)),'')+')' else '' end) $ENDTEXT(11563218) $STATE(ARCH) name=В архиве class=0 $ENDSTATE $STATE(DEL) name=Удален class=2 $ENDSTATE $STATE(ED) name=Редактируется class=0 $ENDSTATE $STATE(FIX) name=Принят class=0 $ENDSTATE $STATE(NEW) name=Начальный class=1 $ENDSTATE $PROP(IN_NO) name=Номер регистрации field_name=in_no table_name=t_sd_indocs field_type=varchar field_length=50 field_scale=null field_prec=50 page=1 order=4 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(IN_DATE) name=Дата регистрации field_name=in_date table_name=t_sd_indocs field_type=datetime field_length=8 field_scale=3 field_prec=23 page=1 order=2 init_class=1 init_formula=.OPERDAY unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(IN_TIME) name=Время регистрации field_name=in_time table_name=t_sd_indocs field_type=datetime field_length=8 field_scale=3 field_prec=23 page=1 order=5 init_class=1 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(INDOC_TYPE_ID) name=Тип входящего документа field_name=indoc_type_id table_name=t_sd_indocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=6 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(CORR_NAME) name=Наименование корреспондента field_name=corr_name table_name=t_sd_indocs field_type=varchar field_length=255 field_scale=null field_prec=255 page=1 order=7 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(OUT_NO) name=Исходящий номер field_name=out_no table_name=t_sd_indocs field_type=varchar field_length=50 field_scale=null field_prec=50 page=1 order=3 init_class=2 init_formula='б/н' unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(OUT_DATE) name=Исходящая дата field_name=out_date table_name=t_sd_indocs field_type=datetime field_length=8 field_scale=3 field_prec=23 page=1 order=1 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(DOCUMENT_FORM_ID) name=Форма передачи документа field_name=document_form_id table_name=t_sd_indocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=8 init_class=1 init_formula=1 unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(FOLDER_ID) name=Папка field_name=folder_id table_name=t_sd_indocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=9 init_class=2 init_formula=.DEPO_FOLDER_DEFAULT unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(OWNER_ID) name=Фонд field_name=owner_id table_name=t_sd_indocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=10 init_class=2 init_formula=.ORGANIZATION unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(COMMENT) name=Примечание field_name=comment table_name=t_sd_indocs field_type=varchar field_length=255 field_scale=null field_prec=255 page=1 order=11 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(CORR_ID) name=Id корреспондента field_name=corr_id table_name=t_sd_indocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=12 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(SD_INDOC_ACT_ID) name=ID акта приема - передачи field_name=sd_indoc_act_id table_name=t_sd_indocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=13 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(QTY_LIST) name=Количество листов field_name=qty_list table_name=t_sd_indocs field_type=int field_length=4 field_scale=0 field_prec=10 page=1 order=14 init_class=1 init_formula=1 unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(RELATION_ID) name=Признак:входящий по СД или СР field_name=relation_id table_name=t_sd_indocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=15 init_class=1 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(SEND_DATE) name=Дата отправки field_name=send_date table_name=t_sd_indocs field_type=datetime field_length=8 field_scale=3 field_prec=23 page=1 order=16 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $RELATION(REL1) class=0 type=FUND_GROUP form=null prop=OWNER_ID idname=null order=10 $ENDRELATION $RELATION(REL6) class=0 type=SIMPLES form=null prop=RELATION_ID idname=null order=null $ENDRELATION $RELATION(REL2) class=4 type=D_DEPO_FOLDERS form=null prop=FOLDER_ID idname=null order=null $ENDRELATION $RELATION(REL3) class=1 type=ACTIONS_HISTORY form=UO_ACTIONS_HISTORY_LIST prop=null idname=null order=110 $ENDRELATION $RELATION(REL4) class=0 type=SD_INDOC_TYPES form=null prop=INDOC_TYPE_ID idname=null order=20 $ENDRELATION $RELATION(REL5) class=1 type=SD_INDOC2DOC form=FORM3 prop=null idname=indoc_id_s order=100 $ENDRELATION $RELATION(REL7) class=0 type=SD_INDOC_ACT form=null prop=SD_INDOC_ACT_ID idname=null order=30 $ENDRELATION $FORM(FORM1) name=Просмотр class=5 filter=null target_state= uo=uo_edit dw=d_sd_indoc_edit procedure=ap_sd_indoc_view patterns=GENERIC_VIEW_ITEM user_define=1 isvisible=0 istab=1 posx=0 posy=0 width=2217 height=1456 proc_text=$TEXT(11563221) create procedure dbo.%PROC% @sid varchar(30) = null, @copy int = null as .BEGIN('N') .CHECK_USER .CHECK_VIEW_ITEM if @id = -1 or @copy=1 begin .GET_PROPS if @id = -1 begin .CHECK_INSERT .INIT_VARS(B) end if exists(select 1 from t_item2class i, t_classvalues v, t_classes c where i.item_id=@owner_id and i.value_id=v.id and v.class_id=c.id and c.code='DOCNO_PREFIX' and v.code='IN_PREFIX' and .ITEMS_EXISTS(i.id)) select @in_time=dateadd(mi,1,max(d.in_time)) from t_sd_indocs d where d.owner_id=@owner_id and d.in_date=@in_date and .ITEM_STATE_CODE(d.id) in ('FIX','ARCH') else select @in_time=dateadd(mi,1,max(d.in_time)) from t_sd_indocs d where d.in_date=@in_date and .ITEMS_EXISTS(d.id) and .ITEM_STATE_CODE(d.id) in ('FIX','ARCH') if @in_time is null or .DATE_NORM(@in_date,B)=.DATE_NORM((getdate()),B) select @in_time=.TIME_FROM_DATE((getdate())) if @copy=1 begin select @id=-1, @sid=null select @state_id = (select id from t_states where type_id=@type_id and class_id=1) select @in_no=null end begin tran .INSERT_ITEMS .INSERT commit tran end .VIEW_ITEM .END $ENDTEXT(11563221) $ACTION2RELATION(REL4.INDOC_NAME) relation=REL4 where=null prop=INDOC_NAME order=1 alias=indoc_name $ENDACTION2RELATION $ACTION2RELATION(REL1.PARTNER_CODE) relation=REL1 where=null prop=PARTNER_CODE order=3 alias=fond_code $ENDACTION2RELATION $ACTION2RELATION(REL1.PARTNER_NAME) relation=REL1 where=null prop=PARTNER_NAME order=4 alias=fond_name $ENDACTION2RELATION $ACTION2RELATION(REL7.IN_NO_ACT) relation=REL7 where=null prop=IN_NO_ACT order=5 alias=in_no_act $ENDACTION2RELATION $ENDFORM $FORM(FORM2) name=Список class=4 filter=FORM4 target_state= uo=uo_list dw=d_sd_indoc_list procedure=ap_30000000000173152 patterns=GENERIC_VIEW_LIST user_define=1 isvisible=0 istab=0 posx=0 posy=0 width=4663 height=2692 proc_text=$TEXT(11563221) create procedure dbo.%PROC% @sid varchar(30) = null .ARGLIST_FILTER, @ctrl_comp_id_s varchar(30) = null as .BEGIN('N') .CHECK_USER .CHECK_VIEW_LIST .ARGCONVERT_FILTER declare @ctrl_comp_id_nn numeric(18,0) declare @ctrl_comp_id_bb numeric(18,0) declare @ctrl_comp_id_ee numeric(18,0) if @ctrl_comp_id_s is NULL or @ctrl_comp_id_s='' begin select @ctrl_comp_id_nn = null select @ctrl_comp_id_bb = -999999999999999998 select @ctrl_comp_id_ee = 999999999999999999 end else begin select @ctrl_comp_id_nn = convert(numeric,@ctrl_comp_id_s) select @ctrl_comp_id_bb = @ctrl_comp_id_nn select @ctrl_comp_id_ee = @ctrl_comp_id_nn end --.VIEW_LIST select sid = convert(varchar, t_items.id), state_sid = convert(varchar, t_items.state_id), type_sid = convert(varchar, t_items.type_id), t_items.item_name , state_name=(select t_states.state_name from t_states where t_states.id=t_items.state_id), type_name=(select t_types.type_name from t_types where t_types.id=t_items.type_id), t_sd_indocs.out_date as out_date_d, t_sd_indocs.in_date as in_date_d, t_sd_indocs.out_no, t_sd_indocs.in_no, t_sd_indocs.in_time as in_time_d, convert(varchar,t_sd_indocs.indoc_type_id) as indoc_type_id_s, t_sd_indocs.corr_name, convert(varchar,t_sd_indocs.document_form_id) as document_form_id_s, convert(varchar,t_sd_indocs.folder_id) as folder_id_s, convert(varchar,t_sd_indocs.owner_id) as owner_id_s, t_sd_indocs.comment, convert(varchar,t_sd_indocs.corr_id) as corr_id_s, convert(varchar,t_sd_indocs.sd_indoc_act_id) as sd_indoc_act_id_s, t_sd_indocs.qty_list, convert(varchar,t_sd_indocs.relation_id) as relation_id_s, t_sd_indocs.send_date as send_date_d, r1861581670_30000000000173144.partner_code as owner_code, r138847957_30000000000173137.indoc_name as indoc_name, r2123623104_30000000000209470.in_no_act as in_no_act --.VIEW_CALC , convert(integer,((case when (select upper(t_states.state_code) from t_states where t_states.id=t_items.state_id)='ED' then null else 1 end))) as fix from #state_list, t_items , t_sd_indocs , t_partners r1861581670_30000000000173144 , t_sd_indoc_types r138847957_30000000000173137 , t_sd_indocs_act r2123623104_30000000000209470, t_partners t2, td_pay_fond where #state_list.state_id = t_items.state_id and t_items.id = t_sd_indocs.id and t_sd_indocs.owner_id *= r1861581670_30000000000173144.id and t_sd_indocs.indoc_type_id *= r138847957_30000000000173137.id and t_sd_indocs.sd_indoc_act_id *= r2123623104_30000000000209470.id and (t_sd_indocs.folder_id is null or exists(select 1 from #folders_list where folder_id=t_sd_indocs.folder_id)) and (t_sd_indocs.in_date between @in_date_bb and @in_date_ee or @in_date_nn is null ) and isnull(rtrim(ltrim(upper(t_sd_indocs.in_no))),'') LIKE isnull('%'+rtrim(ltrim(upper(@in_no_nn)))+'%','%') and (t_sd_indocs.indoc_type_id between @indoc_type_id_bb and @indoc_type_id_ee or @indoc_type_id_nn is null ) and isnull(rtrim(ltrim(upper(t_sd_indocs.corr_name))),'') LIKE isnull('%'+rtrim(ltrim(upper(@corr_name_nn)))+'%','%') and (t_sd_indocs.owner_id between @owner_id_bb and @owner_id_ee or @owner_id_nn is null ) and (t_sd_indocs.sd_indoc_act_id between @sd_indoc_act_id_bb and @sd_indoc_act_id_ee or @sd_indoc_act_id_nn is null ) and (t_sd_indocs.relation_id between @relation_id_bb and @relation_id_ee or @relation_id_nn is null ) and (isnull(upper(ltrim(rtrim(t_items.item_remark))),'') LIKE isnull('%'+upper(ltrim(rtrim(@item_remark))) + '%','%')) and (t2.id between @ctrl_comp_id_bb and @ctrl_comp_id_ee or @ctrl_comp_id_nn is null ) and td_pay_fond.ctrl_comp_id=t2.id and td_pay_fond.id=t_sd_indocs.owner_id order by t_sd_indocs.in_no, .DATE_NORM(t_sd_indocs.in_date,B), .TIME_FROM_DATE(t_sd_indocs.in_time) .END $ENDTEXT(11563221) $ACTION2RELATION(REL4.INDOC_NAME) relation=REL4 where=null prop=INDOC_NAME order=1 alias=indoc_name $ENDACTION2RELATION $ACTION2RELATION(REL1.PARTNER_CODE) relation=REL1 where=null prop=PARTNER_CODE order=4 alias=owner_code $ENDACTION2RELATION $ACTION2RELATION(REL7.IN_NO_ACT) relation=REL7 where=null prop=IN_NO_ACT order=5 alias=in_no_act $ENDACTION2RELATION $CALC(FIX) class=1 type=integer calc_lenght=null calc_prec=null calc_scale=null formula=$TEXT(11563221) (case when (select upper(t_states.state_code) from t_states where t_states.id=t_items.state_id)='ED' then null else 1 end) $ENDTEXT(11563221) label=Редактируется или нет документ order=1 $ENDCALC $ENDFORM $FORM(FORM4) name=Фильтр class=6 filter=null target_state= uo=uo_filter dw=d_sd_indoc_filter procedure=ap_30000000000173154 patterns=null user_define=1 isvisible=1 istab=0 posx=0 posy=0 width=2199 height=856 proc_text=$TEXT(11563221) create procedure dbo.%PROC% as begin declare @in_date_db datetime declare @in_date_de datetime select @in_date_db = .OPERDAY select @in_date_de = @in_date_db declare @owner_id numeric declare @owner_code varchar(100) select @owner_id = .ORGANIZATION select @owner_code = (select partner_code from t_partners where id=@owner_id) declare @ctrl_comp_id numeric, @ctrl_company_name varchar(100) select @ctrl_comp_id=(select ctrl_comp_id from td_pay_fond where id=@owner_id) select @ctrl_company_name = (select partner_code from t_partners where id=@ctrl_comp_id) select @in_date_db as in_date_db, @in_date_de as in_date_de, convert(varchar(50), null) as in_no, convert(varchar(30), null) as indoc_type_id_s, convert(varchar(255), null) as corr_name, convert(varchar(50), null) as in_no_act, convert(varchar(30), @owner_id) as owner_id_s, @owner_code as owner_code, convert(varchar(255), null) as indoc_name, convert(varchar(30), null) as sd_indoc_act_id_s, convert(varchar(30),null) as relation_id_s, convert(varchar(30), @ctrl_comp_id) as ctrl_comp_id_s, @ctrl_company_name as ctrl_company_name end $ENDTEXT(11563221) $FILTER(RELATION_ID) type=1 label=Принадлежность к СД или СР prop=RELATION_ID arg_code=null arg_type=null arg_length=null arg_prec=null arg_scale=null $ENDFILTER $FILTER(CORR_NAME) type=3 label=Наименование корреспондента prop=CORR_NAME arg_code=null arg_type=null arg_length=null arg_prec=null arg_scale=null $ENDFILTER $FILTER(INDOC_TYPE_ID) type=1 label=Тип входящего документа prop=INDOC_TYPE_ID arg_code=null arg_type=null arg_length=null arg_prec=null arg_scale=null $ENDFILTER $FILTER(SD_INDOC_ACT_ID) type=1 label=ID акта приема - передачи prop=SD_INDOC_ACT_ID arg_code=null arg_type=null arg_length=null arg_prec=null arg_scale=null $ENDFILTER $FILTER(OWNER_ID) type=1 label=Фонд prop=OWNER_ID arg_code=null arg_type=null arg_length=null arg_prec=null arg_scale=null $ENDFILTER $FILTER(IN_NO) type=3 label=Номер регистрации prop=IN_NO arg_code=null arg_type=null arg_length=null arg_prec=null arg_scale=null $ENDFILTER $FILTER(IN_DATE) type=2 label=Дата регистрации prop=IN_DATE arg_code=null arg_type=null arg_length=null arg_prec=null arg_scale=null $ENDFILTER $ENDFORM $FORM(FORM5) name=Фильтр для отчета class=6 filter=null target_state= uo=uo_filter dw=d_sd_indoc_filter_rep procedure=ap_30000000000173873 patterns=null user_define=1 isvisible=0 istab=0 posx=0 posy=0 width=1481 height=508 proc_text=$TEXT(11563223) create procedure dbo.%PROC% as begin declare @in_date_db datetime declare @in_date_de datetime select @in_date_db = .OPERDAY select @in_date_de = @in_date_db declare @owner_id numeric declare @owner_code varchar(100) --select @owner_id = .ORGANIZATION --select @owner_code = (select partner_code from t_partners where id=@owner_id) declare @ctrl_comp_id numeric, @ctrl_company_name varchar(100) select @in_date_db as in_date_db_d, @in_date_de as in_date_de_d, convert(varchar(30), @owner_id) as owner_id_s, @owner_code as owner_code, convert(varchar(30), @ctrl_comp_id) as ctrl_comp_id_s, @ctrl_company_name as ctrl_company_name end $ENDTEXT(11563223) $FILTER(OWNER_ID) type=1 label=Фонд prop=OWNER_ID arg_code=null arg_type=null arg_length=null arg_prec=null arg_scale=null $ENDFILTER $FILTER(IN_DATE) type=2 label=Дата регистрации prop=IN_DATE arg_code=null arg_type=null arg_length=null arg_prec=null arg_scale=null $ENDFILTER $ENDFORM $FORM(FORM7) name=Входящие документы к акту class=4 filter=null target_state= uo=uo_list dw=d_sd_indoc_list procedure=ap_30000000000209474 patterns=null user_define=0 isvisible=1 istab=1 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(11563223) create procedure dbo.%PROC% @sid varchar(30) = null .ARGLIST_FILTER as .BEGIN('N') .CHECK_USER .CHECK_VIEW_LIST .ARGCONVERT_FILTER .VIEW_LIST order by t_sd_indocs.in_no, .DATE_NORM(t_sd_indocs.in_date,B), .TIME_FROM_DATE(t_sd_indocs.in_time) .END $ENDTEXT(11563223) $ACTION2RELATION(REL7.IN_NO_ACT) relation=REL7 where=null prop=IN_NO_ACT order=5 alias=in_no_act $ENDACTION2RELATION $ACTION2RELATION(REL4.INDOC_NAME) relation=REL4 where=null prop=INDOC_NAME order=1 alias=indoc_name $ENDACTION2RELATION $ACTION2RELATION(REL1.PARTNER_CODE) relation=REL1 where=null prop=PARTNER_CODE order=4 alias=owner_code $ENDACTION2RELATION $FILTER(SD_INDOC_ACT_ID) type=11 label=ID акта приема - передачи prop=SD_INDOC_ACT_ID arg_code=null arg_type=null arg_length=null arg_prec=null arg_scale=null $ENDFILTER $CALC(FIX) class=1 type=integer calc_lenght=null calc_prec=null calc_scale=null formula=$TEXT(11563223) (case when (select upper(t_states.state_code) from t_states where t_states.id=t_items.state_id)='ED' then null else 1 end) $ENDTEXT(11563223) label=Редактируется или нет документ order=1 $ENDCALC $ENDFORM $FORM(FORM_COPY) name=Просмотр копии class=5 filter=null target_state= uo=uo_edit dw=d_sd_indoc_edit procedure=ap_30000000000008245 patterns=GENERIC_VIEW_ITEM user_define=1 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(11563223) create procedure dbo.%PROC% @sid varchar(30) = null as .BEGIN('N') .CHECK_USER .CHECK_VIEW_ITEM exec ap_sd_indoc_view @sid, 1 .END $ENDTEXT(11563223) $ENDFORM $FORM(SD_INDOC2DOC_LIST) name=Входящие документы для привязки к документу class=4 filter=FORM4 target_state= uo=uo_list_disable dw=d_sd_indoc_list procedure=ap_30000000000173153 patterns=GENERIC_VIEW_LIST user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=4151 height=1012 proc_text=$TEXT(11563223) create procedure dbo.%PROC% @sid varchar(30) = null .ARGLIST_FILTER as .BEGIN('N') .CHECK_USER .CHECK_VIEW_LIST .ARGCONVERT_FILTER .VIEW_LIST and (t_sd_indocs.owner_id=@fund_id or isnull(@fund_id_s,'')='' or t_sd_indocs.owner_id is null) and t_sd_indocs.indoc_type_id in (select i.id from t_sd_indoc_types i, t_sd_indoc_types2types t where t.doc_type_id=@doc_type_id and i.id=t.indoc_type_id) and not exists(select 1 from t_sd_indoc2doc where doc_id=@doc_id and indoc_id=t_sd_indocs.id) order by t_sd_indocs.in_no, .DATE_NORM(t_sd_indocs.in_date,B), .TIME_FROM_DATE(t_sd_indocs.in_time) .END $ENDTEXT(11563223) $ACTION2RELATION(REL4.INDOC_NAME) relation=REL4 where=null prop=INDOC_NAME order=1 alias=indoc_name $ENDACTION2RELATION $ACTION2RELATION(REL1.PARTNER_CODE) relation=REL1 where=null prop=PARTNER_CODE order=4 alias=owner_code $ENDACTION2RELATION $ACTION2RELATION(REL7.IN_NO_ACT) relation=REL7 where=null prop=IN_NO_ACT order=5 alias=in_no_act $ENDACTION2RELATION $FILTER(FUND_ID) type=11 label=Фонд prop=null arg_code=fund_id arg_type=numeric arg_length=null arg_prec=18 arg_scale=0 $ENDFILTER $FILTER(DOC_TYPE_ID) type=11 label=Тип документа prop=null arg_code=doc_type_id arg_type=numeric arg_length=null arg_prec=18 arg_scale=0 $ENDFILTER $FILTER(DOC_ID) type=11 label=Документ prop=null arg_code=doc_id arg_type=numeric arg_length=null arg_prec=18 arg_scale=0 $ENDFILTER $CALC(FIX) class=1 type=integer calc_lenght=null calc_prec=null calc_scale=null formula=1 label=null order=1 $ENDCALC $ENDFORM $FORM(SD_INDOCS_REP) name=Просмотр отчета class=4 filter=FORM5 target_state= uo=uo_list_rep dw=d_sd_indoc_rep procedure=ap_30000000000173354 patterns=null user_define=1 isvisible=0 istab=0 posx=0 posy=0 width=4663 height=2692 proc_text=$TEXT(11563223) create procedure dbo.%PROC% @sid varchar(30) = null, @in_date_db_d varchar(30)=null, @in_date_de_d varchar(30)=null, @owner_id_s varchar(30) = null, @ctrl_comp_id_s varchar(30) = null as .BEGIN('N') .CHECK_USER declare @in_date_de datetime, @in_date_db datetime select @in_date_de=convert(datetime,@in_date_de_d,3), @in_date_db=convert(datetime,@in_date_db_d,3) if @in_date_de is null select @in_date_de=in_date from t_sd_indocs where id=@id if @in_date_de is null select @in_date_de=.OPERDAY if @in_date_db is null or @in_date_db>@in_date_de select @in_date_db=@in_date_de if @owner_id_s='' select @owner_id_s=null if @ctrl_comp_id_s='' select @ctrl_comp_id_s=null select @sid, (case when @in_date_de=@in_date_db then 'Дата: '+convert(varchar,@in_date_de,104) else 'За период с '+convert(varchar,@in_date_db,104)+' по '+convert(varchar,@in_date_de,104) end) as date_str, convert(varchar(36),@in_date_db,3) as in_date_db_d, convert(varchar(36),@in_date_de,3) as in_date_de_d, (select partner_name from t_partners where id=convert(numeric,@owner_id_s)) as owner_name, @owner_id_s as owner_id_s, @ctrl_comp_id_s as ctrl_comp_id_s , (select partner_name from t_partners where id=convert(numeric,@ctrl_comp_id_s)) as ctrl_name .END $ENDTEXT(11563223) $ENDFORM $FORM(SD_INDOCS_REP_DET) name=Перечень отчета class=4 filter=FORM5 target_state= uo=uo_list_rep dw=d_sd_indoc_rep_det procedure=ap_sd_indoc_rep_det patterns=null user_define=1 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(11563224) create procedure dbo.%PROC% @sid varchar(30) = null, @in_date_db_d varchar(30)=null, @in_date_de_d varchar(30)=null, @owner_id_s varchar(30) = null, @ctrl_comp_id_s varchar(30) = null as declare @in_date_de datetime, @in_date_db datetime, @owner_id numeric select @in_date_de=convert(datetime,@in_date_de_d,3), @in_date_db=convert(datetime,@in_date_db_d,3) if @in_date_de is null select @in_date_de=in_date from t_sd_indocs where id=convert(numeric,@sid) if @in_date_de is null select @in_date_de=.OPERDAY if @in_date_db is null or @in_date_db>@in_date_de select @in_date_db=@in_date_de select @in_date_de=.DATE_NORM(@in_date_de,B), @in_date_db=.DATE_NORM(@in_date_db,B) --if @owner_id_s='' select @owner_id_s=null declare @owner_id_nn numeric(18,0) declare @owner_id_bb numeric(18,0) declare @owner_id_ee numeric(18,0) if @owner_id_s is NULL or @owner_id_s='' begin select @owner_id_nn = null select @owner_id_bb = -999999999999999998 select @owner_id_ee = 999999999999999999 end else begin select @owner_id_nn = convert(numeric,@owner_id_s) select @owner_id_bb = @owner_id_nn select @owner_id_ee = @owner_id_nn end declare @ctrl_comp_id_nn numeric(18,0) declare @ctrl_comp_id_bb numeric(18,0) declare @ctrl_comp_id_ee numeric(18,0) if @ctrl_comp_id_s is NULL or @ctrl_comp_id_s='' begin select @ctrl_comp_id_nn = null select @ctrl_comp_id_bb = -999999999999999998 select @ctrl_comp_id_ee = 999999999999999999 end else begin select @ctrl_comp_id_nn = convert(numeric,@ctrl_comp_id_s) select @ctrl_comp_id_bb = @ctrl_comp_id_nn select @ctrl_comp_id_ee = @ctrl_comp_id_nn end /* declare @date_rep datetime select @date_rep=in_date from t_sd_indocs where id=convert(numeric,@sid) if @date_rep is null select @date_rep=.OPERDAY */ select @sid, t_sd_indocs.out_date as out_date_d, t_sd_indocs.in_date as in_date_d, t_sd_indocs.out_no, t_sd_indocs.in_no, t_sd_indocs.in_time as in_time_d, t_sd_indocs.corr_name, t_sd_indocs_act.in_no_act as act_no, t_sd_indocs.comment, t_sd_indoc_types.indoc_name as indoc_name, t_sd_indocs.send_date as send_date_d, t1.partner_name as owner_name from t_sd_indocs , t_sd_indoc_types, t_sd_indocs_act, t_partners t1, t_partners t2, td_pay_fond where .ITEMS_EXISTS_BY_TYPE(t_sd_indocs.id,'SD_INDOC') and upper(.ITEM_STATE_CODE(t_sd_indocs.id))<>'ED' and t_sd_indocs.indoc_type_id *= t_sd_indoc_types.id and .DATE_NORM(t_sd_indocs.in_date,B) between @in_date_db and @in_date_de --and (t_sd_indocs.owner_id between @owner_id_bb and @owner_id_ee or @owner_id_nn is null) and (t2.id between @ctrl_comp_id_bb and @ctrl_comp_id_ee or @ctrl_comp_id_nn is null ) and td_pay_fond.ctrl_comp_id=t2.id and td_pay_fond.id=t1.id and (t_sd_indocs.owner_id between @owner_id_bb and @owner_id_ee or @owner_id_nn is null) and (t1.id between @owner_id_bb and @owner_id_ee or @owner_id_nn is null ) -- and ((t_sd_indocs.owner_id=@owner_id and @owner_id is not null) or @owner_id is null) and t_sd_indocs.sd_indoc_act_id *= t_sd_indocs_act.id and (t_sd_indocs.relation_id <> 1 or t_sd_indocs.relation_id is null) and t_sd_indocs.owner_id=t1.id order by t_sd_indocs.in_no, .DATE_NORM(t_sd_indocs.in_date,B), .TIME_FROM_DATE(t_sd_indocs.in_time) $ENDTEXT(11563224) $ENDFORM $FORM(SR_INDOCS_REP) name=Просмотр отчета для СР class=4 filter=FORM5 target_state= uo=uo_list_rep dw=d_sr_indoc_rep procedure=ap_30000000003408561 patterns=null user_define=1 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(11563224) create procedure dbo.%PROC% @sid varchar(30) = null, @in_date_db_d varchar(30)=null, @in_date_de_d varchar(30)=null, @owner_id_s varchar(30) = null as .BEGIN('N') .CHECK_USER declare @in_date_de datetime, @in_date_db datetime select @in_date_de=convert(datetime,@in_date_de_d,3), @in_date_db=convert(datetime,@in_date_db_d,3) if @in_date_de is null select @in_date_de=in_date from t_sd_indocs where id=@id if @in_date_de is null select @in_date_de=.OPERDAY if @in_date_db is null or @in_date_db>@in_date_de select @in_date_db=@in_date_de if @owner_id_s='' select @owner_id_s=null declare @owner_id numeric select @owner_id=convert(numeric,@owner_id_s) select @sid, (case when @in_date_de=@in_date_db then 'Дата: '+convert(varchar,@in_date_de,104) else 'За период с '+convert(varchar,@in_date_db,104)+' по '+convert(varchar,@in_date_de,104) end) as date_str, convert(varchar(36),@in_date_db,3) as in_date_db_d, convert(varchar(36),@in_date_de,3) as in_date_de_d, (select partner_name from t_partners where id=@owner_id)+ case when @owner_id is null then '' else ' под управлением ' end +(select partner_name from t_partners p, td_pay_fond f where f.id=@owner_id and p.id=f.ctrl_comp_id) as owner_name, @owner_id_s as owner_id_s .END $ENDTEXT(11563224) $ENDFORM $FORM(SR_INDOCS_REP_DET) name=Перечень отчета для СР class=4 filter=FORM5 target_state= uo=uo_list_rep dw=d_sr_indoc_rep_det procedure=ap_sr_indoc_rep_det patterns=null user_define=1 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(11563224) create procedure dbo.%PROC% @sid varchar(30) = null, @in_date_db_d varchar(30)=null, @in_date_de_d varchar(30)=null, @owner_id_s varchar(30) = null as declare @in_date_de datetime, @in_date_db datetime, @owner_id numeric, @indoc_id numeric, @op_name varchar(255), @doc_id numeric, @doc_no varchar(255), @doc_name varchar(255), @doc_type varchar(255), @doc_date datetime select @in_date_de=convert(datetime,@in_date_de_d,3), @in_date_db=convert(datetime,@in_date_db_d,3) if @in_date_de is null select @in_date_de=in_date from t_sd_indocs where id=convert(numeric,@sid) if @in_date_de is null select @in_date_de=.OPERDAY if @in_date_db is null or @in_date_db>@in_date_de select @in_date_db=@in_date_de select @in_date_de=.DATE_NORM(@in_date_de,B), @in_date_db=.DATE_NORM(@in_date_db,B) if @owner_id_s='' select @owner_id_s=null select @owner_id=convert(numeric,@owner_id_s) -- Операции create table #rel( id numeric not null, opers varchar(255) null, docs varchar(255) null ) insert #rel (id) select t_sd_indocs.id from t_sd_indocs where .ITEMS_EXISTS_BY_TYPE(t_sd_indocs.id,'SD_INDOC') and upper(.ITEM_STATE_CODE(t_sd_indocs.id))<>'ED' and .DATE_NORM(t_sd_indocs.in_date,B) between @in_date_db and @in_date_de and ((t_sd_indocs.owner_id=@owner_id and @owner_id is not null) or @owner_id is null) and (t_sd_indocs.relation_id = 1 or t_sd_indocs.relation_id is null) declare opers cursor for select ' '+j.op_name+' №'+j.op_no+' от '+convert(varchar(8),j.op_date,3)+',', i.indoc_id from tr_reg_journal j, t_sd_indoc2doc i where (j.op_id=i.doc_id or j.item_id=i.doc_id) and i.indoc_id in (select id from #rel) order by j.op_date, j.op_no for read only open opers fetch opers into @op_name, @indoc_id while .CURSOR_STATE = 0 begin update #rel set opers=isnull(#rel.opers,'')+isnull(@op_name,'') where #rel.id=@indoc_id fetch opers into @op_name, @indoc_id end close opers .DEALLOCATE opers update #rel set opers=substring(#rel.opers,1,.CHAR_LENGTH(#rel.opers)-1) where .CHAR_LENGTH(#rel.opers)>0 /* -- Исх.документы --old declare docs cursor for select d.id, d.in_no, d.in_date, i.indoc_id from td_depo_docs d, t_sd_indoc2doc i where (d.foundation_id=i.doc_id or d.changed_item_id=i.doc_id) and i.indoc_id in (select id from #rel) and .ITEMS_EXISTS(d.id) order by d.in_date, d.in_no for read only open docs fetch docs into @doc_id, @doc_no, @doc_date, @indoc_id while .CURSOR_STATE = 0 begin select @doc_type=.ITEM_TYPE_CODE(@doc_id) select @doc_name = case when @doc_type='SR_REPORTS_REPORT_FOR_DATE_QTY' then 'Выписка о наличии паев на счете' when @doc_type='SR_REPORT_FOR_OPERATION' then 'Уведомление об операции' when @doc_type='SR_REPORT_REFUS' then 'Уведомление об отказе в совершении операции' when @doc_type='SR_REPORT_DU_ACC' then 'Выписка по счету доверительного управляющего' when @doc_type='SR_REPORT_FOR_PERIOD' then 'Выписка по счету за период' when @doc_type='SR_REPORT_ZD_ACC' then 'Выписка по счету залогодержателя' when @doc_type='SR_REPORT_ACC' then 'Выписка по счету владельца' else null end if @doc_name is not null update #rel set docs=isnull(#rel.docs,'') + ' ' + @doc_name +' №'+isnull(@doc_no,'') +' от '+isnull(convert(varchar(8),@doc_date,3),'')+',' where #rel.id=@indoc_id fetch docs into @doc_id, @doc_no, @doc_date, @indoc_id end close docs .DEALLOCATE docs */ -- Исх.документы --new declare docs cursor for select od.id, od.out_no, od.out_date, i.indoc_id from td_depo_docs d, t_sd_outdocs od, t_sd_indoc2doc i where (d.foundation_id=i.doc_id or d.changed_item_id=i.doc_id) and od.report_id=d.id and i.indoc_id in (select id from #rel) and .ITEM_STATE_CODE(od.id)='OUT' order by od.out_date, od.out_no for read only open docs fetch docs into @doc_id, @doc_no, @doc_date, @indoc_id while .CURSOR_STATE = 0 begin select @doc_name = item_name from t_items where id=@doc_id if @doc_name is not null update #rel set docs=isnull(#rel.docs,'') + ' ' + @doc_name+',' where #rel.id=@indoc_id fetch docs into @doc_id, @doc_no, @doc_date, @indoc_id end close docs .DEALLOCATE docs update #rel set docs=substring(#rel.docs,1,.CHAR_LENGTH(#rel.docs)-1) where .CHAR_LENGTH(#rel.docs)>0 select @sid, t_sd_indocs.out_date as out_date_d, t_sd_indocs.in_date as in_date_d, t_sd_indocs.out_no, t_sd_indocs.in_no, t_sd_indocs.in_time as in_time_d, t_sd_indocs.corr_name, t_sd_indocs_act.in_no_act as act_no, t_sd_indocs.comment, t_sd_indoc_types.indoc_name as indoc_name, #rel.opers as opers_list, #rel.docs as out_docs_list from t_sd_indocs , t_sd_indoc_types, t_sd_indocs_act, #rel where .ITEMS_EXISTS_BY_TYPE(t_sd_indocs.id,'SD_INDOC') and upper(.ITEM_STATE_CODE(t_sd_indocs.id))<>'ED' and t_sd_indocs.indoc_type_id *= t_sd_indoc_types.id and .DATE_NORM(t_sd_indocs.in_date,B) between @in_date_db and @in_date_de and ((t_sd_indocs.owner_id=@owner_id and @owner_id is not null) or @owner_id is null) and t_sd_indocs.sd_indoc_act_id *= t_sd_indocs_act.id and (t_sd_indocs.relation_id = 1 or t_sd_indocs.relation_id is null) and #rel.id=t_sd_indocs.id order by t_sd_indocs.in_no, .DATE_NORM(t_sd_indocs.in_date,B), .TIME_FROM_DATE(t_sd_indocs.in_time) $ENDTEXT(11563224) $ENDFORM $ACTION(#AP_SD_INDOC_NO_CH) name=#Переформирование №№ вх.док-тов (полное) class=9 form=null target_state=null procedure=ap_sd_indoc_no_ch patterns=null user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(11563224) create procedure dbo.%PROC% as declare @in_date datetime declare @in_no varchar(50) declare @in_time datetime declare @owner_id numeric declare @indoc_id numeric .TRANSACTION_SAVE create table #docs( id numeric, in_date datetime, in_time datetime null, owner_id numeric null ) insert into #docs (id,in_date,in_time,owner_id) select d.id,d.in_date,d.in_time,d.owner_id from t_sd_indocs d, t_items i, t_types t, t_states s where d.id=i.id and i.state_id=s.id and i.type_id=t.id and upper(t.type_code)='SD_INDOC' and s.class_id=0 and upper(s.state_code) in ('FIX','ARCH') begin tran update t_sd_indocs set in_no=null declare indocs cursor for select id,in_date,in_time,owner_id from #docs order by in_date, in_time for read only open indocs fetch indocs into @indoc_id,@in_date,@in_time,@owner_id while .CURSOR_STATE=0 begin select @in_no=null .SD_CHECK_DOCNO(t_sd_indocs,in_no,in_date,in_time,@in_no,@in_date,@in_time,'DOCNO_IN_PREFIX','IN_PREFIX',@owner_id,('ED')) update t_sd_indocs set in_no=@in_no where id=@indoc_id fetch indocs into @indoc_id,@in_date,@in_time,@owner_id end close indocs .DEALLOCATE indocs commit tran drop table #docs .TRANSACTION_RESTORE $ENDTEXT(11563224) $ENDACTION $ACTION(#AP_SD_INDOC_NO_CH_IRC) name=#Переформирование №№ вх.док-тов (Иркол) class=9 form=null target_state=null procedure=ap_sd_indoc_no_ch_irc patterns=null user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(11563224) create procedure dbo.%PROC% as SET DATEFIRST 1 declare @prefix_std varchar(40), @cnt_len integer select @prefix_std=ltrim(rtrim((.GET_CONST('DOCNO_IN_PREFIX')))) select @cnt_len=convert(integer,(.GET_CONST('DOCNO_CNT_LEN'))) if isnull(@prefix_std,'')='' or isnull(@cnt_len,0)<=0 return .TRANSACTION_SAVE create table #partners( id numeric null, partner_name varchar(255) null, prefix varchar(40) null ) insert into #partners (partner_name) select p.partner_name from t_partners p, t_items i, t_types t, t_states s where p.id=i.id and i.state_id=s.id and i.type_id=t.id and upper(t.type_code) in ('PARTNERS_JUR','PARTNERS_FIS','OTHER_PARTNERS','PIF_FUND','NPF_FUND') and s.class_id=0 and isnull(p.partner_name,'')<>'' group by p.partner_name having count(*)=1 and p.partner_name in (select t_sd_indocs.corr_name from t_sd_indocs where .ITEMS_EXISTS(t_sd_indocs.id)) update #partners set id=p.id from t_partners p, t_items i, t_types t, t_states s where p.id=i.id and i.state_id=s.id and i.type_id=t.id and upper(t.type_code) in ('PARTNERS_JUR','PARTNERS_FIS','OTHER_PARTNERS','PIF_FUND','NPF_FUND') and s.class_id=0 and p.partner_name=#partners.partner_name update #partners set prefix=(select max(i.code) from t_item2class i, t_classvalues v, t_classes c where i.item_id=#partners.id and i.value_id=v.id and v.class_id=c.id and c.code='DOCNO_PREFIX' and v.code='IN_PREFIX_IRC' and i.code is not null and .ITEMS_EXISTS(i.id)) update #partners set prefix=@prefix_std where isnull(#partners.prefix,'')='' select * from #partners begin tran update t_sd_indocs set corr_id=p.id from #partners p where p.partner_name=t_sd_indocs.corr_name and .ITEMS_EXISTS(t_sd_indocs.id) update t_sd_indocs set in_no=p.prefix + right(convert(varchar(4),datepart(yy,t_sd_indocs.in_date)),2) + replicate('0',2-.CHAR_LENGTH((convert(varchar(2),datepart(wk,t_sd_indocs.in_date))))) + convert(varchar(2),datepart(wk,t_sd_indocs.in_date)) + '0'+convert(varchar(1),datepart(dw,t_sd_indocs.in_date)) + right(t_sd_indocs.in_no,@cnt_len) from #partners p where p.id=t_sd_indocs.corr_id and isnull(t_sd_indocs.in_no,'')<>'' and .ITEMS_EXISTS(t_sd_indocs.id) update t_sd_indocs set in_no=@prefix_std + right(convert(varchar(4),datepart(yy,t_sd_indocs.in_date)),2) + replicate('0',2-.CHAR_LENGTH((convert(varchar(2),datepart(wk,t_sd_indocs.in_date))))) + convert(varchar(2),datepart(wk,t_sd_indocs.in_date)) + '0'+convert(varchar(1),datepart(dw,t_sd_indocs.in_date)) + right(t_sd_indocs.in_no,@cnt_len) where t_sd_indocs.corr_id is null and isnull(t_sd_indocs.in_no,'')<>'' and .ITEMS_EXISTS(t_sd_indocs.id) commit tran drop table #partners .TRANSACTION_RESTORE $ENDTEXT(11563224) $ENDACTION $ACTION(#AP_CHECK_STR_DATE) name=#Проверка даты из строки (форматы 1-5,10-12) class=9 form=null target_state=null procedure=ap_check_str_date patterns=GENERIC_MOVE user_define=1 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(11563224) create procedure dbo.%PROC% @str varchar(8), @yy int=1, -- позиция года @mm int=3, -- позиция месяца @dd int=5 -- позиция дня as -- для форматов типа dd/mm/yy, dd.mm.yy, ddmmyy в любой указанной последовательности dd,mm,yy declare @test varchar(2) select @test = substring(@str,@yy,2) if @test is null or .CHAR_LENGTH(@test)<>2 or not(@test like '[0-9][0-9]') return 1 select @yy=convert(integer,@test) select @test = substring(@str,@mm,2) if @test is null or .CHAR_LENGTH(@test)<>2 or not(@test like '[0,1][0-9]') return 1 select @mm=convert(integer,@test) if not(@mm between 1 and 12) return 1 select @test = substring(@str,@dd,2) if @test is null or .CHAR_LENGTH(@test)<>2 or not(@test like '[0-3][0-9]') return 1 select @dd=convert(integer,@test) if @mm in (1,3,5,7,8,10,12) and not(@dd between 1 and 31) return 1 if @mm in (4,6,9,11) and not(@dd between 1 and 30) return 1 if @mm=2 and (@yy%4)=0 and not(@dd between 1 and 29) return 1 if @mm=2 and (@yy%4)<>0 and not(@dd between 1 and 28) return 1 return 0 $ENDTEXT(11563224) $ENDACTION $ACTION(ACTION1) name=Добавить class=1 form=FORM1 target_state=ED procedure=ap_30000000000173155 patterns=GENERIC_INSERT user_define=0 isvisible=0 istab=1 posx=0 posy=0 width=2240 height=1468 proc_text=$TEXT(11563224) create procedure dbo.%PROC% @sid varchar(30) = null, .ARGLIST as .BEGIN('N') .CHECK_USER .CHECK_UPDATE .ARGCONVERT .INIT_VARS .TEST_UNIQUE begin tran if rtrim(ltrim((select partner_name from t_partners where id=@corr_id)))<>rtrim(ltrim(@corr_name)) select @corr_id=null --if @in_time is null or .TIME_STR(@in_time)='00:00:00' .EXIT_MESSAGE('Введите время регистрации') select @in_time=.TIME_FROM_DATE(@in_time) -- проверка акта if @sd_indoc_act_id is not null begin if isnull(@qty_list,0) < 1 .EXIT_MESSAGE('Введите кол-во листов') select @in_date = a.in_date, @in_time = a.in_time, @owner_id = a.owner_id, @corr_id = a.corr_id, @corr_name=(select partner_name from t_partners where id = a.corr_id) from t_sd_indocs_act a where a.id = @sd_indoc_act_id end .UPDATE_ITEMS .UPDATE .RELGEN .UPDATE_STATE .ACTION_HISTORY commit tran select sid = convert(varchar, @id) .END $ENDTEXT(11563224) $ENDACTION $ACTION(ACTION2) name=Изменить class=2 form=FORM1 target_state=null procedure=ap_30000000000173156 patterns=GENERIC_UPDATE user_define=0 isvisible=0 istab=1 posx=0 posy=0 width=2217 height=1452 proc_text=$TEXT(11563224) create procedure dbo.%PROC% @sid varchar(30) = null, .ARGLIST as .BEGIN('N') .CHECK_USER .CHECK_UPDATE .ARGCONVERT .TEST_UNIQUE begin tran if rtrim(ltrim((select partner_name from t_partners where id=@corr_id)))<>rtrim(ltrim(@corr_name)) select @corr_id=null --if @in_time is null or .TIME_STR(@in_time)='00:00:00' .EXIT_MESSAGE('Введите время регистрации') select @in_time=.TIME_FROM_DATE(@in_time) -- проверка акта if @sd_indoc_act_id is not null begin if isnull(@qty_list,0) < 1 .EXIT_MESSAGE('Введите кол-во листов') select @in_date = a.in_date, @in_time = a.in_time, @owner_id = a.owner_id, @corr_id = a.corr_id, @corr_name=(select partner_name from t_partners where id = a.corr_id) from t_sd_indocs_act a where a.id = @sd_indoc_act_id end .UPDATE_ITEMS .UPDATE .RELGEN .UPDATE_STATE .ACTION_HISTORY commit tran .END $ENDTEXT(11563224) $ENDACTION $ACTION(ACTION5) name=В архив class=9 form=null target_state=ARCH procedure=ap_30000000000173159 patterns=GENERIC_MOVE user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(11563224) create procedure dbo.%PROC% @sid varchar(30) = null as .BEGIN('N') .CHECK_USER .CHECK_UPDATE begin tran .UPDATE_STATE .ACTION_HISTORY /*-------Проводки ----------*/ commit tran .END $ENDTEXT(11563224) $ENDACTION $ACTION(ACTION6) name=Из архива class=9 form=null target_state=FIX procedure=ap_30000000000173160 patterns=GENERIC_MOVE user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(11563224) create procedure dbo.%PROC% @sid varchar(30) = null as .BEGIN('N') .CHECK_USER .CHECK_UPDATE begin tran .UPDATE_STATE .ACTION_HISTORY /*-------Проводки ----------*/ commit tran .END $ENDTEXT(11563224) $ENDACTION $ACTION(ACTION7) name=Удалить class=3 form=FORM1 target_state=DEL procedure=ap_30000000000173161 patterns=GENERIC_MOVE user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=2158 height=1164 proc_text=$TEXT(11563224) create procedure dbo.%PROC% @sid varchar(30) = null as .BEGIN('N') .CHECK_USER .CHECK_UPDATE begin tran update t_sd_indocs set in_no=null where id=@id .UPDATE_STATE .ACTION_HISTORY /*-------Проводки ----------*/ commit tran .END $ENDTEXT(11563224) $ENDACTION $ACTION(ACTION_COPY) name=Копировать class=2 form=FORM_COPY target_state=ED procedure=ap_30000000000008252 patterns=GENERIC_INSERT user_define=1 isvisible=0 istab=0 posx=0 posy=0 width=2149 height=1348 proc_text=$TEXT(11563224) create procedure dbo.%PROC% @sid varchar(30) = null, .ARGLIST as .BEGIN('N') .ARGCONVERT .INIT_VARS .TEST_UNIQUE begin tran if rtrim(ltrim((select partner_name from t_partners where id=@corr_id)))<>rtrim(ltrim(@corr_name)) select @corr_id=null --if @in_time is null or .TIME_STR(@in_time)='00:00:00' .EXIT_MESSAGE('Введите время регистрации') select @in_time=.TIME_FROM_DATE(@in_time) -- проверка акта if @sd_indoc_act_id is not null begin if isnull(@qty_list,0) < 1 .EXIT_MESSAGE('Введите кол-во листов') select @in_date = a.in_date, @in_time = a.in_time, @owner_id = a.owner_id, @corr_id = a.corr_id, @corr_name=(select partner_name from t_partners where id = a.corr_id) from t_sd_indocs_act a where a.id = @sd_indoc_act_id end .UPDATE_ITEMS .UPDATE .UPDATE_STATE .RELGEN .ACTION_HISTORY commit tran select sid = convert(varchar, @id) .END $ENDTEXT(11563224) $ENDACTION $ACTION(INDOC_FIX) name=Принять class=9 form=null target_state=FIX procedure=ap_sd_indoc_fix patterns=GENERIC_MOVE user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(11563224) create procedure dbo.%PROC% @sid varchar(30) = null as .BEGIN('N') .CHECK_USER .CHECK_UPDATE begin tran .GET_PROPS .SD_CHECK_DOCNO(t_sd_indocs,in_no,in_date,in_time,@in_no,@in_date,@in_time,'DOCNO_IN_PREFIX','IN_PREFIX',@owner_id,('ED')) -- Иркол --.SD_CHECK_INDOCNO_IRC(t_sd_indocs,in_no,in_date,in_time,@in_no,@in_date,@in_time,'DOCNO_IN_PREFIX','IN_PREFIX_IRC',@corr_id,('ED')) -- проверка акта if @sd_indoc_act_id is not null begin if upper(.ITEM_STATE_CODE(@sd_indoc_act_id))<>'FIX' .EXIT_MESSAGE('Акт приема-передачи не принят') if isnull(@qty_list,0) < 1 .EXIT_MESSAGE('Введите кол-во листов') select @in_date = a.in_date, @in_time = a.in_time, @owner_id = a.owner_id, @corr_id = a.corr_id, @corr_name=(select partner_name from t_partners where id = a.corr_id) from t_sd_indocs_act a where a.id = @sd_indoc_act_id end --update t_sd_indocs set in_no=@in_no where id=@id .UPDATE .UPDATE_ITEMS .UPDATE_STATE .ACTION_HISTORY commit tran .END $ENDTEXT(11563224) $ENDACTION $ACTION(INDOC_ROLL) name=На редактирование class=9 form=null target_state=ED procedure=ap_30000000000173158 patterns=GENERIC_MOVE user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(11563224) create procedure dbo.%PROC% @sid varchar(30) = null as .BEGIN('N') .CHECK_USER .CHECK_UPDATE begin tran /* if exists(select 1 from t_sd_indoc2doc where t_sd_indoc2doc.indoc_id=@id and .ITEMS_EXISTS(t_sd_indoc2doc.doc_id)) .EXIT_MESSAGE('Существуют связанные документы') */ declare @deldoc_id_s varchar(30) declare deldocs cursor for select convert(varchar(30),t_sd_indoc2doc.id) from t_sd_indoc2doc where t_sd_indoc2doc.indoc_id=@id and .ITEMS_EXISTS(t_sd_indoc2doc.doc_id) order by 1 for read only open deldocs fetch deldocs into @deldoc_id_s while .CURSOR_STATE=0 begin exec ap_sd_indoc2doc_del @deldoc_id_s fetch deldocs into @deldoc_id_s end close deldocs .DEALLOCATE deldocs .UPDATE_STATE .ACTION_HISTORY /*-------Проводки ----------*/ commit tran .END $ENDTEXT(11563224) $ENDACTION $ACTION(SD_INDOC_CREATE4OPER) name=Генерация вх.документа по операции class=9 form=null target_state=ED procedure=ap_sd_indoc_create4oper patterns=GENERIC_MOVE user_define=1 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(11563226) create procedure dbo.%PROC% @sid varchar(30) = null, @doc_id numeric = null, @indoc_type_id numeric = null, @in_date datetime = null, @in_time datetime = null, @out_date datetime = null, @out_no varchar(50) = null, @corr_id numeric = null, @owner_id numeric = null, @document_form_id numeric = null, @folder_id numeric = null as if @indoc_type_id is null return .BEGIN('N') declare @in_no varchar(50) declare @in_time_last datetime declare @corr_name varchar(255) declare @comment varchar(255) declare @sd_indoc_act_id numeric declare @qty_list int declare @relation_id numeric declare @send_date datetime -- OUT if @out_no is null select @out_no='б/н' -- IN_DATE if @in_date is null select @in_date=.OPERDAY -- IN_TIME if exists(select 1 from t_item2class i, t_classvalues v, t_classes c where i.item_id=@owner_id and i.value_id=v.id and v.class_id=c.id and c.code='DOCNO_PREFIX' and v.code='IN_PREFIX' and .ITEMS_EXISTS(i.id)) select @in_time_last=dateadd(mi,1,max(d.in_time)) from t_sd_indocs d where d.owner_id=@owner_id and d.in_date=@in_date and .ITEM_STATE_CODE(d.id) in ('FIX','ARCH') else select @in_time_last=dateadd(mi,1,max(d.in_time)) from t_sd_indocs d where d.in_date=@in_date and .ITEMS_EXISTS(d.id) and .ITEM_STATE_CODE(d.id) in ('FIX','ARCH') if @in_time is null begin if @in_time_last is null or .DATE_NORM(@in_date,B)=.DATE_NORM((getdate()),B) select @in_time=.TIME_FROM_DATE((getdate())) else select @in_time=@in_time_last end else begin if @in_time_last is not null and .TIME_FROM_DATE((@in_time_last)) > .TIME_FROM_DATE((@in_time)) select @in_time=@in_time_last end -- CORR_NAME select @corr_name=partner_name from t_partners where id = @corr_id if isnull(@corr_name,'')='' select @corr_name='Не задан' -- FOLDER if @folder_id is null select @folder_id=.DEPO_FOLDER_DEFAULT begin tran .INSERT_ITEMS .INSERT .UPDATE_STATE .ACTION_HISTORY select @sid=convert(varchar(30),@id) .EXEC_ACTION(@sid,'SD_INDOC','INDOC_FIX') -- Вставка привязки вх.док-та к платежу if @doc_id is not null begin .TYPE_INIT('SD_INDOC2DOC',1) .TYPE_ASSIGN(indoc_id,@id,1) .TYPE_ASSIGN(doc_id,@doc_id,1) .TYPE_INSERT('SD_INDOC2DOC','CRT',1) end commit tran .END $ENDTEXT(11563226) $ENDACTION $ACTION(SD_DOC_NAMES_STR_CH) name=#Переформирование записи о вх.док-тах class=9 form=null target_state=null procedure=ap_sd_doc_names_str_ch patterns=null user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(11563226) create procedure dbo.%PROC% as .TRANSACTION_SAVE create table #ops( id numeric null, doc_name varchar(255) null ) create table #ops_rec( id numeric null, item_id numeric null, head_id numeric null, purpose_id numeric null ) insert into #ops_rec (id, item_id) select o.id, o.item_id from t_sd_asset_ops o where .ITEMS_EXISTS_BY_TYPE(o.id,'SD_ASSET_OPERS') insert into #ops (id) select o.id from t_sd_asset_ops o where .ITEMS_EXISTS_BY_TYPE(o.id,'SD_ASSET_OPERS') update #ops_rec set purpose_id=s.perpose_id from ts_sd_stock_moves s where s.id=#ops_rec.item_id update #ops_rec set head_id=(case when (.ITEM_TYPE_CODE(#ops_rec.item_id) in ('D_STOCK_IN_OTHER_DEPO_SD','D_STOCK_OUT_OTHER_DEPO','FOUNDATION_DOCS_SD')) and (.PURPOSE_CODE(#ops_rec.purpose_id) in (6002,6005)) then (select foundation_id from ts_sd_stock_moves where id=#ops_rec.item_id) when .ITEM_TYPE_CODE(#ops_rec.item_id)in ('SD_PAYBANK_IN','SD_PAYBANK_OUT') then (select bank_acc_rep_id from t_paydocs where id=#ops_rec.item_id) else null end) .ID_VAR(@rec_id) .NAME_VAR(@indoc_name) declare indocs cursor for select distinct i.item_name+':', r.id from t_items i, t_sd_indoc2doc d, #ops_rec r where (d.doc_id=r.item_id or (d.doc_id=r.head_id and r.head_id is not null)) and d.indoc_id=i.id and .ITEMS_EXISTS(d.indoc_id) order by 2,1 for read only open indocs fetch indocs into @indoc_name,@rec_id while .CURSOR_STATE=0 begin update #ops set doc_name=isnull(#ops.doc_name,'')+isnull(@indoc_name,'') where #ops.id=@rec_id fetch indocs into @indoc_name,@rec_id end close indocs .DEALLOCATE indocs update #ops set doc_name=substring(#ops.doc_name,1,.CHAR_LENGTH(#ops.doc_name)-1) where .CHAR_LENGTH(#ops.doc_name)>0 begin tran update t_sd_asset_ops set doc_name=#ops.doc_name from #ops where t_sd_asset_ops.id=#ops.id commit tran drop table #ops_rec drop table #ops .TRANSACTION_RESTORE $ENDTEXT(11563226) $ENDACTION $STATE2ACTION(ARCH.#AP_SD_INDOC_NO_CH) state=ARCH action=#AP_SD_INDOC_NO_CH is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ARCH.#AP_SD_INDOC_NO_CH_IRC) state=ARCH action=#AP_SD_INDOC_NO_CH_IRC is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ARCH.#AP_CHECK_STR_DATE) state=ARCH action=#AP_CHECK_STR_DATE is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ARCH.ACTION1) state=ARCH action=ACTION1 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ARCH.ACTION2) state=ARCH action=ACTION2 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ARCH.ACTION5) state=ARCH action=ACTION5 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ARCH.ACTION6) state=ARCH action=ACTION6 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ARCH.ACTION7) state=ARCH action=ACTION7 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ARCH.ACTION_COPY) state=ARCH action=ACTION_COPY is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ARCH.FORM1) state=ARCH action=FORM1 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ARCH.FORM2) state=ARCH action=FORM2 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ARCH.FORM4) state=ARCH action=FORM4 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ARCH.FORM5) state=ARCH action=FORM5 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ARCH.FORM6) state=ARCH action=FORM6 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ARCH.FORM7) state=ARCH action=FORM7 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ARCH.FORM_COPY) state=ARCH action=FORM_COPY is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ARCH.INDOC_FIX) state=ARCH action=INDOC_FIX is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ARCH.INDOC_ROLL) state=ARCH action=INDOC_ROLL is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ARCH.SD_INDOC2DOC_LIST) state=ARCH action=SD_INDOC2DOC_LIST is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ARCH.SD_INDOCS_REP) state=ARCH action=SD_INDOCS_REP is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ARCH.SD_INDOCS_REP_DET) state=ARCH action=SD_INDOCS_REP_DET is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ARCH.SD_INDOC_CREATE4OPER) state=ARCH action=SD_INDOC_CREATE4OPER is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ARCH.SR_INDOCS_REP) state=ARCH action=SR_INDOCS_REP is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ARCH.SR_INDOCS_REP_DET) state=ARCH action=SR_INDOCS_REP_DET is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ARCH.SD_DOC_NAMES_STR_CH) state=ARCH action=SD_DOC_NAMES_STR_CH is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.#AP_SD_INDOC_NO_CH) state=DEL action=#AP_SD_INDOC_NO_CH is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.#AP_SD_INDOC_NO_CH_IRC) state=DEL action=#AP_SD_INDOC_NO_CH_IRC is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.#AP_CHECK_STR_DATE) state=DEL action=#AP_CHECK_STR_DATE is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.ACTION1) state=DEL action=ACTION1 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.ACTION2) state=DEL action=ACTION2 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.ACTION5) state=DEL action=ACTION5 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.ACTION6) state=DEL action=ACTION6 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.ACTION7) state=DEL action=ACTION7 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.ACTION_COPY) state=DEL action=ACTION_COPY is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.FORM1) state=DEL action=FORM1 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.FORM2) state=DEL action=FORM2 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.FORM4) state=DEL action=FORM4 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.FORM5) state=DEL action=FORM5 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.FORM6) state=DEL action=FORM6 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.FORM7) state=DEL action=FORM7 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.FORM_COPY) state=DEL action=FORM_COPY is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.INDOC_FIX) state=DEL action=INDOC_FIX is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.INDOC_ROLL) state=DEL action=INDOC_ROLL is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.SD_INDOC2DOC_LIST) state=DEL action=SD_INDOC2DOC_LIST is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.SD_INDOCS_REP) state=DEL action=SD_INDOCS_REP is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.SD_INDOCS_REP_DET) state=DEL action=SD_INDOCS_REP_DET is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.SD_INDOC_CREATE4OPER) state=DEL action=SD_INDOC_CREATE4OPER is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.SR_INDOCS_REP) state=DEL action=SR_INDOCS_REP is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.SR_INDOCS_REP_DET) state=DEL action=SR_INDOCS_REP_DET is_available=0 $ENDSTATE2ACTION $STATE2ACTION(DEL.SD_DOC_NAMES_STR_CH) state=DEL action=SD_DOC_NAMES_STR_CH is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ED.#AP_SD_INDOC_NO_CH) state=ED action=#AP_SD_INDOC_NO_CH is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ED.#AP_SD_INDOC_NO_CH_IRC) state=ED action=#AP_SD_INDOC_NO_CH_IRC is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ED.#AP_CHECK_STR_DATE) state=ED action=#AP_CHECK_STR_DATE is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION1) state=ED action=ACTION1 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION2) state=ED action=ACTION2 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION5) state=ED action=ACTION5 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION6) state=ED action=ACTION6 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION7) state=ED action=ACTION7 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION_COPY) state=ED action=ACTION_COPY is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ED.FORM1) state=ED action=FORM1 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ED.FORM2) state=ED action=FORM2 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ED.FORM4) state=ED action=FORM4 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ED.FORM5) state=ED action=FORM5 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ED.FORM6) state=ED action=FORM6 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ED.FORM7) state=ED action=FORM7 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ED.FORM_COPY) state=ED action=FORM_COPY is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ED.INDOC_FIX) state=ED action=INDOC_FIX is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ED.INDOC_ROLL) state=ED action=INDOC_ROLL is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ED.SD_INDOC2DOC_LIST) state=ED action=SD_INDOC2DOC_LIST is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ED.SD_INDOCS_REP) state=ED action=SD_INDOCS_REP is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ED.SD_INDOCS_REP_DET) state=ED action=SD_INDOCS_REP_DET is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ED.SD_INDOC_CREATE4OPER) state=ED action=SD_INDOC_CREATE4OPER is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ED.SR_INDOCS_REP) state=ED action=SR_INDOCS_REP is_available=1 $ENDSTATE2ACTION $STATE2ACTION(ED.SR_INDOCS_REP_DET) state=ED action=SR_INDOCS_REP_DET is_available=0 $ENDSTATE2ACTION $STATE2ACTION(ED.SD_DOC_NAMES_STR_CH) state=ED action=SD_DOC_NAMES_STR_CH is_available=0 $ENDSTATE2ACTION $STATE2ACTION(FIX.#AP_SD_INDOC_NO_CH) state=FIX action=#AP_SD_INDOC_NO_CH is_available=0 $ENDSTATE2ACTION $STATE2ACTION(FIX.#AP_SD_INDOC_NO_CH_IRC) state=FIX action=#AP_SD_INDOC_NO_CH_IRC is_available=0 $ENDSTATE2ACTION $STATE2ACTION(FIX.#AP_CHECK_STR_DATE) state=FIX action=#AP_CHECK_STR_DATE is_available=0 $ENDSTATE2ACTION $STATE2ACTION(FIX.ACTION1) state=FIX action=ACTION1 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(FIX.ACTION2) state=FIX action=ACTION2 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(FIX.ACTION5) state=FIX action=ACTION5 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(FIX.ACTION6) state=FIX action=ACTION6 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(FIX.ACTION7) state=FIX action=ACTION7 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(FIX.ACTION_COPY) state=FIX action=ACTION_COPY is_available=1 $ENDSTATE2ACTION $STATE2ACTION(FIX.FORM1) state=FIX action=FORM1 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(FIX.FORM2) state=FIX action=FORM2 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(FIX.FORM4) state=FIX action=FORM4 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(FIX.FORM5) state=FIX action=FORM5 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(FIX.FORM6) state=FIX action=FORM6 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(FIX.FORM7) state=FIX action=FORM7 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(FIX.FORM_COPY) state=FIX action=FORM_COPY is_available=1 $ENDSTATE2ACTION $STATE2ACTION(FIX.INDOC_FIX) state=FIX action=INDOC_FIX is_available=0 $ENDSTATE2ACTION $STATE2ACTION(FIX.INDOC_ROLL) state=FIX action=INDOC_ROLL is_available=1 $ENDSTATE2ACTION $STATE2ACTION(FIX.SD_INDOC2DOC_LIST) state=FIX action=SD_INDOC2DOC_LIST is_available=1 $ENDSTATE2ACTION $STATE2ACTION(FIX.SD_INDOCS_REP) state=FIX action=SD_INDOCS_REP is_available=1 $ENDSTATE2ACTION $STATE2ACTION(FIX.SD_INDOCS_REP_DET) state=FIX action=SD_INDOCS_REP_DET is_available=0 $ENDSTATE2ACTION $STATE2ACTION(FIX.SD_INDOC_CREATE4OPER) state=FIX action=SD_INDOC_CREATE4OPER is_available=0 $ENDSTATE2ACTION $STATE2ACTION(FIX.SR_INDOCS_REP) state=FIX action=SR_INDOCS_REP is_available=1 $ENDSTATE2ACTION $STATE2ACTION(FIX.SR_INDOCS_REP_DET) state=FIX action=SR_INDOCS_REP_DET is_available=0 $ENDSTATE2ACTION $STATE2ACTION(FIX.SD_DOC_NAMES_STR_CH) state=FIX action=SD_DOC_NAMES_STR_CH is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.#AP_SD_INDOC_NO_CH) state=NEW action=#AP_SD_INDOC_NO_CH is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.#AP_SD_INDOC_NO_CH_IRC) state=NEW action=#AP_SD_INDOC_NO_CH_IRC is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.#AP_CHECK_STR_DATE) state=NEW action=#AP_CHECK_STR_DATE is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.ACTION1) state=NEW action=ACTION1 is_available=1 $ENDSTATE2ACTION $STATE2ACTION(NEW.ACTION2) state=NEW action=ACTION2 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.ACTION5) state=NEW action=ACTION5 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.ACTION6) state=NEW action=ACTION6 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.ACTION7) state=NEW action=ACTION7 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.ACTION_COPY) state=NEW action=ACTION_COPY is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.FORM1) state=NEW action=FORM1 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.FORM2) state=NEW action=FORM2 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.FORM4) state=NEW action=FORM4 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.FORM5) state=NEW action=FORM5 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.FORM6) state=NEW action=FORM6 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.FORM7) state=NEW action=FORM7 is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.FORM_COPY) state=NEW action=FORM_COPY is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.INDOC_FIX) state=NEW action=INDOC_FIX is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.INDOC_ROLL) state=NEW action=INDOC_ROLL is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.SD_INDOC2DOC_LIST) state=NEW action=SD_INDOC2DOC_LIST is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.SD_INDOCS_REP) state=NEW action=SD_INDOCS_REP is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.SD_INDOCS_REP_DET) state=NEW action=SD_INDOCS_REP_DET is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.SD_INDOC_CREATE4OPER) state=NEW action=SD_INDOC_CREATE4OPER is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.SR_INDOCS_REP) state=NEW action=SR_INDOCS_REP is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.SR_INDOCS_REP_DET) state=NEW action=SR_INDOCS_REP_DET is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.SD_DOC_NAMES_STR_CH) state=NEW action=SD_DOC_NAMES_STR_CH is_available=0 $ENDSTATE2ACTION $STATE2PROP(ARCH.COMMENT) state=ARCH prop=COMMENT enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ARCH.CORR_ID) state=ARCH prop=CORR_ID enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ARCH.CORR_NAME) state=ARCH prop=CORR_NAME enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ARCH.DOCUMENT_FORM_ID) state=ARCH prop=DOCUMENT_FORM_ID enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ARCH.FOLDER_ID) state=ARCH prop=FOLDER_ID enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ARCH.INDOC_TYPE_ID) state=ARCH prop=INDOC_TYPE_ID enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ARCH.IN_DATE) state=ARCH prop=IN_DATE enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ARCH.IN_NO) state=ARCH prop=IN_NO enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ARCH.IN_TIME) state=ARCH prop=IN_TIME enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ARCH.OUT_DATE) state=ARCH prop=OUT_DATE enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ARCH.OUT_NO) state=ARCH prop=OUT_NO enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ARCH.OWNER_ID) state=ARCH prop=OWNER_ID enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ARCH.QTY_LIST) state=ARCH prop=QTY_LIST enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ARCH.RELATION_ID) state=ARCH prop=RELATION_ID enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ARCH.SD_INDOC_ACT_ID) state=ARCH prop=SD_INDOC_ACT_ID enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ARCH.SEND_DATE) state=ARCH prop=SEND_DATE enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.COMMENT) state=DEL prop=COMMENT enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.CORR_ID) state=DEL prop=CORR_ID enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.CORR_NAME) state=DEL prop=CORR_NAME enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.DOCUMENT_FORM_ID) state=DEL prop=DOCUMENT_FORM_ID enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.FOLDER_ID) state=DEL prop=FOLDER_ID enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.INDOC_TYPE_ID) state=DEL prop=INDOC_TYPE_ID enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.IN_DATE) state=DEL prop=IN_DATE enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.IN_NO) state=DEL prop=IN_NO enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.IN_TIME) state=DEL prop=IN_TIME enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.OUT_DATE) state=DEL prop=OUT_DATE enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.OUT_NO) state=DEL prop=OUT_NO enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.OWNER_ID) state=DEL prop=OWNER_ID enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.QTY_LIST) state=DEL prop=QTY_LIST enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.RELATION_ID) state=DEL prop=RELATION_ID enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.SD_INDOC_ACT_ID) state=DEL prop=SD_INDOC_ACT_ID enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(DEL.SEND_DATE) state=DEL prop=SEND_DATE enable=0 mandatory=0 visible=0 $ENDSTATE2PROP $STATE2PROP(ED.COMMENT) state=ED prop=COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CORR_ID) state=ED prop=CORR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CORR_NAME) state=ED prop=CORR_NAME enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.DOCUMENT_FORM_ID) state=ED prop=DOCUMENT_FORM_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.FOLDER_ID) state=ED prop=FOLDER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.INDOC_TYPE_ID) state=ED prop=INDOC_TYPE_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.IN_DATE) state=ED prop=IN_DATE enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.IN_NO) state=ED prop=IN_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.IN_TIME) state=ED prop=IN_TIME enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.OUT_DATE) state=ED prop=OUT_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.OUT_NO) state=ED prop=OUT_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.OWNER_ID) state=ED prop=OWNER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.QTY_LIST) state=ED prop=QTY_LIST enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.RELATION_ID) state=ED prop=RELATION_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.SD_INDOC_ACT_ID) state=ED prop=SD_INDOC_ACT_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.SEND_DATE) state=ED prop=SEND_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.COMMENT) state=FIX prop=COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.CORR_ID) state=FIX prop=CORR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.CORR_NAME) state=FIX prop=CORR_NAME enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.DOCUMENT_FORM_ID) state=FIX prop=DOCUMENT_FORM_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.FOLDER_ID) state=FIX prop=FOLDER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.INDOC_TYPE_ID) state=FIX prop=INDOC_TYPE_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.IN_DATE) state=FIX prop=IN_DATE enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.IN_NO) state=FIX prop=IN_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.IN_TIME) state=FIX prop=IN_TIME enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.OUT_DATE) state=FIX prop=OUT_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.OUT_NO) state=FIX prop=OUT_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.OWNER_ID) state=FIX prop=OWNER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.QTY_LIST) state=FIX prop=QTY_LIST enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.RELATION_ID) state=FIX prop=RELATION_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.SD_INDOC_ACT_ID) state=FIX prop=SD_INDOC_ACT_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.SEND_DATE) state=FIX prop=SEND_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.COMMENT) state=NEW prop=COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.CORR_ID) state=NEW prop=CORR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.CORR_NAME) state=NEW prop=CORR_NAME enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.DOCUMENT_FORM_ID) state=NEW prop=DOCUMENT_FORM_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.FOLDER_ID) state=NEW prop=FOLDER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.INDOC_TYPE_ID) state=NEW prop=INDOC_TYPE_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.IN_DATE) state=NEW prop=IN_DATE enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.IN_NO) state=NEW prop=IN_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.IN_TIME) state=NEW prop=IN_TIME enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.OUT_DATE) state=NEW prop=OUT_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.OUT_NO) state=NEW prop=OUT_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.OWNER_ID) state=NEW prop=OWNER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.QTY_LIST) state=NEW prop=QTY_LIST enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.RELATION_ID) state=NEW prop=RELATION_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.SD_INDOC_ACT_ID) state=NEW prop=SD_INDOC_ACT_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.SEND_DATE) state=NEW prop=SEND_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $ENDDOC