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

void ACQ_XFERLINK(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    char bizdate[16];
    long pid = getl(b, T_PURCHASE_ID), amt = getl(b, T_AMOUNT);
    gets_(b, T_BIZDATE, bizdate, sizeof(bizdate));
    if (acdb_insert_ledger(pid, "XFER", amt, bizdate) < 0) FAIL(b);
    OK(b);
}
