fix: correct Epicor stored procedure names and parameter mappings
Update inventory service to use actual PascalCase SP names (e.g. PortalWorkInProgressInventorySummaryV6) and correct parameter names (Customer, SUBUSER) matching the Epicor database. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3cd5b05c46
commit
90ad1925e7
1 changed files with 18 additions and 21 deletions
|
|
@ -54,13 +54,12 @@ export async function getWorkInProgressSummary(
|
|||
dbName: string,
|
||||
sub: number
|
||||
): Promise<InventorySummaryRow[]> {
|
||||
// Call portal_WorkInProgressInventorySummaryV6 stored procedure
|
||||
const result = await execStoredProc<InventorySummaryRow[]>(
|
||||
'portal_WorkInProgressInventorySummaryV6',
|
||||
'PortalWorkInProgressInventorySummaryV6',
|
||||
{
|
||||
CustID: custId,
|
||||
Customer: custId,
|
||||
DBNAME: dbName,
|
||||
sub,
|
||||
SUBUSER: sub,
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -76,11 +75,11 @@ export async function getFinishedGoodsSummary(
|
|||
sub: number
|
||||
): Promise<InventorySummaryRow[]> {
|
||||
const result = await execStoredProc<InventorySummaryRow[]>(
|
||||
'portal_FinishedGoodsInventorySummaryV6',
|
||||
'PortalFinishedGoodsInventorySummaryV6',
|
||||
{
|
||||
CustID: custId,
|
||||
Customer: custId,
|
||||
DBNAME: dbName,
|
||||
sub,
|
||||
SUBUSER: sub,
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -96,11 +95,11 @@ export async function getProcessedOtherSummary(
|
|||
sub: number
|
||||
): Promise<InventorySummaryRow[]> {
|
||||
const result = await execStoredProc<InventorySummaryRow[]>(
|
||||
'portal_ProcessedOtherInventorySummaryV6',
|
||||
'PortalProcessedOtherInventorySummaryV6',
|
||||
{
|
||||
CustID: custId,
|
||||
Customer: custId,
|
||||
DBNAME: dbName,
|
||||
sub,
|
||||
SUBUSER: sub,
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -121,9 +120,9 @@ export async function getUnprocessedSummary(
|
|||
}
|
||||
|
||||
const result = await execStoredProc<InventorySummaryRow[]>(
|
||||
'portal_UnprocessedInventorySummary',
|
||||
'PortalUnprocessedInventorySummary',
|
||||
{
|
||||
CustID: custId,
|
||||
Customer: custId,
|
||||
DBNAME: dbName,
|
||||
}
|
||||
);
|
||||
|
|
@ -144,9 +143,9 @@ export async function getUnprocessedRRSummary(
|
|||
}
|
||||
|
||||
const result = await execStoredProc<InventorySummaryRow[]>(
|
||||
'portal_UnprocessedRRInventorySummary',
|
||||
'PortalUnprocessedInventoryRejectsAndReturnsSummary',
|
||||
{
|
||||
CustID: custId,
|
||||
Customer: custId,
|
||||
DBNAME: dbName,
|
||||
}
|
||||
);
|
||||
|
|
@ -167,9 +166,9 @@ export async function getProcessedRRSummary(
|
|||
}
|
||||
|
||||
const result = await execStoredProc<InventorySummaryRow[]>(
|
||||
'portal_ProcessedRRInventorySummary',
|
||||
'PortalProcessedInventoryRejectsAndReturnsSummary',
|
||||
{
|
||||
CustID: custId,
|
||||
Customer: custId,
|
||||
DBNAME: dbName,
|
||||
}
|
||||
);
|
||||
|
|
@ -237,12 +236,10 @@ export async function getInventoryDetails(
|
|||
DBNAME: dbName,
|
||||
};
|
||||
|
||||
// V6 procedures use CUSTID (uppercase), non-V6 use custID
|
||||
// V6 procedures use Customer, non-V6 also use Customer
|
||||
params.Customer = custId;
|
||||
if (procConfig.isV6) {
|
||||
params.CUSTID = custId;
|
||||
params.sub = sub;
|
||||
} else {
|
||||
params.custID = custId;
|
||||
params.SUBUSER = sub;
|
||||
}
|
||||
|
||||
// Add filters if provided (only for filtered variant)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue