# Date: 30/06/06 # Version: 105 $DOC(ASSET_PLACES) name=Места нахождения активов class=5 product=ALD_SECUR name_formula=null remark_formula=null $STATE(CRT) name=Создан class=0 $ENDSTATE $RELATION(REL1) class=5 type=BROKER2EXCHANGE form=D_BROKER2EXCHANGE_LIST prop=null idname=null order=40 $ENDRELATION $RELATION(REL2) class=5 type=BROKER_INFO form=UO_BROKER_LIST prop=null idname=null order=10 $ENDRELATION $FORM(ASSET_PLACE_LIST) name=Список мест нахождения активов class=4 filter=null target_state= uo=uo_list dw=d_broker2exchange_list_short procedure=ap_10000000000039089 patterns=GENERIC_VIEW_LIST user_define=1 isvisible=0 istab=0 posx=0 posy=0 width=2811 height=1208 proc_text=$TEXT(16280725) create procedure dbo.%PROC% @sid varchar(30) = null .ARGLIST_FILTER as .BEGIN('N') .CHECK_USER .CHECK_VIEW_LIST ---- select @type_id_s = null select @state_name_id_s = null select @item_remark = null .ARGCONVERT_FILTER ---- /*---.VIEW_LIST---*/ if not(@investor_id is null) begin select @owner_id = (select partner_id from tb_broker_change where id = @investor_id) if @owner_id is null select @owner_id = (select td_depo_docs.owner_id from tb_contracts, td_depo_docs where tb_contracts.id = @investor_id and tb_contracts.id = td_depo_docs.id) end 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), convert(varchar,tb_broker2exchange.ext_broker_deal) as ext_broker_deal_s, convert(varchar,tb_broker2exchange.exchange_id) as exchange_id_s, convert(varchar,tb_broker2exchange.object_class_id) as object_class_id_s, r1808725496_10000000000034871.place_name as place_name, r1808725496_10000000000034871.place_code as place_code, r1813581499_10000000000034870.item_name as dogovor_name, r1523132817_10000000000039963.code as object_class_code, r1523132817_10000000000039963.name as object_class_name --.VIEW_CALC into #tmp_t from #state_list, t_items , tb_broker2exchange, td_rate_places r1808725496_10000000000034871 , t_items r1813581499_10000000000034870 , t_move_directions r1523132817_10000000000039963, td_depo_docs where #state_list.state_id = t_items.state_id and t_items.id = tb_broker2exchange.id /* and exists(select 1 from t_items, t_states, t_types where t_items.id=tb_broker2exchange.id and t_states.id=t_items.state_id and t_states.class_id=0 and t_types.id=t_items.type_id and upper(t_types.type_code)=upper('ORGANIZATION_CONTRACTS'))*/ and tb_broker2exchange.exchange_id *= r1808725496_10000000000034871.id and tb_broker2exchange.ext_broker_deal *= r1813581499_10000000000034870.id and tb_broker2exchange.object_class_id *= r1523132817_10000000000039963.id and tb_broker2exchange.ext_broker_deal = td_depo_docs.id and td_depo_docs.owner_id = @owner_id and .ITEMS_EXISTS_BY_TYPE_STATE(td_depo_docs.id,'ORGANIZATION_CONTRACTS','SIGN') and ((exchange_id between @sale_place_id_bb and @sale_place_id_ee) or (exchange_id=@sale_place_id_nn)) -- OWN - рубли /* insert #tmp_t( sid, state_sid, type_sid, item_name, state_name, type_name, ext_broker_deal_s, exchange_id_s, object_class_id_s, place_name, place_code, dogovor_name, object_class_code, object_class_name ) select convert(varchar, t_items.id), convert(varchar, t_items.state_id), convert(varchar, t_items.type_id), t_items.item_name, (select t_states.state_name from t_states where t_states.id=t_items.state_id), (select t_types.type_name from t_types where t_types.id=t_items.type_id), null, (select convert(varchar,id) from td_rate_places where place_code='ВБР'), convert(varchar,(select md.id from t_move_directions md where md.code = 'OWN' and .ITEMS_EXISTS_BY_TYPE(md.id,'MOVE_DIRECTIONS'))), --- 'Свободные средства', (select place_name from td_rate_places where place_code='ВБР'), 'OWN', tb_broker_change.broker_code + ' '+tb_broker_change.broker_name, 'OWN', 'В компании' from #state_list, tb_broker_change, t_items where tb_broker_change.partner_id = @owner_id and t_items.id = tb_broker_change.id and .ITEMS_EXISTS_BY_TYPE(tb_broker_change.id,'BROKER_INFO') and #state_list.state_id = t_items.state_id */ -- OWN - валюта /* insert #tmp_t( sid, state_sid, type_sid, item_name, state_name, type_name, ext_broker_deal_s, exchange_id_s, object_class_id_s, place_name, place_code, dogovor_name, object_class_code, object_class_name ) select convert(varchar, t_items.id), convert(varchar, t_items.state_id), convert(varchar, t_items.type_id), t_items.item_name, (select t_states.state_name from t_states where t_states.id=t_items.state_id), (select t_types.type_name from t_types where t_types.id=t_items.type_id), null, (select convert(varchar,id) from td_rate_places where place_code='ВБР'), convert(varchar,(select md.id from t_move_directions md where md.code = 'OWN_CURRENCY' and .ITEMS_EXISTS_BY_TYPE(md.id,'MOVE_DIRECTIONS'))), --- 'Свободные средства', (select place_name from td_rate_places where place_code='ВБР'), 'OWN_CURRENCY', tb_broker_change.broker_code + ' '+tb_broker_change.broker_name, 'OWN_CURRENCY', 'В компании' from #state_list, tb_broker_change, t_items where tb_broker_change.partner_id = @owner_id and t_items.id = tb_broker_change.id and .ITEMS_EXISTS_BY_TYPE(tb_broker_change.id,'BROKER_INFO') and #state_list.state_id = t_items.state_id */ select * from #tmp_t .END $ENDTEXT(16280725) $FILTER(OWNER_ID) type=11 label=owner_id prop=null arg_code=owner_id arg_type=numeric arg_length=null arg_prec=18 arg_scale=null $ENDFILTER $FILTER(SALE_PLACE_ID) type=1 label=null prop=null arg_code=sale_place_id arg_type=numeric arg_length=null arg_prec=18 arg_scale=0 $ENDFILTER $FILTER(INVESTOR_ID) type=11 label=null prop=null arg_code=investor_id arg_type=numeric arg_length=null arg_prec=18 arg_scale=0 $ENDFILTER $ENDFORM $FORM(ASSET_PLACE_LIST_WDEALTYPE) name=Список мест нахождения активов class=4 filter=null target_state= uo=uo_list dw=d_broker2exchange_list_short procedure=ap_11535000000306626 patterns=null user_define=1 isvisible=1 istab=0 posx=null posy=null width=null height=null proc_text=$TEXT(16280725) create procedure dbo.%PROC% @sid varchar(30) = null .ARGLIST_FILTER as .BEGIN('N') .CHECK_USER .CHECK_VIEW_LIST ---- select @type_id_s = null select @state_name_id_s = null select @item_remark = null .ARGCONVERT_FILTER /*--.VIEW_LIST---*/ if not(@investor_id is null) begin select @owner_id = (select partner_id from tb_broker_change where id = @investor_id) if @owner_id is null select @owner_id = (select td_depo_docs.owner_id from tb_contracts, td_depo_docs where tb_contracts.id = @investor_id and tb_contracts.id = td_depo_docs.id) end .ID_VAR(@rate_place_type_id) .ID_VAR(@deal_type_id) .NAME_VAR(@deal_type_code) if @deal_type_sid is null or @deal_type_sid='' begin select @deal_type_id=null end else begin select @deal_type_id=convert(numeric,@deal_type_sid) end .ASSIGN(@deal_type_code,(.TYPE_CODE(@deal_type_id))) IF((CHARINDEX('VBR',UPPER(@deal_type_code))) > 0) -- внебиржевая площадка BEGIN .ASSIGN(@rate_place_type_id,1) END ELSE BEGIN .ASSIGN(@rate_place_type_id,2) END .ASSIGN(@rate_place_type_id,(ISNULL(@rate_place_type_id,0))) 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), convert(varchar,tb_broker2exchange.ext_broker_deal) as ext_broker_deal_s, convert(varchar,tb_broker2exchange.exchange_id) as exchange_id_s, convert(varchar,tb_broker2exchange.object_class_id) as object_class_id_s, r1808725496_10000000000034871.place_name as place_name, r1808725496_10000000000034871.place_code as place_code, r1813581499_10000000000034870.item_name as dogovor_name, r1523132817_10000000000039963.code as object_class_code, r1523132817_10000000000039963.name as object_class_name --.VIEW_CALC into #tmp_t from #state_list, t_items , tb_broker2exchange, td_rate_places r1808725496_10000000000034871 , t_items r1813581499_10000000000034870 , t_move_directions r1523132817_10000000000039963, td_depo_docs where #state_list.state_id = t_items.state_id and t_items.id = tb_broker2exchange.id /* and exists(select 1 from t_items, t_states, t_types where t_items.id=tb_broker2exchange.id and t_states.id=t_items.state_id and t_states.class_id=0 and t_types.id=t_items.type_id and upper(t_types.type_code)=upper('ORGANIZATION_CONTRACTS'))*/ and r1808725496_10000000000034871.place_type_id = @rate_place_type_id and tb_broker2exchange.exchange_id = r1808725496_10000000000034871.id and tb_broker2exchange.ext_broker_deal *= r1813581499_10000000000034870.id and tb_broker2exchange.object_class_id *= r1523132817_10000000000039963.id and tb_broker2exchange.ext_broker_deal = td_depo_docs.id and td_depo_docs.owner_id = @owner_id and .ITEMS_EXISTS_BY_TYPE_STATE(td_depo_docs.id,'ORGANIZATION_CONTRACTS','SIGN') -- and ((exchange_id between @sale_place_id_bb and @sale_place_id_ee) or (exchange_id=@sale_place_id_nn)) IF(@rate_place_type_id = 2) -- биржевая площадка BEGIN DELETE FROM #tmp_t FROM t_items, tb_broker2exchange, tb_contracts WHERE CONVERT(NUMERIC,#tmp_t.sid) = t_items.id AND t_items.id = tb_broker2exchange.id AND tb_contracts.id = tb_broker2exchange.ext_broker_deal AND tb_contracts.client_id = @owner_id END select * from #tmp_t .END $ENDTEXT(16280725) $FILTER(OWNER_ID) type=11 label=Владелец prop=null arg_code=owner_id arg_type=numeric arg_length=null arg_prec=18 arg_scale=0 $ENDFILTER $FILTER(INVESTOR_ID) type=11 label=Инвестор prop=null arg_code=investor_id arg_type=numeric arg_length=null arg_prec=18 arg_scale=0 $ENDFILTER $FILTER(DEAL_TYPE_SID) type=11 label=Тип сделки prop=null arg_code=deal_type_sid arg_type=varchar arg_length=30 arg_prec=18 arg_scale=0 $ENDFILTER $ENDFORM $FORM(D_ASSET_PLACES) name=Список мест нахождения активов по организации class=4 filter=null target_state= uo=uo_list dw=d_asset_places_org_list procedure=ap_10000000000297994 patterns=GENERIC_VIEW_LIST user_define=1 isvisible=0 istab=0 posx=0 posy=0 width=3502 height=1276 proc_text=$TEXT(16280725) create procedure dbo.%PROC% @sid varchar(30) = null .ARGLIST_FILTER as .BEGIN('N') .CHECK_USER .CHECK_VIEW_LIST ---- select @type_id_s = null select @state_name_id_s = null select @item_remark = null .ARGCONVERT_FILTER ---- /*--.VIEW_LIST---*/ .ID_VAR(@owner_id) select @owner_id = .ORGANIZATION 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), convert(varchar,tb_broker2exchange.ext_broker_deal) as ext_broker_deal_s, convert(varchar,tb_broker2exchange.exchange_id) as exchange_id_s, convert(varchar,tb_broker2exchange.object_class_id) as object_class_id_s, r1808725496_10000000000034871.place_name as place_name, r1808725496_10000000000034871.place_code as place_code, r1813581499_10000000000034870.item_name as dogovor_name, r1523132817_10000000000039963.code as object_class_code, r1523132817_10000000000039963.name as object_class_name, t_bank_accounts.bank_account_no, tb_contracts.dogexec_begin_date, tb_contracts.dogexec_end_date, convert(varchar,tb_contracts.client_id) as client_id_s --.VIEW_CALC into #tmp_t from #state_list, t_items , tb_broker2exchange , td_rate_places r1808725496_10000000000034871 , t_items r1813581499_10000000000034870 , t_move_directions r1523132817_10000000000039963, td_depo_docs, tb_contracts, t_bank_accounts where #state_list.state_id = t_items.state_id and t_items.id = tb_broker2exchange.id and tb_broker2exchange.exchange_id *= r1808725496_10000000000034871.id and tb_broker2exchange.ext_broker_deal *= r1813581499_10000000000034870.id and tb_broker2exchange.object_class_id *= r1523132817_10000000000039963.id and tb_broker2exchange.ext_broker_deal = td_depo_docs.id and tb_contracts.id=td_depo_docs.id and t_bank_accounts.id=*tb_contracts.money_acc_id and td_depo_docs.owner_id = @owner_id and .ITEMS_EXISTS_BY_TYPE_STATE(td_depo_docs.id,'ORGANIZATION_CONTRACTS','SIGN') select * from #tmp_t .END $ENDTEXT(16280725) $ENDFORM $FORM(D_ASSET_PLACES_FO) name=Список мест нахождения активов на площадках срочного рынка class=4 filter=null target_state= uo=uo_list dw=d_asset_places_org_list_fo procedure=ap_21535000002542016 patterns=null user_define=1 isvisible=0 istab=0 posx=null posy=null width=null height=null proc_text=$TEXT(16280725) create procedure dbo.%PROC% @sid varchar(30) = null .ARGLIST_FILTER as .BEGIN('N') .CHECK_USER .CHECK_VIEW_LIST ---- select @type_id_s = null select @state_name_id_s = null select @item_remark = null .ARGCONVERT_FILTER ---- /*--.VIEW_LIST---*/ .ID_VAR(@owner_id) select @owner_id = .ORGANIZATION 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), convert(varchar,tb_broker2exchange.ext_broker_deal) as ext_broker_deal_s, convert(varchar,tb_broker2exchange.exchange_id) as exchange_id_s, convert(varchar,tb_broker2exchange.object_class_id) as object_class_id_s, r1808725496_10000000000034871.place_name as place_name, r1808725496_10000000000034871.place_code as place_code, r1813581499_10000000000034870.item_name as dogovor_name, r1523132817_10000000000039963.code as object_class_code, r1523132817_10000000000039963.name as object_class_name, t_bank_accounts.bank_account_no, tb_contracts.dogexec_begin_date, tb_contracts.dogexec_end_date --.VIEW_CALC into #tmp_t from #state_list, t_items , tb_broker2exchange , td_rate_places r1808725496_10000000000034871 , t_items r1813581499_10000000000034870 , t_move_directions r1523132817_10000000000039963, td_depo_docs, tb_contracts, t_bank_accounts, t_classes, t_classvalues where #state_list.state_id = t_items.state_id and t_items.id = tb_broker2exchange.id -- and tb_broker2exchange.exchange_id *= r1808725496_10000000000034871.id and tb_broker2exchange.exchange_id = r1808725496_10000000000034871.id and tb_broker2exchange.ext_broker_deal *= r1813581499_10000000000034870.id and tb_broker2exchange.object_class_id *= r1523132817_10000000000039963.id and tb_broker2exchange.ext_broker_deal = td_depo_docs.id and tb_contracts.id=td_depo_docs.id and t_bank_accounts.id=*tb_contracts.money_acc_id and td_depo_docs.owner_id = @owner_id and r1808725496_10000000000034871.class_rate_id = t_classes.id and r1808725496_10000000000034871.classvalue_rate_id = t_classvalues.id and upper(rtrim(ltrim(t_classes.code))) = 'STOCK_TYPE' and upper(rtrim(ltrim(t_classvalues.code))) = 'FUTURE_OPTION' and .ITEMS_EXISTS_BY_TYPE_STATE(td_depo_docs.id,'ORGANIZATION_CONTRACTS','SIGN') select * from #tmp_t .END $ENDTEXT(16280725) $ENDFORM $STATE2ACTION(CRT.ASSET_PLACE_LIST) state=CRT action=ASSET_PLACE_LIST is_available=1 $ENDSTATE2ACTION $STATE2ACTION(CRT.ASSET_PLACE_LIST_WDEALTYPE) state=CRT action=ASSET_PLACE_LIST_WDEALTYPE is_available=1 $ENDSTATE2ACTION $STATE2ACTION(CRT.D_ASSET_PLACES) state=CRT action=D_ASSET_PLACES is_available=0 $ENDSTATE2ACTION $STATE2ACTION(CRT.D_ASSET_PLACES_FO) state=CRT action=D_ASSET_PLACES_FO is_available=0 $ENDSTATE2ACTION $ENDDOC