AhmadYarAI commited on
Commit
67d26ff
·
1 Parent(s): 58f5546

Update the notes

Browse files
Files changed (1) hide show
  1. api/invoices.py +4 -3
api/invoices.py CHANGED
@@ -20,7 +20,7 @@ class InvoiceCreate(BaseModel):
20
  patient_name: str
21
  shade: str
22
  received_amount: float
23
- notes: Optional[str] = ""
24
  items: List[ItemCreate]
25
 
26
  @router.post("/")
@@ -37,7 +37,8 @@ def create_invoice(data: InvoiceCreate, db: Session = Depends(get_db)):
37
  shade=data.shade,
38
  total_amount=total,
39
  received_amount=data.received_amount,
40
- remaining_balance=total - data.received_amount
 
41
  )
42
 
43
  db.add(new_invoice)
@@ -60,7 +61,7 @@ def create_invoice(data: InvoiceCreate, db: Session = Depends(get_db)):
60
  # Return the real ID and the formatted INV number
61
  return {
62
  "id": new_invoice.id,
63
- "invoice_no": new_invoice.invoice_number,
64
  "status": "success"
65
  }
66
 
 
20
  patient_name: str
21
  shade: str
22
  received_amount: float
23
+ notes: Optional[str] = None
24
  items: List[ItemCreate]
25
 
26
  @router.post("/")
 
37
  shade=data.shade,
38
  total_amount=total,
39
  received_amount=data.received_amount,
40
+ remaining_balance=total - data.received_amount,
41
+ notes= data.notes
42
  )
43
 
44
  db.add(new_invoice)
 
61
  # Return the real ID and the formatted INV number
62
  return {
63
  "id": new_invoice.id,
64
+ "invoice_no": new_invoice.invoice_no, # Use the column name 'invoice_no'
65
  "status": "success"
66
  }
67