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:
2026-08-11 11:00:31 +05:30
parent 8e9974b735
commit bb6d939059
13 changed files with 450 additions and 76 deletions
+4
View File
@@ -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.