Add manual invoice creation mode with new API & UI flow
CI/CD - ERP Distribution / Build & Deploy Frontend (pull_request) Failing after 13m13s
CI/CD - ERP Distribution / Build & Deploy Backend (pull_request) Failing after 14m28s

Introduced "ModeB" for manual invoice creation in system config. Added backend endpoints and service logic for creating invoices from confirmed Shop POs, with validation and error handling. Updated DTOs to support optional CreatedByUserId. On the frontend, added configuration card to toggle modes, a dialog for manual invoice creation, and UI updates to support the new workflow. Enables admins to choose between automatic and manual invoice creation.
This commit is contained in:
Kalana B. Thilakarathna
2026-10-20 13:38:43 +05:30
parent 5707bd4c31
commit 2de9e5e4ad
12 changed files with 344 additions and 5 deletions
+6
View File
@@ -48,6 +48,9 @@ export const shopPos = {
get: (id: string) =>
api.get<ShopPOResponse>(`/shop-pos/${id}`).then(r => r.data),
confirmedWithoutInvoice: (params?: { agentId?: string; routeId?: string; shopId?: string }) =>
api.get<ShopPOResponse[]>('/shop-pos/confirmed-without-invoice', { params }).then(r => r.data),
create: (body: CreateShopPOBody) =>
api.post<ShopPOResponse>('/shop-pos', body).then(r => r.data),
@@ -84,6 +87,9 @@ export const invoices = {
get: (id: string) =>
api.get<InvoiceResponse>(`/invoices/${id}`).then(r => r.data),
create: (shopPOId: string, createdByUserId?: string | null) =>
api.post<InvoiceResponse>('/invoices', { shopPOId, createdByUserId }).then(r => r.data),
print: (id: string, printedByUserId?: string | null) =>
api.post<InvoiceResponse>(`/invoices/${id}/print`, { printedByUserId }).then(r => r.data),