Árvore de páginas

Versões comparadas

Chave

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

...

def temp-table tt_log_erros no-undo
    field ttv_num_seq                      as integer format ">>>,>>9" label "SeqüênciaSeqˆ¬ncia" column-label "Seq"
    field ttv_num_cod_erro  erro                  as as integer format ">>>>,>>9" label "NúmeroN†mero" column-label "NúmeroN†mero"
    field ttv_des_erro  erro                     as character format "x(50)" label "InconsistênciaInconsist¬ncia" column-label "InconsistênciaInconsist¬ncia"
    field ttv_des_ajuda                    as character format "x(50)" label "Ajuda" column-label "Ajuda"
    index tt_id                           
          ttv_num_seq                      ascending
          ttv_num_cod_erro  erro                 ascending
    .

def temp-table tt_bem_invest_mga no-undo
    field ttv_cod_empresa                  as char format 'x(3)' label 'Empresa Externa' column-label 'Empresa Ext Inicial'
    field ttv_cdn_emit                     as integer format '>>>>>>>>9' label 'Emitente' column-label 'Emitente'
    field ttv_cod_nota                     as character format 'x(20)'
    field ttv_cod_ser_nota                 as character format 'x(5)' label 'Série Nota' column-label 'Série Nota'
    field ttv_cod_natur_operac             as character format 'x(6)' label 'Natureza Operação' column-label 'Natureza Operação'
    field ttv_cod_estab                    as character format 'x(3)' label 'Estabelecimento' column-label 'Estabelecimento'
    field ttv_dat_aquis_bem_pat            as date format '99/99/9999' label 'Data Aquisição' column-label 'Data Aquisição'
    field ttv_cod_cta                      as character format 'x(20)'
    field ttv_cdn_aux                      as integer format '>>>,>>9'
    field ttv_cod_origem                   as character format 'x(8)' label 'Origem' column-label 'Origem'
    field ttv_des_aux_5                    as character format 'x(40)'
    field ttv_cod_chave_aces_docto_fisc    as character format 'x(60)'
    field ttv_val_aquis_bem_pat            as decimal format '->>,>>>,>>>,>>9.99' decimals 2 initial 0 label 'Aquisição Bem' column-label 'Aquisição Bem'
    field ttv_val_aquis_fasb_bem_pat       as decimal format '>>,>>>,>>>,>>9.99' decimals 2
    field ttv_val_aquis_cmi_bem_pat        as decimal format '>>,>>>,>>>,>>9.99' decimals 2
    field ttv_val_ibs_munic                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_cod_unid_medid_item_xml      as character format 'x(12)'
    field ttv_cdn_unid_bem                 as integer format '>>>,>>9'
    field ttv_cdn_org_bem                  as integer format '>>>,>>9'
    field ttv_cdn_ord_manut                as integer format '>>>,>>9'
    field ttv_des_bem_pat                  as character format 'x(40)' label 'Descrição Bem Pat' column-label 'Descrição Bem Pat'
    field ttv_rec_id_bem_pat_2             as recid
    field ttv_cod_unid_negoc               as character format 'x(3)' label 'Unid Negócio' column-label 'Un Neg'
    field tta_num_id_ri_bem_pat            as integer format '>>>,>>>,>>9' initial 1 label 'Identific Bem MRI' column-label 'ID Bem MRI'
    field ttv_gera_bem_quant               as logical initial no label "Gerar Bem por Quantidade" column-label "Gerar Bem por Quantidade"
    field ttv_sequencia                    as integer format '>>9' initial 0 label 'Sequencia' column-label 'Seq'
    field ttv_cod_moed_fasb                AS  as character format 'x(8)'
    field ttv_dat_fasb                     as date format '99/99/9999'
    field ttv_cod_ccusto                   as character format "x(8)" label "Centro Custo" column-label "CCusto".

def var v_hdl_handle program    as handle no-undo.

create tt_bem_invest_mga.
assign tt_bem_invest_mga.ttv_cod_empresa               = "10"
       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                  = "040620240543"
       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_val_aquis_bem_pat         = 129.99 //VALOR DO BEM
       tt_bem_invest_mga.ttv_cdn_unid_bem              = 5 //QUANTIDADE
       tt_bem_invest_mga.ttv_desval_aquis_fasb_bem_pat       = "Primeiro Bem"= 85.45
       tt_bem_invest_mga.ttv_cod_cta = '010701020000102'   val_aquis_cmi_bem_pat     = 95.45
       tt_bem_invest_mga.ttv_cod_ccusto  = '010702030000203'.
create ttval_ibs_munic             = 12.34
       tt_bem_invest_mga.
assign ttttv_bemval_invest_mga.ttv_cod_empresa  ibs_estad             = "10"
    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                   = '010701020000102'
       tt_bem_invest_mga.ttv_cod_ccusto                = '010702030000203'.

create tt_bem_invest_mga.
assign tt_bem_invest_mga.ttv_cod_empresa               = "10"
       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                  = "0543"
       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_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_aquis_fasb_bem_pat    = 34385.45
      cod_estab                = "1"
           tt_bem_invest_mga.ttv_datval_aquis_cmi_bem_pat     = today34395.45
           tt_bem_invest_mga.ttv_cdn_emit      val_ibs_munic             = 542.34
           tt_bem_invest_mga.ttv_codval_ibs_nota  estad                = "04062024"
    = 54.56
       tt_bem_invest_mga.ttv_cod_natur_operac   = "6181A"
    val_cbs                   = 66.78
       tt_bem_invest_mga.ttv_num_codseq_seritem_nota  xml          = "S"465
           tt_bem_invest_mga.ttv_valcod_unid_aquismedid_bemitem_pat = 1.99xml   = 'M2'
           tt_bem_invest_mga.ttv_cdn_unid_bem  bem              = 20
           tt_bem_invest_mga.ttv_des_bem_pat  pat               = "Segundo Bem". 

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

run pi_api_criacao_docto_entr in v_hdl_program (input "ems2",
                  "ems2",
                                                            input  table tt_bem_invest_mga,
                                                                              output table tt_log_erros).
delete procedure v_hdl_program.
assign  vassign  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
                     viewview-as alert-box.
end.