feat(grn): add update functionality for draft GRNs and support document-level discounts
- Implemented Update method in GrnsController to allow editing of draft GRNs. - Enhanced CreateGrnRequest to include an optional totalDiscount property. - Updated GrnService to handle GRN updates, including validation and line item processing. - Modified NewGrnPage to support editing existing GRNs and applying document-level discounts. - Improved UI in NewItemPage and GrnDetailPage for better user experience. - Added search functionality to Select component for improved item selection.
This commit is contained in:
@@ -43,6 +43,10 @@ export const grnsApi = {
|
||||
return apiRequest<Grn>("/grns", { method: "POST", body: request })
|
||||
},
|
||||
|
||||
update(grnId: number, request: CreateGrnRequest): Promise<Grn> {
|
||||
return apiRequest<Grn>(`/grns/${grnId}`, { method: "PUT", body: request })
|
||||
},
|
||||
|
||||
/**
|
||||
* Posts the receipt. Pass a stable idempotencyKey per detail-page session so a retry
|
||||
* cannot double-post stock — unlike the old mock, the server genuinely dedupes on it.
|
||||
|
||||
Reference in New Issue
Block a user