Árvore de páginas

Versões comparadas

Chave

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

...

Exemplo do programa para criação dos registros nas temp-tables com os documentos de entrada a serem implantados:

{include/i_fncrowid.i}

def temp-table tt_log_erros no-undo
    field ttv_num_seq                      as integer format ">>>,>>9" label "Seqüência" column-label "Seq"
    field ttv_num_cod_erro             as integer format ">>>>,>>9" label "Número" column-label "Número"
    field ttv_des_erro                      as character format "x(50)" label "Inconsistência" column-label "Inconsistê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              ascending.


def temp-table tt_bem_invest_mga no-undo
    field ttv_cod_
empresa  empresa                     as  as char format 'x(3)' label 'Empresa Externa' column-label 'Empresa Ext Inicial'
    field ttv_cdn_
emit  emit                            as as Integer format '>>>>>>>>9' label 'Emitente' column-label 'Emitente'
    field ttv_cod_
nota  nota                            as as character format 'x(20)'
    field ttv_cod_ser_
nota  nota                      as as character format 'x(5)' label 'Série S?rie Nota' column-label 'Série S?rie Nota'
    field ttv_cod_natur_
operac  operac              as as character format 'x(6)' label 'Natureza OperaçãoOpera??o' column-label 'Natureza OperaçãoOpera??o'
    field ttv_cod_
estab        estab                    as character format 'x(3)' label 'Estabelecimento' column-label 'Estabelecimento'
    field ttv_dat_aquis_bem_
pat  pat            as date format '99/99/9999' label 'Data AquisçãoAquisi??o' column-label 'Data AquisiçãoAquisi??o'
    field ttv_cod_
cta          cta                      as character format 'x(20)'
    field ttv_cdn_
aux  aux                             as  as Integer format '>>>,>>9'
    field ttv_cod_
origem      origem                   as character format 'x(8)' label 'Origem' column-label 'Origem'
    field ttv_des_aux_
5    5                        as character format 'x(40)'
    field ttv_val_aquis_bem_
pat  pat            as decimal format '->>,>>>,>>>,>>9.99' decimals 2 initial 0 label 'Aquisição Aquisi??o Bem' column-label 'Aquisição Aquisi??o Bem'
    field ttv_val_aquis_fasb_bem_
pat  pat        as as decimal format '>>,>>>,>>>,>>9.99' decimals 2
    field ttv_val_aquis_cmi_bem_
pat  pat     as    as decimal format '>>,>>>,>>>,>>9.99' decimals 2
    field ttv_cdn_unid_
bem    bem                 as Integer format '>>>,>>9'
    field ttv_cdn_org_
bem  bem                    as Integer format '>>>,>>9'
    field ttv_cdn_ord_
manut  manut                as Integer format '>>>,>>9'
    field ttv_des_bem_
pat  pat                    as character format 'x(40)' label 'Descrição Descri??o Bem Pat' column-label 'Descrição Descri??o Bem Pat'
    field ttv_rec_
codid_bem_unidpat_negoc   2             as character format 'x&IF "{&ROWID_READY}" = "YES" &THEN rowid &ELSE recid format '>>>>>>9' &ENDIF
    field ttv_cod_unid_negoc               as character format 'x(3)' label 'Unid
NegócioNeg?cio' column-label 'Un Neg'
    field tta_num_id_ri_bem_
pat  pat           as  as integer format '>>>,>>>,>>9' initial 1 label 'Identific Bem MRI' column-label 'ID Bem MRI'
    field ttv_gera_bem_
quant  quant             as logical initial no label "Gerar Bem por Quantidade" column-label "Gerar Bem por Quantidade"
    field ttv_
sequencia  sequencia                        as integer format '>>9' initial 0 label 'Sequencia' column-label 'Seq'
    field ttv_cod_moed_
fasb  fasb               as  AS character format 'x(8)'
    field ttv_dat_
fasb  fasb                          as AS date format '99/99/9999' 
    field ttv_cod_ccusto                   AS character format 'x(8)'
     .


def var v_handle  
def var v_handle    as handle no-undo.

create tt_bem_invest_mga.
assign tt_bem_invest_mga.ttv_cod_empresa    empresa         = "10"
           tt_bem_invest_mga.ttv_cod_estab  estab               = "1"
           tt_bem_invest_mga.ttv_dat_aquis_bem_pat = today
           tt_bem_invest_mga.ttv_cdn_emit        emit          = 51
           tt_bem_invest_mga.ttv_cod_nota        nota          = "04062024"
           tt_bem_invest_mga.ttv_cod_natur_operac  operac  = "6181A"
           tt_bem_invest_mga.ttv_cod_ser_nota    nota      = "S"
       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_valdes_aquis_bem_pat = 129.99
          = "Primeiro Bem"
       tt_bem_invest_mga.ttv_cdn_unid_bem       = 5
  cod_cta = '010701020000102'   
         tt_bem_invest_mga.ttv_des_bem_pat  cod_ccusto  = '010702030000203'.
          = "Primeiro Bem".  


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                 = "04062024"
           tt_bem_invest_mga.ttv_cod_natur_operac   = "6181A"
           tt_bem_invest_mga.ttv_cod_ser_nota          = "S"
           tt_bem_invest_mga.ttv_val_aquis_bem_pat = 1.99
           tt_bem_invest_mga.ttv_cdn_unid_bem        = 20
           tt_bem_invest_mga.ttv_des_bem_pat          = "Segundo Bem"

.
 

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

...