/*
 * RC_LEDGERLINK.pgc - rc 모듈 서비스 RC_LEDGERLINK (one service = one file).
 * Moved verbatim from the former inline rc_svr.pgc; runs on the caller's XA
 * branch (no EXEC SQL CONNECT). Advertised by rc_svr at tpsvrinit.
 */
#include "RC_LEDGERLINK.h"

/* 25. RC_LEDGERLINK - 대사 원장 연계 기록 (dbio). */
void RC_LEDGERLINK(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    char bizdate[16];
    long pid = getl(b, T_PURCHASE_ID), net = getl(b, T_NET);
    gets_(b, T_BIZDATE, bizdate, sizeof(bizdate));
    if (rcdb_insert_ledger(pid, "RC_LINK", net, bizdate) < 0) FAIL(b);
    OK(b);
}

/* vim: set ts=4 sw=4 et smartindent: */
