fix(patient): consistent debt/paid status, invoice totals, global service search
- patient_debt_rials now = session remaining (final - discount - paid), so the card status and invoice status stay consistent with is_paid even after a session is edited post-invoicing (no more '0 remaining but تکمیل پرداخت'). - InvoiceSummaryModal: remaining subtracts discount; the فاکتور status reflects actual settlement (تسویه شده / بدهکار), and the payments table shows a «مجموع پرداختیها» total row. - Add GET /api/v1/service-items (all owner services) and make the service picker searchable across all services without first choosing a section. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -122,6 +122,20 @@ class ClinicServiceController extends BaseController
|
||||
|
||||
// ── Service Items ────────────────────────────────────────────────────────
|
||||
|
||||
/** همهی سرویسهای owner در همهی بخشها — برای انتخاب/جستجوی سراسری. */
|
||||
#[Route('/api/v1/service-items', methods: ['GET'])]
|
||||
public function listAllItems(#[CurrentUser] User $user): JsonResponse
|
||||
{
|
||||
[$entityType, $entityId] = $this->resolveEntity($user);
|
||||
|
||||
$items = array_map(
|
||||
fn(ServiceItem $i) => $i->toArray(),
|
||||
$this->itemRepo->findByEntity($entityType, $entityId)
|
||||
);
|
||||
|
||||
return $this->success($items);
|
||||
}
|
||||
|
||||
#[Route('/api/v1/service-items/{sectionUuid}', methods: ['GET'])]
|
||||
public function listItems(string $sectionUuid, #[CurrentUser] User $user): JsonResponse
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user