diff --git a/src/lib/ops.ts b/src/lib/ops.ts index a76d381..4e6ad76 100644 --- a/src/lib/ops.ts +++ b/src/lib/ops.ts @@ -486,7 +486,7 @@ export async function computeDefaults( const r = await callNS(ctx, "ZUNIEFI_4003", PROG_LEGACY, { BUDAT: budat, BLDAT: bldat, BLART: "KE", LIFNR: user.pernr, LIFNR_TXT: user.pernrName, - BUPLA: "K100", GSBER: "K200", MWSKZ: "T0", + BUPLA: user.bupla ?? "K100", GSBER: user.gsber ?? "K200", MWSKZ: "T0", AKONT: "21020103", ZTERM: "V123", WRBTR: String(amountWon), WRBTR_SLASH: "", WMWST: "0", BVTYP: "0001", ZFBDT: "", ZFBDT_SLASH: "", @@ -529,7 +529,7 @@ export async function createTempDoc( const commonFi = { BUDAT: budat, BLDAT: bldat, BLART: "KE", LIFNR: user.pernr, LIFNR_TXT: user.pernrName, - BUPLA: "K100", GSBER: "K200", MWSKZ: "T0", + BUPLA: user.bupla ?? "K100", GSBER: user.gsber ?? "K200", MWSKZ: "T0", AKONT: "21020103", ZTERM: "V123", WRBTR: String(amountWon), WRBTR_SLASH: "", WMWST: "0", BVTYP: "0001", ZFBDT: zfbdt, ZFBDT_SLASH: "", @@ -929,7 +929,7 @@ export async function createCorpCardVoucher( CHARGETOTAL: card.AMOUNT, CHARGETOTAL_Slash: "", WMWST_READ_ONLY: card.TAX, BUDAT: p.budat, BLDAT: bldat, BLART: "KE", - BUPLA: "K100", GSBER: "K200", + BUPLA: user.bupla ?? "K100", GSBER: user.gsber ?? "K200", WRBTR_SLASH: "", WMWST: card.TAX, ZFBDT_SLASH: "", EMPTY: "", SGTXT: p.sgtxt, diff --git a/src/types/index.ts b/src/types/index.ts index bcc305b..c3d292f 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -14,6 +14,8 @@ export interface UserProfile { kostlText: string; // "Device Engineering" wfDept: string; // Department code wfDeptText: string; // "Service Engineering" + gsber?: string; // Business Area, e.g. "K300" (SAP requires cost-center-consistent value) + bupla?: string; // Business Place, e.g. "K100" } export interface ReimbursementItem {