implemented the sales and revenue report
This commit is contained in:
@@ -784,6 +784,65 @@ export async function getMasterCatalog(opts: {
|
||||
);
|
||||
}
|
||||
|
||||
export interface CreateProductLocationInput {
|
||||
tenantid: number;
|
||||
locationid: number;
|
||||
productid: number;
|
||||
qty: number;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
/** POST /products/createproductlocation — Add a product to a store catalogue / inventory. */
|
||||
export async function createProductLocation(input: CreateProductLocationInput): Promise<Row> {
|
||||
return fiestaSend<Row>('products/createproductlocation', 'POST', input);
|
||||
}
|
||||
|
||||
export interface StockRequestInput {
|
||||
tenantid: number;
|
||||
locationid: number;
|
||||
productid: number;
|
||||
qty: number;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
/** POST /products/createstockrequest — Store user requests stock. */
|
||||
export async function createStockRequest(input: StockRequestInput): Promise<Row> {
|
||||
return fiestaSend<Row>('products/createstockrequest', 'POST', input);
|
||||
}
|
||||
|
||||
/** /products/getstockrequests?tenantid=&locationid=&status=&pageno=&pagesize= —
|
||||
* Fetch pending/approved stock requests. */
|
||||
export async function getStockRequests(opts: {
|
||||
tenantid: number;
|
||||
locationid?: number;
|
||||
status?: string;
|
||||
pageno?: number;
|
||||
pagesize?: number;
|
||||
}): Promise<Row[]> {
|
||||
return toRows(
|
||||
await fiestaGet('products/getstockrequests', {
|
||||
tenantid: opts.tenantid,
|
||||
locationid: opts.locationid,
|
||||
status: opts.status ?? '',
|
||||
pageno: opts.pageno ?? 1,
|
||||
pagesize: opts.pagesize ?? 50,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export interface UpdateStockRequestInput {
|
||||
requestid?: number;
|
||||
tenantid?: number;
|
||||
locationid?: number;
|
||||
productid?: number;
|
||||
status: string;
|
||||
}
|
||||
|
||||
/** PUT /products/updatestockrequest — Admin approves or rejects a stock request. */
|
||||
export async function updateStockRequest(input: UpdateStockRequestInput): Promise<Row> {
|
||||
return fiestaSend<Row>('products/updatestockrequest', 'PUT', input);
|
||||
}
|
||||
|
||||
/** /products/getproductcategories — global product categories. */
|
||||
export async function getProductCategories(): Promise<Row[]> {
|
||||
return toRows(await fiestaGet('products/getproductcategories', {}));
|
||||
|
||||
Reference in New Issue
Block a user