# Date: 08/11/06 # Version: 105 $DOC(LIST_FOR_MONEY_REDEMPTION) name=Начисленные проценты class=1 product=ALD_SECUR name_formula=$TEXT(15101993) .PURPOSE_NAME2ID(((select purpose_id from td_queries where id=@item_id)))+' №:'+(select in_no from td_depo_docs where id=@item_id)+ ' от '+(select convert(varchar,in_date,103) from td_depo_docs where id=@item_id) $ENDTEXT(15101993) remark_formula=null $STATE(CRT) name=Создан class=0 $ENDSTATE $STATE(new) name=Начальный class=1 $ENDSTATE $PROP(ITEM_ID) name=Операция field_name=item_id table_name=tb_list2money_oper field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=1 init_class=null 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(CONTRACT_ID) name=Договор field_name=contract_id table_name=tb_list2money_oper field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=2 init_class=null 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(LIST_SUM) name=Начисленная сумма field_name=list_sum table_name=tb_list2money_oper field_type=money field_length=8 field_scale=4 field_prec=19 page=1 order=3 init_class=null 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(ASSET_PLACE_ID) name=Место нахождения field_name=asset_place_id table_name=tb_list2money_oper field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=4 init_class=null 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(PORTFOLIO_ID) name=Портфель field_name=portfolio_id table_name=tb_list2money_oper field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=6 init_class=null 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(PORTFOLIO_SUB_ID) name=Балансовый портфель field_name=portfolio_sub_id table_name=tb_list2money_oper field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=7 init_class=null 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(CONTRAGENT_ID) name=Контрагент field_name=contragent_id table_name=tb_list2money_oper field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=5 init_class=null 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=PARTNERS form=null prop=CONTRAGENT_ID idname=null order=40 $ENDRELATION $RELATION(REL2) class=0 type=ITEMS form=null prop=ITEM_ID idname=null order=60 $ENDRELATION $RELATION(REL3) class=0 type=ITEMS form=null prop=CONTRACT_ID idname=null order=10 $ENDRELATION $RELATION(REL4) class=0 type=ITEMS form=null prop=ASSET_PLACE_ID idname=null order=50 $ENDRELATION $RELATION(REL5) class=0 type=PORTFOLIO_SECTION form=null prop=PORTFOLIO_SUB_ID idname=null order=30 $ENDRELATION $RELATION(REL6) class=0 type=PORTFOLIO form=null prop=PORTFOLIO_ID idname=null order=20 $ENDRELATION $RELATION(REL7) class=0 type=MONEY_REDEMPTION form=null prop=ITEM_ID idname=null order=70 $ENDRELATION $FORM(D_LIST2MONEY_REDEMPTION_EDIT) name=Просмотр class=5 filter=null target_state= uo=uo_edit dw=d_list2money_redemption_edit procedure=ap_21535000000572281 patterns=GENERIC_VIEW_ITEM_O user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(15101995) create procedure dbo.%PROC% @sid varchar(30) = null as .BEGIN('N') .CHECK_USER .CHECK_VIEW if @id = -1 begin .VIEW_INIT end else begin .VIEW_ITEM end .END $ENDTEXT(15101995) $ACTION2RELATION(REL3.ITEM_NAME) relation=REL3 where=null prop=ITEM_NAME order=3 alias=contract_name $ENDACTION2RELATION $ACTION2RELATION(REL5.SECTION_NAME) relation=REL5 where=null prop=SECTION_NAME order=7 alias=section_name $ENDACTION2RELATION $ACTION2RELATION(REL1.PARTNER_SHORT_NAME) relation=REL1 where=null prop=PARTNER_SHORT_NAME order=11 alias=partner_short_name $ENDACTION2RELATION $ACTION2RELATION(REL6.PORTFOLIO_NAME) relation=REL6 where=null prop=PORTFOLIO_NAME order=3 alias=portfolio_name $ENDACTION2RELATION $ACTION2RELATION(REL4.ITEM_NAME) relation=REL4 where=null prop=ITEM_NAME order=3 alias=asset_place_name $ENDACTION2RELATION $CALC(ORGANISATION_ID_S) class=1 type=varchar calc_lenght=30 calc_prec=null calc_scale=null formula=.ORGANIZATION label=null order=1 $ENDCALC $ENDFORM $FORM(D_LIST2MONEY_REDEMPTION_LIST) name=Рассчитанные суммы class=4 filter=null target_state= uo=uo_list dw=d_list2money_redemption_list procedure=ap_21535000000572286 patterns=GENERIC_VIEW_LIST user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(15101995) create procedure dbo.%PROC% @sid varchar(30) = null .ARGLIST_FILTER as .BEGIN('N') .CHECK_USER .CHECK_VIEW_LIST .ARGCONVERT_FILTER .VIEW_LIST .END $ENDTEXT(15101995) $ACTION2RELATION(REL3.ITEM_NAME) relation=REL3 where=null prop=ITEM_NAME order=4 alias=contract_name $ENDACTION2RELATION $ACTION2RELATION(REL5.SECTION_NAME) relation=REL5 where=null prop=SECTION_NAME order=7 alias=section_name $ENDACTION2RELATION $ACTION2RELATION(REL4.ITEM_NAME) relation=REL4 where=null prop=ITEM_NAME order=3 alias=asset_place_name $ENDACTION2RELATION $ACTION2RELATION(REL1.PARTNER_SHORT_NAME) relation=REL1 where=null prop=PARTNER_SHORT_NAME order=11 alias=partner_short_name $ENDACTION2RELATION $ACTION2RELATION(REL6.PORTFOLIO_NAME) relation=REL6 where=null prop=PORTFOLIO_NAME order=3 alias=portfolio_name $ENDACTION2RELATION $ACTION2RELATION(REL2.ITEM_NAME) relation=REL2 where=null prop=ITEM_NAME order=3 alias=foundation_name $ENDACTION2RELATION $ACTION2RELATION(REL7.IN_DATE) relation=REL7 where=null prop=IN_DATE order=5 alias=in_date $ENDACTION2RELATION $ACTION2RELATION(REL7.IN_NO) relation=REL7 where=null prop=IN_NO order=14 alias=in_no $ENDACTION2RELATION $FILTER(ITEM_ID) type=11 label=ITEM_ID prop=ITEM_ID arg_code=null arg_type=null arg_length=null arg_prec=null arg_scale=null $ENDFILTER $CALC(ORG_CONTRACT) class=1 type=varchar calc_lenght=255 calc_prec=null calc_scale=null formula=$TEXT(15101995) select t_items.item_name from tb_broker2exchange, t_items where tb_broker2exchange.id=tb_list2money_oper.asset_place_id and tb_broker2exchange.ext_broker_deal=t_items.id $ENDTEXT(15101995) label=Договор обслуживания order=1 $ENDCALC $ENDFORM $FORM(LIST_FOR_MONEY_PROC) name=Начисленные % class=4 filter=null target_state= uo=uo_list dw=d_list2money_redemption_list procedure=ap_21535000000608169 patterns=GENERIC_VIEW_LIST user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(15101995) create procedure dbo.%PROC% @sid varchar(30) = null .ARGLIST_FILTER as .BEGIN('N') .CHECK_USER .CHECK_VIEW_LIST .ARGCONVERT_FILTER .VIEW_LIST .END $ENDTEXT(15101995) $ACTION2RELATION(REL5.SECTION_NAME) relation=REL5 where=null prop=SECTION_NAME order=7 alias=section_name $ENDACTION2RELATION $ACTION2RELATION(REL3.ITEM_NAME) relation=REL3 where=null prop=ITEM_NAME order=3 alias=contract_name $ENDACTION2RELATION $ACTION2RELATION(REL4.ITEM_NAME) relation=REL4 where=null prop=ITEM_NAME order=3 alias=asset_place_name $ENDACTION2RELATION $ACTION2RELATION(REL1.PARTNER_SHORT_NAME) relation=REL1 where=null prop=PARTNER_SHORT_NAME order=11 alias=partner_short_name $ENDACTION2RELATION $ACTION2RELATION(REL6.PORTFOLIO_NAME) relation=REL6 where=null prop=PORTFOLIO_NAME order=3 alias=portfolio_name $ENDACTION2RELATION $ACTION2RELATION(REL2.ITEM_NAME) relation=REL2 where=null prop=ITEM_NAME order=3 alias=foundation_name $ENDACTION2RELATION $ACTION2RELATION(REL7.IN_DATE) relation=REL7 where=null prop=IN_DATE order=5 alias=in_date $ENDACTION2RELATION $ACTION2RELATION(REL7.IN_NO) relation=REL7 where=null prop=IN_NO order=14 alias=in_no $ENDACTION2RELATION $CALC(ORG_CONTRACT) class=1 type=varchar calc_lenght=255 calc_prec=null calc_scale=null formula=$TEXT(15101995) select t_items.item_name from tb_broker2exchange, t_items where tb_broker2exchange.id=tb_list2money_oper.asset_place_id and tb_broker2exchange.ext_broker_deal=t_items.id $ENDTEXT(15101995) label=Договор обслуживания order=1 $ENDCALC $ENDFORM $ACTION(ACTION_DELETE) name=Удалить class=3 form=D_LIST2MONEY_REDEMPTION_EDIT target_state=null procedure=ap_21535000000572294 patterns=GENERIC_MOVE user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(15101995) create procedure dbo.%PROC% @sid varchar(30) = null as .BEGIN('N') .CHECK_USER .CHECK_UPDATE begin tran .TYPE_DELETE ---.ACTION_HISTORY /*-------Проводки ----------*/ commit tran .END $ENDTEXT(15101995) $ENDACTION $ACTION(ACTION_INSERT) name=Добавить class=1 form=D_LIST2MONEY_REDEMPTION_EDIT target_state=CRT procedure=ap_21535000000572292 patterns=GENERIC_INSERT_O user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(15101995) create procedure dbo.%PROC% @sid varchar(30) = null, .ARGLIST as .BEGIN('N') .CHECK_USER .CHECK_INSERT .ARGCONVERT .INIT_VARS .TEST_UNIQUE begin tran .INSERT_ITEMS .INSERT .UPDATE_STATE .RELGEN .ACTION_HISTORY commit tran select sid = convert(varchar, @id) .END $ENDTEXT(15101995) $ENDACTION $ACTION(ACTION_UPDATE) name=Изменить class=2 form=D_LIST2MONEY_REDEMPTION_EDIT target_state=null procedure=ap_21535000000572293 patterns=GENERIC_UPDATE user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(15101995) create procedure dbo.%PROC% @sid varchar(30) = null, .ARGLIST as .BEGIN('N') .CHECK_USER .CHECK_UPDATE .ARGCONVERT .TEST_UNIQUE begin tran .UPDATE_ITEMS .UPDATE .RELGEN .UPDATE_STATE .ACTION_HISTORY commit tran .END $ENDTEXT(15101995) $ENDACTION $ACTION(CALC_PER_CENT) name=Подтвердить class=9 form=null target_state=null procedure=ap_21535000001982515 patterns=null user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(15101995) create procedure dbo.%PROC% @sid varchar(30) = null as --.CHECKPOINT_INIT .BEGIN('N') exec ap_truncate_tables_operations .CHECK_USER .CHECK_UPDATE begin tran .UPDATE_STATE .ACTION_HISTORY declare @comis_sum numeric .ID_VAR(@organisation_id) declare @mess varchar(255) declare @plan_secur_id numeric declare @plan_money_id numeric declare @out_method numeric declare @is_realiz int, @is_p2l_comis int, @is_com_in int, @is_allow_short4stocks int, @is_allow_short4money int, @is_allow_short4client_money numeric, @asset4pereoc_type_id numeric, @character_id numeric, @fin_result numeric, @is_margin numeric, @place_class_id numeric, @money_acc_id numeric, @plan_cur_id numeric, @depo_acc_id numeric, @place_id numeric, @investor_id numeric, @depo_class_id numeric, @depo_subacc_id numeric .GET_PROPS .TYPE_GET('MONEY_REDEMPTION',@item_id) if @owner_id1 is null .EXIT_MESSAGE('Не задан владелец плана') .BACK_GET_ORG_PARMS(@owner_id1, @organisation_id, @plan_money_id, @plan_secur_id, @out_method,@is_realiz,@is_p2l_comis, @is_com_in,@is_allow_short4stocks,@is_allow_short4money,@asset4pereoc_type_id) .BACK_PLASE_CLASS_FROM_OBJ(@place_id, @organisation_id, @place_class_id) -- Выдает класс по объекту местонахождения активов select @plan_cur_id=cur_id from t_plans where id=@plan_money_id if @organisation_id = @investor_id begin select @character_id=1 -- диллерская select @fin_result=1 -- ведем фин результат end else begin select @character_id = 2 -- клиентская select @fin_result =fin_result, @is_margin=is_margin, @is_allow_short4client_money=is_allow_short4money from tb_contracts where id = @investor_id if @fin_result is null begin select @mess = item_name from t_items where id = @investor_id .ASSIGN(@mess,('Не задан параметр расчета финансового результата у клиента' + isnull(@mess,'null'))) .EXIT_MESSAGE(@mess) end end .ASSIGN(@depo_acc_id,(.DEPO_ACC_FROM_SUBACC(@depo_subacc_id))) .TRUNCATE_ALIASES declare @dog_depozit_id numeric select @dog_depozit_id=(select ext_broker_deal from tb_broker2exchange where id=@asset_place_id) select @money_acc_id = (select money_acc_id from tb_contracts where id = @dog_depozit_id) .TYPE_ALIASES_CALC(D,N,1) --select * from #trace_history --.GENERATE_OPERATIONS(@owner_id1,10,@id,@type_id,@action_id,@action_history_id,0,0,'Групповая операция ДС') TRUNCATE TABLE #oper_block_tmp .GENERATE_BLOCK(@owner_id1,10,@id,@type_id,@action_id,@action_history_id,'Групповая операция ДС') exec ap_save_tables_operations --.CHECKPOINT_EXEC('Групповая операция') /*-------Проводки ----------*/ commit tran .END .END $ENDTEXT(15101995) $ENDACTION $STATE2ACTION(CRT.ACTION_DELETE) state=CRT action=ACTION_DELETE is_available=1 $ENDSTATE2ACTION $STATE2ACTION(CRT.ACTION_INSERT) state=CRT action=ACTION_INSERT is_available=0 $ENDSTATE2ACTION $STATE2ACTION(CRT.ACTION_UPDATE) state=CRT action=ACTION_UPDATE is_available=1 $ENDSTATE2ACTION $STATE2ACTION(CRT.CALC_PER_CENT) state=CRT action=CALC_PER_CENT is_available=1 $ENDSTATE2ACTION $STATE2ACTION(CRT.D_LIST2MONEY_REDEMPTION_EDIT) state=CRT action=D_LIST2MONEY_REDEMPTION_EDIT is_available=1 $ENDSTATE2ACTION $STATE2ACTION(CRT.D_LIST2MONEY_REDEMPTION_LIST) state=CRT action=D_LIST2MONEY_REDEMPTION_LIST is_available=1 $ENDSTATE2ACTION $STATE2ACTION(CRT.LIST_FOR_MONEY_PROC) state=CRT action=LIST_FOR_MONEY_PROC is_available=1 $ENDSTATE2ACTION $STATE2ACTION(NEW.ACTION_DELETE) state=NEW action=ACTION_DELETE is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.ACTION_INSERT) state=NEW action=ACTION_INSERT is_available=1 $ENDSTATE2ACTION $STATE2ACTION(NEW.ACTION_UPDATE) state=NEW action=ACTION_UPDATE is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.CALC_PER_CENT) state=NEW action=CALC_PER_CENT is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.D_LIST2MONEY_REDEMPTION_EDIT) state=NEW action=D_LIST2MONEY_REDEMPTION_EDIT is_available=1 $ENDSTATE2ACTION $STATE2ACTION(NEW.D_LIST2MONEY_REDEMPTION_LIST) state=NEW action=D_LIST2MONEY_REDEMPTION_LIST is_available=0 $ENDSTATE2ACTION $STATE2ACTION(NEW.LIST_FOR_MONEY_PROC) state=NEW action=LIST_FOR_MONEY_PROC is_available=0 $ENDSTATE2ACTION $STATE2PROP(CRT.ASSET_PLACE_ID) state=CRT prop=ASSET_PLACE_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.CONTRACT_ID) state=CRT prop=CONTRACT_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.CONTRAGENT_ID) state=CRT prop=CONTRAGENT_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.ITEM_ID) state=CRT prop=ITEM_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.LIST_SUM) state=CRT prop=LIST_SUM enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.PORTFOLIO_ID) state=CRT prop=PORTFOLIO_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.PORTFOLIO_SUB_ID) state=CRT prop=PORTFOLIO_SUB_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.ASSET_PLACE_ID) state=NEW prop=ASSET_PLACE_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.CONTRACT_ID) state=NEW prop=CONTRACT_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.CONTRAGENT_ID) state=NEW prop=CONTRAGENT_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.ITEM_ID) state=NEW prop=ITEM_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.LIST_SUM) state=NEW prop=LIST_SUM enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.PORTFOLIO_ID) state=NEW prop=PORTFOLIO_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.PORTFOLIO_SUB_ID) state=NEW prop=PORTFOLIO_SUB_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $ENDDOC