Produto: | Datasul |
Ocorrência: | Documentação de API |
| Nome Físico | prgfin/apb/apb768zd |
Efetuar o estorno de movimentos dos títulos do contas a pagar ou o cancelamento dos mesmos.
A sintaxe para a chamada da API/BO é:
run prgfin/apb/apb768zd.py (input num_vers_integr_api,
input p_cod_modulo,
input p_cod_matriz_trad_org_ext,
input table tt_cancelamento_estorno_apb,
input table tt_estornar_agrupados,
output table tt_log_erros_atualiz,
output table tt_log_erros_estorn_cancel_apb,
output table tt_estorna_tit_imptos,
output p_log_confir_estorn_cancel).
Parâmetro | Descrição |
num_vers_integr_api | Será utilizado para determinar se o programa que está chamando está íntegro com as definições correntes da API, utilizar o valor "1". |
| p_cod_modulo | Conterá o módulo, será utilizado para verificar se o módulo é “rep”. |
| p_cod_matriz_trad_org_ext | Conterá o código da matriz de tradução da organização externa que tem por finalidade relacionar os códigos externos aos códigos presentes no Datasul-EMS5, caso a matriz de tradução não tiver sido informada, o parâmetro estará em branco. |
| tt_cancelamento_estorno_apb | Conterá os dados dos Títulos ou Movimentos a serem estornos/cancelamentos. |
| tt_estornar_agrupados | Esta temp-table somente deverá ser criada no programa chamador e passada como parâmetro, a mesma é de uso interno e não poderá conter valor no momento da passagem como parâmetro. |
Parâmetro | Descrição |
| tt_log_erros_atualiz | Conterá os dados dos erros ocorridos durante a execução do programa. |
| tt_log_erros_estorn_cancel_apb | Conterá os dados dos erros ocorridos durante a execução do programa. |
| tt_estorna_tit_imptos | Conterá os títulos que podem conter impostos vinculados ao fornecedor. A mesma é de uso interno. |
| p_log_confir_estorn_cancel | Variável do tipo lógico, que receberá o valor do retorno do programa, porém está variável não deverá ser utilizada pelo programa que chama a api após o retorno. A mesma é de uso interno. |
Tabela Temporária | Descrição | Entrada/Saída |
tt_cancelamento_estorno_apb | Conterá as informações do título e informações gerais. | Entrada |
(*) A partir da 5.07A o estabelecimento passa a ter cinco dígitos.
(**) Liberado o número de documento com 16 posições e série com 5, a partir de maio/2011.
Atributo | Tipo | Formato | Descrição | Obrig. | Evol. |
ttv_ind_niv_operac_apb | character | X(10) | 1 = Movimento 2 = Titulo |
|
|
ttv_ind_tip_operac_apb | character | X(12) | 1 = Estorno 2 = Cancelamento |
|
|
tta_cod_estab | character | x(3) / x(5)* | Estabelecimento |
|
|
tta_num_id_tit_ap | integer | 1E+10 | Token Tit AP |
|
|
tta_num_id_movto_tit_ap | integer | 1E+10 | Token Movto Tit AP |
|
|
tta_cod_refer | character | x(10) | Referência |
|
|
tta_dat_transacao | date | 99/99/9999 | Data Transação |
|
|
tta_cod_histor_padr | character | x(8) | Histórico Padrão |
|
|
ttv_des_histor | character | x(40) | Contém |
|
|
ttv_ind_tip_estorn | character | X(10) | 1 = Parcial 2 = Total |
|
|
tta_cod_portador | character | x(5) | Portador |
|
|
ttv_cod_estab_reembol | character | x(8) | Estabelecimento Reembolso |
|
|
ttv_log_reaber_item | logical | Sim/Não | Reabre Item |
|
|
ttv_log_reembol | logical | Sim/Não | Reembolso |
|
|
ttv_log_estorn_impto_retid | logical | Sim/Não | Estorna Imposto |
|
|
tta_cod_estab_ext | character | x(8) | Estabelecimento Externo |
|
|
ttv_rec_tit_ap | recid | >>>>>>9 | Recid Título |
|
|
tta_cdn_fornecedor | Integer | >>>,>>>,>>9 | Fornecedor |
|
|
tta_cod_espec_docto | character | x(3) | Espécie Documento |
|
|
tta_cod_ser_docto | character | x(3)/x(5)** | Série Documento |
|
|
tta_cod_tit_ap | character | x(10)/x(16)** | Título |
|
|
tta_cod_parcela | character | x(02) | Parcela |
|
|
def temp-table tt_cancelamento_estorno_apb no-undo
field ttv_ind_niv_operac_apb as character format "X(10)"
field ttv_ind_tip_operac_apb as character format "X(12)"
field tta_cod_estab as character format "x(3)" label "Estabelecimento" column-label "Estab"
field tta_num_id_tit_ap as integer format "9999999999" initial 0 label "Token Tit AP" column-label "Token Tit AP"
field tta_num_id_movto_tit_ap as integer format "9999999999" initial 0 label "Token Movto Tit AP" column-label "Id Tit AP"
field tta_cod_refer as character format "x(10)" label "Referência" column-label "Referência"
field tta_dat_transacao as date format "99/99/9999" initial today label "Data Transação" column-label "Dat Transac"
field tta_cod_histor_padr as character format "x(8)" label "Histórico Padrão" column-label "Histórico Padrão"
field ttv_des_histor as character format "x(40)" label "Contém" column-label "Histórico"
field ttv_ind_tip_estorn as character format "X(10)"
field tta_cod_portador as character format "x(5)" label "Portador" column-label "Portador"
field ttv_cod_estab_reembol as character format "x(8)"
field ttv_log_reaber_item as logical format "Sim/Não" initial yes
field ttv_log_reembol as logical format "Sim/Não" initial yes
field ttv_log_estorn_impto_retid as logical format "Sim/Não" initial yes
field tta_cod_estab_ext as character format "x(8)" label "Estabelecimento Exte" column-label "Estabelecimento Ext"
field ttv_rec_tit_ap as recid format ">>>>>>9" initial ?
field tta_cdn_fornecedor as Integer format ">>>,>>>,>>9" initial 0 label "Fornecedor" column-label "Fornecedor"
field tta_cod_espec_docto as character format "x(3)" label "Espécie Documento" column-label "Espécie"
field tta_cod_ser_docto as character format "x(3)" label "Série Documento" column-label "Série"
field tta_cod_tit_ap as character format "x(10)" label "Título" column-label "Título"
field tta_cod_parcela as character format "x(02)" label "Parcela" column-label "Parc"
.
Tabela Temporária | Descrição | Entrada/Saída |
tt_estornar_agrupados | Esta temp-table apenas deverá ser definida, não poderá receber valor, é de uso interno. | Entrada |
(*) A partir da 5.07A o estabelecimento passa a ter cinco dígitos.
(**) Liberado o número de documento com 16 posições e série com 5, a partir de maio/2011.
Atributo | Tipo | Formato | Descrição | Obrig. | Evol. |
ttv_num_seq | integer | >>>,>>9 | Seqüência |
|
|
tta_nom_abrev | character | x(15) | Nome Abreviado |
|
|
tta_cod_estab_pagto | character | x(3) / x(5)* | Estabelecimento Pagamento |
|
|
tta_cod_refer | character | x(10) | Referência |
|
|
tta_dat_pagto | date | 99/99/9999 | Data Pagamento |
|
|
tta_cod_estab | character | x(3) / x(5)* | Estabelecimento |
|
|
tta_cod_espec_docto | character | x(3) | Espécie Documento |
|
|
tta_cod_ser_docto | character | x(3)/x(5)** | Série Documento |
|
|
tta_cod_tit_ap | character | x(10)/x(16)** | Título |
|
|
tta_cod_parcela | character | x(02) | Parcela |
|
|
tta_val_movto_ap | decimal | ->>>,>>>,>>9.99 | Valor Movimento |
|
|
tta_ind_modo_pagto | character | X(10) | Modo Pagamento |
|
|
tta_cod_empresa | character | x(3) | Empresa |
|
|
ttv_rec_tit_ap | recid | >>>>>>9 | Recid Título |
|
|
ttv_num_seq_abrev | integer | >>>9 | Sequência |
|
|
tta_ind_trans_ap_abrev | character | X(04) | Transação Abreviada |
|
|
ttv_rec_compl_movto_pagto | recid | >>>>>>9 | Recid |
|
|
ttv_rec_movto_tit_ap | recid | >>>>>>9 | Recid |
|
|
ttv_rec_item_cheq_ap | recid | >>>>>>9 | Recid |
|
|
ttv_rec_item_bord_ap | recid | >>>>>>9 | Recid |
|
|
ttv_rec_item_lote_pagto | recid | >>>>>>9 | Recid |
|
|
def temp-table tt_estornar_agrupados no-undo
field ttv_num_seq as integer format ">>>,>>9" label "Seqüência" column-label "Seq"
field tta_nom_abrev as character format "x(15)" label "Nome Abreviado" column-label "Nome Abreviado"
field tta_cod_estab_pagto as character format "x(3)" label "Estab Pagto" column-label "Estab Pagto"
field tta_cod_refer as character format "x(10)" label "Referência" column-label "Referência"
field tta_dat_pagto as date format "99/99/9999" initial today label "Data Pagamento" column-label "Data Pagto"
field tta_cod_estab as character format "x(3)" label "Estabelecimento" column-label "Estab"
field tta_cod_espec_docto as character format "x(3)" label "Espécie Documento" column-label "Espécie"
field tta_cod_ser_docto as character format "x(3)" label "Série Documento" column-label "Série"
field tta_cod_tit_ap as character format "x(10)" label "Título" column-label "Título"
field tta_cod_parcela as character format "x(02)" label "Parcela" column-label "Parc"
field tta_val_movto_ap as decimal format "->>>,>>>,>>9.99" decimals 2 initial 0 label "Valor Movimento" column-label "Valor Movto"
field tta_ind_modo_pagto as character format "X(10)" label "Modo Pagamento" column-label "Modo Pagto"
field tta_cod_empresa as character format "x(3)" label "Empresa" column-label "Empresa"
field ttv_rec_tit_ap as recid format ">>>>>>9" initial ?
field ttv_num_seq_abrev as integer format ">>>9" label "Sq" column-label "Seq"
field tta_ind_trans_ap_abrev as character format "X(04)" label "Trans Abrev" column-label "Trans Abrev"
field ttv_rec_compl_movto_pagto as recid format ">>>>>>9"
field ttv_rec_movto_tit_ap as recid format ">>>>>>9"
field ttv_rec_item_cheq_ap as recid format ">>>>>>9"
field ttv_rec_item_bord_ap as recid format ">>>>>>9"
field ttv_rec_item_lote_pagto as recid format ">>>>>>9"
index tt_ind_modo
tta_ind_modo_pagto ascending
.
Tabela Temporária | Descrição | Entrada/Saída |
tt_log_erros_atualiz | Conterá as informações de erro que poderão ocorrer na execução do programa. | Saída |
(*) A partir da 5.07A o estabelecimento passa a ter cinco dígitos.
Atributo | Tipo | Formato | Descrição | Obrig. | Evol. |
tta_cod_estab | character | x(3) / x(5)* | Estabelecimento |
|
|
tta_cod_refer | character | x(10) | Referência |
|
|
tta_num_seq_refer | integer | >>>9 | Sequência |
|
|
ttv_num_mensagem | integer | >>>>,>>9 | Número |
|
|
ttv_des_msg_erro | character | x(60) | Mensagem Erro |
|
|
ttv_des_msg_ajuda | character | x(40) | Mensagem Ajuda |
|
|
ttv_ind_tip_relacto | character | X(15) | Tipo Relacionamento |
|
|
ttv_num_relacto | integer | >>>>,>>9 | Relacionamento |
|
|
def temp-table tt_log_erros_atualiz no-undo
field tta_cod_estab as character format "x(3)" label "Estabelecimento" column-label "Estab"
field tta_cod_refer as character format "x(10)" label "Referência" column-label "Referência"
field tta_num_seq_refer as integer format ">>>9" initial 0 label "Sequência" column-label "Seq"
field ttv_num_mensagem as integer format ">>>>,>>9" label "Número" column-label "Número Mensagem"
field ttv_des_msg_erro as character format "x(60)" label "Mensagem Erro" column-label "Inconsistência"
field ttv_des_msg_ajuda as character format "x(40)" label "Mensagem Ajuda" column-label "Mensagem Ajuda"
field ttv_ind_tip_relacto as character format "X(15)" label "Tipo Relacionamento" column-label "Tipo Relac"
field ttv_num_relacto as integer format ">>>>,>>9" label "Relacionamento" column-label "Relacionamento"
.
Tabela Temporária | Descrição | Entrada/Saída |
tt_log_erros_estorn_cancel_apb | Conterá as informações de erro que poderão ocorrer na execução do programa. | Saída |
(*) A partir da 5.07A o estabelecimento passa a ter cinco dígitos.
Atributo | Tipo | Formato | Descrição | Obrig. | Evol. |
tta_cod_estab | character | x(3) / x(5)* | Estabelecimento |
|
|
tta_cod_refer | character | x(10) | Referência |
|
|
tta_num_mensagem | integer | >>,>>>,>>9 | Mensagem |
|
|
ttv_des_msg_erro | character | x(60) | Mensagem Erro |
|
|
| ttv_des_msg_ajuda | character | x(40) | Mensagem Ajuda |
def temp-table tt_log_erros_estorn_cancel_apb no-undo
field tta_cod_estab as character format "x(3)" label "Estabelecimento" column-label "Estab"
field tta_cod_refer as character format "x(10)" label "Referência" column-label "Referência"
field tta_num_mensagem as integer format ">>,>>>,>>9" initial 0 label "Mensagem" column-label "Mensagem"
field ttv_des_msg_erro as character format "x(60)" label "Mensagem Erro" column-label "Inconsistência"
field ttv_des_msg_ajuda as character format "x(40)" label "Mensagem Ajuda" column-label "Mensagem Ajuda"
.
Tabela Temporária | Descrição | Entrada/Saída |
tt_estorna_tit_imptos | Conterá as informações dos títulos que poderão Ter impostos vinculados ao fornecedor, ressaltando que a mesma é de uso interno, e não poderá conter valor, na passagem de parâmetro. | Saída |
(*) A partir da 5.07A o estabelecimento passa a ter cinco dígitos.
(**) Liberado o número de documento com 16 posições e série com 5, a partir de maio/2011.
Atributo | Tipo | Formato | Descrição | Obrig. | Evol. |
ttv_cod_refer_imp | character | x(10) | Referência |
|
|
ttv_cod_refer | character | x(10) | Referência |
|
|
ttv_cod_estab_imp | character | x(3) / x(5)* | Estabelecimento Imposto |
|
|
ttv_cdn_fornecedor_imp | Integer | >>>,>>>,>>9 | Fornecedor |
|
|
ttv_cod_espec_docto_imp | character | x(3) | Espécie Documento |
|
|
ttv_cod_ser_docto_imp | character | x(3)/x(5)** | Série Documento |
|
|
ttv_cod_tit_ap_imp | character | x(10)/x(16)** | Título |
|
|
ttv_cod_parcela_imp | character | x(02) | Parcela |
|
|
ttv_val_tit_ap_imp | decimal | ->>>,>>>,>>9.99 | Valor Título |
|
|
ttv_val_sdo_tit_ap_imp | decimal | ->>>,>>>,>>9.99 | Valor Saldo |
|
|
ttv_num_id_tit_ap_imp | integer | 9999999999 | Token Tit AP |
|
|
ttv_num_mensagem | integer | >>>>,>>9 | Número |
|
|
ttv_des_mensagem | character | x(50) | Mensagem |
|
|
ttv_des_ajuda | character | x(50) | Ajuda |
|
|
ttv_cod_estab_2 | character | x(3) / x(5)* | Estabelecimento |
|
|
ttv_cod_estab | character | x(3) / x(5)* | Estabelecimento |
|
|
ttv_cdn_fornecedor | Integer | >>>,>>>,>>9 | Fornecedor |
|
|
ttv_cod_espec_docto | character | x(3) | Espécie Documento |
|
|
ttv_cod_ser_docto | character | x(3)/x(5)** | Série Documento |
|
|
ttv_cod_tit_ap | character | x(10)/x(16)** | Título Ap |
|
|
ttv_cod_parcela | character | x(02) | Parcela |
|
|
ttv_val_tit_ap | decimal | ->>,>>>,>>>,>>9.99 | Valor Título |
|
|
ttv_val_sdo_tit_ap | decimal | ->>>,>>>,>>9.99 | Valor Saldo |
|
|
ttv_num_id_tit_ap | integer | 9999999999 | Token Tit AP |
|
|
ttv_ind_trans_ap_abrev | character | X(04) | Transação |
|
|
ttv_cod_refer_2 | character | x(10) | Referência |
|
|
ttv_num_order | integer | >>>>,>>9 | Ordem |
|
|
ttv_val_tot_comprtdo | decimal | ->>>,>>>,>>9.99 | Valor Total Comprometido |
|
|
def temp-table tt_estorna_tit_imptos no-undo
field ttv_cod_refer_imp as character format "x(10)" label "Referência" column-label "Referência"
field ttv_cod_refer as character format "x(10)" label "Referência" column-label "Referência"
field ttv_cod_estab_imp as character format "x(3)" label "Estabelec. Impto." column-label "Estab. Imp."
field ttv_cdn_fornecedor_imp as Integer format ">>>,>>>,>>9" label "Fornecedor" column-label "Fornecedor"
field ttv_cod_espec_docto_imp as character format "x(3)" label "Espécie Documento" column-label "Espécie"
field ttv_cod_ser_docto_imp as character format "x(3)" label "Série Documento" column-label "Série"
field ttv_cod_tit_ap_imp as character format "x(10)" label "Título" column-label "Título"
field ttv_cod_parcela_imp as character format "x(02)" label "Parcela" column-label "Parc"
field ttv_val_tit_ap_imp as decimal format "->>>,>>>,>>9.99" decimals 2 label "Valor Título" column-label "Valor Título"
field ttv_val_sdo_tit_ap_imp as decimal format "->>>,>>>,>>9.99" decimals 2 label "Valor Saldo" column-label "Valor Saldo"
field ttv_num_id_tit_ap_imp as integer format "9999999999" label "Token Tit AP" column-label "Token Tit AP"
field ttv_num_mensagem as integer format ">>>>,>>9" label "Número" column-label "Número Mensagem"
field ttv_des_mensagem as character format "x(50)" label "Mensagem" column-label "Mensagem"
field ttv_des_ajuda as character format "x(50)" label "Ajuda" column-label "Ajuda"
field ttv_cod_estab_2 as character format "x(3)" label "Estabelecimento" column-label "Estab"
field ttv_cod_estab as character format "x(3)" label "Estabelecimento" column-label "Estabelecimento"
field ttv_cdn_fornecedor as Integer format ">>>,>>>,>>9" label "Fornecedor" column-label "Fornecedor"
field ttv_cod_espec_docto as character format "x(3)" label "Espécie Documento" column-label "Espécie"
field ttv_cod_ser_docto as character format "x(3)" label "Série Docto" column-label "Série"
field ttv_cod_tit_ap as character format "x(10)" label "Título Ap" column-label "Título Ap"
field ttv_cod_parcela as character format "x(02)" label "Parcela" column-label "Parc"
field ttv_val_tit_ap as decimal format "->>,>>>,>>>,>>9.99" decimals 2 label "Valor Título" column-label "Valor Título"
field ttv_val_sdo_tit_ap as decimal format "->>>,>>>,>>9.99" decimals 2 label "Valor Saldo" column-label "Valor Saldo"
field ttv_num_id_tit_ap as integer format "9999999999" label "Token Tit AP" column-label "Token Tit AP"
field ttv_ind_trans_ap_abrev as character format "X(04)" label "Transação" column-label "Transação"
field ttv_cod_refer_2 as character format "x(10)" label "Referência" column-label "Referência"
field ttv_num_order as integer format ">>>>,>>9" label "Ordem" column-label "Ordem"
field ttv_val_tot_comprtdo as decimal format "->>>,>>>,>>9.99" decimals 2
index tt_idimpto
ttv_cod_estab_imp ascending
ttv_cdn_fornecedor_imp ascending
ttv_cod_espec_docto_imp ascending
ttv_cod_ser_docto_imp ascending
ttv_cod_tit_ap_imp ascending
ttv_cod_parcela_imp ascending
index tt_idimpto_pgef
ttv_cod_estab ascending
ttv_cod_refer ascending
index tt_idtit_refer
ttv_cod_estab_2 ascending
ttv_cdn_fornecedor ascending
ttv_cod_espec_docto ascending
ttv_cod_ser_docto ascending
ttv_cod_tit_ap ascending
ttv_cod_parcela ascending
ttv_cod_refer_2 ascending
index tt_numsg
ttv_num_mensagem ascending
index tt_order
ttv_num_order ascending
.