# Date: 14/03/06 # Version: 105 $DOC(MONEY_MOVE_COMMISSION_2) name=Перевод ДС внутри инвестора class=1 product=ALD_SECUR name_formula=$TEXT(16533946) .TYPE_NAME(@type_id) + " №" + @in_no + " от " + convert(varchar,@in_date,3) $ENDTEXT(16533946) remark_formula=$TEXT(16533946) (select name from t_purposes where id=@purpose_id)+' в сумме '+convert(varchar,isnull(@doc_sum,0))+' '+ isnull((select cur_code from t_currencies where id=@cur_id),'') $ENDTEXT(16533946) $STATE(DEL) name=Удален class=2 $ENDSTATE $STATE(ED) name=Редактируется class=0 $ENDSTATE $STATE(NEW) name=Начальный class=1 $ENDSTATE $STATE(OP_FULL) name=Подтвержден class=0 $ENDSTATE $STATE(SENT) name=Отправлен class=0 $ENDSTATE $STATE(TOSEND) name=На отправку class=0 $ENDSTATE $PROP(FROM_PARTNER_ID) name=Отправитель field_name=from_partner_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=40 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(TO_PARTNER_ID) name=Получатель field_name=to_partner_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=41 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(FROM_PARTNER_ACC_ID) name=Исходный р/с field_name=from_partner_acc_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=29 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(TO_PARTNER_ACC_ID) name=Целевой р/с field_name=to_partner_acc_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=30 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(DOC_SUM) name=Сумма field_name=doc_sum table_name=t_paydocs field_type=money field_length=8 field_scale=4 field_prec=19 page=2 order=8 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(CUR_ID) name=Валюта суммы field_name=cur_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=9 init_class=2 init_formula=.CUR('RUR') 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(PERPOSE_STR) name=Примечание field_name=perpose_str table_name=t_paydocs field_type=varchar field_length=255 field_scale=null field_prec=255 page=2 order=10 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(FOUNDATION_ID) name=Документ основание field_name=foundation_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 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 $PROP(PORTFOLIO_ID) name=Портфель field_name=portfolio_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=12 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=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 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(PURPOSE_ID) name=Целевое назначение field_name=purpose_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=31 init_class=1 init_formula=.GET_PURPOSE_ID(@owner_id,70,@type_id) 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(CHARACTER_CUR_PRICE) name=Тип курса field_name=character_cur_price table_name=t_paydocs field_type=int field_length=4 field_scale=0 field_prec=10 page=2 order=32 init_class=1 init_formula=0 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(PROCENT_PLUS) name=Процент field_name=procent_plus table_name=t_paydocs field_type=money field_length=8 field_scale=4 field_prec=19 page=2 order=35 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(CUR_PRICE) name=Курс field_name=cur_price table_name=t_paydocs field_type=decimal field_length=9 field_scale=8 field_prec=18 page=2 order=34 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(CUR_PRICE_DATE) name=Дата курса field_name=cur_price_date table_name=t_paydocs field_type=datetime field_length=8 field_scale=3 field_prec=23 page=2 order=33 init_class=1 init_formula=@in_date 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(CUR_DEALING_ID) name=Валюта проводки field_name=cur_dealing_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=36 init_class=1 init_formula=(select cur_id from t_plans where plan_code='BACK_MONEY') 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(SUM_CUR_DEALING) name=Сумма проводки field_name=sum_cur_dealing table_name=t_paydocs field_type=money field_length=8 field_scale=4 field_prec=19 page=2 order=37 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(TO_DIRECTION_ID) name=Целевое направление field_name=to_direction_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 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(TO_OBJECT_ID) name=Целевой объект field_name=to_object_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 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(FROM_DIRECTION_ID) name=Исходное направление field_name=from_direction_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 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(FROM_OBJECT_ID) name=Исходный объект field_name=from_object_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 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(CLIENT_ID) name=Клиент field_name=client_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 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(CHARACTER_ID) name=Тип ДС field_name=character_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=11 init_class=2 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(INSTRUCTION_ON2OFF) name=Формирование поручения автоматом field_name=instruction_on2off table_name=t_paydocs field_type=int field_length=4 field_scale=0 field_prec=10 page=2 order=39 init_class=null 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(CLIENT_CONTRACT_ID) name=Клиентский договор field_name=client_contract_id table_name=t_paydocs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=38 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(SCHET_ON_OFF) name=перевод ч/з 57 счет field_name=schet_on_off table_name=t_paydocs field_type=int field_length=4 field_scale=0 field_prec=10 page=2 order=42 init_class=null 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(RECEIVING_PAY_DATE) name=Дата получения платежа field_name=receiving_pay_date table_name=t_paydocs field_type=datetime field_length=null field_scale=null field_prec=null page=2 order=43 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(OUT_DATE) name=Внешняя дата корреспондента field_name=out_date table_name=td_depo_docs field_type=datetime field_length=8 field_scale=3 field_prec=23 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(IN_DATE) name=Дата документа field_name=in_date table_name=td_depo_docs field_type=datetime field_length=8 field_scale=3 field_prec=23 page=1 order=14 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(WHO_GET) name=Кто принял field_name=who_get table_name=td_depo_docs field_type=varchar field_length=100 field_scale=null field_prec=100 page=1 order=15 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(WHO_PUT) name=Кто отправил field_name=who_put table_name=td_depo_docs field_type=varchar field_length=100 field_scale=null field_prec=100 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 $PROP(OUT_NO) name=Внешний номер field_name=out_no table_name=td_depo_docs field_type=varchar field_length=50 field_scale=null field_prec=50 page=1 order=17 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_NO) name=Номер документа field_name=in_no table_name=td_depo_docs field_type=varchar field_length=50 field_scale=null field_prec=50 page=1 order=18 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(CORRESPONDENT_ID) name=Корреспондент field_name=correspondent_id table_name=td_depo_docs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=19 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(PAYER_ID) name=Плательщик field_name=payer_id table_name=td_depo_docs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=20 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(PAY_SUM) name=Сумма field_name=pay_sum table_name=td_depo_docs field_type=money field_length=8 field_scale=4 field_prec=19 page=1 order=21 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(INITIATOR_ID) name=Инициатор field_name=initiator_id table_name=td_depo_docs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=22 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=td_depo_docs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=23 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(DEPO_DOC_TYPE) name=Входящий исходящий или внутренний field_name=depo_doc_type table_name=td_depo_docs field_type=int field_length=4 field_scale=0 field_prec=10 page=1 order=24 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=td_depo_docs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=25 init_class=1 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(SUM_CUR_ID) name=Валюта суммы field_name=sum_cur_id table_name=td_depo_docs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=26 init_class=1 init_formula=.CUR("RUR") 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(DOC_COMMENT) name=Комментарий field_name=doc_comment table_name=td_depo_docs field_type=varchar field_length=255 field_scale=null field_prec=255 page=1 order=27 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(OWNER_ID) name=Организация field_name=owner_id table_name=td_depo_docs field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=28 init_class=1 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 $RELATION(REL10) class=1 type=T_OPERATIONS form=ITEM_OPERS_LIST prop=null idname=item_id_s order=999 $ENDRELATION $RELATION(REL5) class=0 type=CUR form=null prop=CUR_ID idname=null order=null $ENDRELATION $RELATION(REL4) class=0 type=PARTNERS form=null prop=CLIENT_ID idname=null order=null $ENDRELATION $RELATION(REL16) class=0 type=PARTNERS form=null prop=CORRESPONDENT_ID idname=null order=2 $ENDRELATION $RELATION(REL17) class=0 type=PARTNERS form=null prop=PAYER_ID idname=null order=3 $ENDRELATION $RELATION(REL1) class=0 type=PARTNERS form=null prop=INITIATOR_ID idname=null order=1 $ENDRELATION $RELATION(REL3) class=0 type=ITEMS form=null prop=FOUNDATION_ID idname=null order=null $ENDRELATION $RELATION(REL9) class=0 type=ITEMS form=null prop=TO_OBJECT_ID idname=null order=null $ENDRELATION $RELATION(REL8) class=0 type=ITEMS form=null prop=FROM_OBJECT_ID idname=null order=null $ENDRELATION $RELATION(REL14) class=0 type=ITEMS form=null prop=CLIENT_CONTRACT_ID idname=null order=101 $ENDRELATION $RELATION(REL2) class=0 type=PARTNERS_JUR form=null prop=OWNER_ID idname=null order=4 $ENDRELATION $RELATION(REL18) class=0 type=BANK_ACCOUNTS form=null prop=FROM_PARTNER_ACC_ID idname=null order=5 $ENDRELATION $RELATION(REL19) class=0 type=BANK_ACCOUNTS form=null prop=TO_PARTNER_ACC_ID idname=null order=6 $ENDRELATION $RELATION(REL11) class=1 type=ACTIONS_HISTORY form=UO_ACTIONS_HISTORY_LIST prop=null idname=null order=998 $ENDRELATION $RELATION(REL13) class=0 type=PORTFOLIO_SECTION form=null prop=PORTFOLIO_SUB_ID idname=null order=null $ENDRELATION $RELATION(REL12) class=0 type=PORTFOLIO form=null prop=PORTFOLIO_ID idname=null order=100 $ENDRELATION $RELATION(REL7) class=0 type=MOVE_DIRECTION form=null prop=TO_DIRECTION_ID idname=null order=null $ENDRELATION $RELATION(REL6) class=0 type=MOVE_DIRECTION form=null prop=FROM_DIRECTION_ID idname=null order=null $ENDRELATION $FORM(D_BROKOPER_P1) name=Просмотр class=5 filter=null target_state= uo=uo_edit dw=d_brok_depooper_p1 procedure=ap_10000000000031520 patterns=GENERIC_VIEW_ITEM_P1 user_define=0 isvisible=0 istab=1 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(16533949) create procedure dbo.%PROC% @sid varchar(30) = null as declare @id numeric, @action_id numeric, @user_id numeric, @state_id numeric, @type_id numeric, @type_id_s varchar(30), @new_state_id numeric, @state_name_id_s varchar(30) begin select @id = convert(numeric, @sid) select @action_id = %ACTION_ID% select @type_id_s = NULL select @state_name_id_s = NULL .CHECK_USER .CHECK_VIEW_ITEM if @id = -1 begin begin tran .GET_PROPS .CHECK_INSERT .INIT_VARS(B) .INSERT_ITEMS .INSERT .INSERT_DOC_RECORD(@id) commit tran end .INSERT_INFO4OPER(@id) .VIEW_ITEM(ALL,1) end $ENDTEXT(16533949) $ACTION2RELATION(REL1.PARTNER_CODE) relation=REL1 where=null prop=PARTNER_CODE order=18 alias=initiator_code $ENDACTION2RELATION $ACTION2RELATION(REL1.PARTNER_SHORT_NAME) relation=REL1 where=null prop=PARTNER_SHORT_NAME order=19 alias=initiator_short_name $ENDACTION2RELATION $ACTION2RELATION(REL2.PARTNER_CODE) relation=REL2 where=null prop=PARTNER_CODE order=35 alias=brok_code $ENDACTION2RELATION $ACTION2RELATION(REL2.PARTNER_SHORT_NAME) relation=REL2 where=null prop=PARTNER_SHORT_NAME order=36 alias=brok_short_name $ENDACTION2RELATION $ACTION2RELATION(REL16.PARTNER_CODE) relation=REL16 where=null prop=PARTNER_CODE order=18 alias=corr_code $ENDACTION2RELATION $ACTION2RELATION(REL16.PARTNER_SHORT_NAME) relation=REL16 where=null prop=PARTNER_SHORT_NAME order=19 alias=corr_short_name $ENDACTION2RELATION $ACTION2RELATION(REL17.PARTNER_CODE) relation=REL17 where=null prop=PARTNER_CODE order=18 alias=payer_code $ENDACTION2RELATION $ACTION2RELATION(REL17.PARTNER_SHORT_NAME) relation=REL17 where=null prop=PARTNER_SHORT_NAME order=19 alias=payer_short_name $ENDACTION2RELATION $BIND(BIND2) type=UK_INFO4OPER action=FORM_ED class=1 order=20 idname=sid $ENDBIND $BIND(BIND1) type=MONEY_MOVE_COMMISSION_2 action=UO_DEAL_EDIT class=1 order=10 idname=null $ENDBIND $ENDFORM $FORM(UO_DEAL_EDIT) name=Данные class=5 filter=null target_state= uo=uo_edit dw=d_money_move_new procedure=ap_10000000000031523 patterns=GENERIC_VIEW_ITEM_P2 user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(16533949) create procedure dbo.%PROC% @sid varchar(30) = null as declare @id numeric, @action_id numeric, @user_id numeric, @state_id numeric, @type_id numeric, @new_state_id numeric begin select @id = convert(numeric, @sid) select @action_id = %ACTION_ID% .CHECK_USER .CHECK_VIEW_ITEM declare @broker_id numeric select @broker_id=.GET_BROKER_ID .VIEW_ITEM(ALL,2) end $ENDTEXT(16533949) $ACTION2RELATION(REL4.PARTNER_SHORT_NAME) relation=REL4 where=null prop=PARTNER_SHORT_NAME order=null alias=client_short_name $ENDACTION2RELATION $ACTION2RELATION(REL8.ITEM_NAME) relation=REL8 where=null prop=ITEM_NAME order=null alias=from_object_name $ENDACTION2RELATION $ACTION2RELATION(REL9.ITEM_NAME) relation=REL9 where=null prop=ITEM_NAME order=null alias=to_object_name $ENDACTION2RELATION $ACTION2RELATION(REL13.SECTION_NAME) relation=REL13 where=null prop=SECTION_NAME order=null alias=section_name $ENDACTION2RELATION $ACTION2RELATION(REL12.PORTFOLIO_NAME) relation=REL12 where=null prop=PORTFOLIO_NAME order=3 alias=portfolio_name $ENDACTION2RELATION $ACTION2RELATION(REL18.BANK_ACCOUNT_NO) relation=REL18 where=null prop=BANK_ACCOUNT_NO order=12 alias=from_bank_account_no $ENDACTION2RELATION $ACTION2RELATION(REL19.BANK_ACCOUNT_NO) relation=REL19 where=null prop=BANK_ACCOUNT_NO order=12 alias=to_bank_account_no $ENDACTION2RELATION $ACTION2RELATION(REL3.ITEM_NAME) relation=REL3 where=null prop=ITEM_NAME order=3 alias=foundation_name $ENDACTION2RELATION $ACTION2RELATION(REL14.ITEM_NAME) relation=REL14 where=null prop=ITEM_NAME order=3 alias=client_contract_name $ENDACTION2RELATION $CALC(BROKER_ID_S) class=1 type=varchar calc_lenght=30 calc_prec=null calc_scale=null formula=@broker_id label=null order=10 $ENDCALC $CALC(ORGANISATION_ID_S) class=1 type=varchar calc_lenght=30 calc_prec=null calc_scale=null formula=(select owner_id from td_depo_docs where id=@id) label=Организация order=5 $ENDCALC $ENDFORM $ACTION(ACTION_DELETE) name=Удалить class=3 form=D_BROKOPER_P1 target_state=DEL procedure=ap_10000000000031536 patterns=GENERIC_MOVE user_define=0 isvisible=0 istab=1 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(16533951) create procedure dbo.%PROC% @sid varchar(30) = null as declare @action_id numeric, @id numeric, @user_id numeric, @state_id numeric, @new_state_id numeric, @type_id numeric begin tran select @action_id = %ACTION_ID% select @id = convert(numeric, @sid) .CHECK_USER .CHECK_UPDATE .UPDATE_STATE .ACTION_HISTORY /*-------Проводки ----------*/ commit tran $ENDTEXT(16533951) $BIND(BIND1) type=MONEY_MOVE_COMMISSION_2 action=UO_DEAL_EDIT class=1 order=10 idname=null $ENDBIND $ENDACTION $ACTION(ACTION_EXEC) name=Исполнить EXP class=9 form=null target_state=OP_FULL procedure=ap_21535000001692836 patterns=GENERIC_MOVE user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(16533951) create procedure dbo.%PROC% @sid varchar(30) = null, @is_not_save numeric=null as declare @action_id numeric, @id numeric, @user_id numeric, @state_id numeric, @new_state_id numeric, @type_id numeric begin if (@is_not_save is null or @is_not_save=0) exec ap_truncate_tables_operations declare @proc_result int select @action_id = %ACTION_ID% select @id = convert(numeric, @sid) .CHECK_USER .CHECK_UPDATE .UPDATE_STATE .ID_VAR(@action_history_id) .ACTION_HISTORY_TMP(@action_history_id) ------------------------ .GET_PROPS if @owner_id is null .EXIT_MESSAGE('Не задан владелец плана') .NAME_VAR(@from_object_code) .NAME_VAR(@to_object_code) .NAME_VAR(@from_object_class_code) .NAME_VAR(@to_object_class_code) .ID_VAR(@investor_id) .ID_VAR(@organisation_id) .ID_VAR(@from_object_class_id) .ID_VAR(@to_object_class_id) SELECT @from_object_code = td_rate_places.place_code, @from_object_class_code = t_move_directions.code, @from_object_class_id = t_move_directions.id FROM tb_broker2exchange, td_rate_places, t_move_directions WHERE tb_broker2exchange.id = @from_object_id AND tb_broker2exchange.exchange_id = td_rate_places.id AND tb_broker2exchange.object_class_id = t_move_directions.id SELECT @to_object_code = td_rate_places.place_code, @to_object_class_code = t_move_directions.code, @to_object_class_id = t_move_directions.id FROM tb_broker2exchange, td_rate_places, t_move_directions WHERE tb_broker2exchange.id = @to_object_id AND tb_broker2exchange.exchange_id = td_rate_places.id AND tb_broker2exchange.object_class_id = t_move_directions.id .ASSIGN(@from_object_code,(ISNULL(@from_object_code,'OWN'))) .ASSIGN(@to_object_code,(ISNULL(@to_object_code,'OWN'))) .ASSIGN(@from_object_class_code,(ISNULL(@from_object_class_code,'OWN'))) .ASSIGN(@to_object_class_code,(ISNULL(@to_object_class_code,'OWN'))) SELECT @organisation_id = (SELECT tb_broker_change.id FROM tb_broker_change WHERE tb_broker_change.partner_id = @owner_id AND .ITEMS_EXISTS_BY_TYPE(tb_broker_change.id,'broker_info')) if @character_id=2 begin --.ASSIGN(@investor_id,@foundation_id) select @investor_id = @client_contract_id end else begin select @investor_id = @organisation_id end ------------------------------ .ID_VAR(@client_partner_id) select @client_partner_id = (select client_id from tb_contracts where id = @investor_id) /*------ Резидентность--------*/ .INT_VAR(@is_client_resident) IF not(.IS_RESIDENT(@client_partner_id)) SELECT @is_client_resident = 0 ELSE SELECT @is_client_resident = 1 /* Только для входящего платежа IF(ISNULL(@contragent_id,-1) = -1) SELECT @is_contragent_resident = 1 ELSE BEGIN IF(.IS_RESIDENT(@contragent_id)) SELECT @is_contragent_resident = 1 ELSE SELECT @is_contragent_resident = 0 END */ --- Класс клиентского контракта .ID_VAR(@client_contract_class_id) if (@character_id > 1) begin select @client_contract_class_id = t.contract_class_id from tb_contract_types t, tb_contracts c where t.id = c.dog_type_id and c.id = @investor_id end -- Тип синтетического учета .ID_VAR(@org_sint_type_id) select @org_sint_type_id = .GET_TYPE_OF_SINT_ACCOUNTING(@organisation_id) .TRUNCATE_ALIASES ---- .TYPE_ALIASES_CALC(D,N,1) --- TRUNCATE TABLE #oper_block_tmp .GENERATE_BLOCK(@owner_id,10,@id,@type_id,@action_id,@action_history_id,'Перевод ДС внутри инвестора') if @action_history_id is not null begin update #t_actions_history set doc_id=@id, action_date=getdate() where id=@action_history_id if @@error!=0 begin rollback tran return end end if (@is_not_save is null or @is_not_save=1) exec ap_save_tables_operations end RETURN 1 $ENDTEXT(16533951) $ENDACTION $ACTION(ACTION_INSERT) name=Добавить class=1 form=D_BROKOPER_P1 target_state=ED procedure=ap_10000000000031538 patterns=GENERIC_INSERT_P1 user_define=0 isvisible=0 istab=1 posx=0 posy=0 width=2432 height=2108 proc_text=$TEXT(16533951) create procedure dbo.%PROC% @sid varchar(30) = null , .ARGLIST(ALL,1) as declare @action_id numeric, @id numeric, @user_id numeric, @state_id numeric, @type_id numeric, @item_name varchar(100), @new_state_id numeric begin select @action_id = %ACTION_ID% select @id = convert(numeric, @sid) .CHECK_USER .CHECK_UPDATE .ARGCONVERT(ALL,1) .INIT_VARS(AFTER,ALL,1) .BACK_GEN_NO(@in_no,@depo_doc_type,@in_date) --.DEPO_GEN_NO(@in_no,@depo_doc_type) .TEST_UNIQUE(ALL,1) begin tran .UPDATE(ALL,1) .RELGEN .UPDATE_STATE .ACTION_HISTORY commit tran select @sid = convert(varchar,@id) select @sid as sid end $ENDTEXT(16533951) $BIND(BIND2) type=UK_INFO4OPER action=ACTION_UPDATE class=1 order=20 idname=sid $ENDBIND $BIND(BIND1) type=MONEY_MOVE_COMMISSION_2 action=ACTION_UPDATE1 class=1 order=10 idname=null $ENDBIND $ENDACTION $ACTION(ACTION_MOVE) name=Отменить class=9 form=null target_state=ED procedure=ap_10000000000031541 patterns=GENERIC_MOVE user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(16533951) create procedure dbo.%PROC% @sid varchar(30) = null as declare @action_id numeric, @id numeric, @user_id numeric, @state_id numeric, @new_state_id numeric, @type_id numeric begin tran select @action_id = %ACTION_ID% select @id = convert(numeric, @sid) .CHECK_USER .CHECK_UPDATE .GET_PROPS .UPDATE_STATE .ACTION_HISTORY IF ISNULL(@foundation_id, 0) <> 0 BEGIN IF @character_id = 2 AND ISNULL(@instruction_on2off, 0) = 0 BEGIN -- Если стоит опция Не формировать поручение автоматом или в этом поле ничего нет (null) .ITEM_MOVE_STATE(@foundation_id, 'REG') END ELSE IF @character_id = 2 AND ISNULL(@instruction_on2off, 0) = 1 .TYPE_DELETE(@foundation_id,'INSTRUCTION_DS_INOUT') UPDATE t_paydocs SET foundation_id = NULL WHERE id = @id END /*-------Проводки ----------*/ .OPERS_ROLL commit tran $ENDTEXT(16533951) $ENDACTION $ACTION(ACTION_MOVE1) name=Исполнить class=9 form=null target_state=OP_FULL procedure=ap_10000000000031542 patterns=GENERIC_MOVE user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(16533951) create procedure dbo.%PROC% @sid varchar(30) = null as declare @action_id numeric, @id numeric, @user_id numeric, @state_id numeric, @new_state_id numeric, @type_id numeric begin tran select @action_id = %ACTION_ID% select @id = convert(numeric, @sid) .CHECK_USER .CHECK_UPDATE .ACTION_HISTORY /*-------Проводки ----------*/ .GET_PROPS .TEST_RATE2CUR2DATE(@in_date,@cur_id) -- проверка курса на дату declare @organisation_id numeric, @plan_money_id numeric, @plan_securs_id numeric, @out_method_id numeric, @investor_subc_str varchar(255), @investor_id numeric, @from_subc_str varchar(255), @to_subc_str varchar(255) declare @is_realiz int, @is_p2l_comis int, @is_com_in int, @is_allow_short4stocks int, @is_allow_short4money int, @asset4pereoc_type_id numeric ---получение параметров для проводок .BACK_GET_ORG_PARMS(@owner_id,@organisation_id,@plan_money_id,@plan_securs_id,@out_method_id,@is_realiz,@is_p2l_comis,@is_com_in,@is_allow_short4stocks,@is_allow_short4money,@asset4pereoc_type_id) if @character_id=2 select @investor_id=@client_contract_id else select @investor_id=@organisation_id .ASSIGN(@investor_subc_str,'') --формирование строки аналитики .SUBC_STR_ADD(@investor_subc_str,'investors',@investor_id) .SUBC_STR_ADD(@investor_subc_str,'portfolio',@portfolio_id) .SUBC_STR_ADD(@investor_subc_str,'investor2portfolio',@portfolio_sub_id) .ASSIGN(@from_subc_str,@investor_subc_str) .SUBC_STR_ADD(@from_subc_str,'BANK_ACCOUNT',@from_partner_acc_id) .SUBC_STR_ADD(@from_subc_str,'ASSET_PLACES',@from_object_id) .ASSIGN(@to_subc_str,@investor_subc_str) .SUBC_STR_ADD(@to_subc_str,'BANK_ACCOUNT',@to_partner_acc_id) .SUBC_STR_ADD(@to_subc_str,'ASSET_PLACES',@to_object_id) --проводки .BACK_OPERS_BEGIN_MOVE(@owner_id,0,@from_direction_id,@from_object_id,@to_direction_id,@to_object_id,@client_contract_id,@investor_subc_str,@portfolio_sub_id) ---@from_direction .BACK_MONEY_MOVE(@sum_cur_dealing,@in_date,@cur_price_date,@cur_dealing_id,@from_subc_str,@to_subc_str,@doc_sum,@doc_sum) .ID_VAR(@res_char_id) ---.ID_VAR(@client_contract_id) if @organisation_id != @investor_id select @client_contract_id = @investor_id #ifdef ALD_BANK_SECS ---проводки по Центробанку IF (.TEST_SINT_ACCOUNTING(@organisation_id)) or (.TEST_CLIENT_ACCOUNTING(@client_contract_id)) BEGIN .INV_CHARACTER_CALC(@investor_id,@res_char_id) .EXEC_PROC((ap_move_own_money_aliases @id),'Перевод ДС внутри инвестора: формирование алиасов') END #endif if @instruction_on2off=1 and @character_id=2 begin -------------- Создаем поручение на перевод автоматически-------- .TYPE_INIT('INSTRUCTION_DS_INOUT',5) .TYPE_ASSIGN(type_poruch_id,3,5) .BACK_GEN_NO(@in_no5_1,1,@in_date) .TYPE_ASSIGN(in_no,@in_no5_1,5) .TYPE_ASSIGN(in_date,@in_date,5) .TYPE_ASSIGN(depo_doc_type,1,5) .TYPE_ASSIGN(client_id,@client_id,5) .TYPE_ASSIGN(bank_account_id,@from_partner_acc_id,5) .TYPE_ASSIGN(asset_place_id,@from_object_id,5) .TYPE_ASSIGN(bank_account2move_id,@to_partner_acc_id,5) .TYPE_ASSIGN(asset_place_2move_id,@to_object_id,5) .TYPE_ASSIGN(price_cur_id,@cur_id,5) .TYPE_ASSIGN(doc_sum_lim,@doc_sum,5) .TYPE_ASSIGN(owner_id,@owner_id,5) .TYPE_ASSIGN(exec_end_date,@in_date,5) .TYPE_ASSIGN(client_contract_id,@client_contract_id,5) .TYPE_ASSIGN(portfolio_id,@portfolio_id,5) .TYPE_ASSIGN(investor2portfolio_id,@portfolio_sub_id,5) .TYPE_INSERT('INSTRUCTION_DS_INOUT','COMPLIT',5) update t_paydocs set foundation_id=@id5_1 where id=@id update tb_directions set in_time = dateadd(minute, rand()*390, '09:30:00') where id=@id5_1 end else if @instruction_on2off=0 and @character_id =2 begin declare @doc_sum_lim money select @doc_sum_lim=doc_sum_lim from tb_directions where id=@foundation_id if @doc_sum_lim=(select sum(doc_sum) from t_paydocs where foundation_id=@foundation_id and .ITEMS_EXISTS_BY_TYPE_STATE(t_paydocs.id,'MONEY_MOVE_COMMISSION_2','OP_FULL')) begin .ITEM_MOVE_STATE(@foundation_id,'COMPLIT') end end #ifdef ALD_UKPIF ------------ ПИФ ----------------- if .TEST_PIF_CLIENT(@client_contract_id) begin if @schet_on_off = 1 execute ap_pif_pay_exec_move_from_57 @sid, ---Изменено добавлено _from_57 ----- востановленно @action_history_id, @client_contract_id, @from_direction_id, @from_object_id, @to_direction_id, @to_object_id, @doc_sum, @in_date, @cur_id, @from_partner_acc_id, @to_partner_acc_id if isnull(@schet_on_off,0) = 0 execute ap_pif_pay_exec_move @sid, @action_history_id, @client_contract_id, @from_direction_id, @from_object_id, @to_direction_id, @to_object_id, @doc_sum, @in_date, @cur_id, @from_partner_acc_id, @to_partner_acc_id if @@error != 0 begin if @@trancount<>0 rollback tran return end end #endif --kashuba_av Изменение статуса выполняется после создания проводок. .UPDATE_STATE #ifdef ALD_BANK_SECS ------------ БАНК ----------------- IF .TEST_SINT_ACCOUNTING(@organisation_id) BEGIN .ID_VAR(@account_type_id) --- Определяем тип учета select @account_type_id = (select sint_account_type_id from tb_broker_change where id = @organisation_id) if @account_type_id is null select @account_type_id = 1 -- По умолчанию - банковский /* .GENERATE_TYPED_OPERATIONS(@owner_id,1,@id,@type_id,@action_id,0,@character_id,'Фактический платеж',@action_history_id,null,'Перевод ДС внутри инвестора')*/ .GENERATE_OPERATIONS(@owner_id,@account_type_id,@id,@type_id,@action_id,@action_history_id,0,@res_char_id,'Фактический платеж: перевод ДС внутри инвестора.') -- .ITEM_ALIASES_CLEAR(@id) END #endif commit tran $ENDTEXT(16533951) $ENDACTION $ACTION(ACTION_MOVE2) name=update переводов ДС class=9 form=null target_state=null procedure=ap_21535000000662217 patterns=null user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(16533951) create procedure dbo.%PROC% @sid varchar(30) = null as begin begin tran update t_paydocs set client_contract_id=foundation_id, instruction_on2off=1 where character_id=2 and .ITEMS_EXISTS_BY_TYPE(t_paydocs.id,'MONEY_MOVE_COMMISSION_2') commit tran end $ENDTEXT(16533951) $ENDACTION $ACTION(ACTION_TO_EDIT) name=На редактирование class=9 form=null target_state=ED procedure=ap_21535000001692837 patterns=GENERIC_MOVE user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(16533951) 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(16533951) $ENDACTION $ACTION(ACTION_TO_SEND) name=На отправку class=9 form=null target_state=TOSEND procedure=ap_21535000001692838 patterns=GENERIC_MOVE user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(16533951) 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(16533951) $ENDACTION $ACTION(ACTION_UPDATE) name=Изменить class=2 form=D_BROKOPER_P1 target_state=null procedure=ap_10000000000031543 patterns=GENERIC_UPDATE_P1 user_define=0 isvisible=0 istab=1 posx=0 posy=0 width=2665 height=1976 proc_text=$TEXT(16533951) create procedure dbo.%PROC% @sid varchar(30) = null, .ARGLIST(ALL,1) as declare @action_id numeric, @id numeric, @user_id numeric, @state_id numeric, @type_id numeric, @item_name varchar(100), @new_state_id numeric begin tran select @action_id = %ACTION_ID% select @id = convert(numeric, @sid) .CHECK_USER .CHECK_UPDATE .ARGCONVERT(ALL,1) if @in_no is null begin .INIT_VARS(AFTER,ALL,1) .BACK_GEN_NO(@in_no,@depo_doc_type,@in_date) end ---.DEPO_CHK_NO(@id,@in_no,@depo_doc_type) .TEST_UNIQUE(ALL,1) .UPDATE(ALL,1) .RELGEN .UPDATE_STATE .ACTION_HISTORY commit tran select sid = convert(varchar, @id) $ENDTEXT(16533951) $BIND(BIND2) type=UK_INFO4OPER action=ACTION_UPDATE class=1 order=30 idname=sid $ENDBIND $BIND(BIND1) type=MONEY_MOVE_COMMISSION_2 action=ACTION_UPDATE1 class=1 order=20 idname=null $ENDBIND $ENDACTION $ACTION(ACTION_UPDATE1) name=Данные (изм.) class=2 form=UO_DEAL_EDIT target_state=null procedure=ap_10000000000031539 patterns=GENERIC_UPDATE_P2 user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(16533951) create procedure dbo.%PROC% @sid varchar(30) = null, .ARGLIST(ALL, 2) as declare @action_id numeric, @id numeric, @user_id numeric, @state_id numeric, @type_id numeric, @item_name varchar(100), @new_state_id numeric begin tran select @action_id = %ACTION_ID% select @id = convert(numeric, @sid) .CHECK_USER .CHECK_UPDATE .ARGCONVERT(ALL, 2) .TEST_UNIQUE(ALL, 2) .GET_PROPS(ALL,1) .INIT_VARS(B) .UPDATE_ITEMS /*if @to_object_id=@from_object_id .EXIT_MESSAGE('Исходный и целевой объекты совпадают') */ if @character_id=1 select @client_contract_id=null, @foundation_id=null, @instruction_on2off=null if (@character_id=2) and (@instruction_on2off is null) .EXIT_MESSAGE('Параметр - Формировать авт. не задан!!!') declare @rate_value decimal(18,8), @rate_date datetime if @cur_id<>@cur_dealing_id begin if @character_cur_price=0 begin .TEST_RATE2CUR2DATE(@cur_price_date,@cur_id) .CONVERT_SUM(@cur_id,@cur_dealing_id,@cur_price_date,0,@doc_sum,@sum_cur_dealing,@rate_value,@rate_date) select @cur_price=round(convert(money,@rate_value),2) end else begin if isnull(@cur_price,0)=0 .EXIT_MESSAGE('Курс не задан') select @sum_cur_dealing=round((@cur_price*@doc_sum+@doc_sum*@cur_price*(isnull(@procent_plus,0)/100)),2) end end else begin select @sum_cur_dealing=@doc_sum select @cur_price=1 select @procent_plus=null end declare @organisation_id numeric, @plan_money_id numeric, @plan_securs_id numeric, @out_method_id numeric, @is_realiz int, @is_p2l_comis int, @is_com_in int, @is_allow_short4stocks int, @is_allow_short4money int, @asset4pereoc_type_id numeric .BACK_GET_ORG_PARMS(@owner_id,@organisation_id,@plan_money_id,@plan_securs_id,@out_method_id,@is_realiz,@is_p2l_comis,@is_com_in,@is_allow_short4stocks,@is_allow_short4money,@asset4pereoc_type_id) .BACK_PLASE_CLASS_FROM_OBJ(@to_object_id,@organisation_id,@to_direction_id) .BACK_PLASE_CLASS_FROM_OBJ(@from_object_id,@organisation_id,@from_direction_id) /* declare @from_partner_id numeric, @to_partner_id numeric select @from_partner_id=client_id from tb_contracts where id=@foundation_id if @from_partner_id is null select @from_partner_id=@owner_id select @to_partner_id=client_id from tb_contracts where id=@foundation_id if @to_partner_id is null select @to_partner_id=@owner_id update t_paydocs set from_partner_id=@from_partner_id, to_partner_id=@to_partner_id where id=@id */ .UPDATE(ALL,2) .RELGEN .UPDATE_STATE .ACTION_HISTORY commit tran $ENDTEXT(16533951) $ENDACTION $ACTION(ALIASES_CALC) name=Расчет алиасов class=9 form=null target_state=null procedure=ap_move_own_money_aliases patterns=null user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(16533951) create procedure dbo.%PROC% @sid varchar(30) = null as begin .ID_VAR(@id) select @id = convert(numeric,@sid) .GET_PROPS -- .EXIT_MESSAGE_PARM('@owner_id',@owner_id) .NAME_VAR(@from_object_code) .NAME_VAR(@to_object_code) .NAME_VAR(@from_object_class_code) .NAME_VAR(@to_object_class_code) .ID_VAR(@investor_id) .ID_VAR(@organisation_id) SELECT @from_object_code = td_rate_places.place_code, @from_object_class_code = t_move_directions.code FROM tb_broker2exchange, td_rate_places, t_move_directions WHERE tb_broker2exchange.id = @from_object_id AND tb_broker2exchange.exchange_id = td_rate_places.id AND tb_broker2exchange.object_class_id = t_move_directions.id SELECT @to_object_code = td_rate_places.place_code, @to_object_class_code = t_move_directions.code FROM tb_broker2exchange, td_rate_places, t_move_directions WHERE tb_broker2exchange.id = @to_object_id AND tb_broker2exchange.exchange_id = td_rate_places.id AND tb_broker2exchange.object_class_id = t_move_directions.id .ASSIGN(@from_object_code,(ISNULL(@from_object_code,'OWN'))) .ASSIGN(@to_object_code,(ISNULL(@to_object_code,'OWN'))) .ASSIGN(@from_object_class_code,(ISNULL(@from_object_class_code,'OWN'))) .ASSIGN(@to_object_class_code,(ISNULL(@to_object_class_code,'OWN'))) if @character_id=2 begin .ASSIGN(@investor_id,@foundation_id) end else begin SELECT @investor_id = (SELECT tb_broker_change.id FROM tb_broker_change WHERE tb_broker_change.partner_id = @owner_id AND .ITEMS_EXISTS_BY_TYPE(tb_broker_change.id,'broker_info')) end .NAME_VAR(@money_operation_name) --if --.TYPE_ALIASES_CALC(D,N,1) end RETURN 1 $ENDTEXT(16533951) $ENDACTION $ACTION(COPY) name=Скопировать class=9 form=null target_state=ED procedure=ap_10000000000031545 patterns=GENERIC_MOVE user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(16533951) create procedure dbo.%PROC% @sid varchar(30) = null as declare @action_id numeric, @id numeric, @user_id numeric, @state_id numeric, @new_state_id numeric, @type_id numeric begin tran select @action_id = %ACTION_ID% select @id = convert(numeric, @sid) declare @set_id numeric select @set_id=@id .CHECK_USER .CHECK_UPDATE .ACTION_HISTORY .GET_PROPS select @in_no=null, @out_date=null, @doc_sum=null --@in_date=null, --.BACK_GEN_NO(@in_no,@depo_doc_type,@in_date) .INSERT_ITEMS .INSERT update t_items set item_name='COPY' where id=@id /*.ITEM_MOVE_STATE(@id,'EDIT')*/ .UPDATE_STATE /*-------Проводки ----------*/ commit tran $ENDTEXT(16533951) $ENDACTION $ACTION(SEND_PAYMENT) name=Отправить class=9 form=null target_state=SENT procedure=ap_21535000001692839 patterns=null user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(16533951) create procedure dbo.%PROC% @sid varchar(30) = null as declare @action_id numeric, @id numeric, @user_id numeric, @state_id numeric, @new_state_id numeric, @type_id numeric begin tran select @action_id = %ACTION_ID% select @id = convert(numeric, @sid) .CHECK_USER .CHECK_UPDATE .UPDATE_STATE .ACTION_HISTORY /*-------Проводки ----------*/ .GET_PROPS .TEST_RATE2CUR2DATE(@in_date,@cur_id) -- проверка курса на дату declare @organisation_id numeric, @plan_money_id numeric, @plan_securs_id numeric, @out_method_id numeric, @investor_subc_str varchar(255), @investor_id numeric, @from_subc_str varchar(255), @to_subc_str varchar(255) declare @is_realiz int, @is_p2l_comis int, @is_com_in int, @is_allow_short4stocks int, @is_allow_short4money int, @asset4pereoc_type_id numeric #ifdef ALD_UKPIF ------------ ПИФ ----------------- if .TEST_PIF_CLIENT(@client_contract_id) begin if @schet_on_off = 1 begin execute ap_pif_pay_exec_move_to_57 @sid, @action_history_id, @client_contract_id, @from_direction_id, @from_object_id, @to_direction_id, @to_object_id, @doc_sum, @in_date, @cur_id, @from_partner_acc_id, @to_partner_acc_id if @@error != 0 begin if @@trancount<>0 rollback tran return end end else begin .EXIT_MESSAGE('Метод используется только при переводе платежей через 57 счет') end end #endif commit tran $ENDTEXT(16533951) $ENDACTION $STATE2ACTION(ED.ACTION_DELETE) state=ED action=ACTION_DELETE $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION_EXEC) state=ED action=ACTION_EXEC $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION_MOVE1) state=ED action=ACTION_MOVE1 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION_MOVE2) state=ED action=ACTION_MOVE2 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION_TO_SEND) state=ED action=ACTION_TO_SEND $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION_UPDATE) state=ED action=ACTION_UPDATE $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION_UPDATE1) state=ED action=ACTION_UPDATE1 $ENDSTATE2ACTION $STATE2ACTION(ED.COPY) state=ED action=COPY $ENDSTATE2ACTION $STATE2ACTION(ED.D_BROKOPER_P1) state=ED action=D_BROKOPER_P1 $ENDSTATE2ACTION $STATE2ACTION(ED.SEND_PAYMENT) state=ED action=SEND_PAYMENT $ENDSTATE2ACTION $STATE2ACTION(ED.UO_DEAL_EDIT) state=ED action=UO_DEAL_EDIT $ENDSTATE2ACTION $STATE2ACTION(NEW.ACTION_INSERT) state=NEW action=ACTION_INSERT $ENDSTATE2ACTION $STATE2ACTION(OP_FULL.ACTION_MOVE) state=OP_FULL action=ACTION_MOVE $ENDSTATE2ACTION $STATE2ACTION(OP_FULL.ACTION_MOVE2) state=OP_FULL action=ACTION_MOVE2 $ENDSTATE2ACTION $STATE2ACTION(OP_FULL.COPY) state=OP_FULL action=COPY $ENDSTATE2ACTION $STATE2ACTION(OP_FULL.D_BROKOPER_P1) state=OP_FULL action=D_BROKOPER_P1 $ENDSTATE2ACTION $STATE2ACTION(OP_FULL.UO_DEAL_EDIT) state=OP_FULL action=UO_DEAL_EDIT $ENDSTATE2ACTION $STATE2ACTION(SENT.ACTION_MOVE) state=SENT action=ACTION_MOVE $ENDSTATE2ACTION $STATE2ACTION(SENT.ACTION_MOVE1) state=SENT action=ACTION_MOVE1 $ENDSTATE2ACTION $STATE2ACTION(SENT.ACTION_UPDATE) state=SENT action=ACTION_UPDATE $ENDSTATE2ACTION $STATE2ACTION(SENT.ACTION_UPDATE1) state=SENT action=ACTION_UPDATE1 $ENDSTATE2ACTION $STATE2ACTION(SENT.ALIASES_CALC) state=SENT action=ALIASES_CALC $ENDSTATE2ACTION $STATE2ACTION(SENT.COPY) state=SENT action=COPY $ENDSTATE2ACTION $STATE2ACTION(SENT.D_BROKOPER_P1) state=SENT action=D_BROKOPER_P1 $ENDSTATE2ACTION $STATE2ACTION(SENT.UO_DEAL_EDIT) state=SENT action=UO_DEAL_EDIT $ENDSTATE2ACTION $STATE2ACTION(TOSEND.ACTION_EXEC) state=TOSEND action=ACTION_EXEC $ENDSTATE2ACTION $STATE2ACTION(TOSEND.ACTION_MOVE1) state=TOSEND action=ACTION_MOVE1 $ENDSTATE2ACTION $STATE2ACTION(TOSEND.ACTION_TO_EDIT) state=TOSEND action=ACTION_TO_EDIT $ENDSTATE2ACTION $STATE2ACTION(TOSEND.D_BROKOPER_P1) state=TOSEND action=D_BROKOPER_P1 $ENDSTATE2ACTION $STATE2ACTION(TOSEND.UO_DEAL_EDIT) state=TOSEND action=UO_DEAL_EDIT $ENDSTATE2ACTION $STATE2PROP(ED.CHARACTER_CUR_PRICE) state=ED prop=CHARACTER_CUR_PRICE enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CHARACTER_ID) state=ED prop=CHARACTER_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CLIENT_CONTRACT_ID) state=ED prop=CLIENT_CONTRACT_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CLIENT_ID) state=ED prop=CLIENT_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CORRESPONDENT_ID) state=ED prop=CORRESPONDENT_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CUR_DEALING_ID) state=ED prop=CUR_DEALING_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CUR_ID) state=ED prop=CUR_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CUR_PRICE) state=ED prop=CUR_PRICE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CUR_PRICE_DATE) state=ED prop=CUR_PRICE_DATE enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.DEPO_DOC_TYPE) state=ED prop=DEPO_DOC_TYPE 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.DOC_COMMENT) state=ED prop=DOC_COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.DOC_SUM) state=ED prop=DOC_SUM enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.FOLDER_ID) state=ED prop=FOLDER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.FOUNDATION_ID) state=ED prop=FOUNDATION_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.FROM_DIRECTION_ID) state=ED prop=FROM_DIRECTION_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.FROM_OBJECT_ID) state=ED prop=FROM_OBJECT_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.FROM_PARTNER_ACC_ID) state=ED prop=FROM_PARTNER_ACC_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.INITIATOR_ID) state=ED prop=INITIATOR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.INSTRUCTION_ON2OFF) state=ED prop=INSTRUCTION_ON2OFF enable=1 mandatory=0 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.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=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.PAYER_ID) state=ED prop=PAYER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.PAY_SUM) state=ED prop=PAY_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.PERPOSE_STR) state=ED prop=PERPOSE_STR enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.PORTFOLIO_ID) state=ED prop=PORTFOLIO_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.PORTFOLIO_SUB_ID) state=ED prop=PORTFOLIO_SUB_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.PROCENT_PLUS) state=ED prop=PROCENT_PLUS enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.PURPOSE_ID) state=ED prop=PURPOSE_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.RECEIVING_PAY_DATE) state=ED prop=RECEIVING_PAY_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.SCHET_ON_OFF) state=ED prop=SCHET_ON_OFF enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.SUM_CUR_ID) state=ED prop=SUM_CUR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.TO_DIRECTION_ID) state=ED prop=TO_DIRECTION_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.TO_OBJECT_ID) state=ED prop=TO_OBJECT_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.TO_PARTNER_ACC_ID) state=ED prop=TO_PARTNER_ACC_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.WHO_GET) state=ED prop=WHO_GET enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.WHO_PUT) state=ED prop=WHO_PUT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.CHARACTER_CUR_PRICE) state=NEW prop=CHARACTER_CUR_PRICE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.CHARACTER_ID) state=NEW prop=CHARACTER_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.CLIENT_CONTRACT_ID) state=NEW prop=CLIENT_CONTRACT_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.CLIENT_ID) state=NEW prop=CLIENT_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.CORRESPONDENT_ID) state=NEW prop=CORRESPONDENT_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.CUR_ID) state=NEW prop=CUR_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.CUR_PRICE) state=NEW prop=CUR_PRICE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.CUR_PRICE_DATE) state=NEW prop=CUR_PRICE_DATE enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.DEPO_DOC_TYPE) state=NEW prop=DEPO_DOC_TYPE 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.DOC_COMMENT) state=NEW prop=DOC_COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.DOC_SUM) state=NEW prop=DOC_SUM enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.FOLDER_ID) state=NEW prop=FOLDER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.FOUNDATION_ID) state=NEW prop=FOUNDATION_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.FROM_DIRECTION_ID) state=NEW prop=FROM_DIRECTION_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.FROM_OBJECT_ID) state=NEW prop=FROM_OBJECT_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.FROM_PARTNER_ACC_ID) state=NEW prop=FROM_PARTNER_ACC_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.INITIATOR_ID) state=NEW prop=INITIATOR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.INSTRUCTION_ON2OFF) state=NEW prop=INSTRUCTION_ON2OFF enable=1 mandatory=0 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.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=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.PAYER_ID) state=NEW prop=PAYER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.PAY_SUM) state=NEW prop=PAY_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.PERPOSE_STR) state=NEW prop=PERPOSE_STR enable=1 mandatory=0 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 $STATE2PROP(NEW.PROCENT_PLUS) state=NEW prop=PROCENT_PLUS enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.PURPOSE_ID) state=NEW prop=PURPOSE_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.RECEIVING_PAY_DATE) state=NEW prop=RECEIVING_PAY_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.SCHET_ON_OFF) state=NEW prop=SCHET_ON_OFF enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.SUM_CUR_ID) state=NEW prop=SUM_CUR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.TO_DIRECTION_ID) state=NEW prop=TO_DIRECTION_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.TO_OBJECT_ID) state=NEW prop=TO_OBJECT_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.TO_PARTNER_ACC_ID) state=NEW prop=TO_PARTNER_ACC_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.WHO_GET) state=NEW prop=WHO_GET enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.WHO_PUT) state=NEW prop=WHO_PUT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(SENT.RECEIVING_PAY_DATE) state=SENT prop=RECEIVING_PAY_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $ENDDOC