1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Urgente API - Títulos Contas a Pagar

Discussão em 'EMS , HCM e Totvs 11' iniciado por rodolfo.rcs, Outubro 29, 2021.

  1. rodolfo.rcs

    rodolfo.rcs Membro Participativo

    Pessoal, bom dia.

    Vocês sabem qual API é utilizada para gerar título no Contas a Pagar ? Se sim, poderiam postar algum exemplo.
  2. marco.luques

    marco.luques Membro Ativo

    Bom dia.

    Eu uso a apb900zf conforme o exemplo abaixo

    tem essa também a apb900gz: https://tdn.totvs.com/pages/releaseview.action?pageId=191468462

    Deve ser só diferença de versão mesmo.


    /****apb900zf***/

    EMPTY TEMP-TABLE tt_integr_apb_lote_impl.
    EMPTY TEMP-TABLE tt_integr_apb_item_lote_impl_3.
    EMPTY TEMP-TABLE tt_integr_apb_item_lote_impl.
    EMPTY TEMP-TABLE tt_integr_apb_aprop_ctbl_pend.
    EMPTY TEMP-TABLE tt_integr_apb_impto_impl_pend.
    EMPTY TEMP-TABLE tt_integr_apb_abat_antecip_vouc.
    EMPTY TEMP-TABLE tt_integr_apb_abat_prev_provis.
    EMPTY TEMP-TABLE tt_log_erros_atualiz.
    EMPTY TEMP-TABLE tt_integr_apb_aprop_relacto.
    EMPTY TEMP-TABLE tt_integr_apb_relacto_pend.

    find first emitente where emitente.cod-emitente = tt-buf.cod-emitente no-lock no-error.

    CREATE tt_integr_apb_lote_impl.
    ASSIGN tt_integr_apb_lote_impl.tta_cod_estab = c-cod-estabel
    tt_integr_apb_lote_impl.tta_cod_refer = SUBSTRING(STRING(TIME,"HH:MM:SS"),1,2) +
    SUBSTRING(STRING(TIME,"HH:MM:SS"),4,2) +
    SUBSTRING(STRING(TIME,"HH:MM:SS"),7,2) +
    STRING(MTIME - (TIME * 1000))
    tt_integr_apb_lote_impl.tta_dat_transacao = dt-trans
    tt_integr_apb_lote_impl.tta_ind_origin_tit_ap = "APB"
    tt_integr_apb_lote_impl.tta_cod_empresa = c-empresa
    tt_integr_apb_lote_impl.tta_cod_indic_econ = tt-buf.cod_indic_econ
    tt_integr_apb_lote_impl.tta_cod_espec_docto = "PR".

    //rotina para criar o título.

    CREATE tt_integr_apb_item_lote_impl_3.
    ASSIGN tt_integr_apb_item_lote_impl_3.ttv_rec_integr_apb_lote_impl = RECID(tt_integr_apb_lote_impl)
    tt_integr_apb_item_lote_impl_3.ttv_rec_integr_apb_item_lote = RECID(tt_integr_apb_item_lote_impl_3)
    tt_integr_apb_item_lote_impl_3.tta_num_seq_refer = 10
    tt_integr_apb_item_lote_impl_3.tta_cdn_fornecedor = tt-buf.cod-emitente
    tt_integr_apb_item_lote_impl_3.tta_cod_tit_ap = cd-embarque
    tt_integr_apb_item_lote_impl_3.tta_cod_parcela = tt-buf.cod_parcela
    tt_integr_apb_item_lote_impl_3.tta_dat_emis_docto = today
    tt_integr_apb_item_lote_impl_3.tta_dat_vencto_tit_ap = tt-buf.dat_prev_pagto
    tt_integr_apb_item_lote_impl_3.tta_dat_prev_pagto = tt-buf.dat_prev_pagto
    tt_integr_apb_item_lote_impl_3.tta_cod_indic_econ = tt-buf.cod_indic_econ
    tt_integr_apb_item_lote_impl_3.tta_val_tit_ap = tt-buf.valor
    tt_integr_apb_item_lote_impl_3.tta_cod_portador = tt-buf.cod_portador
    tt_integr_apb_item_lote_impl_3.tta_des_text_histor = tt-buf.despesa
    tt_integr_apb_item_lote_impl_3.tta_val_cotac_indic_econ = tt-buf.moeda.

    CREATE tt_integr_apb_aprop_ctbl_pend.
    ASSIGN tt_integr_apb_aprop_ctbl_pend.ttv_rec_integr_apb_item_lote = RECID(tt_integr_apb_item_lote_impl_3)
    tt_integr_apb_aprop_ctbl_pend.tta_cod_tip_fluxo_financ = "402"
    tt_integr_apb_aprop_ctbl_pend.tta_cod_unid_negoc = "100"
    tt_integr_apb_aprop_ctbl_pend.tta_val_aprop_ctbl = tt_integr_apb_item_lote_impl_3.tta_val_tit_ap.

    RUN prgfin/apb/apb900zf.py ( INPUT 4,
    INPUT "",
    INPUT-OUTPUT TABLE tt_integr_apb_item_lote_impl_3 ).

    FIND FIRST tt_log_erros_atualiz NO-LOCK NO-ERROR.
    IF AVAIL tt_log_erros_atualiz THEN DO:
    RUN prgint/ufn/ufn901za.py ( INPUT 1 ). // prg_api_mostra_log_erros
    END.
  3. rodolfo.rcs

    rodolfo.rcs Membro Participativo

    Marcos, bom dia.

    Funcionou, porém preciso que não integre automaticamente. Fique na digitação do lote para gerar as pendências de aprovação do MLA.

    Procurei algum parametro na API mas não encontrei.
  4. marco.luques

    marco.luques Membro Ativo

    Bom dia.

    Nao utilizo ainda o MLA, mas recomendo voce criar uma pré duplicata em cadastro especifico, para ser aprovada pelo MLA, e somente depois da aprovação criar a duplicata no contas a pagar.

Compartilhe esta Página