Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

/*-- Filtro RECID x ROWID Aplicado --*/
{include/i_fncrowid.i}
def temp-table tt_logbem_invest_errosmga no-undo
    field ttv_numcod_seq  empresa                    as integerchar format ">>>,>>9"'x(3)' label "Seqˆ¬ncia"'Empresa Externa' column-label "Seq" 'Empresa Ext Inicial'
    field ttv_num_cod_errocdn_emit                     as integer format ">>>>,>>9"'>>>>>>>>9' label "N†mero"'Emitente' column-label "N†mero"'Emitente'
    field ttv_descod_erronota                     as character format "'x(50)" label "Inconsist¬ncia" column-label "Inconsist¬ncia"20)'
    field ttv_descod_ser_ajudanota                  as  as character format "'x(505)"' label "Ajuda" 'Série Nota' column-label "Ajuda"
    index tt_id'Série Nota'
       field   ttv_numcod_natur_seqoperac              as  character      ASCENDING
          ttv_num_cod_erro                 ASCENDING.
def temp-table tt_bem_invest_mga no-undoformat 'x(6)' label 'Natureza Operação' column-label 'Natureza Operação'
    field ttv_cod_empresaestab                    as charcharacter format 'x(3)' label 'Estabelecimento'Empresa Externa' column-label 'Empresa Ext InicialEstabelecimento'
    field ttv_dat_cdnaquis_bem_emitpat                     as integer  as date format '>>>>>>>>999/99/9999' label 'EmitenteData Aquisição' column-label 'EmitenteData Aquisição'
    field ttv_cod_notacta                     as as character format 'x(20)'
    field ttv_cod_ser_notacdn_aux                     as as characterinteger format 'x(5)' label 'Série Nota' column-label 'Série Nota'
    field ttv_cod_natur_operac >>>,>>9'
    field ttv_cod_origem                   as character format 'x(68)' label 'Natureza OperaçãoOrigem' column-label 'Natureza OperaçãoOrigem'
    field ttv_des_codaux_estab5                    as character format 'x(3)' label 'Estabelecimento' column-label 'Estabelecimento'40)'
    field ttv_datcod_chave_aquisaces_bemdocto_patfisc            as datecharacter format '99/99/9999x(60)' label "Chave 'Data Aquisição'Acesso NFE" column-label 'Data Aquisição'"Chave Acesso NFE"
    field ttv_cod_ctaind_gera_event_imob_item                      as as character format 'x(2015)'
   label field ttv_cdn_aux                      as integer format '>>>,>>9''Gera Event Imob Item' column-label 'Gera Event Imob Item'
    field ttv_cod_origemval_aquis_bem_pat             as  decimal     as character format 'x(8)'format '->>,>>>,>>>,>>9.99' decimals 2 initial 0 label 'OrigemAquisição Bem' column-label 'OrigemAquisição Bem'
    field ttv_des_aux_5val_aquis_fasb_bem_pat       as decimal format '>>,>>>,>>>,>>9.99' decimals 2
     field ttv_val_aquis_cmi_bem_pat        as characterdecimal format 'x(40)'>>,>>>,>>>,>>9.99' decimals 2
    field ttv_codval_chave_aces_docto_fiscibs_munic    as  character format 'x(60)' label "Chave Acesso NFE" column-label "Chave Acesso NFE"           as decimal format '>>>,>>>,>>>,>>9.99' decimals 2
    field ttv_val_ibs_estad                as decimal format '>>>,>>>,>>>,>>9.99' decimals 2
    field ttv_val_cbs                      as decimal format '>>>,>>>,>>>,>>9.99' decimals 2
    field ttv_num_seq_item_xml             as integer format '>>>>,>>9'
    field ttv_indcod_geraunid_eventmedid_imobitem_itemxml     as as character format 'x(15)' label 'Gera Event Imob Item' column-label 'Gera Event Imob Item12)'
    field ttv_valcdn_aquisunid_bem_pat            as decimal format '->>,>>>,>>>,>>9.99' decimals 2 initial 0 label 'Aquisição Bem' column-label 'Aquisição Bem                 as integer format '>>>,>>9'
    field ttv_valcdn_aquisorg_fasb_bem_patbem                 as as decimalinteger format '>>,>>>,>>>,>>9.99' decimals 2

    field ttv_cdn_ord_manut     field ttv_val_aquis_cmi_bem_pat           as decimalinteger format '>>,>>>,>>>,>>9.99' decimals 2
    field ttv_valdes_ibsbem_municpat                  as decimalcharacter format 'x(40)' label 'Descrição '>>>,>>>,>>>,>>9.99' decimals 2Bem Pat' column-label 'Descrição Bem Pat'
    field ttv_val_ibs_estad ttv_rec_id_bem_pat_2                as decimal format '>>>,>>>,>>>,>>9.99' decimals 2 as &IF "{&ROWID_READY}" = "YES" &THEN rowid &ELSE recid &ENDIF
    field ttv_cod_valunid_cbsnegoc                      as decimal format '>>>,>>>,>>>,>>9.99' decimals 2as character format 'x(3)' label 'Unid Negócio' column-label 'Un Neg'
    field ttvtta_num_id_seqri_itembem_xmlpat             as as integer format '>>>>>>>,>>>,>>9'
  initial  1 field ttv_cod_unid_medid_item_xml      as character format 'x(12)label 'Identific Bem MRI' column-label 'ID Bem MRI'
    field ttv_cdngera_unidbem_bemquant                 as integer format '>>>,>>9' as logical initial no label "Gerar Bem por Quantidade" column-label "Gerar Bem por Quantidade"
    field ttv_cdn_org_bemsequencia                    as integer format '>>>,>>9' initial 0 label 'Sequencia' column-label 'Seq'
    field ttv_cdncod_ordmoed_manutfasb                as integercharacter format '>>>,>>9x(8)'
    field ttv_desdat_bemcotac_patfasb                as  asdate character format 'x(40)' label 'Descrição Bem Pat' column-label 'Descrição Bem Pat99/99/9999'
    field ttv_rec_id_bem_pat_2cod_ccusto                   as &IF "{&ROWID_READY}" = "YES" &THEN rowid &ELSE recid &ENDIFcharacter format "x(8)" label "Centro Custo" column-label "CCusto".

def temp-table tt_log_erros NO-UNDO
    field ttv_cod_unid_negocnum_seq                     as as characterinteger format 'x(3)'">>>,>>9" label 'Unid Negócio' "Seqüência" column-label 'Un Neg' "Seq"
    field ttattv_num_id_ri_bem_patcod_erro                  asas integer format '>>>">>>>,>>>,>>9'" initial 1 label 'Identific Bem MRI'"Número" column-label 'ID Bem MRI'"Número"
    field ttv_gera_bem_quantdes_erro                     as logical initial no character format "x(50)" label "Gerar Bem por QuantidadeInconsistência" column-label "Gerar Bem por QuantidadeInconsistência"
    field ttv_sequenciades_ajuda                    as integercharacter format '>>9' initial 0 label 'Sequencia'"x(50)" label "Ajuda" column-label 'Seq'"Ajuda"
    fieldindex ttv_cod_moed_fasb                as character format 'x(8)'
tt_id
        field  ttv_datnum_cotac_fasbseq               as  date  format '99/99/9999'   ASCENDING
    field      ttv_num_cod_ccustoerro                   as character format "x(8)" label "Centro Custo" column-label "CCusto"ASCENDING.

def var v_hdl_program    as handle no-undo.

create tt_bem_invest_mga.
assign tt_bem_invest_mga.ttv_cod_empresa               = "1"
       tt_bem_invest_mga.ttv_cod_estab                 = "1"
       tt_bem_invest_mga.ttv_dat_aquis_bem_pat         = today
       tt_bem_invest_mga.ttv_cdn_emit                  = 1
       tt_bem_invest_mga.ttv_cod_nota                  = "123456712345678"
       tt_bem_invest_mga.ttv_cod_natur_operac          = "6181A"
       tt_bem_invest_mga.ttv_cod_ser_nota              = "S"
       tt_bem_invest_mga.ttv_cod_chave_aces_docto_fisc = '34221001442721000333-44-001-000005418-1-17417368-1'
       tt_bem_invest_mga.ttv_ind_gera_event_imob_item  = 'Gerado'
       tt_bem_invest_mga.ttv_val_aquis_bem_pat         = 129.99 //VALOR DO BEM
       tt_bem_invest_mga.ttv_cdn_unid_bem              = 5 //QUANTIDADE
       tt_bem_invest_mga.ttv_val_ibs_munic             = 12.34
       tt_bem_invest_mga.ttv_val_ibs_estad             = 24.56
       tt_bem_invest_mga.ttv_val_cbs                   = 36.78
       tt_bem_invest_mga.ttv_num_seq_item_xml          = 965
       tt_bem_invest_mga.ttv_cod_unid_medid_item_xml   = 'KG'
       tt_bem_invest_mga.ttv_des_bem_pat               = "Primeiro Bem"
       tt_bem_invest_mga.ttv_cod_cta                   = '010701010000101'.

create tt_bem_invest_mga.
assign tt_bem_invest_mga.ttv_cod_empresa               = "1"
       tt_bem_invest_mga.ttv_cod_estab                 = "1"
       tt_bem_invest_mga.ttv_dat_aquis_bem_pat         = today
       tt_bem_invest_mga.ttv_cdn_emit                  = 5
       tt_bem_invest_mga.ttv_cod_nota                  = "123456712345678"
       tt_bem_invest_mga.ttv_cod_natur_operac          = "6181A"
       tt_bem_invest_mga.ttv_cod_ser_nota              = "S"
       tt_bem_invest_mga.ttv_cod_chave_aces_docto_fisc = '65221001442721000333-44-001-000005418-1-17417368-1'
       tt_bem_invest_mga.ttv_ind_gera_event_imob_item  = 'Gerar'
       tt_bem_invest_mga.ttv_val_aquis_bem_pat         = 655569.99 //VALOR DO BEM
       tt_bem_invest_mga.ttv_cdn_unid_bem              = 34 //QUANTIDADE
       tt_bem_invest_mga.ttv_val_ibs_munic             = 42.34
       tt_bem_invest_mga.ttv_val_ibs_estad             = 54.56
       tt_bem_invest_mga.ttv_val_cbs                   = 66.78
       tt_bem_invest_mga.ttv_num_seq_item_xml          = 465
       tt_bem_invest_mga.ttv_cod_unid_medid_item_xml   = 'M2'
       tt_bem_invest_mga.ttv_cdn_unid_bem              = 20
       tt_bem_invest_mga.ttv_des_bem_pat               = "Segundo Bem"
       tt_bem_invest_mga.ttv_cod_cta                   = '010701010000101'.

run prgfin\fas\fas791za.py persistent set v_hdl_program.

run pi_api_criacao_docto_entr in v_hdl_program (input "ems2",
                                                input-output table tt_bem_invest_mga,
                                                output table tt_log_erros).
delete procedure v_hdl_program.
assign v_hdl_program = ?.

for each tt_log_erros no-lock:
    message "Seq.:  " tt_log_erros.ttv_num_seq skip
            "Cod. Erro: " tt_log_erros.ttv_num_cod_erro skip
            "Descrição Erro: " tt_log_erros.ttv_des_erro skip
            "Ajuda: " tt_log_erros.ttv_des_ajuda skip
            view-as alert-box.
end.