Histórico da Página
...
Atributo | Tipo | Formato | Descrição | Obrigatório | Evolução |
ttv_cod_empresa | character | x(3) | Código da empresa externa a ser traduzida pela matriz de tradução de unidade organizacional. | Sim | |
ttv_cdn_emit | integer | >>>>>>>>9 | Código numérico do fornecedor do documento fiscal. | Sim | |
ttv_cod_nota | character | x(20) | Número do documento fiscal. | Sim | |
ttv_cod_ser_nota | character | x(5) | Série do documento fiscal. | Sim | |
ttv_cod_natur_operac | character | x(6) | Natureza de operação do documento fiscal. | Sim | |
ttv_cod_estab | character | x(3) | Código do estabelecimento externo a ser traduzido pela matriz de tradução de unidade organizacional. | Sim | |
ttv_dat_aquis_bem_pat | date | 99/99/9999 | Data de emissão do documento de entrada do qual é extraído um item de um lançamento contábil. | Sim | |
ttv_cod_cta | character | x(20) | Código do centro de custo. | Não | |
ttv_cdn_aux | integer | >>>,>>9 | Código do centro de custo externo a ser traduzido pela matriz de tradução de centros de custo. | Não | |
ttv_cod_origem | character | x(8) | Código da origem do documento de entrada. | Não | |
ttv_des_aux_5 | character | x(40) | Narrativa do item do documento de entrada. | Não | |
ttv_cod_chave_aces_docto_fisc | character | x(60) | Chave de acesso da Nota Fiscal Eletrônica (NF-e) ou do Documento Fiscal correspondente, que será utilizada para a geração dos eventos relativos à CBS e ao IBS no sistema da NF-e. | Não | |
ttv_ind_gera_event_imob_item | character | x(15) | Indica se o evento de Imobilização do item do documento de entrada da Reforma Tributária (211130) deve ser gerado. As opções disponíveis são:
| Não | |
ttv_val_aquis_bem_pat | decimal | ->>,>>>,>>>,>>9.99 | Valor do documento de entrada. | Não | |
ttv_val_aquis_fasb_bem_pat | decimal | >>,>>>,>>>,>>9.99 | Valor FASB do documento de entrada. | Não | |
ttv_val_aquis_cmi_bem_pa | decimal | >>,>>>,>>>,>>9.99 | Valor CMCAC do documento de entrada. | Não | |
ttv_val_ibs_munic | decimal | >>>,>>>,>>>,>>9.99 | Valor do IBS - Imposto sobre Bens e Serviços municipal no documento fiscal de entrada sempre que a operação envolver incidência desse tributo. | Não | |
ttv_val_ibs_estad | decimal | >>>,>>>,>>>,>>9.99 | Valor do IBS - Imposto sobre Bens e Serviços estadual no documento fiscal de entrada sempre que a operação envolver incidência desse tributo. | Não | |
ttv_val_cbs | decimal | >>>,>>>,>>>,>>9.99 | Valor da CBS - Contribuição sobre Bens e Serviços do documento fiscal de entrada sempre que a operação envolver incidência desse tributo. | Não | |
ttv_num_seq_item_xml | integer | >>>>,>>9 | Número da sequência do item no XML do documento fiscal de entrada. | Não | |
ttv_cod_unid_medid_item_xml | character | x(12) | Unidade de medida do item no XML do documento fiscal de entrada. | Não | |
ttv_rec_id_bem_pat_2 | recid/roiwd | Recid ou Rowid, caso já tenha liberação da função | Não | ||
ttv_cdn_unid_bem | integer | >>>,>>9 | Quantidade do item do documento de entrada. | Sim | |
ttv_cdn_org_bem | integer | >>>,>>9 | Número da ordem de investimentos do documento de entrada. | Não | |
ttv_cdn_ord_manut | integer | >>>,>>9 | Número da ordem de manutenção do documento de entrada. | Não | |
ttv_des_bem_pat | character | x(40) | Descrição do item do documento de entrada | Sim | |
ttv_cod_unid_negoc | character | x(3) | Código da unidade de negócio. | Não | |
tta_num_id_ri_bem_pat | integer | >>>,>>>,>>9 | Número de identificação do bem patrimonial. | Não | |
ttv_gera_bem_quant | logical | yes/no | Indicador de geração de bens por quantidade. | Não | |
ttv_sequencia | integer | >>9 | Número sequencial do item do documento fiscal. | Não | |
ttv_cod_moed_fasb | character | x(8) | Código da moeda FASB. | Não | |
ttv_dat_cotac_fasb | date | 99/99/9999 | Data de cotação da moeda FASB. | Não | |
ttv_cod_ccusto | character | X(8) | Centro de Custo ems5 | Sim |
...
/*-- Filtro RECID x ROWID Aplicado --*/
{include/i_fncrowid.i}
def temp-table tt_logbem_invest_errosmga no-undo
field ttv_numcod_seqempresa 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(5020)"'
label "Inconsistência" column-label "Inconsistência"
field ttv_des_ajudafield ttv_cod_ser_nota 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 'Empresa ExternaEstabelecimento' column-label 'Empresa Ext InicialEstabelecimento'
field ttv_dat_cdnaquis_bem_emitpat as as integer 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_coddes_aux_estab5 as character format 'x(3)' label 'Estabelecimento' column-label 'Estabelecimento40)'
field ttv_cod_datchave_aquisaces_bemdocto_pat fisc as datecharacter format '99/99/9999x(60)' label 'Data Aquisi‡Æo'"Chave Acesso NFE" column-label 'Data Aquisi‡Æo'"Chave Acesso NFE"
field ttv_cod_cta_ind_gera_event_imob_item as character as character format 'x(20)'format 'x(15)' label 'Gera Event Imob Item' column-label 'Gera Event Imob Item'
field ttv_cdn_aux val_aquis_bem_pat as integerdecimal format '->>,>>>,>>>,>>9.99'
decimals field ttv_cod_origem as character format 'x(8)' label 'Origem'2 initial 0 label 'Aquisição Bem' column-label 'OrigemAquisição Bem'
field ttv_des_aux_5val_aquis_fasb_bem_pat as character format 'x(40)'
field ttv_cod_chave_aces_docto_fisc as character format 'x(60)'as decimal format '>>,>>>,>>>,>>9.99' decimals 2
field ttv_val_aquis_cmi_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_patibs_munic as as decimal format '>>>>>,>>>,>>>,>>9.99' decimals 2
field ttv_val_aquis_cmi_bem_patibs_estad as decimal format '>>>>>,>>>,>>>,>>9.99' decimals 2
field ttv_val_ibs_municcbs as decimal format '>>>,>>>,>>>,>>9.99' decimals 2
field ttv_valnum_seq_ibsitem_estadxml as as decimalinteger format '>>>,>>>,>>>>>>>,>>9.99' decimals 2
field ttv_val_cbs cod_unid_medid_item_xml as decimalcharacter format '>>>,>>>,>>>,>>9.99' decimals 2x(12)'
field ttv_numcdn_seq_item_xmlunid_bem as integer format '>>>>>>>,>>9'
field ttv_cod_unid_medid_item_xmlcdn_org_bem as integer format '>>>,>>9'
field ttv_cdn_ord_manut as integer format '>>>,>>9'
field ttv_des_bem_pat as character format 'x(12) format 'x(40)' label 'Descrição Bem Pat' column-label 'Descrição Bem Pat'
field ttv_rec_id_bem_pat_2 as &IF "{&ROWID_READY}" = "YES" &THEN rowid &ELSE recid &ENDIF
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_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 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 Pat'99/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 logicalcharacter initial noformat "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"x(50)" label 'Sequencia'"Ajuda" column-label 'Seq'
field ttv_cod_moed_fasb "Ajuda"
index tt_id
as character format 'x(8)'
field ttv_datnum_fasbseq as ASCENDING
date format '99/99/9999'
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 = "101"
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 = "054312345678"
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 = "101"
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 = "054312345678"
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 vv_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‡ÆoDescrição Erro: " tt_log_erros.ttv_des_erro skip
"Ajuda: " tt_log_erros.ttv_des_ajuda skip
view-as alert-box.
end.