# Date: 29/06/06 # Version: 105 $DOC(D_STOCK_OUT_OTHER_DEPO) name=Снятие ЦБ в другом СД class=1 product=ALD_FUND name_formula=.DEPO_OPER_ITEM_NAME remark_formula=$TEXT(12503274) .TO_STR_RND(@stock_qty) + ' ' + .ITEM_NAME(@stock_id) + ' ' + .ITEM_NAME(@s_subacc_id) + '->' + .ITEM_NAME(@t_subacc_id) + ' ' + isnull(@move_contragent_name, '') + ' ' + isnull(@contragent_comment, '') $ENDTEXT(12503274) $STATE(BEG) name=Начальный class=1 $ENDSTATE $STATE(DEL) name=Удален class=2 $ENDSTATE $STATE(ED) name=Редактируется class=0 $ENDSTATE $STATE(OP_END_SD) name=Подтвержден class=0 $ENDSTATE $PROP(OUT_DATE) name=Внешняя дата корреспондента field_name=out_date table_name=td_depo_docs field_type=datetime field_length=8 field_scale=null field_prec=null 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(IN_DATE) name=Дата документа field_name=in_date table_name=td_depo_docs field_type=datetime field_length=8 field_scale=null field_prec=null page=1 order=2 init_class=1 init_formula=.OPERDAY unique_index=1 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=null page=1 order=3 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=null 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(OUT_NO) name=Внешний номер field_name=out_no table_name=td_depo_docs field_type=varchar field_length=50 field_scale=null field_prec=null 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 $PROP(IN_NO) name=Номер документа field_name=in_no table_name=td_depo_docs field_type=varchar field_length=50 field_scale=null field_prec=null page=1 order=6 init_class=0 init_formula=null unique_index=1 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=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(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=8 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=null field_prec=null page=1 order=9 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=10 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=11 init_class=1 init_formula=1 unique_index=null numerator=null import_type=null import_table=null import_field= 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=null field_prec=null page=1 order=12 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=13 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(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=14 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=null page=1 order=15 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_REMARK) name=Комментарий по документам - основаниям field_name=foundation_remark table_name=td_depo_docs field_type=varchar field_length=255 field_scale=null field_prec=null page=2 order=17 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(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=18 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 $PROP(KEEP_SUBACC_ID) name=Активный раздел field_name=keep_subacc_id table_name=td_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 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(T_SUBACC_ID) name=Раздел счета получатель field_name=t_subacc_id table_name=td_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=23 init_class=0 init_formula=@keep_subacc_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(S_SUBACC_ID) name=Раздел счета поставщик field_name=s_subacc_id table_name=td_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=24 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(MOVE_COMMENT) name=Комментарий field_name=move_comment table_name=td_stock_moves field_type=varchar field_length=255 field_scale=null field_prec=null page=2 order=26 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(CONTRAGENT_COMMENT) name=Контрагент с ном держателем field_name=contragent_comment table_name=td_stock_moves field_type=varchar field_length=255 field_scale=null field_prec=null page=2 order=27 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field= import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(OPER_FORM_ID) name=Форма операции field_name=oper_form_id table_name=td_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=28 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(REESTR_OPER_DATE) name=Дата операции в реестре field_name=reestr_oper_date table_name=td_stock_moves field_type=datetime field_length=8 field_scale=null field_prec=null page=2 order=29 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(DEPOCORR_OPER_DATE) name=Дата исполнения депозитарие field_name=depocorr_oper_date table_name=td_stock_moves field_type=datetime field_length=8 field_scale=null field_prec=null 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(MOVE_CONTRAGENT_NAME) name=Контрагент по передаче field_name=move_contragent_name table_name=td_stock_moves field_type=varchar field_length=255 field_scale=null field_prec=null page=2 order=31 init_class=null init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field= import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(CONTR_OWNER_TYPE_ID) name=Тип держания field_name=contr_owner_type_id table_name=td_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=32 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(CONTR_ACCOUNT) name=Счет контрагента field_name=contr_account table_name=td_stock_moves field_type=varchar field_length=100 field_scale=null field_prec=null page=2 order=33 init_class=null init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field= import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(CONTR_JURADRESS) name=Юридический адрес field_name=contr_juradress table_name=td_stock_moves field_type=varchar field_length=255 field_scale=null field_prec=null 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(CONTR_REGISTER_NO) name=N госрегистрации field_name=contr_register_no table_name=td_stock_moves field_type=varchar field_length=60 field_scale=null field_prec=null 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(CONTR_REGISTER_DATE) name=Дата регистрации field_name=contr_register_date table_name=td_stock_moves field_type=datetime field_length=8 field_scale=null field_prec=null page=2 order=36 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(CONTR_REGISTRATOR) name=Регистратор field_name=contr_registrator table_name=td_stock_moves field_type=varchar field_length=255 field_scale=null field_prec=null page=2 order=37 init_class=null init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field= import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(KEEP_TRAJECT_END_ID) name=Конечный узел цепочки хранения field_name=keep_traject_end_id table_name=td_stock_moves 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(REESTR_OPER_ID) name=Ссылка на перечень выписки по конечному узлу field_name=reestr_oper_id table_name=td_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=39 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(DEPOCORR_OPER_ID) name=Ссылка на перечень выписки по ближ корресп field_name=depocorr_oper_id table_name=td_stock_moves 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(STOCK_ID) name=ценная бумага field_name=stock_id table_name=ts_sd_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 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(STOCK_PRICE) name=Сумма сделки field_name=stock_price table_name=ts_sd_stock_moves field_type=money field_length=8 field_scale=null field_prec=null page=2 order=41 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(STOCK_PRICE_CUR_ID) name=Валюта сделки field_name=stock_price_cur_id table_name=ts_sd_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=42 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(COUPON_SUM) name=УНКД field_name=coupon_sum table_name=ts_sd_stock_moves field_type=money field_length=8 field_scale=null field_prec=null page=2 order=43 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(FOUND_DOC_ID) name=Договор счета ДЕПО field_name=found_doc_id table_name=ts_sd_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=25 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(STOCK_QTY) name=Количество field_name=stock_qty table_name=ts_sd_stock_moves field_type=money field_length=8 field_scale=null field_prec=null page=2 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(CONTRAG_ID) name=Контрагент по учету в СД field_name=contrag_id table_name=ts_sd_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=44 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=ts_sd_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=16 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(PERPOSE_ID) name=Назначение field_name=perpose_id table_name=ts_sd_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 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(IS_COUPON_IN_PRICE) name=УНКД в том числе field_name=is_coupon_in_price table_name=ts_sd_stock_moves field_type=int field_length=4 field_scale=null field_prec=null page=2 order=45 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(IS_COMPLETED) name=Проведено по СД field_name=is_completed table_name=ts_sd_stock_moves field_type=int field_length=4 field_scale=null field_prec=null page=10 order=46 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(EXEC_DATE) name=Дата исполнения field_name=exec_date table_name=ts_sd_stock_moves field_type=datetime field_length=8 field_scale=null field_prec=null page=2 order=47 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 $RELATION(REL17) class=0 type=TARGET_PURPOSES form=null prop=PERPOSE_ID idname=null order=70 $ENDRELATION $RELATION(REL18) class=0 type=partners form=null prop=CONTRAG_ID idname=null order=80 $ENDRELATION $RELATION(REL19) class=1 type=ASSETS2ITEMS form=D_ASSETS2ITEMS_LIST prop=null idname=docitem_id_s order=30 $ENDRELATION $RELATION(REL1) class=0 type=partners form=null prop=INITIATOR_ID idname=null order=null $ENDRELATION $RELATION(REL2) class=0 type=partners form=null prop=CORRESPONDENT_ID idname=null order=null $ENDRELATION $RELATION(REL3) class=1 type=t_operations form=item_opers_list prop=null idname=item_id_s order=130 $ENDRELATION $RELATION(REL4) class=1 type=actions_history form=uo_actions_history_list prop=null idname=null order=120 $ENDRELATION $RELATION(REL5) class=1 type=reports form=uo_reports_page_list prop=null idname=foundation_id_s order=110 $ENDRELATION $RELATION(REL7) class=1 type=activdocs form=ACTION2 prop=null idname=null order=1000 $ENDRELATION $RELATION(REL8) class=0 type=PIF_FUND form=null prop=OWNER_ID idname=null order=null $ENDRELATION $RELATION(REL9) class=0 type=items form=null prop=FOUNDATION_ID idname=null order=50 $ENDRELATION $RELATION(REL10) class=0 type=DOG_DEALINGS_SALE form=null prop=FOUNDATION_ID idname=null order=60 $ENDRELATION $RELATION(REL11) class=0 type=partners form=null prop=PAYER_ID idname=null order=null $ENDRELATION $RELATION(REL12) class=0 type=td_stock_emis form=null prop=STOCK_ID idname=null order=10 $ENDRELATION $RELATION(REL13) class=0 type=depo_subacc form=null prop=S_SUBACC_ID idname=null order=30 $ENDRELATION $RELATION(REL14) class=0 type=depo_subacc form=null prop=KEEP_SUBACC_ID idname=null order=20 $ENDRELATION $RELATION(REL15) class=4 type=d_depo_folders form=null prop=FOLDER_ID idname=null order=null $ENDRELATION $RELATION(REL16) class=0 type=items form=null prop=FOUND_DOC_ID idname=null order=40 $ENDRELATION $RELATION(REL6) class=1 type=SD_INDOC2DOC form=FORM2 prop=null idname=doc_id_s order=1010 $ENDRELATION $FORM(D_ASSETS2ITEMS_EDIT) name=Список для привязки партий class=5 filter=null target_state= uo=uo_assets2items dw=d_assets2items_edit procedure=ap_30145000002861346 patterns=null user_define=1 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503275) create procedure dbo.%PROC% @sid varchar(30) = null as declare @id numeric, @action_id numeric, @user_id numeric, @state_id numeric, @type_id numeric begin select @action_id = %ACTION_ID% select @id = convert(numeric, @sid) .CHECK_USER /* assets2items */ /* delete t_items from t_pays2items where t_pays2items.id = t_items.id and t_pays2items.docitem_id = @id and .ITEMS_EXISTS_BY_TYPE(t_pays2items.id,'assets2items') delete t_pays2items where t_pays2items.docitem_id = @id and .ITEMS_EXISTS_BY_TYPE(t_pays2items.id,'assets2items') */ .GET_PROPS declare @fund_type_code varchar(255) declare @subc3_type_id numeric declare @subc3_item_id numeric declare @fund_plan_id numeric declare @operday datetime declare @stock_account_id numeric --select @operday = @exec_date --.OPERDAY .GET_SD_OPER_DATE(@operday,@id) if @owner_id is null .EXIT_MESSAGE('Не задан фонд') select @fund_type_code = .ITEM_TYPE_CODE(@owner_id) select @fund_type_code = lower(@fund_type_code) if @fund_type_code = 'pif_fund' begin select @fund_plan_id = .ARG_PLAN('PIF_ACCOUNT') end else if @fund_type_code = 'npf_fund' begin select @fund_plan_id = .ARG_PLAN('NPF_ACCOUNT') end select @stock_account_id = .ACCID_FROM_EFFNO(@fund_plan_id,'58.1') if @fund_type_code = 'pif_fund' begin select @subc3_type_id = .SUBCTYPE_FROM_CODE('stock_emis') select @subc3_item_id = @stock_id end else begin select @subc3_type_id = .SUBCTYPE_FROM_CODE('asset_manager') select @subc3_item_id = isnull(@initiator_id, @owner_id) end .TOTALS_QUERY_SUB(@owner_id,@fund_plan_id,@operday,@operday,@stock_account_id,'stock_emis',@stock_id,'doc_item',N,(.FROM_SUBC3),(.WHERE_SUBC3(@subc3_type_id,@subc3_item_id)),L,N,Y,N,Y) /* Delete not existed */ delete t_items from t_pays2items where t_pays2items.id = t_items.id and t_pays2items.docitem_id = @id and t_pays2items.paydoc_id not in (select o.subc2_id from #tmp_oss o ) and .ITEMS_EXISTS_BY_TYPE(t_pays2items.id,'assets2items') delete t_pays2items where t_pays2items.docitem_id = @id and t_pays2items.paydoc_id not in (select o.subc2_id from #tmp_oss o ) and .ITEMS_EXISTS_BY_TYPE(t_pays2items.id,'assets2items') /*-------*/ select @sid as sid, convert(decimal(18,4), @stock_qty) as stock_qty, t_types.type_name, d.in_no, d.in_date, convert(varchar(30), o.subc2_id) as part_id_s, convert(decimal(18,4), o.saldo_de) as part_sum, convert(decimal(18,4), o.q_saldo_de) as part_qty, convert(decimal(18,4), (o.saldo_de / o.q_saldo_de)) as part_price, convert(decimal(18,4),(select min(p.covered_sum) from t_pays2items p where p.docitem_id = @id and p.paydoc_id = o.subc2_id and .ITEMS_EXISTS_BY_TYPE(p.id,'assets2items')) ) as calc_sum from #tmp_oss o, td_depo_docs d, t_items, t_types where o.subc2_id = d.id and o.q_saldo_de > 0 and o.subc2_id = t_items.id and t_items.type_id = t_types.id order by d.in_date, d.in_no end $ENDTEXT(12503275) $ENDFORM $FORM(D_STOCK_OUT_VIEW_NOTSD) name=Данные class=5 filter=null target_state= uo=uo_edit dw=d_stock_out_view_notsd procedure=ap_30145000002861329 patterns=GENERIC_VIEW_ITEM_P2 user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503275) 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 .MONEY_VAR(@dog_stock_covered_qty) .ID_VAR(@foundation_id) .ID_VAR(@perpose_id) select @foundation_id = foundation_id,@perpose_id=perpose_id from ts_sd_stock_moves where id =@id if not(@perpose_id is null) begin if .PURPOSE_CODE(@perpose_id) = 6005 and not(@foundation_id is null) begin select @dog_stock_covered_qty = 0 select @dog_stock_covered_qty = .STOCK_COVERED_BY_DEAL_QTY(@id,@foundation_id) end end .VIEW_ITEM(ALL,2) end $ENDTEXT(12503275) $ACTION2RELATION(REL14.DEPO_SUBACC_NO) relation=REL14 where=null prop=DEPO_SUBACC_NO order=13 alias=keep_subacc_no $ENDACTION2RELATION $ACTION2RELATION(REL14.DEPO_SUBACC_NAME) relation=REL14 where=null prop=DEPO_SUBACC_NAME order=5 alias=keep_subacc_name $ENDACTION2RELATION $ACTION2RELATION(REL13.DEPO_SUBACC_NO) relation=REL13 where=null prop=DEPO_SUBACC_NO order=13 alias=s_subacc_no $ENDACTION2RELATION $ACTION2RELATION(REL13.DEPO_SUBACC_NAME) relation=REL13 where=null prop=DEPO_SUBACC_NAME order=5 alias=s_subacc_name $ENDACTION2RELATION $ACTION2RELATION(REL12.EMMITENT_ID) relation=REL12 where=null prop=EMMITENT_ID order=1 alias=emmitent_id_s $ENDACTION2RELATION $ACTION2RELATION(REL12.STOCK_CODE) relation=REL12 where=null prop=STOCK_CODE order=3 alias=stock_code $ENDACTION2RELATION $ACTION2RELATION(REL12.STOCK_NAME) relation=REL12 where=null prop=STOCK_NAME order=4 alias=stock_name $ENDACTION2RELATION $ACTION2RELATION(REL12.STOCK_TYPE_ID) relation=REL12 where=null prop=STOCK_TYPE_ID order=6 alias=stock_type_id_s $ENDACTION2RELATION $ACTION2RELATION(REL9.ITEM_NAME) relation=REL9 where=null prop=ITEM_NAME order=2 alias=dog_name $ENDACTION2RELATION $ACTION2RELATION(REL9.ITEM_REMARK) relation=REL9 where=null prop=ITEM_REMARK order=4 alias=dog_remark $ENDACTION2RELATION $ACTION2RELATION(REL10.STOCK_ID) relation=REL10 where=null prop=STOCK_ID order=4 alias=dog_stock_id_s $ENDACTION2RELATION $ACTION2RELATION(REL10.STOCK_QTY) relation=REL10 where=null prop=STOCK_QTY order=6 alias=dog_stock_qty $ENDACTION2RELATION $ACTION2RELATION(REL16.ITEM_NAME) relation=REL16 where=null prop=ITEM_NAME order=2 alias=dog_depo_name $ENDACTION2RELATION $ACTION2RELATION(REL16.ITEM_REMARK) relation=REL16 where=null prop=ITEM_REMARK order=4 alias=dog_depo_remark $ENDACTION2RELATION $ACTION2RELATION(REL17.CODE) relation=REL17 where=null prop=CODE order=1 alias=purpose_code $ENDACTION2RELATION $ACTION2RELATION(REL17.NAME) relation=REL17 where=null prop=NAME order=2 alias=purpose_name $ENDACTION2RELATION $ACTION2RELATION(REL18.PARTNER_CODE) relation=REL18 where=null prop=PARTNER_CODE order=1 alias=partner_code $ENDACTION2RELATION $ACTION2RELATION(REL18.PARTNER_SHORT_NAME) relation=REL18 where=null prop=PARTNER_SHORT_NAME order=4 alias=partner_short_name $ENDACTION2RELATION $CALC(DOG_STOCK_COVERED_QTY) class=1 type=money calc_lenght=null calc_prec=null calc_scale=null formula=@dog_stock_covered_qty label=null order=1 $ENDCALC $ENDFORM $FORM(FORM1) name=Просмотр class=5 filter=null target_state= uo=uo_depooper_edit dw=d_sdepo_oper_p1 procedure=ap_30145000002433591 patterns=GENERIC_VIEW_ITEM_P1 user_define=1 isvisible=0 istab=1 posx=0 posy=0 width=3168 height=1944 proc_text=$TEXT(12503275) 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 commit tran end .INSERT_INFO4OPER(@id) .VIEW_ITEM(ALL,1) /* .ACTION_HISTORY */ end $ENDTEXT(12503275) $ACTION2RELATION(REL1.PARTNER_CODE) relation=REL1 where=null prop=PARTNER_CODE order=1 alias=initiator_code $ENDACTION2RELATION $ACTION2RELATION(REL1.PARTNER_SHORT_NAME) relation=REL1 where=null prop=PARTNER_SHORT_NAME order=4 alias=initiator_short_name $ENDACTION2RELATION $ACTION2RELATION(REL2.PARTNER_CODE) relation=REL2 where=null prop=PARTNER_CODE order=1 alias=corr_code $ENDACTION2RELATION $ACTION2RELATION(REL2.PARTNER_SHORT_NAME) relation=REL2 where=null prop=PARTNER_SHORT_NAME order=4 alias=corr_short_name $ENDACTION2RELATION $ACTION2RELATION(REL11.PARTNER_CODE) relation=REL11 where=null prop=PARTNER_CODE order=1 alias=payer_code $ENDACTION2RELATION $ACTION2RELATION(REL11.PARTNER_SHORT_NAME) relation=REL11 where=null prop=PARTNER_SHORT_NAME order=4 alias=payer_short_name $ENDACTION2RELATION $ACTION2RELATION(REL8.CTRL_COMP_ID) relation=REL8 where=null prop=CTRL_COMP_ID order=null alias=ctrl_comp_id_s $ENDACTION2RELATION $ACTION2RELATION(REL8.PARTNER_CODE) relation=REL8 where=null prop=PARTNER_CODE order=null alias=fond_code $ENDACTION2RELATION $ACTION2RELATION(REL8.PARTNER_NAME) relation=REL8 where=null prop=PARTNER_NAME order=null alias=fond_name $ENDACTION2RELATION $BIND(BIND1) type=D_STOCK_OUT_OTHER_DEPO action=D_STOCK_OUT_VIEW_NOTSD class=1 order=1 idname=null $ENDBIND $BIND(BIND3) type=activdocs action=ACTION1 class=0 order=3 idname=null $ENDBIND $BIND(BIND2) type=SD_INFO4OPER action=FORM_ED class=1 order=10 idname=sid $ENDBIND $ENDFORM $ACTION(ACTION1) name=Данные (изменение) class=2 form=D_STOCK_OUT_VIEW_NOTSD target_state=null procedure=ap_30145000002861347 patterns=GENERIC_UPDATE_P2 user_define=1 isvisible=1 istab=1 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503275) 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) .GET_PROPS(ALL,1) /***************************/ if @perpose_id is null .EXIT_MESSAGE('Не задано целевое назначение ') if @stock_id is null .EXIT_MESSAGE('Не задана ЦБ') if .PURPOSE_CODE(@perpose_id) = 6005 and @foundation_id is null .EXIT_MESSAGE('Не задан договор основание') if @contrag_id is null .EXIT_MESSAGE('Не задан контрагент по учету в СД') if @found_doc_id is null .EXIT_MESSAGE('Не задан договор счета ДЕПО') .TYPE_GET('FUND_CONTRACTS',@found_doc_id,1) if @owner_id != @owner_id1 .EXIT_MESSAGE('Выбран договор счета ДЕПО другого фонда') else begin if @initiator_id is null and @initiator_id1 is not null .EXIT_MESSAGE('Выберите договор счета ДЕПО для фонда') else begin if @initiator_id != @initiator_id1 .EXIT_MESSAGE('Выберите договор счета ДЕПО для заданного управляющего') end end if @stock_qty <= 0 .EXIT_MESSAGE('Количество бумаг не может быть отрицательным или 0') if (@stock_price <= 0 or @stock_price is null) and -- кроме сделок предпоставки not (.PURPOSE_CODE(@perpose_id) = 6005 and (select mode_id from tb_baysale_docitems where id=@foundation_id) = 2) .EXIT_MESSAGE('Введите сумму поручения') if @stock_price <= @coupon_sum and isnull(@stock_price,0) > 0 .EXIT_MESSAGE('Сумма УНКД должна быть меньше Суммы сделки') /* if @s_subacc_id is null .EXIT_MESSAGE('Раздел поставщик не задан') */ .TEST_UNIQUE(ALL, 2) if not(@foundation_id is null) and .PURPOSE_CODE(@perpose_id) = 6005 begin .TYPE_GET('dog_dealings_sale',@foundation_id,3) .MONEY_VAR(@dog_stock_covered_qty) .MONEY_VAR(@dog_sum) .MONEY_VAR(@dog_coupon_sum) .ID_VAR(@dog_pif_cont_comp_id) .ID_VAR(@asset_manager_id) .ID_VAR(@dog_asset_manager_id) .ID_VAR(@pif_cont_comp_id) .NAME_VAR(@f_type_code) select @f_type_code = .ITEM_TYPE_CODE(@owner_id) select @f_type_code = lower(@f_type_code) if @f_type_code = 'pif_fund' begin select @pif_cont_comp_id = .GET_CTRL_COMP_ID(@owner_id) select @dog_pif_cont_comp_id = .GET_CTRL_COMP_ID(@owner_id3) if @dog_pif_cont_comp_id != @pif_cont_comp_id .EXIT_MESSAGE('УК ПИФ в сделке и в поручении должна быть одна и та же.') end if @f_type_code = 'npf_fund' begin select @asset_manager_id = isnull(@initiator_id,@owner_id) select @dog_asset_manager_id = isnull(@initiator_id3,@owner_id3) if @dog_asset_manager_id != @asset_manager_id if @initiator_id is null /* При размещении самостоятельно НПФ*/ begin if @dog_asset_manager_id != @asset_manager_id .EXIT_MESSAGE('В поручении не задан управляющий - должна быть выбрана сделка для НПФ') end else /* При размещении через УК*/ begin if @dog_asset_manager_id != @asset_manager_id .EXIT_MESSAGE('В сделке и в поручении заданы разные управляющие.') end end select @dog_stock_covered_qty = 0 select @dog_sum = 0 select @dog_coupon_sum = 0 .STOCK_COVERED_BY_DEAL(@stock_qty3,@sum_in_paycur3,@coupon_account_sum3,@dog_stock_covered_qty,@dog_sum,@dog_coupon_sum,@id,@foundation_id) if @dog_stock_covered_qty + @stock_qty > @stock_qty3 begin .EXIT_MESSAGE('Превышено количество ценных бумаг по Договору ') end if @stock_qty + @dog_stock_covered_qty < @stock_qty3 begin select @stock_price = .ROUND_MONEY((@sum_in_paycur3 * @stock_qty / @stock_qty3),2) select @coupon_sum = .ROUND_MONEY((@coupon_account_sum3 * @stock_qty / @stock_qty3),2) end else begin select @stock_price = @sum_in_paycur3 - @dog_sum select @coupon_sum = @coupon_account_sum3 - @dog_coupon_sum end select @is_coupon_in_price=@is_coupon_in_sum3 end .UPDATE_ITEMS .UPDATE(ALL,2) .RELGEN .UPDATE_STATE .ACTION_HISTORY commit tran $ENDTEXT(12503275) $ENDACTION $ACTION(ACTION10) name=Изменить class=2 form=FORM1 target_state=null procedure=ap_30145000002861348 patterns=GENERIC_UPDATE_P1 user_define=1 isvisible=0 istab=1 posx=0 posy=0 width=3241 height=1920 proc_text=$TEXT(12503275) 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) .DEPO_CHK_NO(@id,@in_no,@depo_doc_type) .UPDATE(ALL,1) .RELGEN .UPDATE_STATE .ACTION_HISTORY commit tran select sid = convert(varchar, @id) $ENDTEXT(12503275) $BIND(BIND1) type=D_STOCK_OUT_OTHER_DEPO action=ACTION1 class=1 order=1 idname=null $ENDBIND $BIND(BIND2) type=activdocs action=ACTION1 class=0 order=2 idname=null $ENDBIND $BIND(BIND3) type=SD_INFO4OPER action=ACTION_UPDATE class=1 order=10 idname=sid $ENDBIND $ENDACTION $ACTION(ACTION11) name=Удалить class=3 form=FORM1 target_state=DEL procedure=ap_30145000002861351 patterns=GENERIC_MOVE user_define=1 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503275) create procedure dbo.%PROC% @sid varchar(30) = null as .CHECKPOINT_INIT 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 .CHECKPOINT_EXEC('Проверка прав') .UPDATE_STATE .ACTION_HISTORY /*-------Проводки ----------*/ .OPERS_ROLL .CHECKPOINT_EXEC('Удаление') commit tran $ENDTEXT(12503275) $BIND(BIND1) type=D_STOCK_OUT_OTHER_DEPO action=D_STOCK_OUT_VIEW_NOTSD class=1 order=1 idname=null $ENDBIND $ENDACTION $ACTION(ACTION13) name=Отменить class=9 form=null target_state=ED procedure=ap_30145000002861353 patterns=GENERIC_MOVE user_define=1 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503275) create procedure dbo.%PROC% @sid varchar(30) = null as .CHECKPOINT_INIT 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 .CHECKPOINT_EXEC('Проверка прав') if @exec_date is null update ts_sd_stock_moves set exec_date=dd.arch_date from td_depo_docs dd where dd.id=ts_sd_stock_moves.id and dd.id=@id .OPERS_ROLL(ALL) .CHECKPOINT_EXEC('Удаление проводок') .ARH_FLAG_CLEAR exec ap_sd_oper_roll @doc_id=@id, @oper_doc_id=@id .CHECKPOINT_EXEC('Переход в другой статус') commit tran $ENDTEXT(12503275) $ENDACTION $ACTION(ACTION15) name=Изменить привязку к партиям class=2 form=D_ASSETS2ITEMS_EDIT target_state=null procedure=ap_30145000002861354 patterns=null user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503275) create procedure dbo.%PROC% @sid varchar(30) = null, @part_id_s varchar(30), @calc_sum varchar(30) 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 begin tran declare @docitem_id numeric declare @paydoc_id numeric declare @covered_sum money select @action_id = %ACTION_ID% select @docitem_id = convert(numeric, @sid) select @paydoc_id = convert(numeric, @part_id_s) select @covered_sum = convert(decimal(18,4), @calc_sum) select @covered_sum = isnull(@covered_sum, 0) .CHECK_USER if not exists( select 1 from t_pays2items where t_pays2items.docitem_id = @docitem_id and t_pays2items.paydoc_id = @paydoc_id and .ITEMS_EXISTS_BY_TYPE(t_pays2items.id,'assets2items') ) begin if @covered_sum > 0 begin .TYPE_INIT('assets2items') .TYPE_ASSIGN(docitem_id, @docitem_id) .TYPE_ASSIGN(paydoc_id, @paydoc_id) .TYPE_ASSIGN(covered_sum, @covered_sum) .TYPE_INSERT('assets2items', 'CRT') end end else begin if @covered_sum > 0 update t_pays2items set covered_sum = @covered_sum where docitem_id = @docitem_id and paydoc_id = @paydoc_id and .ITEMS_EXISTS_BY_TYPE(t_pays2items.id,'assets2items') else begin delete t_items from t_pays2items where t_pays2items.id = t_items.id and t_pays2items.docitem_id = @docitem_id and paydoc_id = @paydoc_id and .ITEMS_EXISTS_BY_TYPE(t_pays2items.id,'assets2items') delete t_pays2items where t_pays2items.docitem_id = @docitem_id and paydoc_id = @paydoc_id and .ITEMS_EXISTS_BY_TYPE(t_pays2items.id,'assets2items') end end commit tran select sid = convert(varchar, @id) end $ENDTEXT(12503275) $ENDACTION $ACTION(ACTION2) name=Подтверждение class=9 form=null target_state=OP_END_SD procedure=ap_30145000002861355 patterns=GENERIC_MOVE user_define=1 isvisible=0 istab=1 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503275) create procedure dbo.%PROC% @sid varchar(30) = null as .BEGIN('Y') begin tran .CHECKPOINT_INIT select @action_id = %ACTION_ID% select @id = convert(numeric, @sid) .CHECK_USER .CHECK_UPDATE .UPDATE_STATE .ACTION_HISTORY .GET_PROPS .ARH_NUMBER_UPDATE .CHECKPOINT_EXEC('RIGHTS') update ts_sd_stock_moves set owner_id = @owner_id, initiator_id = @initiator_id where id = @id if @exec_date is null begin select @exec_date = @in_date update ts_sd_stock_moves set exec_date = @in_date where id = @id end declare @oper_date datetime select @oper_date = @exec_date .ARH_DATE_SD(@oper_date) .CHECKPOINT_EXEC('ARCH_DATE') exec ap_sd_oper_out @doc_id = @id, @oper_doc_id = @id, @oper_action_id = @action_id, @oper_action_history_id = @action_history_id, @oper_date = @oper_date if @@error != 0 begin begin tran .ARH_FLAG_CLEAR update t_actions_history set dst_id=@state_id where id=@action_history_id update t_items set state_id = @state_id where id=@id commit tran return end .CHECKPOINT_EXEC('AP_SD_OPER_OUT') commit tran .END $ENDTEXT(12503275) $ENDACTION $ACTION(ACTION9) name=Добавить class=1 form=FORM1 target_state=ED procedure=ap_30145000002861356 patterns=GENERIC_INSERT_P1 user_define=1 isvisible=0 istab=1 posx=0 posy=0 width=2926 height=1932 proc_text=$TEXT(12503275) create procedure dbo.%PROC% @sid varchar(30) = null, .ARGLIST(ALL,1) as .CHECKPOINT_INIT .BEGIN('Y') 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) if @in_date is null .EXIT_MESSAGE('Введите дату документа') .CHECKPOINT_EXEC('Проверка параметров') .SD_GEN_NO(@in_no,@depo_doc_type,@in_date) .CHECKPOINT_EXEC('Проверка номера документа') begin tran .UPDATE(ALL,1) .RELGEN .UPDATE_STATE .ACTION_HISTORY commit tran select @sid = convert(varchar,@id) select @sid .CHECKPOINT_EXEC('Вставка документа') end .END $ENDTEXT(12503275) $BIND(BIND1) type=D_STOCK_OUT_OTHER_DEPO action=ACTION1 class=1 order=1 idname=null $ENDBIND $BIND(BIND2) type=activdocs action=ACTION1 class=0 order=2 idname=null $ENDBIND $BIND(BIND3) type=SD_INFO4OPER action=ACTION_UPDATE class=1 order=10 idname=sid $ENDBIND $ENDACTION $ACTION(SD_OPER_OUT) name=Проведение по СД (снятие ЦБ) class=9 form=null target_state=null procedure=ap_sd_oper_out patterns=null user_define=1 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503275) create proc dbo.%PROC% @doc_id numeric, -- id док-та основания поручения (=id поручения для приема не в нашем) @oper_doc_id numeric, -- id поручения @oper_action_id numeric, -- id метода поручения @oper_action_history_id numeric, @oper_date datetime -- дата проведения as begin begin tran .CHECKPOINT_INIT .GET_SD_OPER_DATE(@oper_date,@doc_id) ------------ -- GET_PROPS ------------ .ID_VAR(@foundation_id) .ID_VAR(@perpose_id) .ID_VAR(@stock_id) .ID_VAR(@stock_price_cur_id) .ID_VAR(@contrag_id) .ID_VAR(@part_id) .ID_VAR(@owner_id) .ID_VAR(@initiator_id) .MONEY_VAR(@stock_price) .MONEY_VAR(@stock_qty) .MONEY_VAR(@coupon_sum) .INT_VAR(@is_coupon_in_price) select @foundation_id=foundation_id, @perpose_id=perpose_id, @stock_id=stock_id, @stock_price_cur_id=stock_price_cur_id, @contrag_id=contrag_id, @part_id=part_id, @owner_id=owner_id, @initiator_id=initiator_id, @stock_price=stock_price, @stock_qty=stock_qty, @coupon_sum=coupon_sum, @is_coupon_in_price=is_coupon_in_price from ts_sd_stock_moves where id=@doc_id ------------ -- ------------ .ID_VAR(@oper_id) .ID_VAR(@asset_manager_id) .ID_VAR(@contr_id) .ID_VAR(@stock_account_id) .ID_VAR(@fund_plan_id) .ID_VAR(@doc_method_id) .ID_VAR(@sum_method_id) .ID_VAR(@ball_acc_type_id) .ID_VAR(@subc3_type_id) .ID_VAR(@subc3_item_id) .ID_VAR(@coupon_acc_id) .ID_VAR(@pol_coupon_acc_id) .ID_VAR(@contr_account_id) .ID_VAR(@add_account_id) .INT_VAR(@purpose_code) .MONEY_VAR(@stock_op_sum) .MONEY_VAR(@stock_add_sum) .MONEY_VAR(@sum_in_dog) .MONEY_VAR(@qty_saldo_coupon) .MONEY_VAR(@bal_saldo_coupon) .MONEY_VAR(@stock_price_out_coupon) .MONEY_VAR(@coupon_bal_sum_lf) .MONEY_VAR(@coupon_qty_sum_lf) .MONEY_VAR(@coupon_covered_sum) .MONEY_VAR(@coupon_bal_sum_total) .MONEY_VAR(@pol_coupon_sum) .MONEY_VAR(@coupon_add_sum) .MONEY_VAR(@stock_sum) .MONEY_VAR(@qty_saldo) .MONEY_VAR(@bal_saldo) .MONEY_VAR(@stock_price_out) .MONEY_VAR(@dog_stock_covered_qty) .MONEY_VAR(@dog_stock_covered_sum) .NAME_VAR(@stock_subc_str) .NAME_VAR(@fund_type_code) declare @comm_48_6 varchar(255), @dog_brok_name varchar(255), @comm_76_48 varchar(255) declare @cur_pay decimal(18,8) declare @r_date datetime if @owner_id is null .EXIT_MESSAGE('Задайте фонд') select @fund_type_code = lower(.ITEM_TYPE_CODE(@owner_id)) .CHECKPOINT_EXEC('PARAMETRS') ------------------- -- Счета ------------------- if @fund_type_code = 'pif_fund' begin select @fund_plan_id = .ARG_PLAN('PIF_ACCOUNT') select @coupon_acc_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.6') select @pol_coupon_acc_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.7') select @contr_account_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.5.1') select @add_account_id = .ACCID_FROM_EFFNO(@fund_plan_id,'96.3.1') end if @fund_type_code = 'npf_fund' begin select @fund_plan_id = .ARG_PLAN('NPF_ACCOUNT') select @asset_manager_id = isnull(@initiator_id,@owner_id) select @coupon_acc_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.6') select @pol_coupon_acc_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.7') if @owner_id = @asset_manager_id /* При размещении НПФ*/ begin select @add_account_id = .ACCID_FROM_EFFNO(@fund_plan_id,'80.2') select @contr_account_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.4') end else /* При размещении УК*/ begin select @add_account_id = .ACCID_FROM_EFFNO(@fund_plan_id,'80.1') select @contr_account_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.5') end end .CHECKPOINT_EXEC('ACCOUNTS') ---------------------- -- Подготовка проводок ---------------------- select @purpose_code=.PURPOSE_CODE(@perpose_id) -- Списание ЦБ по сделке if @purpose_code = 6005 begin if upper(.ITEM_STATE_CODE(@foundation_id)) = 'COMPLETE' .EXIT_MESSAGE('Cделка-основание уже перерегистрирована') if upper(.ITEM_STATE_CODE(@foundation_id)) != 'CRT' .EXIT_MESSAGE('Cделка-основание не подписана') .TYPE_GET('dog_dealings_sale',@foundation_id,2_1) if @owner_id != @owner_id2_1 .EXIT_MESSAGE('Выбрана сделка другого фонда') else begin if @initiator_id is null and @initiator_id2_1 is not null .EXIT_MESSAGE('Не задан управляющий - выберите сделку для фонда') else begin if @initiator_id != @initiator_id2_1 .EXIT_MESSAGE('Выберите сделку для заданного управляющего') end end .CHECK_STOCK_EMM_AND_TYPE(@stock_id,@stock_id2_1,'Эммитент и тип ЦБ в сделке-основании должен соответствовать эммитенту и типу ЦБ в поручении') if (select registr_mode_id from td_pay_fond where id=@owner_id) = 2 -- ЦБ из сделки begin select @stock_id = @stock_id2_1 update ts_sd_stock_moves set stock_id=@stock_id where id=@doc_id end if @mode_id2_1 is null .EXIT_MESSAGE('В сделке не задан способ расчетов по сделке') -- поставка против платежа - другой счет для ПИФ if (@mode_id2_1 = 3) and (@fund_type_code = 'pif_fund') select @contr_account_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.5.4') if @character_id2_1 = 1 -- Дилерская сделка select @contr_id = @contragent_id2_1 else -- Клиентская сделка select @contr_id = @organisation_id2_1 -- было раньше: -- select @doc_method_id = @stock_out_method_id2_1 -- select @sum_method_id = @stock_out_sum_method_id2_1 -- стало: select @doc_method_id = out_method_id, @sum_method_id = out_sum_method_id from td_pay_fond where id = @owner_id select @ball_acc_type_id = @ball_acc_type_id2_1 select @is_coupon_in_price=@is_coupon_in_sum2_1 if @mode_id2_1 = 2 -- предпоставка select @sum_in_dog = @summ_doc_total2_1 else -- предоплата, поставка против платежа select @sum_in_dog = @sum_in_paycur2_1 .STOCK_COVERED_BY_DEAL(@stock_qty2_1,@sum_in_dog,@coupon_account_sum2_1,@dog_stock_covered_qty,@dog_stock_covered_sum,@coupon_covered_sum,@doc_id,@foundation_id) if @dog_stock_covered_qty + @stock_qty > @stock_qty2_1 .EXIT_MESSAGE('Превышено количество ценных бумаг по сделке') select @dog_brok_name = ' по сделке ' + .ITEM_NAME(@foundation_id) +' по поручению ' + .ITEM_NAME(@oper_doc_id) select @comm_48_6 ='Списание балансовой стоимости ЦБ '+ @dog_brok_name select @comm_76_48 ='Отражение задолженности покупателя ЦБ '+ @dog_brok_name end -- Другие списания else begin select @doc_method_id = out_method_id, @sum_method_id = out_sum_method_id from td_pay_fond where id = @owner_id select @ball_acc_type_id = 58 select @contr_id = @contrag_id select @dog_stock_covered_qty = 0 select @dog_stock_covered_sum = 0 select @coupon_covered_sum = 0 select @dog_brok_name = ' по поручению ' + .ITEM_NAME(@oper_doc_id) select @comm_48_6 ='Списание балансовой стоимости ЦБ '+ @dog_brok_name select @comm_76_48 ='Отражение задолженности покупателя ЦБ '+ @dog_brok_name if @fund_type_code = 'pif_fund' begin select @contr_account_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.5.3') end end if @doc_method_id is null .EXIT_MESSAGE('Не задан метод списания ЦБ') if @sum_method_id is null .EXIT_MESSAGE('Не задан метод задания суммы списания ЦБ') if @ball_acc_type_id = 61 -- Долгосрочные активы begin if @fund_type_code = 'npf_fund' select @stock_account_id = .ACCID_FROM_EFFNO(@fund_plan_id,'6.1') else select @stock_account_id = .ACCID_FROM_EFFNO(@fund_plan_id,'06.1') end else -- Краткосрочные активы select @stock_account_id = .ACCID_FROM_EFFNO(@fund_plan_id,'58.1') select @coupon_bal_sum_total = 0 .CHECKPOINT_EXEC('PURPOSE') ------------------------------------------------ -- Проверка количества ЦБ на балансе ------------------------------------------------ if @fund_type_code = 'pif_fund' begin .SALDO_FAST(@owner_id,@fund_plan_id,@oper_date,@stock_account_id,D,Y,'stock_emis',@stock_id,N,N,N,@qty_saldo) end if @fund_type_code = 'npf_fund' begin .SALDO_FAST(@owner_id,@fund_plan_id,@oper_date,@stock_account_id,D,Y,'stock_emis',@stock_id,'asset_manager',@asset_manager_id,N,@qty_saldo) end if @qty_saldo < @stock_qty begin if @ball_acc_type_id = 61 -- Долгосрочные активы .EXIT_MESSAGE('Не хватает ценных бумаг на счете 6.1 бухгалтерского учета фонда') else .EXIT_MESSAGE('Не хватает ценных бумаг на счете 58.1 бухгалтерского учета фонда') end ------------------------------------------------------------------------- -- Получение данных по остаткам в разрезе документов поступления (партий) ------------------------------------------------------------------------- .TRANSACTION_SAVE if @fund_type_code = 'pif_fund' begin select @subc3_type_id = .SUBCTYPE_FROM_CODE('stock_emis') select @subc3_item_id = @stock_id end else begin select @subc3_type_id = .SUBCTYPE_FROM_CODE('asset_manager') select @subc3_item_id = @asset_manager_id end .TOTALS_QUERY_SUB(@owner_id,@fund_plan_id,@oper_date,@oper_date,@stock_account_id,'stock_emis',@stock_id,'doc_item',N,(.FROM_SUBC3),(.WHERE_SUBC3(@subc3_type_id,@subc3_item_id)),L,N,Y,N,Y) delete #tmp_oss where q_saldo_de<=0 or saldo_de<0 if isnull((select count(*) from #tmp_oss),0)=0 begin .DROP_QUERY_TABLES(#tmp_oss) .TRANSACTION_RESTORE .EXIT_MESSAGE('Не выдана разбивка по документам') end -- по остаткам по УНКД .TOTALS_QUERY_SUB(@owner_id,@fund_plan_id,@oper_date,@oper_date,@coupon_acc_id,'stock_emis',@stock_id,'doc_item',N,(.FROM_SUBC3),(.WHERE_SUBC3(@subc3_type_id,@subc3_item_id)),L,N,Y,N,Y,#tmp_coupon) delete #tmp_coupon where q_saldo_de<0 or saldo_de<0 or (q_saldo_de=0 and saldo_de=0) .CHECKPOINT_EXEC('SALDO') ----------- -- Проводки ----------- begin tran -------------------------------- -- Проводки списания (lifo-fifo) -------------------------------- .LIFO_FIFO_BEGIN(#tmp_oss,@doc_method_id,@stock_qty,@oper_doc_id) -- ! валюта в проводку = валюте плана(RUR) .OPERATION(@owner_id,@fund_plan_id,@oper_date,'48',@stock_account_id,@op_sum_lf,'RUR',@oper_date,@op_qty_lf,@op_qty_lf,@comm_48_6,N,@oper_id,@oper_doc_id,@oper_action_id,@oper_action_history_id) .UPDATE_SUBC(K,'stock_emis',@stock_id,@oper_id) .UPDATE_SUBC(К,'doc_item',@subc2_id_lf,@oper_id) if @fund_type_code = 'npf_fund' begin .UPDATE_SUBC(D,'asset_manager',@asset_manager_id,@oper_id) .UPDATE_SUBC(K,'asset_manager',@asset_manager_id,@oper_id) end .SUBC_CHECK(@oper_id) -- Списание УНКД if exists(select 1 from #tmp_coupon o where o.subc2_id = @subc2_id_lf) begin .MONEY_VAR(@coupon_saldo_qty) select @coupon_bal_sum_lf = o.saldo_de, @coupon_saldo_qty = o.q_saldo_de -- @coupon_qty_sum_lf = o.q_saldo_de from #tmp_coupon o where o.subc2_id = @subc2_id_lf select @coupon_qty_sum_lf = @q_saldo_lf if @coupon_qty_sum_lf > @op_qty_lf begin -- select @coupon_bal_sum_lf = .ROUND_MONEY((@coupon_bal_sum_lf * @op_qty_lf /@coupon_qty_sum_lf),2) -- select @coupon_qty_sum_lf = @op_qty_lf select @coupon_bal_sum_lf = .ROUND_MONEY(((convert(double precision,@coupon_bal_sum_lf)/convert(double precision,@coupon_qty_sum_lf)) * @op_qty_lf),2) select @coupon_qty_sum_lf = @op_qty_lf end if @coupon_qty_sum_lf > @coupon_saldo_qty select @coupon_qty_sum_lf = @coupon_saldo_qty -- ! валюта в проводку = валюте плана(RUR) .OPERATION(@owner_id,@fund_plan_id,@oper_date,@pol_coupon_acc_id,@coupon_acc_id,@coupon_bal_sum_lf,'RUR',@oper_date,0,@coupon_qty_sum_lf,'Списание УНКД',N,@oper_id,@oper_doc_id,@oper_action_id,@oper_action_history_id) .UPDATE_SUBC(D,'stock_emis',@stock_id,@oper_id) .UPDATE_SUBC(K,'stock_emis',@stock_id,@oper_id) .UPDATE_SUBC(К,'doc_item',@subc2_id_lf,@oper_id) if @fund_type_code = 'npf_fund' begin .UPDATE_SUBC(K,'asset_manager',@asset_manager_id,@oper_id) .UPDATE_SUBC(D,'asset_manager',@asset_manager_id,@oper_id) end .SUBC_CHECK(@oper_id) select @coupon_bal_sum_total = @coupon_bal_sum_total + @coupon_bal_sum_lf end .LIFO_FIFO_END .CHECKPOINT_EXEC('SPISANIE') ---------------------------- -- Проводки по задолженности ---------------------------- -- подготовка if @purpose_code = 6005 -- Списание ЦБ по сделке begin if @dog_stock_covered_qty + @stock_qty < @stock_qty2_1 begin select @stock_sum = .ROUND_MONEY((convert(double precision,@sum_in_dog) * @stock_qty / @stock_qty2_1),2) select @pol_coupon_sum = .ROUND_MONEY((@coupon_account_sum2_1 * @stock_qty / @stock_qty2_1),2) select @pol_coupon_sum = isnull(@pol_coupon_sum,0) end else begin select @stock_sum = @sum_in_dog - @dog_stock_covered_sum select @pol_coupon_sum = isnull(@coupon_account_sum2_1 - @coupon_covered_sum,0) end if @mode_id2_1 = 2 and @pay_cur_id2_1 != @cur_id2_1 -- предпоставка на другую валюту begin -- .CONVERT_SUM(@cur_id2_1,@pay_cur_id2_1,@oper_date,0,@stock_sum,@stock_op_sum,@cur_pay,@r_date) if isnull(@cur_price2pay_rate2_1,0) != 0 -- курс задан в сделке begin select @stock_op_sum = .ROUND_MONEY((@stock_sum * @cur_price2pay_rate2_1),2) end else begin .CONVERT_SUM(@cur_id2_1,@pay_cur_id2_1,@oper_date,0,@stock_sum,@stock_op_sum,@cur_pay,@r_date) end end else -- предоплата, поставка против платежа select @stock_op_sum = @stock_sum select @stock_op_sum=.ROUND_MONEY(@stock_op_sum,2) update ts_sd_stock_moves set stock_price=@stock_op_sum, coupon_sum=@pol_coupon_sum, is_coupon_in_price=@is_coupon_in_price where id=@doc_id end -- Другие списания else begin select @stock_sum = @stock_price select @pol_coupon_sum = isnull(@coupon_sum,0) select @stock_op_sum = @stock_sum end if @is_coupon_in_price = 1 select @stock_op_sum = @stock_op_sum - @pol_coupon_sum -- задолженность покупателя .OPERATION(@owner_id,@fund_plan_id,@oper_date,@contr_account_id,'48',@stock_op_sum,@stock_price_cur_id,@oper_date,0,@stock_qty,@comm_76_48,N,@oper_id,@oper_doc_id,@oper_action_id,@oper_action_history_id) if @fund_type_code = 'npf_fund' begin if @asset_manager_id=@owner_id begin .UPDATE_SUBC(D,'partners',@contr_id,@oper_id) end else begin .UPDATE_SUBC(D,'partners_cont',@contr_id,@oper_id) .UPDATE_SUBC(D,'partners',@asset_manager_id,@oper_id) end .UPDATE_SUBC(K,'asset_manager',@asset_manager_id,@oper_id) end else begin .UPDATE_SUBC(D,'partners',@contr_id,@oper_id) end .SUBC_CHECK(@oper_id) .CHECKPOINT_EXEC('DOLG') -- отражение ПНКД в случае его наличия if @pol_coupon_sum != 0 begin .OPERATION(@owner_id,@fund_plan_id,@oper_date,@contr_account_id,@pol_coupon_acc_id,@pol_coupon_sum,@stock_price_cur_id,@oper_date,0,0,'Отражение накопленного купонного дохода',N,@oper_id,@oper_doc_id,@oper_action_id,@oper_action_history_id) .UPDATE_SUBC(K,'stock_emis',@stock_id,@oper_id) if @fund_type_code = 'npf_fund' begin if @asset_manager_id=@owner_id begin .UPDATE_SUBC(D,'partners',@contr_id,@oper_id) end else begin .UPDATE_SUBC(D,'partners_cont',@contr_id,@oper_id) .UPDATE_SUBC(D,'partners',@asset_manager_id,@oper_id) end .UPDATE_SUBC(K,'asset_manager',@asset_manager_id,@oper_id) end else begin .UPDATE_SUBC(D,'partners',@contr_id,@oper_id) end .SUBC_CHECK(@oper_id) end .CHECKPOINT_EXEC('PNKD') ---------------------------------------------------------------------------- -- Проводки на прибыль при реализации (задолженность - балансовая стоимость) ---------------------------------------------------------------------------- --! валюта в проводку=валюте плана(RUR), @stock_op_sum - д.б. в валюте плана -- Способ отражения прибыли при реализации для фонда = по операциям if (select profit_oper_mode_id from td_pay_fond where id=@owner_id) = 1 begin select @stock_add_sum = @stock_op_sum - @bal_sum_total_lf select @stock_add_sum=.ROUND_MONEY(@stock_add_sum,2) if isnull(@stock_add_sum,0)<>0 begin if @stock_add_sum > 0 begin .OPERATION(@owner_id,@fund_plan_id,@oper_date,'48',@add_account_id,@stock_add_sum,'RUR',@oper_date,0,0,'Прибыль при реализации ЦБ',N,@oper_id,@oper_doc_id,@oper_action_id,@oper_action_history_id) if @fund_type_code = 'npf_fund' begin .UPDATE_SUBC(D,'asset_manager',@asset_manager_id,@oper_id) .UPDATE_SUBC(K,'asset_manager',@asset_manager_id,@oper_id) end .SUBC_CHECK(@oper_id) end else if @stock_add_sum < 0 begin select @stock_add_sum = abs(@stock_add_sum) .OPERATION(@owner_id,@fund_plan_id,@oper_date,@add_account_id,'48',@stock_add_sum,'RUR',@oper_date,0,0,'Убыток от реализации ЦБ',N,@oper_id,@oper_doc_id,@oper_action_id,@oper_action_history_id) if @fund_type_code = 'npf_fund' begin .UPDATE_SUBC(D,'asset_manager',@asset_manager_id,@oper_id) .UPDATE_SUBC(K,'asset_manager',@asset_manager_id,@oper_id) end .SUBC_CHECK(@oper_id) end end end .CHECKPOINT_EXEC('DOHOD') ---------------------------------- -- Проводки на разницу ПНКД - УНКД ---------------------------------- --! валюта в проводку=валюте плана(RUR), @pol_coupon_sum - д.б. в валюте плана select @coupon_add_sum = @pol_coupon_sum - @coupon_bal_sum_total if @coupon_add_sum > 0 begin .OPERATION(@owner_id,@fund_plan_id,@oper_date,@pol_coupon_acc_id,@add_account_id,@coupon_add_sum,'RUR',@oper_date,0,0,'Прирост стоимости имущеста от накопленного купонного дохода',N,@oper_id,@oper_doc_id,@oper_action_id,@oper_action_history_id) .UPDATE_SUBC(D,'stock_emis',@stock_id,@oper_id) if @fund_type_code = 'npf_fund' begin .UPDATE_SUBC(D,'asset_manager',@asset_manager_id,@oper_id) .UPDATE_SUBC(K,'asset_manager',@asset_manager_id,@oper_id) end .SUBC_CHECK(@oper_id) end else if @coupon_add_sum < 0 begin select @coupon_add_sum = abs(@coupon_add_sum) .OPERATION(@owner_id,@fund_plan_id,@oper_date,@add_account_id,@pol_coupon_acc_id,@coupon_add_sum,'RUR',@oper_date,0,0,'Уменьшение стоимости имущеста от накопленного купонного дохода',N,@oper_id,@oper_doc_id,@oper_action_id,@oper_action_history_id) .UPDATE_SUBC(K,'stock_emis',@stock_id,@oper_id) if @fund_type_code = 'npf_fund' begin .UPDATE_SUBC(D,'asset_manager',@asset_manager_id,@oper_id) .UPDATE_SUBC(K,'asset_manager',@asset_manager_id,@oper_id) end .SUBC_CHECK(@oper_id) end .CHECKPOINT_EXEC('PNKD_UNKD') ----------------- -- конец проводок ----------------- declare @j_sum money select @j_sum=@stock_op_sum+(case when @is_coupon_in_price=0 then @pol_coupon_sum else 0 end) .SD_ASSENT_ADD(@doc_id,@stock_id,@j_sum,@stock_qty,@owner_id,@perpose_id) .SD_ASSET_OPER_ADD(@doc_id,@stock_id,@j_sum,@stock_qty,@owner_id,@perpose_id,2) commit tran .DROP_QUERY_TABLES(#tmp_oss) .DROP_QUERY_TABLES(#tmp_coupon) .TRANSACTION_RESTORE -------------------- -- Завершение сделки -------------------- update ts_sd_stock_moves set is_completed=1 where id=@doc_id if @purpose_code = 6005 begin update td_depo_docs set foundation_id=@foundation_id where id=@oper_doc_id if @dog_stock_covered_qty + @stock_qty = @stock_qty2_1 begin declare @foundation_id_s varchar(30) select @foundation_id_s=convert(varchar(30),@foundation_id) .EXEC_ACTION(@foundation_id_s,'dog_dealings_sale','complete_sale',Y) end end .CHECKPOINT_EXEC('CLOSE') commit tran end $ENDTEXT(12503275) $ENDACTION $STATE2ACTION(BEG.ACTION9) state=BEG action=ACTION9 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION1) state=ED action=ACTION1 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION10) state=ED action=ACTION10 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION11) state=ED action=ACTION11 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION15) state=ED action=ACTION15 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION2) state=ED action=ACTION2 $ENDSTATE2ACTION $STATE2ACTION(ED.D_STOCK_OUT_VIEW_NOTSD) state=ED action=D_STOCK_OUT_VIEW_NOTSD $ENDSTATE2ACTION $STATE2ACTION(ED.FORM1) state=ED action=FORM1 $ENDSTATE2ACTION $STATE2ACTION(OP_END_SD.ACTION13) state=OP_END_SD action=ACTION13 $ENDSTATE2ACTION $STATE2ACTION(OP_END_SD.D_STOCK_OUT_VIEW_NOTSD) state=OP_END_SD action=D_STOCK_OUT_VIEW_NOTSD $ENDSTATE2ACTION $STATE2ACTION(OP_END_SD.FORM1) state=OP_END_SD action=FORM1 $ENDSTATE2ACTION $STATE2PROP(BEG.CONTRAGENT_COMMENT) state=BEG prop=CONTRAGENT_COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CONTRAG_ID) state=BEG prop=CONTRAG_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CONTR_ACCOUNT) state=BEG prop=CONTR_ACCOUNT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CONTR_JURADRESS) state=BEG prop=CONTR_JURADRESS enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CONTR_OWNER_TYPE_ID) state=BEG prop=CONTR_OWNER_TYPE_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CONTR_REGISTER_DATE) state=BEG prop=CONTR_REGISTER_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CONTR_REGISTER_NO) state=BEG prop=CONTR_REGISTER_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CONTR_REGISTRATOR) state=BEG prop=CONTR_REGISTRATOR enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CORRESPONDENT_ID) state=BEG prop=CORRESPONDENT_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.COUPON_SUM) state=BEG prop=COUPON_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.DEPOCORR_OPER_DATE) state=BEG prop=DEPOCORR_OPER_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.DEPOCORR_OPER_ID) state=BEG prop=DEPOCORR_OPER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.DEPO_DOC_TYPE) state=BEG prop=DEPO_DOC_TYPE enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.DOCUMENT_FORM_ID) state=BEG prop=DOCUMENT_FORM_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.DOC_COMMENT) state=BEG prop=DOC_COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.EXEC_DATE) state=BEG prop=EXEC_DATE enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.FOLDER_ID) state=BEG prop=FOLDER_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.FOUNDATION_ID) state=BEG prop=FOUNDATION_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.FOUND_DOC_ID) state=BEG prop=FOUND_DOC_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.INITIATOR_ID) state=BEG prop=INITIATOR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.IN_DATE) state=BEG prop=IN_DATE enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.IN_NO) state=BEG prop=IN_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.IS_COUPON_IN_PRICE) state=BEG prop=IS_COUPON_IN_PRICE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.KEEP_SUBACC_ID) state=BEG prop=KEEP_SUBACC_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.KEEP_TRAJECT_END_ID) state=BEG prop=KEEP_TRAJECT_END_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.MOVE_COMMENT) state=BEG prop=MOVE_COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.MOVE_CONTRAGENT_NAME) state=BEG prop=MOVE_CONTRAGENT_NAME enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.OPER_FORM_ID) state=BEG prop=OPER_FORM_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.OUT_DATE) state=BEG prop=OUT_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.OUT_NO) state=BEG prop=OUT_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.PAYER_ID) state=BEG prop=PAYER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.PAY_SUM) state=BEG prop=PAY_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.PERPOSE_ID) state=BEG prop=PERPOSE_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.REESTR_OPER_DATE) state=BEG prop=REESTR_OPER_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.REESTR_OPER_ID) state=BEG prop=REESTR_OPER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.STOCK_ID) state=BEG prop=STOCK_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.STOCK_PRICE) state=BEG prop=STOCK_PRICE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.STOCK_QTY) state=BEG prop=STOCK_QTY enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.SUM_CUR_ID) state=BEG prop=SUM_CUR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.S_SUBACC_ID) state=BEG prop=S_SUBACC_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.T_SUBACC_ID) state=BEG prop=T_SUBACC_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.WHO_GET) state=BEG prop=WHO_GET enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.WHO_PUT) state=BEG prop=WHO_PUT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTRAGENT_COMMENT) state=ED prop=CONTRAGENT_COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTRAG_ID) state=ED prop=CONTRAG_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTR_ACCOUNT) state=ED prop=CONTR_ACCOUNT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTR_JURADRESS) state=ED prop=CONTR_JURADRESS enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTR_OWNER_TYPE_ID) state=ED prop=CONTR_OWNER_TYPE_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTR_REGISTER_DATE) state=ED prop=CONTR_REGISTER_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTR_REGISTER_NO) state=ED prop=CONTR_REGISTER_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTR_REGISTRATOR) state=ED prop=CONTR_REGISTRATOR 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.COUPON_SUM) state=ED prop=COUPON_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.DEPOCORR_OPER_DATE) state=ED prop=DEPOCORR_OPER_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.DEPOCORR_OPER_ID) state=ED prop=DEPOCORR_OPER_ID enable=1 mandatory=0 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.EXEC_DATE) state=ED prop=EXEC_DATE enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.FOLDER_ID) state=ED prop=FOLDER_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.FOUNDATION_ID) state=ED prop=FOUNDATION_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.FOUND_DOC_ID) state=ED prop=FOUND_DOC_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.INITIATOR_ID) state=ED prop=INITIATOR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.IN_NO) state=ED prop=IN_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.IS_COUPON_IN_PRICE) state=ED prop=IS_COUPON_IN_PRICE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.KEEP_SUBACC_ID) state=ED prop=KEEP_SUBACC_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.KEEP_TRAJECT_END_ID) state=ED prop=KEEP_TRAJECT_END_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.MOVE_COMMENT) state=ED prop=MOVE_COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.MOVE_CONTRAGENT_NAME) state=ED prop=MOVE_CONTRAGENT_NAME enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.OPER_FORM_ID) state=ED prop=OPER_FORM_ID 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.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_ID) state=ED prop=PERPOSE_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.REESTR_OPER_DATE) state=ED prop=REESTR_OPER_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.REESTR_OPER_ID) state=ED prop=REESTR_OPER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.STOCK_ID) state=ED prop=STOCK_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.STOCK_PRICE) state=ED prop=STOCK_PRICE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.STOCK_QTY) state=ED prop=STOCK_QTY enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.SUM_CUR_ID) state=ED prop=SUM_CUR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.S_SUBACC_ID) state=ED prop=S_SUBACC_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.T_SUBACC_ID) state=ED prop=T_SUBACC_ID enable=1 mandatory=0 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(OP_END_SD.DOC_COMMENT) state=OP_END_SD prop=DOC_COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(OP_END_SD.PAY_SUM) state=OP_END_SD prop=PAY_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(OP_END_SD.SUM_CUR_ID) state=OP_END_SD prop=SUM_CUR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $ENDDOC $DOC(D_STOCK_IN_OTHER_DEPO_SD) name=Прием ЦБ в другом СД class=1 product=ALD_FUND name_formula=.DEPO_OPER_ITEM_NAME remark_formula=$TEXT(12503277) .TO_STR_RND(@stock_qty) + ' ' + .ITEM_NAME(@stock_id) + ' '+ .ITEM_NAME(@s_subacc_id) + '->' + .ITEM_NAME(@t_subacc_id) + ' ' + isnull(@move_contragent_name, '') + ' ' + isnull(@contragent_comment, '') $ENDTEXT(12503277) $STATE(BEG) name=Начальный class=1 $ENDSTATE $STATE(DEL) name=Удален class=2 $ENDSTATE $STATE(ED) name=Редактируется class=0 $ENDSTATE $STATE(OP_END_SD) name=Подтвержден class=0 $ENDSTATE $PROP(OUT_DATE) name=Внешняя дата корреспондента field_name=out_date table_name=td_depo_docs field_type=datetime field_length=8 field_scale=null field_prec=null 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(IN_DATE) name=Дата документа field_name=in_date table_name=td_depo_docs field_type=datetime field_length=8 field_scale=null field_prec=null page=1 order=2 init_class=1 init_formula=.OPERDAY unique_index=1 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=null page=1 order=3 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=null 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(OUT_NO) name=Внешний номер field_name=out_no table_name=td_depo_docs field_type=varchar field_length=50 field_scale=null field_prec=null 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 $PROP(IN_NO) name=Номер документа field_name=in_no table_name=td_depo_docs field_type=varchar field_length=50 field_scale=null field_prec=null page=1 order=6 init_class=0 init_formula=null unique_index=1 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=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(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=8 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=null field_prec=null page=1 order=9 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=10 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=11 init_class=1 init_formula=1 unique_index=null numerator=null import_type=null import_table=null import_field= 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=null field_prec=null page=1 order=12 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=13 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(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=14 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=null page=1 order=15 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_REMARK) name=Документ - основание field_name=foundation_remark table_name=td_depo_docs field_type=varchar field_length=255 field_scale=null field_prec=null page=2 order=17 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(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=18 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 $PROP(KEEP_SUBACC_ID) name=Активный раздел field_name=keep_subacc_id table_name=td_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 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(T_SUBACC_ID) name=Раздел счета получатель field_name=t_subacc_id table_name=td_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=23 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(S_SUBACC_ID) name=Раздел счета поставщик field_name=s_subacc_id table_name=td_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=24 init_class=0 init_formula=@keep_subacc_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(MOVE_COMMENT) name=Комментарий field_name=move_comment table_name=td_stock_moves field_type=varchar field_length=255 field_scale=null field_prec=null page=2 order=26 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(CONTRAGENT_COMMENT) name=Контрагент с ном держателем field_name=contragent_comment table_name=td_stock_moves field_type=varchar field_length=255 field_scale=null field_prec=null page=2 order=27 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field= import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(OPER_FORM_ID) name=Форма операции field_name=oper_form_id table_name=td_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=28 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(REESTR_OPER_DATE) name=Дата операции в реестре field_name=reestr_oper_date table_name=td_stock_moves field_type=datetime field_length=8 field_scale=null field_prec=null page=2 order=29 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(DEPOCORR_OPER_DATE) name=Дата исполнения в депозитарии field_name=depocorr_oper_date table_name=td_stock_moves field_type=datetime field_length=8 field_scale=null field_prec=null 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(MOVE_CONTRAGENT_NAME) name=Контрагент по передаче field_name=move_contragent_name table_name=td_stock_moves field_type=varchar field_length=255 field_scale=null field_prec=null page=2 order=31 init_class=null init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field= import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(CONTR_OWNER_TYPE_ID) name=Тип держания field_name=contr_owner_type_id table_name=td_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=32 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(CONTR_ACCOUNT) name=Счет контрагента field_name=contr_account table_name=td_stock_moves field_type=varchar field_length=100 field_scale=null field_prec=null page=2 order=33 init_class=null init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field= import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(CONTR_JURADRESS) name=Юридический адрес field_name=contr_juradress table_name=td_stock_moves field_type=varchar field_length=255 field_scale=null field_prec=null 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(CONTR_REGISTER_NO) name=N госрегистрации field_name=contr_register_no table_name=td_stock_moves field_type=varchar field_length=60 field_scale=null field_prec=null 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(CONTR_REGISTER_DATE) name=Дата регистрации field_name=contr_register_date table_name=td_stock_moves field_type=datetime field_length=8 field_scale=null field_prec=null page=2 order=36 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(CONTR_REGISTRATOR) name=Регистратор field_name=contr_registrator table_name=td_stock_moves field_type=varchar field_length=255 field_scale=null field_prec=null page=2 order=37 init_class=null init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field= import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(KEEP_TRAJECT_END_ID) name=Конечный узел цепочки хранения field_name=keep_traject_end_id table_name=td_stock_moves 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(REESTR_OPER_ID) name=Ссылка на перечень выписки по конечному узлу field_name=reestr_oper_id table_name=td_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=39 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(DEPOCORR_OPER_ID) name=Ссылка на перечень выписки по ближ корресп field_name=depocorr_oper_id table_name=td_stock_moves 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(STOCK_ID) name=ценная бумага field_name=stock_id table_name=ts_sd_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 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(STOCK_PRICE) name=Сумма сделки field_name=stock_price table_name=ts_sd_stock_moves field_type=money field_length=8 field_scale=null field_prec=null 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(STOCK_PRICE_CUR_ID) name=Валюта сделки field_name=stock_price_cur_id table_name=ts_sd_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=42 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(COUPON_SUM) name=УНКД field_name=coupon_sum table_name=ts_sd_stock_moves field_type=money field_length=8 field_scale=null field_prec=null page=2 order=43 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(FOUND_DOC_ID) name=Договор счета ДЕПО field_name=found_doc_id table_name=ts_sd_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=25 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(STOCK_QTY) name=Количество field_name=stock_qty table_name=ts_sd_stock_moves field_type=money field_length=8 field_scale=null field_prec=null page=2 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(CONTRAG_ID) name=Контрагент по учету в СД field_name=contrag_id table_name=ts_sd_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=44 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(FOUNDATION_ID) name=Сделка field_name=foundation_id table_name=ts_sd_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 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(PERPOSE_ID) name=Целевое назначение field_name=perpose_id table_name=ts_sd_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 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(IS_COUPON_IN_PRICE) name=УНКД в том числе field_name=is_coupon_in_price table_name=ts_sd_stock_moves field_type=int field_length=4 field_scale=null field_prec=null page=2 order=46 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(IS_COMPLETED) name=Проведено по СД field_name=is_completed table_name=ts_sd_stock_moves field_type=int field_length=4 field_scale=null field_prec=null page=10 order=47 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(PART_ID) name=Документ для зачисления field_name=part_id table_name=ts_sd_stock_moves field_type=numeric field_length=9 field_scale=0 field_prec=18 page=2 order=45 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(EXEC_DATE) name=Дата исполнения field_name=exec_date table_name=ts_sd_stock_moves field_type=datetime field_length=8 field_scale=null field_prec=null page=2 order=48 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 $RELATION(REL17) class=0 type=partners form=null prop=CONTRAG_ID idname=null order=90 $ENDRELATION $RELATION(REL18) class=0 type=TARGET_PURPOSES form=null prop=PERPOSE_ID idname=null order=80 $ENDRELATION $RELATION(REL1) class=0 type=partners form=null prop=CORRESPONDENT_ID idname=null order=null $ENDRELATION $RELATION(REL2) class=0 type=partners form=null prop=INITIATOR_ID idname=null order=null $ENDRELATION $RELATION(REL3) class=1 type=t_operations form=item_opers_list prop=null idname=item_id_s order=130 $ENDRELATION $RELATION(REL4) class=1 type=actions_history form=uo_actions_history_list prop=null idname=null order=120 $ENDRELATION $RELATION(REL5) class=1 type=reports form=uo_reports_page_list prop=null idname=foundation_id_s order=110 $ENDRELATION $RELATION(REL7) class=1 type=activdocs form=ACTION2 prop=null idname=null order=1000 $ENDRELATION $RELATION(REL8) class=0 type=PIF_FUND form=null prop=OWNER_ID idname=null order=70 $ENDRELATION $RELATION(REL9) class=0 type=items form=null prop=FOUNDATION_ID idname=null order=50 $ENDRELATION $RELATION(REL10) class=0 type=DOG_DEALINGS_BAY form=null prop=FOUNDATION_ID idname=null order=60 $ENDRELATION $RELATION(REL11) class=0 type=partners form=null prop=PAYER_ID idname=null order=null $ENDRELATION $RELATION(REL12) class=0 type=depo_subacc form=null prop=T_SUBACC_ID idname=null order=30 $ENDRELATION $RELATION(REL13) class=0 type=td_stock_emis form=null prop=STOCK_ID idname=null order=10 $ENDRELATION $RELATION(REL14) class=0 type=depo_subacc form=null prop=KEEP_SUBACC_ID idname=null order=20 $ENDRELATION $RELATION(REL15) class=4 type=d_depo_folders form=null prop=FOLDER_ID idname=null order=null $ENDRELATION $RELATION(REL16) class=0 type=items form=null prop=FOUND_DOC_ID idname=null order=40 $ENDRELATION $RELATION(REL19) class=0 type=items form=null prop=PART_ID idname=null order=100 $ENDRELATION $RELATION(REL6) class=1 type=SD_INDOC2DOC form=FORM2 prop=null idname=doc_id_s order=1010 $ENDRELATION $FORM(D_STOCK_IN_VIEW_NOTSD) name=Данные class=5 filter=null target_state= uo=uo_edit dw=d_stock_in_view_notsd procedure=ap_30145000002861543 patterns=GENERIC_VIEW_ITEM_P2 user_define=1 isvisible=1 istab=1 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503278) 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 .MONEY_VAR(@dog_stock_covered_qty) .ID_VAR(@foundation_id) .ID_VAR(@perpose_id) select @foundation_id=foundation_id,@perpose_id=perpose_id from ts_sd_stock_moves where id =@id if not(@perpose_id is null) begin if .PURPOSE_CODE(@perpose_id) = 6002 and not(@foundation_id is null) begin select @dog_stock_covered_qty = 0 select @dog_stock_covered_qty = .STOCK_COVERED_BY_DEAL_QTY(@id,@foundation_id) end end .VIEW_ITEM(ALL,2) end $ENDTEXT(12503278) $ACTION2RELATION(REL14.DEPO_SUBACC_NO) relation=REL14 where=null prop=DEPO_SUBACC_NO order=13 alias=keep_subacc_no $ENDACTION2RELATION $ACTION2RELATION(REL14.DEPO_SUBACC_NAME) relation=REL14 where=null prop=DEPO_SUBACC_NAME order=5 alias=keep_subacc_name $ENDACTION2RELATION $ACTION2RELATION(REL12.DEPO_SUBACC_NO) relation=REL12 where=null prop=DEPO_SUBACC_NO order=13 alias=t_subacc_no $ENDACTION2RELATION $ACTION2RELATION(REL12.DEPO_SUBACC_NAME) relation=REL12 where=null prop=DEPO_SUBACC_NAME order=5 alias=t_subacc_name $ENDACTION2RELATION $ACTION2RELATION(REL13.EMMITENT_ID) relation=REL13 where=null prop=EMMITENT_ID order=1 alias=emmitent_id_s $ENDACTION2RELATION $ACTION2RELATION(REL13.STOCK_CODE) relation=REL13 where=null prop=STOCK_CODE order=3 alias=stock_code $ENDACTION2RELATION $ACTION2RELATION(REL13.STOCK_NAME) relation=REL13 where=null prop=STOCK_NAME order=4 alias=stock_name $ENDACTION2RELATION $ACTION2RELATION(REL13.STOCK_TYPE_ID) relation=REL13 where=null prop=STOCK_TYPE_ID order=6 alias=stock_type_id_s $ENDACTION2RELATION $ACTION2RELATION(REL9.ITEM_NAME) relation=REL9 where=null prop=ITEM_NAME order=2 alias=dog_name $ENDACTION2RELATION $ACTION2RELATION(REL9.ITEM_REMARK) relation=REL9 where=null prop=ITEM_REMARK order=4 alias=dog_remark $ENDACTION2RELATION $ACTION2RELATION(REL10.STOCK_ID) relation=REL10 where=null prop=STOCK_ID order=4 alias=dog_stock_id_s $ENDACTION2RELATION $ACTION2RELATION(REL10.STOCK_QTY) relation=REL10 where=null prop=STOCK_QTY order=6 alias=dog_stock_qty $ENDACTION2RELATION $ACTION2RELATION(REL16.ITEM_NAME) relation=REL16 where=null prop=ITEM_NAME order=2 alias=dog_depo_name $ENDACTION2RELATION $ACTION2RELATION(REL16.ITEM_REMARK) relation=REL16 where=null prop=ITEM_REMARK order=4 alias=dog_depo_remark $ENDACTION2RELATION $ACTION2RELATION(REL18.CODE) relation=REL18 where=null prop=CODE order=1 alias=purpose_code $ENDACTION2RELATION $ACTION2RELATION(REL18.NAME) relation=REL18 where=null prop=NAME order=2 alias=purpose_name $ENDACTION2RELATION $ACTION2RELATION(REL17.PARTNER_CODE) relation=REL17 where=null prop=PARTNER_CODE order=1 alias=partner_code $ENDACTION2RELATION $ACTION2RELATION(REL17.PARTNER_SHORT_NAME) relation=REL17 where=null prop=PARTNER_SHORT_NAME order=4 alias=partner_short_name $ENDACTION2RELATION $ACTION2RELATION(REL19.ITEM_NAME) relation=REL19 where=null prop=ITEM_NAME order=null alias=part_name $ENDACTION2RELATION $ACTION2RELATION(REL8.OUT_METHOD_ID) relation=REL8 where=null prop=OUT_METHOD_ID order=null alias=out_method_id $ENDACTION2RELATION $ACTION2RELATION(REL8.OUT_SUM_METHOD_ID) relation=REL8 where=null prop=OUT_SUM_METHOD_ID order=null alias=out_sum_method_id $ENDACTION2RELATION $CALC(DOG_STOCK_COVERED_QTY) class=1 type=decimal calc_lenght=null calc_prec=18 calc_scale=4 formula=@dog_stock_covered_qty label=Количество ценных бумаг используемое по договору order=1 $ENDCALC $ENDFORM $FORM(FORM2) name=Просмотр class=5 filter=null target_state= uo=uo_depooper_edit dw=d_sdepo_oper_p1 procedure=ap_30145000002433585 patterns=GENERIC_VIEW_ITEM_P1 user_define=1 isvisible=0 istab=1 posx=0 posy=0 width=2386 height=1924 proc_text=$TEXT(12503278) 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 commit tran end .INSERT_INFO4OPER(@id) .VIEW_ITEM(ALL,1) /* .ACTION_HISTORY */ end $ENDTEXT(12503278) $ACTION2RELATION(REL2.PARTNER_CODE) relation=REL2 where=null prop=PARTNER_CODE order=1 alias=initiator_code $ENDACTION2RELATION $ACTION2RELATION(REL2.PARTNER_SHORT_NAME) relation=REL2 where=null prop=PARTNER_SHORT_NAME order=4 alias=initiator_short_name $ENDACTION2RELATION $ACTION2RELATION(REL1.PARTNER_CODE) relation=REL1 where=null prop=PARTNER_CODE order=1 alias=corr_code $ENDACTION2RELATION $ACTION2RELATION(REL1.PARTNER_SHORT_NAME) relation=REL1 where=null prop=PARTNER_SHORT_NAME order=4 alias=corr_short_name $ENDACTION2RELATION $ACTION2RELATION(REL11.PARTNER_CODE) relation=REL11 where=null prop=PARTNER_CODE order=1 alias=payer_code $ENDACTION2RELATION $ACTION2RELATION(REL11.PARTNER_SHORT_NAME) relation=REL11 where=null prop=PARTNER_SHORT_NAME order=4 alias=payer_short_name $ENDACTION2RELATION $ACTION2RELATION(REL8.CTRL_COMP_ID) relation=REL8 where=null prop=CTRL_COMP_ID order=null alias=ctrl_comp_id_s $ENDACTION2RELATION $ACTION2RELATION(REL8.PARTNER_CODE) relation=REL8 where=null prop=PARTNER_CODE order=null alias=fond_code $ENDACTION2RELATION $ACTION2RELATION(REL8.PARTNER_SHORT_NAME) relation=REL8 where=null prop=PARTNER_SHORT_NAME order=null alias=fond_name $ENDACTION2RELATION $BIND(BIND1) type=D_STOCK_IN_OTHER_DEPO_SD action=D_STOCK_IN_VIEW_NOTSD class=1 order=1 idname=null $ENDBIND $BIND(BIND2) type=SD_INFO4OPER action=FORM_ED class=1 order=10 idname=sid $ENDBIND $ENDFORM $FORM(UO_PART_LIST) name=Список для привязки партий class=4 filter=null target_state= uo=uo_list_disable dw=d_part_list procedure=ap_30145000002861561 patterns=GENERIC_VIEW_LIST user_define=1 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503278) create procedure dbo.%PROC% @sid varchar(30) = null .ARGLIST_FILTER as declare @action_id numeric, @user_id numeric, @state_id numeric, @type_id numeric begin set nocount on select @action_id = %ACTION_ID% .CHECK_USER .CHECK_VIEW .ARGCONVERT_FILTER ------------------------------------------------- --GET_PROPS declare @fund_type_code varchar(255) declare @subc3_type_id numeric declare @subc3_item_id numeric declare @fund_plan_id numeric declare @operday datetime declare @stock_account_id numeric declare @owner_id numeric declare @initiator_id numeric declare @new_part_id numeric declare @purpose_code numeric if upper(.ITEM_TYPE_CODE(@docitem_id)) in ('D_STOCK_IN_OTHER_DEPO_SD','D_STOCK_OUT_OTHER_DEPO') select @operday = exec_date from ts_sd_stock_moves where id=@docitem_id else select @operday = .OPERDAY --select @owner_id = .ORGANIZATION select @owner_id = owner_id from td_depo_docs where id=@docitem_id select @initiator_id = initiator_id from td_depo_docs where id=@docitem_id select @purpose_code = code from t_purposes where id=@perpose_id if @purpose_code=6002 and @foundation_id is not null and @foundation_id !=0 begin select @new_part_id=@foundation_id end else select @new_part_id=@docitem_id --if @owner_id is null --.EXIT_MESSAGE('Не задан фонд') select @fund_type_code = .ITEM_TYPE_CODE(@owner_id) select @fund_type_code = lower(@fund_type_code) if @fund_type_code = 'pif_fund' begin select @fund_plan_id = .ARG_PLAN('PIF_ACCOUNT') end else if @fund_type_code = 'npf_fund' begin select @fund_plan_id = .ARG_PLAN('NPF_ACCOUNT') end select @stock_account_id = .ACCID_FROM_EFFNO(@fund_plan_id,'58.1') if @fund_type_code = 'pif_fund' begin select @subc3_type_id = .SUBCTYPE_FROM_CODE('stock_emis') select @subc3_item_id = @stock_id end else begin select @subc3_type_id = .SUBCTYPE_FROM_CODE('asset_manager') select @subc3_item_id = isnull(@initiator_id, @owner_id) end .TOTALS_QUERY_SUB(@owner_id,@fund_plan_id,@operday,@operday,@stock_account_id,'stock_emis',@stock_id,'doc_item',N,(.FROM_SUBC3),(.WHERE_SUBC3(@subc3_type_id,@subc3_item_id)),L,N,Y,N,Y) /*--------------------------------------- .VIEW_LIST ---------------------- */ select sid = convert(varchar, t_items.id), t_items.item_name , type_name=(select t_types.type_name from t_types where t_types.id=t_items.type_id), d.in_date, d.in_no, convert(decimal(18,4), o.saldo_de) as part_sum, convert(decimal(18,4), o.q_saldo_de) as part_qty, convert(decimal(18,4), (o.saldo_de / o.q_saldo_de)) as part_price from #tmp_oss o, -- #state_list, t_items, t_states, td_depo_docs d where o.subc2_id = d.id and o.q_saldo_de > 0 and o.subc2_id = t_items.id and t_items.state_id = t_states.id and t_states.class_id = 0 -- and #state_list.state_id = t_items.state_id and (d.folder_id is null or exists(select 1 from #folders_list where folder_id=d.folder_id)) and (isnull(upper(ltrim(rtrim(t_items.item_remark))),'') LIKE isnull('%'+upper(ltrim(rtrim(@item_remark))) + '%','%')) UNION select sid = convert(varchar, t_items.id), ('Новая партия: '+t_items.item_name) as item_name, type_name=(select t_types.type_name from t_types where t_types.id=t_items.type_id), convert(datetime,null) as in_date, '' as in_no, convert(decimal(18,4),null) as part_sum, convert(decimal(18,4),null) as part_qty, convert(decimal(18,4),null) as part_price from t_items where t_items.id = @new_part_id end $ENDTEXT(12503278) $FILTER(PERPOSE_ID) type=11 label=Целевое назначение prop=null arg_code=perpose_id arg_type=numeric arg_length=null arg_prec=18 arg_scale=0 $ENDFILTER $FILTER(FOUNDATION_ID) type=11 label=Сделка prop=null arg_code=foundation_id arg_type=numeric arg_length=null arg_prec=18 arg_scale=0 $ENDFILTER $FILTER(DOCITEM_ID) type=11 label=Документ из которого выбираем prop=null arg_code=docitem_id arg_type=numeric arg_length=30 arg_prec=18 arg_scale=0 $ENDFILTER $FILTER(STOCK_ID) type=11 label=ЦБ по которой отбираем prop=null arg_code=stock_id arg_type=numeric arg_length=null arg_prec=18 arg_scale=0 $ENDFILTER $ENDFORM $ACTION(ACTION1) name=Подтверждение class=9 form=null target_state=OP_END_SD procedure=ap_30145000002861566 patterns=GENERIC_MOVE user_define=1 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503280) create procedure dbo.%PROC% @sid varchar(30) = null as .BEGIN('Y') --declare @action_id numeric, -- @id numeric, -- @user_id numeric, -- @state_id numeric, -- @new_state_id numeric, -- @type_id numeric begin tran .CHECKPOINT_INIT select @action_id = %ACTION_ID% select @id = convert(numeric, @sid) .CHECK_USER .CHECK_UPDATE .UPDATE_STATE .ACTION_HISTORY .GET_PROPS .ARH_NUMBER_UPDATE .CHECKPOINT_EXEC('RIGHTS') update ts_sd_stock_moves set owner_id=@owner_id, initiator_id=@initiator_id where id=@id if @exec_date is null begin select @exec_date=@in_date update ts_sd_stock_moves set exec_date=@in_date where id=@id end declare @oper_date datetime select @oper_date = @exec_date .ARH_DATE_SD(@oper_date) .CHECKPOINT_EXEC('ARCH_DATE') exec ap_sd_oper_in @doc_id=@id, @oper_doc_id=@id, @oper_action_id=@action_id, @oper_action_history_id=@action_history_id, @oper_date=@oper_date .CHECKPOINT_EXEC('AP_SD_OPER_IN') commit tran .END $ENDTEXT(12503280) $ENDACTION $ACTION(ACTION11) name=Отменить class=9 form=null target_state=ED procedure=ap_30145000002861567 patterns=GENERIC_MOVE user_define=1 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503280) create procedure dbo.%PROC% @sid varchar(30) = null as .CHECKPOINT_INIT 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 .CHECKPOINT_EXEC('Проверка прав') if @exec_date is null update ts_sd_stock_moves set exec_date=dd.arch_date from td_depo_docs dd where dd.id=ts_sd_stock_moves.id and dd.id=@id .OPERS_ROLL(ALL) .CHECKPOINT_EXEC('Откат проводок') .ARH_FLAG_CLEAR exec ap_sd_oper_roll @doc_id=@id, @oper_doc_id=@id .CHECKPOINT_EXEC('Откат документа') commit tran $ENDTEXT(12503280) $ENDACTION $ACTION(ACTION13) name=Данные (изменение) class=2 form=D_STOCK_IN_VIEW_NOTSD target_state=null procedure=ap_30145000002861568 patterns=GENERIC_UPDATE_P2 user_define=1 isvisible=1 istab=1 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503280) 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) .GET_PROPS(ALL,1) /***************/ if @stock_id is null .EXIT_MESSAGE('Не задана ЦБ') if @perpose_id is null .EXIT_MESSAGE('Не задано целевое назначение ') if .PURPOSE_CODE(@perpose_id) = 6002 and @foundation_id is null .EXIT_MESSAGE('Не задан договор основание') if .PURPOSE_CODE(@perpose_id) != 6001 and @contrag_id is null .EXIT_MESSAGE('Не задан контрагент по учету в СД') if @found_doc_id is null .EXIT_MESSAGE('Не задан договор счета ДЕПО') .TYPE_GET('FUND_CONTRACTS',@found_doc_id,1) if @owner_id != @owner_id1 .EXIT_MESSAGE('Выбран договор счета ДЕПО другого фонда') else begin if @initiator_id is null and @initiator_id1 is not null .EXIT_MESSAGE('Выберите договор счета ДЕПО для фонда') else begin if @initiator_id != @initiator_id1 .EXIT_MESSAGE('Выберите договор счета ДЕПО для заданного управляющего') end end if @stock_qty <= 0 .EXIT_MESSAGE('Количество бумаг не может быть отрицательным или 0') if (@stock_price <= 0 or @stock_price is null) and -- кроме сделок предпоставки not (.PURPOSE_CODE(@perpose_id) = 6002 and (select mode_id from tb_baysale_docitems where id=@foundation_id) = 2) .EXIT_MESSAGE('Введите сумму поручения') if @stock_price <= @coupon_sum and isnull(@stock_price,0) > 0 .EXIT_MESSAGE('Сумма УНКД должна быть меньше Суммы сделки') if @part_id is null or @part_id = 0 begin if .PURPOSE_CODE(@perpose_id) = 6002 select @part_id = @foundation_id else select @part_id = @id end /***************/ .TEST_UNIQUE(ALL, 2) if not(@foundation_id is null) and .PURPOSE_CODE(@perpose_id) = 6002 begin .TYPE_GET('dog_dealings_bay',@foundation_id,3) .MONEY_VAR(@dog_stock_covered_qty) .MONEY_VAR(@dog_sum) .MONEY_VAR(@dog_coupon_sum) .ID_VAR(@dog_pif_cont_comp_id) .ID_VAR(@asset_manager_id) .ID_VAR(@dog_asset_manager_id) .ID_VAR(@pif_cont_comp_id) .NAME_VAR(@f_type_code) select @f_type_code = .ITEM_TYPE_CODE(@owner_id) select @f_type_code = lower(@f_type_code) if @f_type_code = 'pif_fund' begin select @pif_cont_comp_id = .GET_CTRL_COMP_ID(@owner_id) select @dog_pif_cont_comp_id = .GET_CTRL_COMP_ID(@owner_id3) if @dog_pif_cont_comp_id != @pif_cont_comp_id .EXIT_MESSAGE('УК ПИФ в сделке и в поручении должна быть одна и та же.') end if @f_type_code = 'npf_fund' begin select @asset_manager_id = isnull(@initiator_id,@owner_id) select @dog_asset_manager_id = isnull(@initiator_id3,@owner_id3) if @dog_asset_manager_id != @asset_manager_id if @initiator_id is null /* При размещении самостоятельно НПФ*/ begin if @dog_asset_manager_id != @asset_manager_id .EXIT_MESSAGE('В поручении не задан управляющий - должна быть выбрана сделка для НПФ') end else /* При размещении через УК*/ begin if @dog_asset_manager_id != @asset_manager_id .EXIT_MESSAGE('В сделке и в поручении заданы разные управляющие.') end end select @dog_stock_covered_qty = 0 select @dog_sum = 0 select @dog_coupon_sum = 0 .STOCK_COVERED_BY_DEAL(@stock_qty3,@sum_in_paycur3,@coupon_account_sum3,@dog_stock_covered_qty,@dog_sum,@dog_coupon_sum,@id,@foundation_id) if @dog_stock_covered_qty + @stock_qty > @stock_qty3 begin .EXIT_MESSAGE('Превышено количество ценных бумаг по Договору ') end if @stock_qty + @dog_stock_covered_qty < @stock_qty3 begin select @stock_price = .ROUND_MONEY((@sum_in_paycur3 * @stock_qty / @stock_qty3),2) select @coupon_sum = .ROUND_MONEY((@coupon_account_sum3 * @stock_qty / @stock_qty3),2) end else begin select @stock_price = @sum_in_paycur3 - @dog_sum select @coupon_sum = @coupon_account_sum3 - @dog_coupon_sum end select @is_coupon_in_price=@is_coupon_in_sum3 end .UPDATE_ITEMS .UPDATE(ALL,2) .RELGEN .UPDATE_STATE .ACTION_HISTORY commit tran $ENDTEXT(12503280) $ENDACTION $ACTION(ACTION7) name=Добавить class=1 form=FORM2 target_state=ED procedure=ap_30145000002861569 patterns=GENERIC_INSERT_P1 user_define=1 isvisible=0 istab=1 posx=0 posy=0 width=2651 height=1896 proc_text=$TEXT(12503280) create procedure dbo.%PROC% @sid varchar(30) = null, .ARGLIST(ALL,1) as .CHECKPOINT_INIT .BEGIN('Y') 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) if @in_date is null .EXIT_MESSAGE('Введите дату документа') .CHECKPOINT_EXEC('Проверка прав') .SD_GEN_NO(@in_no,@depo_doc_type,@in_date) .CHECKPOINT_EXEC('Проверка номера') begin tran .UPDATE(ALL,1) .RELGEN .UPDATE_STATE .ACTION_HISTORY commit tran select @sid = convert(varchar,@id) select @sid .CHECKPOINT_EXEC('Добавление') end .END $ENDTEXT(12503280) $BIND(BIND1) type=D_STOCK_IN_OTHER_DEPO_SD action=ACTION13 class=1 order=null idname=null $ENDBIND $BIND(BIND2) type=SD_INFO4OPER action=ACTION_UPDATE class=1 order=10 idname=sid $ENDBIND $ENDACTION $ACTION(ACTION8) name=Изменить class=2 form=FORM2 target_state=null procedure=ap_30145000002861571 patterns=GENERIC_UPDATE_P1 user_define=1 isvisible=0 istab=1 posx=0 posy=0 width=2821 height=1820 proc_text=$TEXT(12503280) 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) .DEPO_CHK_NO(@id,@in_no,@depo_doc_type) .UPDATE(ALL,1) .RELGEN .UPDATE_STATE .ACTION_HISTORY commit tran select sid = convert(varchar, @id) $ENDTEXT(12503280) $BIND(BIND1) type=D_STOCK_IN_OTHER_DEPO_SD action=ACTION13 class=1 order=1 idname=null $ENDBIND $BIND(BIND2) type=SD_INFO4OPER action=ACTION_UPDATE class=1 order=10 idname=sid $ENDBIND $ENDACTION $ACTION(ACTION9) name=Удалить class=3 form=FORM2 target_state=DEL procedure=ap_30145000002861573 patterns=GENERIC_MOVE user_define=1 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503280) create procedure dbo.%PROC% @sid varchar(30) = null as .CHECKPOINT_INIT 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 .CHECKPOINT_EXEC('Права') /*-------Проводки ----------*/ .OPERS_ROLL select sid = convert(varchar, @id) .DEPO_DELETE_FOUNDATION .DEPO_CHK_REPS(@id,'reports_report_for_operation') .CHECKPOINT_EXEC('Удаление оснований и отчетов') commit tran $ENDTEXT(12503280) $ENDACTION $ACTION(SD_OPER_IN) name=Проведение по СД (прием ЦБ) class=9 form=null target_state=null procedure=ap_sd_oper_in patterns=null user_define=1 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503280) create proc dbo.%PROC% @doc_id numeric, -- id док-та основания поручения (=id поручения для приема не в нашем) @oper_doc_id numeric, -- id поручения @oper_action_id numeric, -- id метода поручения @oper_action_history_id numeric, @oper_date datetime -- дата проведения as begin begin tran .CHECKPOINT_INIT .GET_SD_OPER_DATE(@oper_date,@doc_id) ------------ -- GET_PROPS ------------ .ID_VAR(@foundation_id) .ID_VAR(@perpose_id) .ID_VAR(@stock_id) .ID_VAR(@stock_price_cur_id) .ID_VAR(@contrag_id) .ID_VAR(@part_id) .ID_VAR(@owner_id) .ID_VAR(@initiator_id) .MONEY_VAR(@stock_price) .MONEY_VAR(@stock_qty) .MONEY_VAR(@coupon_sum) .INT_VAR(@is_coupon_in_price) select @foundation_id=foundation_id, @perpose_id=perpose_id, @stock_id=stock_id, @stock_price_cur_id=stock_price_cur_id, @contrag_id=contrag_id, @part_id=part_id, @owner_id=owner_id, @initiator_id=initiator_id, @stock_price=stock_price, @stock_qty=stock_qty, @coupon_sum=coupon_sum, @is_coupon_in_price=is_coupon_in_price from ts_sd_stock_moves where id=@doc_id ------------ -- ------------ .ID_VAR(@oper_id) .ID_VAR(@asset_manager_id) .ID_VAR(@contr_id) .ID_VAR(@deb_id) .ID_VAR(@cred_id) .ID_VAR(@coupon_deb_id) .ID_VAR(@fund_plan_id) .ID_VAR(@partion_id) .MONEY_VAR(@sum_in_dog) .MONEY_VAR(@dog_sum) .MONEY_VAR(@dog_qty) .MONEY_VAR(@dog_coupon_sum) .MONEY_VAR(@dog_oblig_sum) .MONEY_VAR(@stock_oper_sum) .MONEY_VAR(@stock_tmp_sum) .MONEY_VAR(@coupon_oper_sum) .MONEY_VAR(@oblig_oper_sum) .NAME_VAR(@fund_type_code) .NAME_VAR(@doc_name_fund) .NAME_VAR(@coupon_doc_name_fund) .INT_VAR(@purpose_code) declare @cur_pay decimal(18,8) declare @r_date datetime if @owner_id is null .EXIT_MESSAGE('Задайте фонд') select @fund_type_code=lower(.ITEM_TYPE_CODE(@owner_id)) select @purpose_code=.PURPOSE_CODE(@perpose_id) select @doc_name_fund = .PURPOSE_NAME(@purpose_code) + ':' + .ITEM_NAME(@oper_doc_id) -- партия if (select out_sum_method_id from td_pay_fond where id=@owner_id) = 1 select @partion_id=(select td_depo_docs.id from td_depo_docs where in_no='COMMON_ASSET_INPUT' and .ITEMS_EXISTS_BY_TYPE(td_depo_docs.id,'letter_in')) else select @partion_id=@part_id .CHECKPOINT_EXEC('PARAMETRS') -- контрагент select @contr_id = @contrag_id -- суммы в проводки select @stock_oper_sum = @stock_price select @coupon_oper_sum = @coupon_sum ------------------- -- Счета ------------------- if @fund_type_code = 'pif_fund' begin select @fund_plan_id = .ARG_PLAN('PIF_ACCOUNT') select @deb_id = .ACCID_FROM_EFFNO(@fund_plan_id,'58.1') select @cred_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.5.2') select @coupon_deb_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.6') end if @fund_type_code = 'npf_fund' begin select @fund_plan_id = .ARG_PLAN('NPF_ACCOUNT') select @asset_manager_id = isnull(@initiator_id,@owner_id) select @deb_id = .ACCID_FROM_EFFNO(@fund_plan_id,'58.1') if @owner_id = @asset_manager_id -- через НПФ select @cred_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.4') else -- через УК select @cred_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.5') select @coupon_deb_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.6') end .CHECKPOINT_EXEC('ACCOUNTS') ------------------- -- Целевые назначения ------------------- -- Принятие начальных остатков if @purpose_code = 6001 begin select @cred_id = .ACCID_FROM_EFFNO(@fund_plan_id,'00') select @doc_name_fund = ' Начальные остатки' + @doc_name_fund end -- Зачисление ЦБ от эмитента и Прочее зачисление if @purpose_code in (6003,6004) begin if @fund_type_code = 'pif_fund' begin select @cred_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.5.3') end select @doc_name_fund = @doc_name_fund end -- Зачисление ЦБ по сделке if @purpose_code = 6002 begin if upper(.ITEM_STATE_CODE(@foundation_id)) = 'COMPLETE' .EXIT_MESSAGE('Cделка-основание уже перерегистрирована') if upper(.ITEM_STATE_CODE(@foundation_id)) != 'CRT' .EXIT_MESSAGE('Cделка-основание не подписана') .TYPE_GET('dog_dealings_bay',@foundation_id,2_1) if @owner_id != @owner_id2_1 .EXIT_MESSAGE('Выбрана сделка другого фонда') else begin if @initiator_id is null and @initiator_id2_1 is not null .EXIT_MESSAGE('Не задан управляющий - выберите сделку для фонда') else begin if @initiator_id != @initiator_id2_1 .EXIT_MESSAGE('Выберите сделку для заданного управляющего') end end .CHECK_STOCK_EMM_AND_TYPE(@stock_id,@stock_id2_1,'Эммитент и тип ЦБ в сделке-основании должен соответствовать эммитенту и типу ЦБ в поручении') if (select registr_mode_id from td_pay_fond where id=@owner_id) = 2 -- ЦБ из сделки begin select @stock_id = @stock_id2_1 update ts_sd_stock_moves set stock_id=@stock_id where id=@doc_id end if @mode_id2_1 is null .EXIT_MESSAGE('В сделке не задан способ расчетов по сделке') if @fund_type_code = 'pif_fund' begin if @ball_acc_type_id2_1 = 61 -- Долгосрочные активы select @deb_id = .ACCID_FROM_EFFNO(@fund_plan_id,'06.1') if @mode_id2_1 = 3 -- поставка против платежа select @cred_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.5.4') end if @fund_type_code = 'npf_fund' begin if @ball_acc_type_id2_1 = 61 -- Долгосрочные активы select @deb_id = .ACCID_FROM_EFFNO(@fund_plan_id,'6.1') end if @character_id2_1 = 1 -- Дилерская сделка select @contr_id = @contragent_id2_1 else -- Клиентская сделка select @contr_id = @organisation_id2_1 select @is_coupon_in_price=@is_coupon_in_sum2_1 if @mode_id2_1 = 2 -- предпоставка select @sum_in_dog = @summ_doc_total2_1 else -- предоплата, поставка против платежа select @sum_in_dog = @sum_in_paycur2_1 .STOCK_COVERED_BY_DEAL(@stock_qty2_1,@sum_in_dog,@coupon_account_sum2_1,@dog_qty,@dog_sum,@dog_coupon_sum,@doc_id,@foundation_id) if @stock_qty + @dog_qty > @stock_qty2_1 .EXIT_MESSAGE('Превышено количество ценных бумаг по сделке') if @stock_qty + @dog_qty < @stock_qty2_1 select @stock_tmp_sum = .ROUND_MONEY((convert(double precision,@sum_in_dog) * @stock_qty / @stock_qty2_1),2) else select @stock_tmp_sum = @sum_in_dog - @dog_sum if isnull(@coupon_account_sum2_1,0) != 0 begin if @stock_qty + @dog_qty < @stock_qty2_1 select @coupon_oper_sum = .ROUND_MONEY((@coupon_account_sum2_1 * @stock_qty / @stock_qty2_1),2) else select @coupon_oper_sum = @coupon_account_sum2_1 - @dog_coupon_sum end else select @coupon_oper_sum = 0 if @mode_id2_1 = 2 and @pay_cur_id2_1 != @cur_id2_1 -- предпоставка на другую валюту begin -- .CONVERT_SUM(@cur_id2_1,@pay_cur_id2_1,@oper_date,0,@stock_tmp_sum,@stock_oper_sum,@cur_pay,@r_date) if isnull(@cur_price2pay_rate2_1,0) != 0 begin select @stock_oper_sum = .ROUND_MONEY((@stock_tmp_sum * @cur_price2pay_rate2_1),2) end else begin .CONVERT_SUM(@cur_id2_1,@pay_cur_id2_1,@oper_date,0,@stock_tmp_sum,@stock_oper_sum,@cur_pay,@r_date) end end else select @stock_oper_sum = @stock_tmp_sum select @stock_oper_sum = .ROUND_MONEY(@stock_oper_sum,2) update ts_sd_stock_moves set stock_price=@stock_oper_sum, coupon_sum=@coupon_oper_sum, is_coupon_in_price=@is_coupon_in_price where id=@doc_id end --================================================================================ /* declare @sum_ob money, @s_str varchar(255),@obor_partner2plan_id numeric select @s_str='' .SUBC_STR_ADD(@s_str,'doc_item',@partion_id,Y) .SUBC_STR_ADD(@s_str,'stock_emis',@stock_id,Y) if @fund_type_code = 'npf_fund' begin .SUBC_STR_ADD(@s_str,'asset_manager',@asset_manager_id,Y) end select @obor_partner2plan_id =t_plans2partner.id from t_plans2partner,t_items,t_states where t_plans2partner.plan_id=(@fund_plan_id) and t_plans2partner.partner_id= (@owner_id) and t_plans2partner.id=t_items.id and t_items.state_id=t_states.id and t_states.class_id !=2 select @sum_ob=isnull(sum(o.sum_bal),0) from t_oper_list o ,t_accounts where o.partner2plan_id=@obor_partner2plan_id and convert(datetime,convert(varchar(30),o.op_date,3),3) > convert(datetime,convert(varchar(30),@oper_date,3),3) and o.deb_or_cred = -1 and o.acc_id = t_accounts.id and t_accounts.id=@deb_id and o.subc_eff_num LIKE '%'+@s_str+'%' if isnull(@sum_ob,0) != 0 .EXIT_MESSAGE('Зачисление проводится раньше, чем уже проведенное снятие') if isnull(@coupon_oper_sum,0) != 0 begin select @obor_partner2plan_id =t_plans2partner.id from t_plans2partner,t_items,t_states where t_plans2partner.plan_id=(@fund_plan_id) and t_plans2partner.partner_id= (@owner_id) and t_plans2partner.id=t_items.id and t_items.state_id=t_states.id and t_states.class_id !=2 select @sum_ob=isnull(sum(o.sum_bal),0) from t_oper_list o ,t_accounts where o.partner2plan_id=@obor_partner2plan_id and convert(datetime,convert(varchar(30),o.op_date,3),3) > convert(datetime,convert(varchar(30),@oper_date,3),3) and o.deb_or_cred = -1 and o.acc_id = t_accounts.id and t_accounts.id=@coupon_deb_id and o.subc_eff_num LIKE '%'+@s_str+'%' if isnull(@sum_ob,0) != 0 .EXIT_MESSAGE('Зачисление проводится раньше, чем уже проведенное снятие') end */ --================================================================================ .CHECKPOINT_EXEC('PURPOSE') ----------- -- Проводки ----------- select @coupon_doc_name_fund = 'УНКД ' + @doc_name_fund if @is_coupon_in_price = 1 select @stock_oper_sum = @stock_oper_sum - isnull(@coupon_oper_sum,0) ---------------- -- По зачислению ---------------- .OPERATION(@owner_id,@fund_plan_id,@oper_date,@deb_id,@cred_id,@stock_oper_sum,@stock_price_cur_id,@oper_date,@stock_qty,0,@doc_name_fund,N,@oper_id,@oper_doc_id,@oper_action_id,@oper_action_history_id) .UPDATE_SUBC(D,'stock_emis',@stock_id,@oper_id) .UPDATE_SUBC(D,'doc_item',@partion_id,@oper_id) if @fund_type_code = 'pif_fund' begin if @purpose_code != 6001 begin .UPDATE_SUBC(K,'partners',@contr_id,@oper_id) end end if @fund_type_code = 'npf_fund' begin .UPDATE_SUBC(D,'asset_manager',@asset_manager_id,@oper_id) if @purpose_code != 6001 begin if @owner_id = @asset_manager_id -- через НПФ begin .UPDATE_SUBC(K,'partners',@contr_id,@oper_id) end else -- через УК begin .UPDATE_SUBC(K,'partners_cont',@contr_id,@oper_id) .UPDATE_SUBC(K,'partners',@asset_manager_id,@oper_id) end end end .SUBC_CHECK(@oper_id) .CHECKPOINT_EXEC('ZACHISL') ----------- -- По УНКД ----------- if isnull(@coupon_oper_sum,0) != 0 begin .OPERATION(@owner_id,@fund_plan_id,@oper_date,@coupon_deb_id,@cred_id,@coupon_oper_sum,@stock_price_cur_id,@oper_date,@stock_qty,0,@coupon_doc_name_fund,N,@oper_id,@oper_doc_id,@oper_action_id,@oper_action_history_id) .UPDATE_SUBC(D,'stock_emis',@stock_id,@oper_id) .UPDATE_SUBC(D,'doc_item',@partion_id,@oper_id) if @fund_type_code = 'pif_fund' begin if @purpose_code != 6001 begin .UPDATE_SUBC(K,'partners',@contr_id,@oper_id) end end if @fund_type_code = 'npf_fund' begin .UPDATE_SUBC(D,'asset_manager',@asset_manager_id,@oper_id) if @purpose_code != 6001 begin if @owner_id = @asset_manager_id -- через НПФ begin .UPDATE_SUBC(K,'partners',@contr_id,@oper_id) end else -- через УК begin .UPDATE_SUBC(K,'partners_cont',@contr_id,@oper_id) .UPDATE_SUBC(K,'partners',@asset_manager_id,@oper_id) end end end .SUBC_CHECK(@oper_id) end .CHECKPOINT_EXEC('UNKD') ---------------------------------- -- по прочим обязательствам сделки ---------------------------------- if @purpose_code = 6002 begin if @fund_type_code = 'pif_fund' begin if @mode_id2_1 = 3 -- поставка против платежа select @cred_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.5.4') else select @cred_id = .ACCID_FROM_EFFNO(@fund_plan_id,'76.12') end -- Обязательства по оплате if exists(select 1 from tb_plans,tb_plan_pays where tb_plans.item_id = @foundation_id and tb_plans.id =tb_plan_pays.id and tb_plan_pays.pay_perpose_id !=1 and .ITEMS_EXISTS_BY_TYPE(tb_plans.id,'obligation_payer_out')) begin .FOR_DOCS(N,'obligation_payer_out',ALL,C,'tb_plans.item_id = @foundation_id and tb_plans.id = t_items100.id','tb_plans') if @for_state_code1 in ('OP','EXEC') begin .TYPE_GET('obligation_payer_out',@for_id1,5_1) if @pay_perpose_id5_1 !=1 begin select @dog_oblig_sum = .SUM_COVERED_BY_OBLIG(@plan_sum5_1,@stock_qty2_1,@doc_id,@foundation_id) if @stock_qty + @dog_qty < @stock_qty2_1 select @oblig_oper_sum = .ROUND_MONEY((@plan_sum5_1 * @stock_qty / @stock_qty2_1),2) else select @oblig_oper_sum = @plan_sum5_1 - @dog_oblig_sum .OPERATION(@owner_id,@fund_plan_id,@oper_date,@deb_id,@cred_id,@oblig_oper_sum,@pay_cur_id5_1,@oper_date,0,0,@plan_str5_1,N,@oper_id,@oper_doc_id,@oper_action_id,@oper_action_history_id) .UPDATE_SUBC(D,'stock_emis',@stock_id,@oper_id) .UPDATE_SUBC(D,'doc_item',@partion_id,@oper_id) if @fund_type_code = 'pif_fund' begin .UPDATE_SUBC(K,'partners',@to_partner_id5_1,@oper_id) end if @fund_type_code = 'npf_fund' begin .UPDATE_SUBC(D,'asset_manager',@asset_manager_id,@oper_id) if @owner_id2_1 = @asset_manager_id -- через НПФ begin .UPDATE_SUBC(K,'partners',@to_partner_id5_1,@oper_id) end else -- через УК begin .UPDATE_SUBC(K,'partners_cont',@to_partner_id5_1,@oper_id) .UPDATE_SUBC(K,'partners',@asset_manager_id,@oper_id) end end .SUBC_CHECK(@oper_id) end end .END_FOR_DOCS end .CHECKPOINT_EXEC('OTHER') -- Ожидаемый платеж if exists(select 1 from tb_plans,tb_plan_pays where tb_plans.item_id = @foundation_id and tb_plans.id =tb_plan_pays.id and tb_plan_pays.pay_perpose_id !=1 and .ITEMS_EXISTS_BY_TYPE(tb_plans.id,'obligation_payer_in')) begin .FOR_DOCS(N,'obligation_payer_in',ALL,C,'tb_plans.item_id = @foundation_id and tb_plans.id = t_items100.id','tb_plans',2) if @for_state_code2 in ('OP','EXEC') begin .TYPE_GET('obligation_payer_in',@for_id2,6_1) if @pay_perpose_id6_1 !=1 begin select @dog_oblig_sum = .SUM_COVERED_BY_OBLIG(@plan_sum6_1,@stock_qty2_1,@doc_id,@foundation_id) if @stock_qty + @dog_qty < @stock_qty2_1 select @oblig_oper_sum = .ROUND_MONEY((@plan_sum6_1 * @stock_qty / @stock_qty2_1),2) else select @oblig_oper_sum = @plan_sum6_1 - @dog_oblig_sum .OPERATION(@owner_id,@fund_plan_id,@oper_date,@cred_id,@deb_id,@oblig_oper_sum,@pay_cur_id6_1,@oper_date,0,0,@plan_str6_1,N,@oper_id,@oper_doc_id,@oper_action_id,@oper_action_history_id) .UPDATE_SUBC(K,'stock_emis',@stock_id,@oper_id) .UPDATE_SUBC(K,'doc_item',@partion_id,@oper_id) if @fund_type_code = 'pif_fund' begin .UPDATE_SUBC(D,'partners',@from_partner_id6_1,@oper_id) end if @fund_type_code = 'npf_fund' begin .UPDATE_SUBC(K,'asset_manager',@asset_manager_id,@oper_id) if @owner_id2_1 = @asset_manager_id -- через НПФ begin .UPDATE_SUBC(D,'partners',@from_partner_id6_1,@oper_id) end else -- через УК begin .UPDATE_SUBC(D,'partners_cont',@from_partner_id6_1,@oper_id) .UPDATE_SUBC(D,'partners',@asset_manager_id,@oper_id) end end .SUBC_CHECK(@oper_id) end end .END_FOR_DOCS(2) end end .CHECKPOINT_EXEC('PAYMENT') -------------------- -- Завершение сделки -------------------- update ts_sd_stock_moves set is_completed=1 where id=@doc_id if @purpose_code = 6002 begin update td_depo_docs set foundation_id=@foundation_id where id=@oper_doc_id if @stock_qty + @dog_qty = @stock_qty2_1 begin declare @foundation_id_s varchar(30) select @foundation_id_s=convert(varchar(30),@foundation_id) .EXEC_ACTION(@foundation_id_s,'dog_dealings_bay','complete_bay',Y) end end declare @j_sum money select @j_sum=sum(op_sum) from t_operations where item_id=@oper_doc_id and action_id=@oper_action_id .SD_ASSENT_ADD(@doc_id,@stock_id,@j_sum,@stock_qty,@owner_id,@perpose_id) .SD_ASSET_OPER_ADD(@doc_id,@stock_id,@j_sum,@stock_qty,@owner_id,@perpose_id,1) .CHECKPOINT_EXEC('CLOSE') commit tran end $ENDTEXT(12503280) $ENDACTION $ACTION(SD_OPER_ROLL) name=Отмена проведения по СД class=9 form=null target_state=null procedure=ap_sd_oper_roll patterns=null user_define=1 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(12503280) create proc dbo.%PROC% @doc_id numeric, -- id док-та основания поручения (=id поручения не в нашем) @oper_doc_id numeric -- id поручения as begin begin tran update ts_sd_stock_moves set is_completed=0 where id=@doc_id ----------- --GET_PROPS ----------- .ID_VAR(@perpose_id) .ID_VAR(@foundation_id) .INT_VAR(@purpose_code) select @perpose_id = perpose_id, @foundation_id = foundation_id from ts_sd_stock_moves where id=@doc_id select @purpose_code=.PURPOSE_CODE(@perpose_id) --------------------------- -- Отмена завершения сделки --------------------------- if @purpose_code in (6002,6005) begin update td_depo_docs set foundation_id=null where id=@oper_doc_id if upper(.ITEM_STATE_CODE(@foundation_id)) = 'COMPLETE' begin declare @foundation_id_s varchar(30) select @foundation_id_s=convert(varchar(30),@foundation_id) if @purpose_code=6002 .EXEC_ACTION(@foundation_id_s,'dog_dealings_bay','uncomplete_bay',Y) else .EXEC_ACTION(@foundation_id_s,'dog_dealings_sale','uncomplete_sale',Y) end -- убрать сумму в поручении по сделке предпоставки if (select mode_id from tb_baysale_docitems where id=@foundation_id) = 2 begin update ts_sd_stock_moves set stock_price=null where id=@doc_id end end .SD_ASSENT_DEL(@doc_id) .SD_ASSET_OPER_DEL(@doc_id) commit tran end $ENDTEXT(12503280) $ENDACTION $STATE2ACTION(BEG.ACTION13) state=BEG action=ACTION13 $ENDSTATE2ACTION $STATE2ACTION(BEG.ACTION7) state=BEG action=ACTION7 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION1) state=ED action=ACTION1 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION13) state=ED action=ACTION13 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION8) state=ED action=ACTION8 $ENDSTATE2ACTION $STATE2ACTION(ED.ACTION9) state=ED action=ACTION9 $ENDSTATE2ACTION $STATE2ACTION(ED.D_STOCK_IN_VIEW_NOTSD) state=ED action=D_STOCK_IN_VIEW_NOTSD $ENDSTATE2ACTION $STATE2ACTION(ED.FORM2) state=ED action=FORM2 $ENDSTATE2ACTION $STATE2ACTION(OP_END_SD.ACTION11) state=OP_END_SD action=ACTION11 $ENDSTATE2ACTION $STATE2ACTION(OP_END_SD.D_STOCK_IN_VIEW_NOTSD) state=OP_END_SD action=D_STOCK_IN_VIEW_NOTSD $ENDSTATE2ACTION $STATE2ACTION(OP_END_SD.FORM2) state=OP_END_SD action=FORM2 $ENDSTATE2ACTION $STATE2ACTION(OP_END_SD.UO_PART_LIST) state=OP_END_SD action=UO_PART_LIST $ENDSTATE2ACTION $STATE2PROP(BEG.CONTRAGENT_COMMENT) state=BEG prop=CONTRAGENT_COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CONTRAG_ID) state=BEG prop=CONTRAG_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CONTR_ACCOUNT) state=BEG prop=CONTR_ACCOUNT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CONTR_JURADRESS) state=BEG prop=CONTR_JURADRESS enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CONTR_OWNER_TYPE_ID) state=BEG prop=CONTR_OWNER_TYPE_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CONTR_REGISTER_DATE) state=BEG prop=CONTR_REGISTER_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CONTR_REGISTER_NO) state=BEG prop=CONTR_REGISTER_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CONTR_REGISTRATOR) state=BEG prop=CONTR_REGISTRATOR enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.CORRESPONDENT_ID) state=BEG prop=CORRESPONDENT_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.COUPON_SUM) state=BEG prop=COUPON_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.DEPOCORR_OPER_DATE) state=BEG prop=DEPOCORR_OPER_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.DEPOCORR_OPER_ID) state=BEG prop=DEPOCORR_OPER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.DEPO_DOC_TYPE) state=BEG prop=DEPO_DOC_TYPE enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.DOCUMENT_FORM_ID) state=BEG prop=DOCUMENT_FORM_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.DOC_COMMENT) state=BEG prop=DOC_COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.EXEC_DATE) state=BEG prop=EXEC_DATE enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.FOLDER_ID) state=BEG prop=FOLDER_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.FOUNDATION_ID) state=BEG prop=FOUNDATION_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.FOUND_DOC_ID) state=BEG prop=FOUND_DOC_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.INITIATOR_ID) state=BEG prop=INITIATOR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.IN_DATE) state=BEG prop=IN_DATE enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.IN_NO) state=BEG prop=IN_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.IS_COUPON_IN_PRICE) state=BEG prop=IS_COUPON_IN_PRICE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.KEEP_SUBACC_ID) state=BEG prop=KEEP_SUBACC_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.KEEP_TRAJECT_END_ID) state=BEG prop=KEEP_TRAJECT_END_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.MOVE_COMMENT) state=BEG prop=MOVE_COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.MOVE_CONTRAGENT_NAME) state=BEG prop=MOVE_CONTRAGENT_NAME enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.OPER_FORM_ID) state=BEG prop=OPER_FORM_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.OUT_DATE) state=BEG prop=OUT_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.OUT_NO) state=BEG prop=OUT_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.PART_ID) state=BEG prop=PART_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.PAYER_ID) state=BEG prop=PAYER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.PAY_SUM) state=BEG prop=PAY_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.PERPOSE_ID) state=BEG prop=PERPOSE_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.REESTR_OPER_DATE) state=BEG prop=REESTR_OPER_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.REESTR_OPER_ID) state=BEG prop=REESTR_OPER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.STOCK_ID) state=BEG prop=STOCK_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.STOCK_PRICE) state=BEG prop=STOCK_PRICE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.STOCK_QTY) state=BEG prop=STOCK_QTY enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.SUM_CUR_ID) state=BEG prop=SUM_CUR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.S_SUBACC_ID) state=BEG prop=S_SUBACC_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.T_SUBACC_ID) state=BEG prop=T_SUBACC_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.WHO_GET) state=BEG prop=WHO_GET enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(BEG.WHO_PUT) state=BEG prop=WHO_PUT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTRAGENT_COMMENT) state=ED prop=CONTRAGENT_COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTRAG_ID) state=ED prop=CONTRAG_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTR_ACCOUNT) state=ED prop=CONTR_ACCOUNT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTR_JURADRESS) state=ED prop=CONTR_JURADRESS enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTR_OWNER_TYPE_ID) state=ED prop=CONTR_OWNER_TYPE_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTR_REGISTER_DATE) state=ED prop=CONTR_REGISTER_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTR_REGISTER_NO) state=ED prop=CONTR_REGISTER_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.CONTR_REGISTRATOR) state=ED prop=CONTR_REGISTRATOR 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.COUPON_SUM) state=ED prop=COUPON_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.DEPOCORR_OPER_DATE) state=ED prop=DEPOCORR_OPER_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.DEPOCORR_OPER_ID) state=ED prop=DEPOCORR_OPER_ID enable=1 mandatory=0 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.EXEC_DATE) state=ED prop=EXEC_DATE enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.FOLDER_ID) state=ED prop=FOLDER_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.FOUNDATION_ID) state=ED prop=FOUNDATION_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.FOUND_DOC_ID) state=ED prop=FOUND_DOC_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.INITIATOR_ID) state=ED prop=INITIATOR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.IN_NO) state=ED prop=IN_NO enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.IS_COUPON_IN_PRICE) state=ED prop=IS_COUPON_IN_PRICE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.KEEP_SUBACC_ID) state=ED prop=KEEP_SUBACC_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.KEEP_TRAJECT_END_ID) state=ED prop=KEEP_TRAJECT_END_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.MOVE_COMMENT) state=ED prop=MOVE_COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.MOVE_CONTRAGENT_NAME) state=ED prop=MOVE_CONTRAGENT_NAME enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.OPER_FORM_ID) state=ED prop=OPER_FORM_ID 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.PART_ID) state=ED prop=PART_ID enable=1 mandatory=0 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_ID) state=ED prop=PERPOSE_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.REESTR_OPER_DATE) state=ED prop=REESTR_OPER_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.REESTR_OPER_ID) state=ED prop=REESTR_OPER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.STOCK_ID) state=ED prop=STOCK_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.STOCK_PRICE) state=ED prop=STOCK_PRICE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.STOCK_QTY) state=ED prop=STOCK_QTY enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.SUM_CUR_ID) state=ED prop=SUM_CUR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.S_SUBACC_ID) state=ED prop=S_SUBACC_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(ED.T_SUBACC_ID) state=ED prop=T_SUBACC_ID enable=1 mandatory=0 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(OP_END_SD.DOC_COMMENT) state=OP_END_SD prop=DOC_COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(OP_END_SD.PAY_SUM) state=OP_END_SD prop=PAY_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(OP_END_SD.SUM_CUR_ID) state=OP_END_SD prop=SUM_CUR_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $ENDDOC