feat: enrich invoice summary with session payments, consumables and discount

Port the remaining gap of tauri /files/invoice-summary into the admin
invoice summary: GET /api/v1/billing/invoices/{uuid} now includes a
'session' key (full PatientSession payload) so InvoiceSummaryModal can
render the consumables table, the itemized payments table (method,
amount, date-time, recorder) and real discount/paid/remaining figures
instead of heuristics. Invoices without a source session keep the
previous behavior (session: null).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
hamed
2026-07-16 14:38:38 +03:30
co-authored by Claude Opus 4.8
parent 3b2b22f7d6
commit 0e0e4ebe71
6 changed files with 391 additions and 15 deletions
+1 -1
View File
@@ -139,7 +139,7 @@ class BillingController extends BaseController
return $this->error(ErrorCodes::ERR_NOT_FOUND_001, 'صورتحساب یافت نشد', 404);
}
return $this->success(['data' => $invoice->toArray()]);
return $this->success(['data' => $this->invoiceService->detailWithSession($invoice)]);
}
#[Route('/api/v1/billing/invoices/{uuid}/finalize', methods: ['POST'])]