Módulo: CÂMBIO EXPORTAÇÃO
Funcionalidade: Liquidação de Fatura
Data/Hora da Publicação: 01/10/2010 00:00:00
Data/Hora Última Alteração: 03/03/2011 15:25:23
Descrição da Nota: LIQUIDAÇÃO ARBITRAGEM VALOR INCORRETO DA FATURA NA MOEDA DO CONTRATO
Sintoma
Foi vinculada uma fatura com moeda diferente a moeda do contrato(arbitragem). Após o sistema
(vinculação) efetuar o cálculo do valor da fatura na moeda do contrato, alteramos este valor e
salvamos. O sistema fez as contabilizações corretamente. Ao entrar na tela da liquidação, o valor da
fatura na moeda do contrato foi recalculado, ficando diferente do valor da tela da vinculação,
gerando assim erros na contabilização e atualização dos saldos.
Solução
Ao chamar a tela da liquidação, não efetuar recalculo do valor da fatura na moeda do contrato,
sempre considerar o valor que foi informado na vinculação(tabela /pws/zycbt005).
Realizada outra melhoria para evitar erros, onde a coluna Valor da Fatura na moeda do contrato foi
fechada para alteração, assim o usuário só poderá efetuar uma liquidação parcial considerando a
coluna Valor da Fatura na moeda original.
8.0
Produto:
Nota
Descrição
Informações Complementares
----------------------------------------------------------------------------------------------------
Nota Número 10638 Data: 01/10/2010 Hora: 12:53:52
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
Nota Número : 10638
Categoria : Erro de Programa
Prioridade : Média
Versão PW.CE : 8.0
Pacote : 00005
Agrupamento : 00041
----------------------------------------------------------------------------------------------------
Referência às notas relacionadas:
Número - Ordem - Versão - Pacote - Descrição Breve
00243 - 00001 - 6.0 - 00021 - CÁLCULO JUROS NA LIQUIDAÇÃO
00403 - 00002 - 6.0 - 00022 - LIQUIDAÇÃO COM SEQUEÊNCIAS IGUAIS MAS COM DIVISÕES DIFERENTES
00430 - 00003 - 6.0 - 00021 - NA LIQUIDAÇÃO COM ARBITRAGEM, O VALOR VINCULADO NÃO ESTÁ CORRETO
01499 - 00004 - 6.0 - 00023 - EXIT VINCULAÇÃO / LIQUIDAÇÃO - ALTERAÇÃO DOCUMENTOS CONTÁBEIS
01596 - 00005 - 6.0 - 00023 - LIQUIDAÇÃO - PROBLEMAS COM FATOR DE CONVERSÃO DE MOEDAS
01640 - 00006 - 6.0 - 00024 - LIQUIDAÇÃO - TABELA /PWS/ZYBCBT004.
01705 - 00007 - 6.0 - 00024 - LIQUIDAÇÃO ESTORNO SALDO À PAGAR
01946 - 00008 - 6.0 - 00024 - LIQUIDAÇÃO COM ARBITRAGEM DE MOEDA
02011 - 00009 - 6.0 - 00024 - LIQUIDAÇÃO COM ARBITRAGEM - CALCULO PROVISÃO JUROS
02032 - 00010 - 6.0 - 00024 - CAMPO DEDUZ_JUROS NÃO ESTAVA SENDO ATUALIZADO NA TABELA DE LIQUID
03776 - 00011 - 7.0 - 00001 - LIQUIDAÇÃO - DATA PAGAMENTO NO EXTERIOR
04958 - 00012 - 7.0 - 00003 - FATURA/VINCULAÇÃO/LIQUIDAÇÃO - COMMODITIES
05486 - 00013 - 7.0 - 00003 - SELECIONAR RECURSO PARA LIQUIDAÇÃO DE FATURAS
05666 - 00014 - 7.0 - 00004 - LIQUIDAÇÃO DE FATURAS
06093 - 00015 - 7.0 - 00004 - CB - 444548 - CODE INSPECTOR E VERIFICAÇÃO AMPLIADA
06615 - 00016 - 7.0 - 00005 - LIQUIDAÇÃO - TRADUÇÃO TEXTOS 253 254 255
06766 - 00017 - 7.0 - 00005 - LIQUIDAÇÃO DE FATURA
07760 - 00018 - 7.0 - 00007 - DA-LIQUIDAÇÃO E VINCULAÇÃO LIQ. AUTOMÁT - NORMAL/ARBITRAGEM/PERFO
07775 - 00019 - 7.0 - 00007 - LIQUIDAÇÃO COM ARBITRAGEM - RECALCULA VALOR VINCULADO INCORRETAME
08239 - 00020 - 7.0 - 00009 - VALORES MANTIDOS NO EXTERIOR E LIQUIDAÇÃO - COMISSÃO DE AGENTE
08536 - 00021 - 7.0 - 00009 - DA-VINCULAÇÃO/LIQUIDAÇÃO-OTIMIZAÇÃO-BUSCA TAXAS/TIPO DOCTO. POR C
08981 - 00022 - 7.0 - 00010 - LIQUIDAÇÃO - VALORES INCORRETOS QUANDO FOR MOEDA JPY
09062 - 00023 - 8.0 - 00001 - DESVINCULAÇÃO LIQUIDAÇÃO ATUALIZAÇÃO INCORRETA 001-DTVINCUL E 005
09394 - 00024 - 8.0 - 00001 - VINCULAÇÃO E LIQUIDAÇÃO DE FATURAS
09652 - 00025 - 8.0 - 00002 - LIQUIDAÇÃO - ERRO RE-LANÇAMENTO ARBITRAGEM DEVIDO CAMPO 005-BELNR
09903 - 00026 - 8.0 - 00002 - VINCULAÇÃO COM LIQ AUTOMÁTICA - MENSAGEM INCORRETA DOCUMENTO COMP
09980 - 00027 - 8.0 - 00003 - VINCULAÇÃO COM LIQ AUTOMÁTICA - MENSAGEM INCORRETA DOCUMENTO COMP
10020 - 00028 - 8.0 - 00003 - LIQUIDAÇÃO - ARBITRAGEM - CONTA ARB INCORRETA PT-NÃO FAZ ARREDOND
10204 - 00029 - 8.0 - 00003 - LIQUIDAÇÃO - PREENCHIMENTO DO CAMPO SOCIEDADE PARCEIRA.
----------------------------------------------------------------------------------------------------
LIQUIDAÇÃO ARBITRAGEM VALOR INCORRETO DA FATURA NA MOEDA DO CONTRATO
----------------------------------------------------------------------------------------------------
Palavras Chave:
LIQUIDAÇÃO ARBITRAGEM VALOR INCORRETO DA FATURA NA MOEDA DO CONTRATO
----------------------------------------------------------------------------------------------------
Objetos da nota:
REPS /PWS/MZYCB004F01
REPS /PWS/MZYCB004F02
REPS /PWS/MZYCB004TOP
REPS /PWS/MZYCB004X01
----------------------------------------------------------------------------------------------------
Modificações efetuadas em REPS /PWS/MZYCB004F01
...
gsberf type /pws/zycbt030-gsberf,
pendcomm type /pws/zycbt030-pendcomm,
end of t_pendcomm,
t_itab_pendcomm type sorted table of t_pendcomm
with unique key nrinvoic nrparcf gsberf.
data:
itab_pendcomm type t_itab_pendcomm,
v_bukrs_fat like /pws/zycbt017-bukrs.
refresh: itab_zycbt005.
clear: /pws/zycbe005, /pws/zycbe006.
* >> Início da inclusão: FORM CARREGA_ITAB_ZYCBT005
clear: itab_paridade.
refresh: itab_paridade.
* << Fim da inclusão
select single * from /pws/zycbt007 into /pws/zycbt007
where bukrs = /pws/zycbe001-bukrs.
wa_zycbt007 = /pws/zycbt007.
select single * from /pws/zycbt089 into /pws/zycbt089
where bukrs = /pws/zycbe001-bukrs.
select single * from /pws/zyglt009 into /pws/zyglt009
where bukrs = /pws/zycbe001-bukrs.
if v_trans is initial.
if v_dtvencto is initial and
v_nrinvoic is initial.
...
...
endif.
if not itab_zycbt005[] is initial.
select nrinvoic nrparcf gsberf pendcomm
from /pws/zycbt030 into table itab_pendcomm
for all entries in itab_zycbt005
where nrinvoic = itab_zycbt005-nrinvoic
and nrparcf = itab_zycbt005-nrparcf
and gsberf = itab_zycbt005-gsberf
and pendcomm = 'X'.
endif.
* >> Início da inclusão: FORM CARREGA_ITAB_ZYCBT005
if not itab_zycbt005[] is initial.
select * from /pws/zycbt006
into table itab_zycbt006
for all entries in itab_zycbt005
where nrinvoic = itab_zycbt005-nrinvoic
and nrparcf = itab_zycbt005-nrparcf
and gsberf = itab_zycbt005-gsberf.
endif.
* << Fim da inclusão
loop at itab_zycbt005.
read table itab_pendcomm
with key
nrinvoic = itab_zycbt005-nrinvoic
nrparcf = itab_zycbt005-nrparcf
gsberf = itab_zycbt005-gsberf
pendcomm = 'X'
transporting no fields.
if sy-subrc eq 0.
message i061 with text-054
itab_zycbt005-nrinvoic
text-231
text-217.
delete itab_zycbt005.
continue.
* >> Início da inclusão: FORM CARREGA_ITAB_ZYCBT005
endif.
v_total_liq = 0.
read table itab_zycbt006
with key nrinvoic = itab_zycbt005-nrinvoic
nrparcf = itab_zycbt005-nrparcf
gsberf = itab_zycbt005-gsberf.
if sy-subrc eq 0.
loop at itab_zycbt006 where nrinvoic = itab_zycbt005-nrinvoic
and nrparcf = itab_zycbt005-nrparcf
and gsberf = itab_zycbt005-gsberf.
v_total_liq = v_total_liq + itab_zycbt006-vlme.
endloop.
itab_zycbt005-vlme = itab_zycbt005-vlme_p - v_total_liq.
else.
itab_zycbt005-vlme = itab_zycbt005-vlme_p.
* << Fim da inclusão
endif.
* >> Início da exclusão: FORM CARREGA_ITAB_ZYCBT005
itab_zycbt005-vlme = itab_zycbt005-slpagar.
* << Fim da exclusão
if itab_zycbt005-waers ne itab_zycbt005-waers_c.
* >> Início da exclusão: FORM CARREGA_ITAB_ZYCBT005
itab_zycbt005-vlme = itab_zycbt005-vlme / itab_zycbt005-parid.
* << Fim da exclusão
select *
from tcurx
...
...
if sy-subrc <> 0.
tcurx-currdec = 2.
endif.
itab_zycbt005-vlme = itab_zycbt005-vlme /
( 10 ** ( tcurx-currdec - 2 ) ).
endif.
modify itab_zycbt005.
move-corresponding itab_zycbt005 to itab_paridade.
move itab_zycbt005-parid to itab_paridade-v_parid.
move itab_zycbt005-waers_c to itab_paridade-v_waers_c.
* >> Início da inclusão: FORM CARREGA_ITAB_ZYCBT005
move itab_zycbt005-slpagar to itab_paridade-v_vlme_c.
* << Fim da inclusão
append itab_paridade.
endloop.
clear: itab_zycbt005-status.
modify itab_zycbt005 transporting status
where nrseqc = v_nrseqc.
loop at itab_paridade.
* >> Início da exclusão: FORM CARREGA_ITAB_ZYCBT005
itab_paridade-v_vlme_c =
itab_paridade-vlme * itab_paridade-v_parid.
* << Fim da exclusão
select *
from tcurx
up to 1 rows
where currkey eq itab_paridade-waers.
endselect.
if sy-subrc <> 0.
tcurx-currdec = 2.
endif.
itab_paridade-v_vlme_c = itab_paridade-v_vlme_c /
( 10 ** ( tcurx-currdec - 2 ) ).
...
...
if not itab_zycbt001[] is initial.
select *
from /pws/zycbt074
into table itab_zycbt074
for all entries in itab_zycbt001
where nrseqc = itab_zycbt001-nrseqc.
endif.
clear v_msg_1.
loop at itab_zycbt005.
move-corresponding itab_zycbt005 to itab_zycbt005_s.
* >> Início da inclusão: FORM CARREGA_ITAB_ZYCBT005
itab_zycbt005_s-slliquid = itab_zycbt005-slpagar.
* << Fim da inclusão
append itab_zycbt005_s.
perform lock_record.
endloop.
* >> Início da inclusão: FORM CARREGA_ITAB_ZYCBT005
perform calcula_valor_liquidado.
* << Fim da inclusão
perform carrega_vljur_vlcomis.
if v_trans is initial.
clear: itab_zycbt005-slpagar.
modify itab_zycbt005 transporting slpagar
...
...
gsberf = /pws/zycbe006-gsberf.
if sy-subrc eq 0.
v_vlmedif = /pws/zycbe006-vlme - itab_zycbt005_ant-vlme.
if itab_zycbt005-waers ne itab_zycbt005-waers_c.
v_vlmedif = v_vlmedif * itab_zycbt005-parid.
endif.
else.
v_vlmedif = /pws/zycbe006-vlme.
if itab_zycbt005-waers ne itab_zycbt005-waers_c.
v_vlmedif = v_vlmedif * itab_zycbt005-parid.
* >> Início da inclusão: FORM ALTERA_ITAB_ZYCBT005
endif.
endif.
if v_trans = 2.
v_total_liq = 0.
loop at itab_zycbt006
where nrinvoic = /pws/zycbe006-nrinvoic
and nrparcf = /pws/zycbe006-nrparcf
and gsberf = /pws/zycbe006-gsberf.
if itab_zycbt006-dtvincul = v_dtvincul and
itab_zycbt006-dtpagto = v_dtpagto and
itab_zycbt006-dtpagext = v_dtpagext.
else.
v_total_liq = v_total_liq + itab_zycbt006-vlme.
endif.
endloop.
v_total_liq = v_total_liq + /pws/zycbe006-vlme.
if v_total_liq > itab_zycbt005-vlme_p.
move /pws/zycbe006-vlme to v_aux_1.
move itab_zycbt005_s-slliquid to v_aux_2.
condense: v_aux_1 no-gaps,
v_aux_2 no-gaps.
concatenate: text-025 v_aux_1 into v_msg_1,
'é superior ao saldo => ' v_aux_2
into v_msg_2.
perform msg_valor_invalido using v_msg_1 v_msg_2.
exit.
endif.
* << Fim da inclusão
endif.
* >> Início da inclusão: FORM ALTERA_ITAB_ZYCBT005
if /pws/zycbe006-vlme = itab_zycbt005_s-vlme.
v_vlmedif = itab_zycbt005_s-slpagar.
* << Fim da inclusão
endif.
itab_zycbt005-slpagar =
* >> Início da exclusão: FORM ALTERA_ITAB_ZYCBT005
itab_zycbt005_s-slpagar - v_vlmedif.
* << Fim da exclusão
* >> Início da inclusão: FORM ALTERA_ITAB_ZYCBT005
itab_zycbt005_s-slliquid - v_vlmedif.
* << Fim da inclusão
if itab_zycbt005-slpagar lt 0.
* >> Início da inclusão: FORM ALTERA_ITAB_ZYCBT005
if sy-ucomm = 'DELE'.
modify itab_zycbt005
index tc_faturas-current_line transporting mark.
exit.
endif.
* << Fim da inclusão
clear: v_aux_1, v_aux_2, v_msg_1, v_msg_2.
if itab_zycbt005-waers eq itab_zycbt005-waers_c.
...
...
perform determina_fator using v_parafator
v_defator.
select *
up to 1 rows
from tcurx
where currkey = itab_zycbt005-waers.
endselect.
if sy-subrc <> 0.
tcurx-currdec = 2.
endif.
* >> Início da inclusão: FORM FILL_DATE6_F30_ACE
read table itab_paridade
with key nrinvoic = itab_zycbt006-nrinvoic
gsberf = itab_zycbt006-gsberf
nrparcf = itab_zycbt006-nrparcf.
if sy-subrc eq 0.
itab_zycbe033-wrbtr = itab_paridade-v_vlme_c.
else.
* << Fim da inclusão
itab_zycbe033-wrbtr = itab_zycbt006-vlme *
( ( itab_zycbt005-parid / v_defator ) * v_parafator ).
* >> Início da inclusão: FORM FILL_DATE6_F30_ACE
endif.
* << Fim da inclusão
itab_zycbe033-wrbtr = itab_zycbe033-wrbtr /
( 10 ** ( tcurx-currdec - 2 ) ).
perform verifica_casas_decimais
using
itab_zycbe033-wrbtr
...
...
perform determina_fator using v_parafator
v_defator.
select *
up to 1 rows
from tcurx
where currkey = itab_zycbt005-waers.
endselect.
if sy-subrc <> 0.
tcurx-currdec = 2.
endif.
* >> Início da inclusão: FORM FILL_DATE6_F30_ACE
read table itab_paridade
with key nrinvoic = itab_zycbt006-nrinvoic
gsberf = itab_zycbt006-gsberf
nrparcf = itab_zycbt006-nrparcf.
if sy-subrc eq 0.
itab_zycbt036-residuo = itab_paridade-v_vlme_c.
else.
* << Fim da inclusão
itab_zycbt036-residuo = itab_zycbt006-vlme *
( ( itab_zycbt005-parid / v_defator ) * v_parafator ).
* >> Início da inclusão: FORM FILL_DATE6_F30_ACE
endif.
* << Fim da inclusão
itab_zycbt036-residuo = itab_zycbt036-residuo /
( 10 ** ( tcurx-currdec - 2 ) ).
perform verifica_casas_decimais
using
itab_zycbt036-residuo
...
...
dtincl = itab_zycbt005-dtincl
nrinvoic = itab_zycbt005-nrinvoic
gsberf = itab_zycbt005-gsberf
dtvincul = itab_zycbt005-dtvincul
dtvencto = itab_zycbt005-dtvencto.
if v_status_s eq 0.
exit.
endif.
perform determina_fator using v_parafator
v_defator.
* >> Início da exclusão: FORM CALC_PARIDADE
if itab_zycbt005-vlme eq 0 and v_parid ne 0 and v_vlme_c ne 0.
* << Fim da exclusão
* >> Início da inclusão: FORM CALC_PARIDADE
read table itab_zycbt005_s
with key nrinvoic = itab_zycbt005-nrinvoic
nrparcf = itab_zycbt005-nrparcf
gsberf = itab_zycbt005-gsberf.
if sy-subrc eq 0 and itab_zycbt005-vlme = itab_zycbt005_s-vlme.
itab_zycbt005-vlme = itab_zycbt005_s-vlme.
v_vlme_c = itab_zycbt005_s-slpagar.
elseif itab_zycbt005-vlme eq 0 and v_parid ne 0 and v_vlme_c ne 0.
* << Fim da inclusão
itab_zycbt005-vlme = v_vlme_c /
( ( itab_paridade-v_parid / v_defator ) * v_parafator ).
perform verifica_casas_decimais
using
itab_zycbt005-vlme
itab_zycbt005-waers
itab_zycbt005-waers_c
changing itab_zycbt005-vlme.
v_vlme_c = itab_zycbt005-vlme *
( ( itab_paridade-v_parid / v_defator ) * v_parafator ).
...
...
endif.
move v_vlme_c to itab_paridade-v_vlme_c.
modify itab_paridade transporting v_vlme_c
where nrinvoic = itab_zycbt005-nrinvoic and
gsberf = itab_zycbt005-gsberf and
nrparcf = itab_zycbt005-nrparcf.
modify itab_zycbt005 index v_index.
endform.
form determina_fator using p_parafator
p_defator.
* >> Início da inclusão: FORM DETERMINA_FATOR
if itab_zycbt005-waers = itab_zycbt005-waers_c.
p_parafator = p_defator = 1.
else.
* << Fim da inclusão
select single ffact tfact
from tcurf
into (p_parafator,
p_defator)
where fcurr = itab_zycbt005-waers
and tcurr = itab_zycbt005-waers_c
* >> Início da exclusão: FORM DETERMINA_FATOR
and gdatu >= sy-datum. "#EC PORTABLE
* << Fim da exclusão
* >> Início da inclusão: FORM DETERMINA_FATOR
and gdatu >= sy-datum. "#EC PORTABLE
endif.
* << Fim da inclusão
endform.
form valida_taxa_parametro.
clear: v_taxa_vazia.
clear itab_zycbe033-kursf.
perform verifica_data2 using /pws/zycbt089-tx_desm_cli
itab_zycbt006-dtpagto.
if not v_databl is initial.
perform define_cambio using v_databl
itab_zycbt006-waers
wa_zycbt007-waersb
...
...
read table itab_zyglt316 index 1 into wa_zyglt316.
if sy-subrc = 0.
case p_tipo.
when 'D'.
move wa_zyglt316-konts to p_conta.
when 'C'.
move wa_zyglt316-konth to p_conta.
endcase.
endif.
endform.
* >> Início da inclusão:
form calcula_valor_liquidado.
data: v_ult_liquidacao(1) type c.
v_ult_liquidacao = 'N'.
if not v_trans is initial and not itab_zycbt005[] is initial.
select * from /pws/zycbt006
into table itab_zycbt006
for all entries in itab_zycbt005
where nrinvoic = itab_zycbt005-nrinvoic
and nrparcf = itab_zycbt005-nrparcf
and gsberf = itab_zycbt005-gsberf.
sort itab_zycbt006 by nrinvoic nrparcf gsberf dtpagto descending.
loop at itab_zycbt005_s.
read table itab_zycbt005 with key
nrinvoic = itab_zycbt005_s-nrinvoic
nrparcf = itab_zycbt005_s-nrparcf
gsberf = itab_zycbt005_s-gsberf.
if sy-subrc eq 0 and itab_zycbt005-slpagar = 0.
read table itab_zycbt006 with key
nrinvoic = itab_zycbt005_s-nrinvoic
nrparcf = itab_zycbt005_s-nrparcf
gsberf = itab_zycbt005_s-gsberf.
if sy-subrc eq 0.
if itab_zycbt006-dtvincul = v_dtvincul and
itab_zycbt006-dtpagto = v_dtpagto and
itab_zycbt006-dtpagext = v_dtpagext.
v_vlme_c = 0.
loop at itab_zycbt006
where nrinvoic = itab_zycbt005_s-nrinvoic
and nrparcf = itab_zycbt005_s-nrparcf
and gsberf = itab_zycbt005_s-gsberf.
if itab_zycbt006-dtvincul = v_dtvincul and
itab_zycbt006-dtpagto = v_dtpagto and
itab_zycbt006-dtpagext = v_dtpagext.
else.
v_vlme_c = v_vlme_c + itab_zycbt006-vlme.
endif.
endloop.
perform determina_fator using v_parafator
v_defator.
v_vlme_c = v_vlme_c * ( ( itab_zycbt005-parid /
v_defator ) * v_parafator ).
v_vlme_c = itab_zycbt005-vlvinc - v_vlme_c.
v_ult_liquidacao = 'S'.
else.
perform determina_fator using v_parafator
v_defator.
v_vlme_c = itab_zycbt005_s-vlme *
( ( itab_zycbt005-parid / v_defator ) * v_parafator ).
endif.
endif.
else.
perform determina_fator using v_parafator
v_defator.
v_vlme_c = itab_zycbt005_s-vlme *
( ( itab_zycbt005-parid / v_defator ) * v_parafator ).
endif.
perform verifica_casas_decimais
using
itab_zycbt005-vlme
itab_zycbt005-waers
itab_zycbt005-waers_c
changing v_vlme_c.
itab_zycbt005_s-slpagar = v_vlme_c.
modify itab_zycbt005_s.
if v_ult_liquidacao = 'S'.
loop at itab_paridade
where nrinvoic = itab_zycbt005_s-nrinvoic
and nrparcf = itab_zycbt005_s-nrparcf
and gsberf = itab_zycbt005_s-gsberf.
if itab_paridade-dtvincul = v_dtvincul and
itab_paridade-dtpagto = v_dtpagto and
itab_paridade-dtpagext = v_dtpagext.
itab_paridade-v_vlme_c = v_vlme_c.
modify itab_paridade.
endif.
endloop.
endif.
endloop.
endif.
endform.
* << Fim da inclusão
----------------------------------------------------------------------------------------------------
Modificações efetuadas em REPS /PWS/MZYCB004F02
...
and tpdesp = itab_zycbt006-tpdesp
and nrparc = itab_zycbt006-nrparc
and dtincl = itab_zycbt006-dtincl
and nrinvoic = itab_zycbt006-nrinvoic
and gsberf = itab_zycbt006-gsberf
and dtvincul = itab_zycbt006-dtvincul
and dtvencto = itab_zycbt006-dtvencto
and dtpagto = itab_zycbt006-dtpagto
and dtpagext = itab_zycbt006-dtpagext
and nrparcf = itab_zycbt006-nrparcf.
* >> Início da inclusão: FORM ATUALIZA_TABELAS_TRANSP2
read table itab_paridade
with key nrinvoic = itab_zycbt006-nrinvoic
gsberf = itab_zycbt006-gsberf
nrparcf = itab_zycbt006-nrparcf.
if sy-subrc eq 0.
v_vlme_sl = itab_paridade-v_vlme_c.
else.
* << Fim da inclusão
v_vlme_sl = itab_zycbt006-vlme * itab_zycbt005_ant-parid.
* >> Início da inclusão: FORM ATUALIZA_TABELAS_TRANSP2
endif.
* << Fim da inclusão
clear tcurx-currdec.
select single * from tcurx
where ( currkey = itab_zycbt005_ant-waers_c
or currkey = itab_zycbt005_ant-waers )
and currdec = 0.
if sy-subrc <> 0.
tcurx-currdec = 2.
endif.
v_vlme_sl = v_vlme_sl * ( 10 ** ( tcurx-currdec - 2 ) ).
* >> Início da inclusão: FORM ATUALIZA_TABELAS_TRANSP2
read table itab_paridade
with key nrinvoic = itab_zycbt006-nrinvoic
gsberf = itab_zycbt006-gsberf
nrparcf = itab_zycbt006-nrparcf.
if sy-subrc eq 0.
if itab_zycbt006-v_vldif < 0.
itab_zycbt006-v_vldif_arb = itab_paridade-v_vlme_c * -1.
else.
itab_zycbt006-v_vldif_arb = itab_paridade-v_vlme_c.
endif.
else.
* << Fim da inclusão
itab_zycbt006-v_vldif_arb = itab_zycbt006-v_vldif *
itab_zycbt005_ant-parid.
* >> Início da inclusão: FORM ATUALIZA_TABELAS_TRANSP2
endif.
* << Fim da inclusão
itab_zycbt006-v_vldif_arb =
itab_zycbt006-v_vldif_arb * ( 10 ** ( tcurx-currdec - 2 ) ).
v_slpagar001 = v_slpagar001 + itab_zycbt006-v_vldif_arb.
modify itab_zycbt006.
update /pws/zycbt005 set slpagar = slpagar + v_vlme_sl
...
...
and dtincl = itab_zycbt006-dtvincul
and nrinvoic = itab_zycbt006-nrinvoic
and dtliquid = v_dtpagto
and dtpagext = itab_zycbt006-dtpagext
and ( dtpagto = '00000000' or
dtpagto = ' ' or
dtpagto = space ).
endif.
else.
if itab_zycbt006-v_status = 'N'.
* >> Início da inclusão: FORM ATUALIZA_TABELAS_TRANSP2
read table itab_paridade
with key nrinvoic = itab_zycbt006-nrinvoic
gsberf = itab_zycbt006-gsberf
nrparcf = itab_zycbt006-nrparcf.
if sy-subrc eq 0.
v_slpagar = itab_zycbt005-slpagar + itab_paridade-v_vlme_c.
else.
* << Fim da inclusão
v_slpagar = itab_zycbt005-slpagar +
( itab_zycbt006-v_vldif * itab_zycbt005-parid ).
* >> Início da inclusão: FORM ATUALIZA_TABELAS_TRANSP2
endif.
* << Fim da inclusão
read table /pws/zycbt005.
update /pws/zycbt005 set slpagar = v_slpagar
where nrseqc = itab_zycbt006-nrseqc
and nrinvoic = itab_zycbt006-nrinvoic
and dtvincul = itab_zycbt006-dtvincul
...
...
if itab_zycbt006-belnr_d = /pws/zycbe001-belnr2.
update /pws/zycbt005 set belnr = itab_zycbt006-belnr_d
dtbelnr = itab_zycbt006-dtpagto
where nrseqc = itab_zycbt006-nrseqc
and dtvincul = itab_zycbt006-dtvincul.
endif.
endif.
else.
if v_liquida eq 'X'.
if itab_zycbt006-status = 'C'.
* >> Início da exclusão: FORM ATUALIZA_TABELAS_TRANSP2
v_slpagar = itab_zycbt005-slpagar + ( itab_zycbt006-vlme *
itab_zycbt005-parid ).
* << Fim da exclusão
* >> Início da inclusão: FORM ATUALIZA_TABELAS_TRANSP2
read table itab_paridade
with key nrinvoic = itab_zycbt006-nrinvoic
gsberf = itab_zycbt006-gsberf
nrparcf = itab_zycbt006-nrparcf.
if sy-subrc eq 0.
v_slpagar = itab_zycbt005-slpagar +
itab_paridade-v_vlme_c.
else.
v_slpagar = itab_zycbt005-slpagar +
( itab_zycbt006-vlme * itab_zycbt005-parid ).
endif.
* << Fim da inclusão
endif.
read table /pws/zycbt005.
update /pws/zycbt005 set slpagar = v_slpagar
where nrseqc = itab_zycbt006-nrseqc
and nrinvoic = itab_zycbt006-nrinvoic
and dtvincul = itab_zycbt006-dtvincul
and nrparcf = itab_zycbt006-nrparcf
and gsberf = itab_zycbt006-gsberf.
endif.
endif.
...
...
and dtpagext = v_dtpagext
and ( dtpagto = '00000000' or
dtpagto = ' ' or
dtpagto = space )
and ( dtliquid = '00000000' or
dtliquid = ' ' or
dtliquid = space ).
endif.
endif.
endif.
* >> Início da inclusão: FORM ATUALIZA_TABELAS_TRANSP2
read table itab_paridade
with key nrinvoic = itab_zycbt006-nrinvoic
gsberf = itab_zycbt006-gsberf
nrparcf = itab_zycbt006-nrparcf.
if sy-subrc eq 0.
if itab_zycbt006-v_vldif < 0.
itab_zycbt006-v_vldif_arb = itab_paridade-v_vlme_c * -1.
else.
itab_zycbt006-v_vldif_arb = itab_paridade-v_vlme_c.
endif.
else.
* << Fim da inclusão
itab_zycbt006-v_vldif_arb = itab_zycbt006-v_vldif *
itab_zycbt005-parid.
* >> Início da inclusão: FORM ATUALIZA_TABELAS_TRANSP2
endif.
* << Fim da inclusão
v_slpagar001 = v_slpagar001 + itab_zycbt006-v_vldif_arb.
modify itab_zycbt006.
clear itab_recurso_aux.
read table itab_recurso_aux
with key nrinvoic = itab_zycbt006-nrinvoic
...
...
if /pws/zycbt089-tp_liq_and ne 'D'.
v_kunnr = itab_zycbt006-kunnr.
else.
if /pws/zycbt089-liq_and_cod_cli is initial.
select single ktokd from kna1
into v_ktokd
where kunnr eq itab_zycbt006-kunnr.
select single codtrans
from /pws/zyglt368
into v_kunnr
* >> Início da exclusão: FORM ESTORNO_PERIODO_ABERTO
where ktokd = v_ktokd. "#EC CI_NOFIRST
* << Fim da exclusão
* >> Início da inclusão: FORM ESTORNO_PERIODO_ABERTO
where ktokd = v_ktokd. "#EC CI_NOFIRST
* << Fim da inclusão
else.
v_kunnr = /pws/zycbt089-liq_and_cod_cli.
endif.
endif.
if itab_zycbt006_aux4[] > itab_zycbt006[].
loop at itab_zycbt006_aux4
where nrinvoic = itab_zycbt006-nrinvoic
and nrparcf = itab_zycbt006-nrparcf
and gsberf = itab_zycbt006-gsberf.
loop at itab_bsad
...
...
select single kursf from bkpf
into bkpf-kursf
where belnr eq itab_zycbt209-belnr_f28
and bukrs eq itab_zycbt006-bukrs
and gjahr eq v_year.
endif.
v_reais_f = ( itab_zycbt006-vlme - itab_zycbt084-result_saldo )
/ ( 10 ** ( tcurx-currdec - 2 ) ).
v_reais_f = ( ( bkpf-kursf / v_defator )
* v_parafator ) * v_reais_f.
* >> Início da inclusão: FORM CALCULA_DIFERENCA_REAIS_ESTORN
else.
read table itab_paridade
with key nrinvoic = itab_zycbt006-nrinvoic
gsberf = itab_zycbt006-gsberf
nrparcf = itab_zycbt006-nrparcf.
if sy-subrc eq 0.
v_reais_c = itab_paridade-v_vlme_c.
* << Fim da inclusão
else.
v_reais_c = ( itab_paridade-v_vlme_c * itab_paridade-v_parid ).
* >> Início da inclusão: FORM CALCULA_DIFERENCA_REAIS_ESTORN
endif.
* << Fim da inclusão
v_reais_c = v_reais_c / ( 10 ** ( tcurx-currdec - 2 ) ).
v_reais_c = ( ( v_txcbrl_cont / v_defator )
* v_parafator ) * v_reais_c.
clear itab_zycbt084.
read table itab_zycbt084 with key
...
...
empresa_nao_encontrada = 3
period_in_not_valid = 4
period_not_assigned = 5
version_undefined = 6
others = 7.
select single kursf from bkpf
into bkpf-kursf
where belnr eq itab_zycbt006-belnr_d
and bukrs eq itab_zycbt006-bukrs
and gjahr eq v_year.
* >> Início da inclusão: FORM CALCULA_DIFERENCA_REAIS
read table itab_paridade
with key nrinvoic = itab_zycbt006-nrinvoic
gsberf = itab_zycbt006-gsberf
nrparcf = itab_zycbt006-nrparcf.
if sy-subrc eq 0.
v_reais_c = itab_paridade-v_vlme_c.
else.
* << Fim da inclusão
v_reais_c = itab_zycbt006-vlme * itab_zycbt005-parid.
* >> Início da inclusão: FORM CALCULA_DIFERENCA_REAIS
endif.
* << Fim da inclusão
clear tcurx-currdec.
select single * from tcurx
where currkey = /pws/zycbe001-waers.
if sy-subrc <> 0.
tcurx-currdec = 2.
endif.
...
...
select single kursf from bkpf
into bkpf-kursf
where belnr eq itab_zycbt006-belnr_f28
and bukrs eq itab_zycbt006-bukrs
and gjahr eq v_year.
v_reais_f = ( itab_zycbt006-vlme - itab_zycbt084-result_saldo )
/ ( 10 ** ( tcurx-currdec - 2 ) ).
v_reais_f = ( ( bkpf-kursf / v_defator )
* v_parafator ) * v_reais_f.
endif.
* >> Início da inclusão: FORM CALCULA_DIFERENCA_REAIS
else.
read table itab_paridade
with key nrinvoic = itab_zycbt006-nrinvoic
gsberf = itab_zycbt006-gsberf
nrparcf = itab_zycbt006-nrparcf.
if sy-subrc eq 0.
v_reais_c = itab_paridade-v_vlme_c.
* << Fim da inclusão
else.
v_reais_c = ( itab_zycbt006-vlme * itab_zycbt005-parid ).
* >> Início da inclusão: FORM CALCULA_DIFERENCA_REAIS
endif.
* << Fim da inclusão
v_reais_c = v_reais_c / ( 10 ** ( tcurx-currdec - 2 ) ).
v_reais_c = ( ( v_txcbrl_cont / v_defator )
* v_parafator ) * v_reais_c.
clear itab_zycbt084.
read table itab_zycbt084 with key
...
...
wa_cols-screen-name = '/PWS/ZYCBE006-FIPOS' or
wa_cols-screen-name = '/PWS/ZYCBE006-GEBER' or
wa_cols-screen-name = '/PWS/ZYCBE006-EBELN' or
wa_cols-screen-name = '/PWS/ZYCBE006-COD_AREA' .
wa_cols-screen-input = '1'.
else.
wa_cols-screen-input = '0'.
endif.
if itab_zycbt005-waers ne itab_zycbt005-waers_c.
if wa_cols-screen-name = 'V_VLME_C'.
* >> Início da exclusão: FORM ROT_EXIBICAO2
wa_cols-screen-input = '1'.
* << Fim da exclusão
* >> Início da inclusão: FORM ROT_EXIBICAO2
wa_cols-screen-input = '0'.
* << Fim da inclusão
endif.
endif.
modify tc_faturas-cols from wa_cols.
endloop.
loop at screen.
if screen-name = 'V_DEDUZ'.
if ( /pws/zycbe001-tpcontr(1) = 'P' or
/pws/zycbe001-tpcontr(1) = 'S' )
and ( /pws/zycbe001-ffrcalc = 'L' ).
screen-input = '1'.
...
----------------------------------------------------------------------------------------------------
Modificações efetuadas em REPS /PWS/MZYCB004TOP
...
with header line,
v_repid like sy-repid,
v_campo(35) type c.
data: begin of itab_zycbt006_ca occurs 0.
include structure /pws/zycbt006.
data: end of itab_zycbt006_ca.
data: v_line type n.
data: v_vlme type /pws/zycet013-vlme,
v_belnr_cg type /pws/zycet013-belnr.
data: v_loop type i .
* >> Início da inclusão:
data: v_total_liq like /pws/zycbt006-vlme.
* << Fim da inclusão
----------------------------------------------------------------------------------------------------
Modificações efetuadas em REPS /PWS/MZYCB004X01
...
nrparcf LIKE /pws/zycbt005-nrparcf,
gsberf LIKE /pws/zycbt005-gsberf,
dtvincul LIKE /pws/zycbt005-dtvincul,
dtvencto LIKE /pws/zycbt005-dtvencto,
END OF itab_zycbt005_aux2.
DATA: BEGIN OF itab_zycbt005_s OCCURS 0,
nrinvoic LIKE /pws/zycbt005-nrinvoic,
nrparcf LIKE /pws/zycbt005-nrparcf,
gsberf LIKE /pws/zycbt005-gsberf,
slpagar LIKE /pws/zycbt005-slpagar,
* >> Início da inclusão:
vlme like /pws/zycbt006-vlme,
slliquid like /pws/zycbt005-slpagar,
* << Fim da inclusão
END OF itab_zycbt005_s.
DATA: BEGIN OF itab_zycbt005_liq OCCURS 0,
nrinvoic LIKE /pws/zycbt005-nrinvoic,
nrparcf LIKE /pws/zycbt005-nrparcf,
gsberf LIKE /pws/zycbt005-gsberf,
END OF itab_zycbt005_liq.
DATA: BEGIN OF itab_zycbt006_aux OCCURS 0,
nrinvoic LIKE /pws/zycbt006-nrinvoic,
nrparcf LIKE /pws/zycbt006-nrparcf,
dtvincul LIKE /pws/zycbt006-dtvincul,
...