# Date: 07/07/06 # Version: 105 $DOC(PIF_PAYS2REPORT) name=Заявки к отчету регистратора class=1 product=ALD_PIF name_formula=null remark_formula=null $STATE(CRT) name=Создан class=0 $ENDSTATE $STATE(FIX) name=Обработан class=0 $ENDSTATE $STATE(NEW) name=Начальный class=1 $ENDSTATE $PROP(SHARE_QTY) name=Количество паев field_name=share_qty table_name=tp_extract2claim field_type=decimal field_length=9 field_scale=8 field_prec=18 page=1 order=1 init_class=null init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(AGENT_SUM) name=Сумма агента field_name=agent_sum table_name=tp_extract2claim field_type=money field_length=8 field_scale=4 field_prec=19 page=1 order=2 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(SUM_FOR_TRANSFER) name=Сумма платежа field_name=sum_for_transfer table_name=tp_extract2claim field_type=money field_length=8 field_scale=4 field_prec=19 page=1 order=3 init_class=null init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(CLAIM_ID) name=Заявка field_name=claim_id table_name=tp_extract2claim field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=4 init_class=null init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(EXTRACT_ID) name=Отчет регистратора field_name=extract_id table_name=tp_extract2claim field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=5 init_class=null init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(PAY_AGENT_ID) name=Агент field_name=pay_agent_id table_name=tp_extract2claim field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=6 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(PAY_PARTNER_ID) name=Пайщик field_name=pay_partner_id table_name=tp_extract2claim 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(SHARE_QTY_C) name=Количество паев (расч.) field_name=share_qty_c table_name=tp_extract2claim field_type=decimal field_length=9 field_scale=8 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(AGENT_SUM_C) name=Сумма агента (расч.) field_name=agent_sum_c table_name=tp_extract2claim field_type=money field_length=8 field_scale=4 field_prec=19 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(SUM_FOR_TRANSFER_C) name=Сумма платежа (расч.) field_name=sum_for_transfer_c table_name=tp_extract2claim field_type=money field_length=8 field_scale=4 field_prec=19 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(TAX_PERCENT) name=Новый процент налога field_name=tax_percent table_name=tp_extract2claim field_type=money field_length=8 field_scale=4 field_prec=19 page=1 order=11 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(IS_NEW_TAX) name=Расчет по новому проценту налога field_name=is_new_tax table_name=tp_extract2claim field_type=int field_length=4 field_scale=0 field_prec=10 page=1 order=12 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(COMMENT) name=Комментарий field_name=comment table_name=tp_extract2claim field_type=varchar field_length=255 field_scale=null field_prec=255 page=1 order=13 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(GET_PAYMT_TYPE) name=Отбор платежей field_name=get_paymt_type table_name=tp_extract2claim field_type=int field_length=4 field_scale=0 field_prec=10 page=1 order=14 init_class=1 init_formula=2 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(CLAIM_TYPE_ID) name=Тип выбранной заявки (1-выдача, 2-погашение) field_name=claim_type_id table_name=tp_extract2claim field_type=int field_length=4 field_scale=0 field_prec=10 page=1 order=15 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(PAYMT_STR) name=Платеж(и) field_name=paymt_str table_name=tp_extract2claim field_type=varchar field_length=255 field_scale=null field_prec=255 page=1 order=16 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(TAX_SUM) name=Сума налога field_name=tax_sum table_name=tp_extract2claim field_type=money field_length=8 field_scale=4 field_prec=19 page=1 order=17 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(IS_MANUAL_TAX) name=Ввод налога вручную field_name=is_manual_tax table_name=tp_extract2claim field_type=int field_length=4 field_scale=0 field_prec=10 page=1 order=18 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(ALLOC_SUM) name=Сумма подтвержденных расходов field_name=alloc_sum table_name=tp_extract2claim field_type=money field_length=8 field_scale=4 field_prec=19 page=1 order=19 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(AGENT_PROC) name=Процент агента field_name=agent_proc table_name=tp_extract2claim field_type=money field_length=8 field_scale=4 field_prec=19 page=1 order=20 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(ALLOC_DATE) name=Дата приобретения паев (для погашения) field_name=alloc_date table_name=tp_extract2claim field_type=datetime field_length=8 field_scale=3 field_prec=23 page=1 order=21 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(COMMENT_CANCEL) name=Причина отказа field_name=comment_cancel table_name=tp_extract2claim field_type=varchar field_length=255 field_scale=null field_prec=255 page=1 order=22 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $PROP(IN_ACC_QTY) name=Остатки по счету (для отчетов) field_name=in_acc_qty table_name=tp_extract2claim field_type=decimal field_length=9 field_scale=8 field_prec=18 page=1 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(BANK_ACC_ID) name=Расчетный счет пайщика (для отчетов) field_name=bank_acc_id table_name=tp_extract2claim field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 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(AGENT_DOG_ID) name=Договор с агентом field_name=agent_dog_id table_name=tp_extract2claim field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 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(DOP_SUM_TYPE) name=Способ учета доп.расходов (спр.5051) field_name=dop_sum_type table_name=tp_extract2claim field_type=numeric field_length=9 field_scale=0 field_prec=18 page=1 order=26 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(DOP_SUM_ED) name=Указанные расходы (доп. или все) field_name=dop_sum_ed table_name=tp_extract2claim field_type=money field_length=8 field_scale=4 field_prec=19 page=1 order=27 init_class=0 init_formula=null unique_index=null numerator=null import_type=null import_table=null import_field=null import_where=null ref_table=null ref_key=null ref_display=null ref_alias=null ref_where=null $ENDPROP $RELATION(REL3) class=0 type=PARTNERS form=null prop=PAY_AGENT_ID idname=null order=2 $ENDRELATION $RELATION(REL4) class=0 type=PARTNERS form=null prop=PAY_PARTNER_ID idname=null order=3 $ENDRELATION $RELATION(REL1) class=0 type=ITEMS form=null prop=CLAIM_ID idname=null order=1 $ENDRELATION $RELATION(REL2) class=0 type=PIF_PAY_REPS_GROUP form=null prop=EXTRACT_ID idname=null order=4 $ENDRELATION $FORM(FORM1) name=Заявки class=4 filter=null target_state= uo=uo_list dw=d_pif_pays2rep_list procedure=ap_10000000000089065 patterns=GENERIC_VIEW_LIST user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(09123050) 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 .VIEW_LIST end $ENDTEXT(09123050) $ACTION2RELATION(REL1.ITEM_NAME) relation=REL1 where=null prop=ITEM_NAME order=null alias=claim_name $ENDACTION2RELATION $ACTION2RELATION(REL3.PARTNER_SHORT_NAME) relation=REL3 where=null prop=PARTNER_SHORT_NAME order=10 alias=agent_name $ENDACTION2RELATION $ACTION2RELATION(REL4.PARTNER_SHORT_NAME) relation=REL4 where=null prop=PARTNER_SHORT_NAME order=10 alias=partner_short_name $ENDACTION2RELATION $FILTER(EXTRACT_ID) type=11 label=Отчет регистратора prop=EXTRACT_ID arg_code=null arg_type=null arg_length=null arg_prec=null arg_scale=null $ENDFILTER $ENDFORM $FORM(FORM2) name=Просмотр class=5 filter=null target_state= uo=uo_edit dw=d_pif_pays2rep_edit procedure=ap_10000000000089070 patterns=GENERIC_VIEW_ITEM_O user_define=0 isvisible=0 istab=1 posx=0 posy=0 width=2217 height=2008 proc_text=$TEXT(09123050) create procedure dbo.%PROC% @sid varchar(30) = null .ARGLIST_FILTER 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 .ID_VAR(@extract_id) .ID_VAR(@pif_pay_type_id) select @extract_id=convert(numeric,@extract_id_s) if @id = -1 begin select @pif_pay_type_id=1 .VIEW_INIT end else begin select @pif_pay_type_id=pq.pif_pay_type_id from tp_pif_queries pq, tp_extract2claim ec where pq.id=ec.claim_id and ec.id=@id .VIEW_ITEM end end $ENDTEXT(09123050) $ACTION2RELATION(REL1.ITEM_NAME) relation=REL1 where=null prop=ITEM_NAME order=null alias=claim_name $ENDACTION2RELATION $ACTION2RELATION(REL3.PARTNER_SHORT_NAME) relation=REL3 where=null prop=PARTNER_SHORT_NAME order=10 alias=agent_name $ENDACTION2RELATION $ACTION2RELATION(REL4.PARTNER_SHORT_NAME) relation=REL4 where=null prop=PARTNER_SHORT_NAME order=10 alias=partner_short_name $ENDACTION2RELATION $BIND(BIND1) type=PIF_PAYMT2PAYS action=FORM1 class=1 order=2 idname=pif_pay_id_s $ENDBIND $FILTER(EXTRACT_ID) type=11 label=Отчет регистратора prop=EXTRACT_ID arg_code=null arg_type=null arg_length=null arg_prec=null arg_scale=null $ENDFILTER $CALC(IS_REG_CONTROL) class=1 type=integer calc_lenght=null calc_prec=null calc_scale=null formula=$TEXT(09123050) (select is_reg_control from td_pay_fond pif, td_depo_docs rep where pif.id=rep.owner_id and rep.id=@extract_id) $ENDTEXT(09123050) label=Ввод и контроль данных от регистратора order=1 $ENDCALC $CALC(REP_TYPE) class=1 type=integer calc_lenght=null calc_prec=null calc_scale=null formula=$TEXT(09123050) select case when (upper((select t.type_code from t_items i, t_types t where i.id = @extract_id and i.type_id = t.id))='PIF_PAY_REPORT') then 1 else 0 end $ENDTEXT(09123050) label=null order=2 $ENDCALC $CALC(PIF_PAY_TYPE_ID) class=1 type=integer calc_lenght=null calc_prec=null calc_scale=null formula=@pif_pay_type_id label=Тип заявки 1 - однораз, 2 - многораз order=3 $ENDCALC $ENDFORM $FORM(FORM3) name=Проведение по реестру class=4 filter=null target_state= uo=uo_list_disable dw=d_pif_rep2pays_list procedure=ap_30000000000097532 patterns=GENERIC_VIEW_LIST user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(09123050) create procedure dbo.%PROC% @sid varchar(30) = null .ARGLIST_FILTER as .BEGIN('N') .CHECK_USER .CHECK_VIEW_LIST .ARGCONVERT_FILTER .VIEW_LIST .END $ENDTEXT(09123050) $ACTION2RELATION(REL2.REG_DATE) relation=REL2 where=null prop=REG_DATE order=6 alias=reg_date $ENDACTION2RELATION $ACTION2RELATION(REL2.REP_NO) relation=REL2 where=null prop=REP_NO order=15 alias=rep_no $ENDACTION2RELATION $ACTION2RELATION(REL2.IN_NO) relation=REL2 where=null prop=IN_NO order=14 alias=rep_in_no $ENDACTION2RELATION $ACTION2RELATION(REL3.PARTNER_SHORT_NAME) relation=REL3 where=null prop=PARTNER_SHORT_NAME order=10 alias=agent_name $ENDACTION2RELATION $ACTION2RELATION(REL4.PARTNER_SHORT_NAME) relation=REL4 where=null prop=PARTNER_SHORT_NAME order=10 alias=partner_short_name $ENDACTION2RELATION $FILTER(CLAIM_ID) type=11 label=Заявка prop=CLAIM_ID arg_code=null arg_type=null arg_length=null arg_prec=null arg_scale=null $ENDFILTER $CALC(REP_STATE_NAME) class=1 type=varchar calc_lenght=255 calc_prec=null calc_scale=null formula=$TEXT(09123050) select s.state_name from t_states s, t_items i where s.id=i.state_id and i.id=tp_extract2claim.extract_id $ENDTEXT(09123050) label=Статус отчета order=1 $ENDCALC $CALC(REP_TYPE_NAME) class=1 type=varchar calc_lenght=255 calc_prec=null calc_scale=null formula=$TEXT(09123050) case .ITEM_TYPE_CODE(tp_extract2claim.extract_id) when 'PIF_PAY_REPORT' then 'Принятие' when 'PIF_PAY_CANCEL' then 'Отказ' end $ENDTEXT(09123050) label=тип отчета order=2 $ENDCALC $ENDFORM $ACTION(ACTION1) name=Добавить class=1 form=FORM2 target_state=CRT procedure=ap_10000000000089080 patterns=GENERIC_INSERT_O user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=2167 height=1924 proc_text=$TEXT(09123050) create procedure dbo.%PROC% @sid varchar(30) = null, .ARGLIST 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% .CHECK_USER .CHECK_INSERT .ARGCONVERT .INIT_VARS .TEST_UNIQUE if upper(.ITEM_STATE_CODE(@extract_id))='OP_END' .EXIT_MESSAGE('Добавить невозможно - отчет регистратора подтвержден') if upper(.ITEM_STATE_CODE(@extract_id))='ED' .EXIT_MESSAGE('Добавить невозможно - данные отчета регистратора редактируются') if exists(select 1 from tp_extract2claim where tp_extract2claim.claim_id=@claim_id and tp_extract2claim.extract_id=@extract_id) .EXIT_MESSAGE('Данная заявка уже есть в этом отчете') if @claim_type_id=2 begin if (select pay_type_id from tp_pif_queries where id=@claim_id)=1 begin if isnull(@share_qty,0)<=0 .EXIT_MESSAGE('Введите количество паев') if @share_qty > (select stock_qty from tp_pif_queries where id=@claim_id) .EXIT_MESSAGE('Количество списываемых паев не должно превышать количество паев в выбранной заявке') end select @share_qty_c=@share_qty end if (select pif_pay_type_id from tp_pif_queries where id=@claim_id)=1 or @agent_dog_id is null begin select @agent_dog_id=agent_dog_id from tp_pif_queries where id=@claim_id select @pay_agent_id=agent_id from tp_pif_queries where id=@claim_id end else select @pay_agent_id=client_id from tb_contracts where id=@agent_dog_id .INSERT_ITEMS .INSERT select @sid=convert(varchar(30),@id) if @claim_type_id=1 -- платежи для заявок на размещение begin if @get_paymt_type=2 begin .EXEC_ACTION(@sid,'PIF_PAYS2REPORT','GET_PAYMENTS',Y) end if @get_paymt_type=1 begin .ID_VAR(@paymt_id) select @paymt_id=p.id from t_paydocs p, t_items i, t_states s, t_types t where i.id = p.id and p.pif_pay_id = @claim_id and p.doc_sum = @sum_for_transfer and i.state_id = s.id and i.type_id = t.id and s.class_id =0 and upper(s.state_code) = 'PERF' and upper(t.type_code) in ('SD_PAYBANK_IN','SD_PAYDOCS_CASH_IN') and not exists (select 1 from tp_paymt2pays, .ACTUAL_TABLES where tp_paymt2pays.paymt_id=p.id .ACTUAL_WHERE(tp_paymt2pays.id)) if @paymt_id is not null and not exists(select 1 from tp_paymt2pays where tp_paymt2pays.paymt_id=@paymt_id) begin .TYPE_INIT('PIF_PAYMT2PAYS') .TYPE_ASSIGN(pif_pay_id,@id) .TYPE_ASSIGN(paymt_id,@paymt_id) .TYPE_INSERT('PIF_PAYMT2PAYS','CRT') end end if exists(select 1 from tp_paymt2pays pp, t_paydocs p where pp.pif_pay_id=@id and pp.paymt_id=p.id and p.pif_pay_id!=@claim_id and .ITEMS_EXISTS(pp.id)) .EXIT_MESSAGE('Заявка, указанная в выбранном платеже не соответствует данной заявке в отчете') select @paymt_str='' declare @paymt_date varchar(8), @paymt_no varchar(30) declare paydocs cursor for select isnull(convert(varchar(8),p.doc_date,3),''), isnull(rtrim(ltrim(p.doc_number)),'') from t_paydocs p, tp_paymt2pays pp where pp.paymt_id=p.id and pp.pif_pay_id = @id and .ITEMS_EXISTS(pp.id) open paydocs fetch paydocs into @paymt_date, @paymt_no while .CURSOR_STATE = 0 begin select @paymt_str=@paymt_str+'№'+@paymt_no+' от '+@paymt_date+':' fetch paydocs into @paymt_date, @paymt_no end close paydocs .DEALLOCATE paydocs update tp_extract2claim set paymt_str=@paymt_str where id=@id end .EXEC_ACTION(@sid,'PIF_PAYS2REPORT','CLAIM_CALC_PARTS',Y) .UPDATE_STATE .RELGEN .ACTION_HISTORY select sid = convert(varchar, @id) commit tran $ENDTEXT(09123050) $ENDACTION $ACTION(ACTION2) name=Изменить class=2 form=FORM2 target_state=null procedure=ap_10000000000089081 patterns=GENERIC_UPDATE user_define=0 isvisible=0 istab=1 posx=0 posy=0 width=2226 height=2016 proc_text=$TEXT(09123050) create procedure dbo.%PROC% @sid varchar(30) = null, .ARGLIST 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 if upper(.ITEM_STATE_CODE(@id))='FIX' begin update tp_extract2claim set comment = @comment, alloc_date = @alloc_date, comment_cancel = @comment_cancel where id=@id end if upper(.ITEM_STATE_CODE(@id))='CRT' begin if @claim_type_id=2 begin if (select pay_type_id from tp_pif_queries where id=@claim_id)=1 begin if isnull(@share_qty,0)<=0 .EXIT_MESSAGE('Введите количество паев') if @share_qty > (select stock_qty from tp_pif_queries where id=@claim_id) .EXIT_MESSAGE('Количество списываемых паев не должно превышать количество паев в выбранной заявке') end select @share_qty_c=@share_qty end if (select pif_pay_type_id from tp_pif_queries where id=@claim_id)=1 or @agent_dog_id is null begin select @agent_dog_id=agent_dog_id from tp_pif_queries where id=@claim_id select @pay_agent_id=agent_id from tp_pif_queries where id=@claim_id end else select @pay_agent_id=client_id from tb_contracts where id=@agent_dog_id .UPDATE_ITEMS .UPDATE if @claim_type_id=1 -- платежи для заявок на размещение begin if @get_paymt_type=2 begin .EXEC_ACTION(@sid,'PIF_PAYS2REPORT','GET_PAYMENTS',Y) end if @get_paymt_type=1 begin .ID_VAR(@paymt_id) select @paymt_id=p.id from t_paydocs p, t_items i, t_states s, t_types t where i.id = p.id and p.pif_pay_id = @claim_id and p.doc_sum = @sum_for_transfer and i.state_id = s.id and i.type_id = t.id and s.class_id =0 and upper(s.state_code) = 'PERF' and upper(t.type_code) = 'SD_PAYBANK_IN' and not exists (select 1 from tp_paymt2pays, .ACTUAL_TABLES where tp_paymt2pays.paymt_id=p.id .ACTUAL_WHERE(tp_paymt2pays.id)) if @paymt_id is not null and not exists(select 1 from tp_paymt2pays where tp_paymt2pays.paymt_id=@paymt_id) begin .TYPE_INIT('PIF_PAYMT2PAYS') .TYPE_ASSIGN(pif_pay_id,@id) .TYPE_ASSIGN(paymt_id,@paymt_id) .TYPE_INSERT('PIF_PAYMT2PAYS','CRT') end end if exists(select 1 from tp_paymt2pays pp, t_paydocs p where pp.pif_pay_id=@id and pp.paymt_id=p.id and p.pif_pay_id!=@claim_id and .ITEMS_EXISTS(pp.id)) .EXIT_MESSAGE('Заявка, указанная в выбранном платеже не соответствует данной заявке в отчете') select @paymt_str='' declare @paymt_date varchar(8), @paymt_no varchar(30) declare paydocs cursor for select isnull(convert(varchar(8),p.doc_date,3),''), isnull(rtrim(ltrim(p.doc_number)),'') from t_paydocs p, tp_paymt2pays pp where pp.paymt_id=p.id and pp.pif_pay_id = @id and .ITEMS_EXISTS(pp.id) open paydocs fetch paydocs into @paymt_date, @paymt_no while .CURSOR_STATE = 0 begin select @paymt_str=@paymt_str+'№'+@paymt_no+' от '+@paymt_date+':' fetch paydocs into @paymt_date, @paymt_no end close paydocs .DEALLOCATE paydocs update tp_extract2claim set paymt_str=@paymt_str where id=@id end .EXEC_ACTION(@sid,'PIF_PAYS2REPORT','CLAIM_CALC_PARTS',Y) end --.RELGEN --.UPDATE_STATE commit tran $ENDTEXT(09123050) $BIND(BIND1) type=PIF_PAYMT2PAYS action=FORM1 class=1 order=2 idname=pif_pay_id_s $ENDBIND $ENDACTION $ACTION(ACTION3) name=Удалить class=9 form=null target_state=null procedure=ap_10000000000089083 patterns=GENERIC_MOVE user_define=0 isvisible=0 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(09123050) create procedure dbo.%PROC% @sid varchar(30) = null as declare @action_id numeric, @id numeric, @user_id numeric, @state_id numeric, @new_state_id numeric, @type_id numeric begin tran select @action_id = %ACTION_ID% select @id = convert(numeric, @sid) .CHECK_USER .CHECK_UPDATE delete t_items from tp_paymt2pays where t_items.id=tp_paymt2pays.id and tp_paymt2pays.pif_pay_id=@id delete tp_paymt2pays where tp_paymt2pays.pif_pay_id=@id .TYPE_DELETE commit tran $ENDTEXT(09123050) $ENDACTION $ACTION(CLAIM_CALC) name=Расчет (без партий) class=9 form=null target_state=null procedure=ap_10000000000089084 patterns=GENERIC_MOVE user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(09123050) create procedure dbo.%PROC% @sid varchar(30) = null 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) .GET_PROPS .MONEY_VAR(@total_sum) .MONEY_VAR(@tax) .MONEY_VAR(@stock_price) .MONEY_VAR(@tax_percent_c) .ID_VAR(@tax_category_id) --.ID_VAR(@agent_dog_id) .ID_VAR(@owner_id) declare @reg_date datetime declare @pay_date datetime select @reg_date=reg_date, @pay_date=pay_date from ts_reg_report where id=@extract_id --select @agent_dog_id=agent_dog_id from tp_pif_queries where id=@claim_id select @owner_id=owner_id from td_depo_docs where id=@extract_id .PIF_ROUND_PAYS(@owner_id, @share_qty_c, @share_qty_c) .PIF_ROUND_PAYS(@owner_id, @share_qty, @share_qty) if upper(.ITEM_TYPE_CODE(@claim_id))='PIF_PAY_BUY' begin if @is_new_tax=0 select @tax_percent_c=null else select @tax_percent_c=@tax_percent -- Кол-во паев в зависимости от типа операции --------- .ID_VAR(@buy_type_id) .ID_VAR(@fund_plan_id) .ID_VAR(@acc96_id) .ID_VAR(@pay_owner_id) declare @claim_qty .PIF_PAY_TYPE, @saldo_qty money, @pay_price money select @buy_type_id=pay_type_id from tp_pif_queries where id=@claim_id if @buy_type_id in (3,4) begin if @buy_type_id=3 begin select @pay_price = .PIF_PAY_PRICE(@owner_id,@pay_date) if @pay_price is null .EXIT_MESSAGE('Для данного фонда не задана цена пая') if @pay_price<>0 select @claim_qty = convert(.PIF_PAY_TYPE,isnull((select payment_sum from tp_pif_queries where id=@claim_id),0))/convert(.PIF_PAY_TYPE,@pay_price) end if @buy_type_id=4 begin select @fund_plan_id = .ARG_PLAN('PIF_ACCOUNT') select @acc96_id = .SD_ACCID_FROM_EFFNO(@fund_plan_id,'96.1') select @pay_owner_id=pay_owner_id from tp_pif_queries where id=@claim_id .SALDO_FAST(@owner_id,@fund_plan_id,@reg_date,@acc96_id,K,Y,'partners',@pay_owner_id,N,N,N,@saldo_qty) select @claim_qty=.PAYS_QTY_CALC(@saldo_qty,@owner_id) end select @claim_qty=isnull(@claim_qty,0) .PIF_ROUND_PAYS(@owner_id, @claim_qty, @claim_qty) if isnull(@share_qty,0)=0 select @share_qty=@claim_qty if isnull(@share_qty,0)<=0 .EXIT_MESSAGE('Не указано количество паев') if @share_qty > @claim_qty .EXIT_MESSAGE('Количество списываемых паев не должно превышать количество паев в выбранной заявке') end --------------------------------------------------------- select @share_qty_c=@share_qty exec ap_pifpay_out @share_qty_c, @is_manual_tax, @tax_sum, @alloc_sum, @tax_percent_c, @pay_partner_id, @agent_dog_id, @owner_id, @reg_date, @pay_date, @stock_price out, @sum_for_transfer_c out, -- @total_sum out, @agent_sum_c out, @agent_proc out, @tax out if @@error != 0 begin rollback tran return end end if upper(.ITEM_TYPE_CODE(@claim_id))='PIF_PAY_ALLOCATE' begin select @sum_for_transfer_c=round(sum(isnull(p.doc_sum,0)),2) from t_paydocs p, tp_paymt2pays s where s.pif_pay_id=@id and s.paymt_id=p.id exec ap_pifpay_in @sum_for_transfer_c, @agent_dog_id, @owner_id, @reg_date, @pay_date, @stock_price out, @share_qty_c out, @total_sum out, @agent_sum_c out, @agent_proc out if @@error != 0 begin rollback tran return end end if isnull((select is_reg_control from td_pay_fond pif, td_depo_docs rep where pif.id=rep.owner_id and rep.id=@extract_id),0)=0 begin select @sum_for_transfer = isnull(@sum_for_transfer_c,0) select @share_qty = isnull(@share_qty_c,0) select @agent_sum = isnull(@agent_sum_c,0) end select @tax_sum=isnull(@tax,0) select @agent_proc=isnull(@agent_proc,0) .PIF_ROUND_PAYS(@owner_id, @share_qty_c, @share_qty_c) .PIF_ROUND_PAYS(@owner_id, @share_qty, @share_qty) .UPDATE_ITEMS .UPDATE commit tran $ENDTEXT(09123050) $ENDACTION $ACTION(CLAIM_CALC_PARTS) name=Расчет class=9 form=null target_state=null procedure=ap_30000000003451718 patterns=GENERIC_MOVE user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(09123050) create procedure dbo.%PROC% @sid varchar(30) = null 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) .GET_PROPS .MONEY_VAR(@total_sum) .MONEY_VAR(@tax) .MONEY_VAR(@stock_price) .MONEY_VAR(@tax_percent_c) .ID_VAR(@tax_category_id) --.ID_VAR(@agent_dog_id) .ID_VAR(@owner_id) declare @reg_date datetime declare @pay_date datetime select @reg_date=reg_date, @pay_date=pay_date from ts_reg_report where id=@extract_id --select @agent_dog_id=agent_dog_id from tp_pif_queries where id=@claim_id select @owner_id=owner_id from td_depo_docs where id=@extract_id .PIF_ROUND_PAYS(@owner_id, @share_qty_c, @share_qty_c) .PIF_ROUND_PAYS(@owner_id, @share_qty, @share_qty) if upper(.ITEM_TYPE_CODE(@claim_id))='PIF_PAY_BUY' begin if @is_new_tax=0 select @tax_percent_c=null else select @tax_percent_c=@tax_percent -- Кол-во паев в зависимости от типа операции --------- .ID_VAR(@buy_type_id) .ID_VAR(@fund_plan_id) .ID_VAR(@acc96_id) .ID_VAR(@pay_owner_id) declare @claim_qty .PIF_PAY_TYPE, @saldo_qty money, @pay_price money, @share_qty_res .PIF_PAY_TYPE, @bal_out_sum money, @dop_sum money select @buy_type_id=pay_type_id from tp_pif_queries where id=@claim_id if @buy_type_id in (3,4) begin if @buy_type_id=3 begin select @pay_price = .PIF_PAY_PRICE(@owner_id,@pay_date) if @pay_price is null .EXIT_MESSAGE('Для данного фонда не задана цена пая') if @pay_price<>0 select @claim_qty = convert(.PIF_PAY_TYPE,isnull((select payment_sum from tp_pif_queries where id=@claim_id),0))/convert(.PIF_PAY_TYPE,@pay_price) end if @buy_type_id=4 begin select @fund_plan_id = .ARG_PLAN('PIF_ACCOUNT') select @acc96_id = .SD_ACCID_FROM_EFFNO(@fund_plan_id,'96.1') select @pay_owner_id=pay_owner_id from tp_pif_queries where id=@claim_id .SALDO_FAST(@owner_id,@fund_plan_id,@reg_date,@acc96_id,K,Y,'partners',@pay_owner_id,N,N,N,@saldo_qty) select @claim_qty=.PAYS_QTY_CALC(@saldo_qty,@owner_id) end select @claim_qty=isnull(@claim_qty,0) .PIF_ROUND_PAYS(@owner_id, @claim_qty, @claim_qty) if isnull(@share_qty,0)=0 select @share_qty=@claim_qty if isnull(@share_qty,0)<=0 .EXIT_MESSAGE('Не указано количество паев') if @share_qty > @claim_qty .EXIT_MESSAGE('Количество списываемых паев не должно превышать количество паев в выбранной заявке') end --------------------------------------------------------- select @share_qty_c=@share_qty exec ap_pifpay_out_parts @owner_id, @agent_dog_id, @pay_partner_id, @claim_id, @reg_date, @pay_date, @share_qty_c, @is_manual_tax, @tax_percent_c, @tax_sum, @dop_sum_ed, @dop_sum_type, 0, -- без проводок null, null, null, @sum_for_transfer_c out, -- сумма выплаты (без скидки и налога) @agent_sum_c out, -- скидка @tax out, -- налог @bal_out_sum out, -- бал.стоимость @dop_sum out, -- доп.расходы @alloc_date out, -- дата посл.партии @share_qty_res out if @@error != 0 begin rollback tran return end select @share_qty_c=@share_qty_res select @alloc_sum=@bal_out_sum+isnull(@dop_sum,0) end if upper(.ITEM_TYPE_CODE(@claim_id))='PIF_PAY_ALLOCATE' begin select @sum_for_transfer_c=round(sum(isnull(p.doc_sum,0)),2) from t_paydocs p, tp_paymt2pays s where s.pif_pay_id=@id and s.paymt_id=p.id --- Проверка минимальной суммы за паи ---------- declare @check_sum money if (select type_queries from tp_pif_queries where id=@claim_id)=1 -- только для обычной выдачи begin if .GET_CLASS_VALUE_CODE_FOR_ITEM(@agent_dog_id,'PIF_CHECK_ALLOCATE_SUM','FUND_RULES')='FUND_RULES' select @check_sum=convert(money,(select max(i.code) from t_item2class i, t_classvalues v, t_classes c where i.item_id=@owner_id and i.value_id=v.id and v.class_id=c.id and c.code='PIF_CHECK_ALLOCATE_SUM' and v.code='FUND_RULES' and .ITEMS_EXISTS(i.id) and .ITEMS_EXISTS(c.id) and .ITEMS_EXISTS(v.id))) else select @check_sum=convert(money,(select max(i.code) from t_item2class i, t_classvalues v, t_classes c where i.item_id=@agent_dog_id and i.value_id=v.id and v.class_id=c.id and c.code='PIF_CHECK_ALLOCATE_SUM' and v.code='AGENT_RULES' and .ITEMS_EXISTS(i.id) and .ITEMS_EXISTS(c.id) and .ITEMS_EXISTS(v.id))) if isnull(@check_sum,0)>0 and isnull(@check_sum,0)>@sum_for_transfer_c .EXIT_MESSAGE_PARM('Сумма оплаты меньше установленной минимальной суммы на приобретение',@check_sum) end ------------------------------------------------- exec ap_pifpay_in @sum_for_transfer_c, @agent_dog_id, @owner_id, @reg_date, @pay_date, @stock_price out, @share_qty_c out, @total_sum out, @agent_sum_c out, @agent_proc out if @@error != 0 begin rollback tran return end end if isnull((select is_reg_control from td_pay_fond pif, td_depo_docs rep where pif.id=rep.owner_id and rep.id=@extract_id),0)=0 begin select @sum_for_transfer = isnull(@sum_for_transfer_c,0) if upper(.ITEM_TYPE_CODE(@claim_id))='PIF_PAY_ALLOCATE' select @share_qty = isnull(@share_qty_c,0) select @agent_sum = isnull(@agent_sum_c,0) end select @tax_sum=isnull(@tax,0) select @agent_proc=isnull(@agent_proc,0) .PIF_ROUND_PAYS(@owner_id, @share_qty_c, @share_qty_c) .PIF_ROUND_PAYS(@owner_id, @share_qty, @share_qty) .UPDATE_ITEMS .UPDATE commit tran $ENDTEXT(09123050) $ENDACTION $ACTION(GET_PAYMENTS) name=Отбор всех платежей class=9 form=null target_state=null procedure=ap_10000000000089085 patterns=GENERIC_MOVE user_define=0 isvisible=1 istab=0 posx=0 posy=0 width=0 height=0 proc_text=$TEXT(09123050) create procedure dbo.%PROC% @sid varchar(30) = null as .BEGIN('N') --.CHECK_USER --.CHECK_UPDATE begin tran .ID_VAR(@paymt_id) .ID_VAR(@claim_id) select @claim_id=claim_id from tp_extract2claim where id=@id delete t_items from tp_paymt2pays where t_items.id=tp_paymt2pays.id and tp_paymt2pays.pif_pay_id=@id delete tp_paymt2pays where tp_paymt2pays.pif_pay_id=@id declare paydocs cursor for select p.id from t_paydocs p, t_items i, t_states s, t_types t where i.id = p.id and p.pif_pay_id = @claim_id and i.state_id = s.id and i.type_id = t.id and s.class_id =0 and upper(s.state_code) = 'PERF' and upper(t.type_code) in ('SD_PAYBANK_IN','SD_PAYDOCS_CASH_IN') and not exists (select 1 from tp_paymt2pays, .ACTUAL_TABLES where tp_paymt2pays.paymt_id=p.id .ACTUAL_WHERE(tp_paymt2pays.id)) open paydocs fetch paydocs into @paymt_id while .CURSOR_STATE = 0 begin .TYPE_INIT('PIF_PAYMT2PAYS') .TYPE_ASSIGN(pif_pay_id,@id) .TYPE_ASSIGN(paymt_id,@paymt_id) .TYPE_INSERT('PIF_PAYMT2PAYS','CRT') fetch paydocs into @paymt_id end close paydocs .DEALLOCATE paydocs commit tran .END $ENDTEXT(09123050) $ENDACTION $STATE2ACTION(CRT.ACTION2) state=CRT action=ACTION2 $ENDSTATE2ACTION $STATE2ACTION(CRT.ACTION3) state=CRT action=ACTION3 $ENDSTATE2ACTION $STATE2ACTION(CRT.FORM1) state=CRT action=FORM1 $ENDSTATE2ACTION $STATE2ACTION(CRT.FORM2) state=CRT action=FORM2 $ENDSTATE2ACTION $STATE2ACTION(CRT.FORM3) state=CRT action=FORM3 $ENDSTATE2ACTION $STATE2ACTION(FIX.ACTION2) state=FIX action=ACTION2 $ENDSTATE2ACTION $STATE2ACTION(FIX.FORM1) state=FIX action=FORM1 $ENDSTATE2ACTION $STATE2ACTION(FIX.FORM2) state=FIX action=FORM2 $ENDSTATE2ACTION $STATE2ACTION(FIX.FORM3) state=FIX action=FORM3 $ENDSTATE2ACTION $STATE2ACTION(NEW.ACTION1) state=NEW action=ACTION1 $ENDSTATE2ACTION $STATE2PROP(CRT.AGENT_DOG_ID) state=CRT prop=AGENT_DOG_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.AGENT_SUM) state=CRT prop=AGENT_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.ALLOC_SUM) state=CRT prop=ALLOC_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.CLAIM_ID) state=CRT prop=CLAIM_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.CLAIM_TYPE_ID) state=CRT prop=CLAIM_TYPE_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.COMMENT) state=CRT prop=COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.COMMENT_CANCEL) state=CRT prop=COMMENT_CANCEL enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.DOP_SUM_ED) state=CRT prop=DOP_SUM_ED enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.DOP_SUM_TYPE) state=CRT prop=DOP_SUM_TYPE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.EXTRACT_ID) state=CRT prop=EXTRACT_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.GET_PAYMT_TYPE) state=CRT prop=GET_PAYMT_TYPE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.IS_MANUAL_TAX) state=CRT prop=IS_MANUAL_TAX enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.IS_NEW_TAX) state=CRT prop=IS_NEW_TAX enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.PAY_AGENT_ID) state=CRT prop=PAY_AGENT_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.PAY_PARTNER_ID) state=CRT prop=PAY_PARTNER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.PAYMT_STR) state=CRT prop=PAYMT_STR enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.SHARE_QTY) state=CRT prop=SHARE_QTY enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.SUM_FOR_TRANSFER) state=CRT prop=SUM_FOR_TRANSFER enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.TAX_PERCENT) state=CRT prop=TAX_PERCENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(CRT.TAX_SUM) state=CRT prop=TAX_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.ALLOC_DATE) state=FIX prop=ALLOC_DATE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.COMMENT) state=FIX prop=COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(FIX.COMMENT_CANCEL) state=FIX prop=COMMENT_CANCEL enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.AGENT_DOG_ID) state=NEW prop=AGENT_DOG_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.AGENT_SUM) state=NEW prop=AGENT_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.ALLOC_SUM) state=NEW prop=ALLOC_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.CLAIM_ID) state=NEW prop=CLAIM_ID enable=1 mandatory=1 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.CLAIM_TYPE_ID) state=NEW prop=CLAIM_TYPE_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.COMMENT) state=NEW prop=COMMENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.COMMENT_CANCEL) state=NEW prop=COMMENT_CANCEL enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.DOP_SUM_ED) state=NEW prop=DOP_SUM_ED enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.DOP_SUM_TYPE) state=NEW prop=DOP_SUM_TYPE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.EXTRACT_ID) state=NEW prop=EXTRACT_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.GET_PAYMT_TYPE) state=NEW prop=GET_PAYMT_TYPE enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.IS_MANUAL_TAX) state=NEW prop=IS_MANUAL_TAX enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.IS_NEW_TAX) state=NEW prop=IS_NEW_TAX enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.PAY_AGENT_ID) state=NEW prop=PAY_AGENT_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.PAY_PARTNER_ID) state=NEW prop=PAY_PARTNER_ID enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.PAYMT_STR) state=NEW prop=PAYMT_STR enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.SHARE_QTY) state=NEW prop=SHARE_QTY enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.SUM_FOR_TRANSFER) state=NEW prop=SUM_FOR_TRANSFER enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.TAX_PERCENT) state=NEW prop=TAX_PERCENT enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $STATE2PROP(NEW.TAX_SUM) state=NEW prop=TAX_SUM enable=1 mandatory=0 visible=1 $ENDSTATE2PROP $ENDDOC