Spaces:
Sleeping
Sleeping
Update the UI and also work on shade and description
Browse files- __pycache__/main.cpython-313.pyc +0 -0
- api/__init__.py +1 -0
- api/__pycache__/__init__.cpython-313.pyc +0 -0
- core/__init__.py +1 -0
- core/__pycache__/__init__.cpython-313.pyc +0 -0
- frontend/Sajid Invoice.pdf +0 -0
- frontend/css/style.css +1 -0
- frontend/img/logo.jpeg +0 -0
- frontend/index.html +26 -6
- frontend/js/app.js +2 -2
- frontend/js/data.js +11 -22
- frontend/js/rows.js +3 -3
- main.py +8 -3
- models/__init__.py +1 -0
- models/__pycache__/__init__.cpython-313.pyc +0 -0
__pycache__/main.cpython-313.pyc
CHANGED
|
Binary files a/__pycache__/main.cpython-313.pyc and b/__pycache__/main.cpython-313.pyc differ
|
|
|
api/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# Package marker for local api modules.
|
api/__pycache__/__init__.cpython-313.pyc
ADDED
|
Binary file (170 Bytes). View file
|
|
|
core/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# Package marker for local core modules.
|
core/__pycache__/__init__.cpython-313.pyc
ADDED
|
Binary file (171 Bytes). View file
|
|
|
frontend/Sajid Invoice.pdf
DELETED
|
Binary file (57.3 kB)
|
|
|
frontend/css/style.css
CHANGED
|
@@ -55,6 +55,7 @@ body {
|
|
| 55 |
}
|
| 56 |
.topbar-brand { display: flex; align-items: center; gap: 12px; }
|
| 57 |
.topbar-icon { width: 38px; height: 38px; background: rgba(255,255,255,0.15); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; border: 1px solid rgba(255,255,255,0.25); }
|
|
|
|
| 58 |
.topbar-name { font-family: 'Lora', serif; font-size: 1.12rem; font-weight: 700; color: #fff; letter-spacing: 0.01em; }
|
| 59 |
.topbar-sub { font-size: 0.7rem; color: rgba(255,255,255,0.65); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 1px; }
|
| 60 |
.topbar-tabs { display: flex; gap: 4px; }
|
|
|
|
| 55 |
}
|
| 56 |
.topbar-brand { display: flex; align-items: center; gap: 12px; }
|
| 57 |
.topbar-icon { width: 38px; height: 38px; background: rgba(255,255,255,0.15); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; border: 1px solid rgba(255,255,255,0.25); }
|
| 58 |
+
.topbar-logo { height: 38px; width: auto; max-width: 160px; background: #fff; padding: 4px 6px; border-radius: 8px; object-fit: contain; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
|
| 59 |
.topbar-name { font-family: 'Lora', serif; font-size: 1.12rem; font-weight: 700; color: #fff; letter-spacing: 0.01em; }
|
| 60 |
.topbar-sub { font-size: 0.7rem; color: rgba(255,255,255,0.65); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 1px; }
|
| 61 |
.topbar-tabs { display: flex; gap: 4px; }
|
frontend/img/logo.jpeg
ADDED
|
frontend/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
| 11 |
|
| 12 |
<div class="topbar">
|
| 13 |
<div class="topbar-brand">
|
| 14 |
-
<
|
| 15 |
<div>
|
| 16 |
<div class="topbar-name">SmiloCAD Dental Laboratory</div>
|
| 17 |
<div class="topbar-sub">Invoice Management System</div>
|
|
@@ -65,9 +65,29 @@
|
|
| 65 |
</div>
|
| 66 |
</div>
|
| 67 |
|
| 68 |
-
<div class="form-
|
| 69 |
-
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
</div>
|
| 72 |
</div>
|
| 73 |
|
|
@@ -157,8 +177,8 @@
|
|
| 157 |
</div>
|
| 158 |
<div class="print-info-right">
|
| 159 |
<div class="print-info-title">Bill To</div>
|
| 160 |
-
<div class="print-info-row"><span class="k">
|
| 161 |
-
<div class="print-info-row"><span class="k">
|
| 162 |
<div class="print-info-row"><span class="k">Address</span> <span class="v" id="print-address">Address</span></div>
|
| 163 |
<div class="print-info-row"><span class="k">Phone</span> <span class="v" id="print-phone">Phone</span></div>
|
| 164 |
<div class="print-info-row"><span class="k">Email</span> <span class="v" id="print-email">Email</span></div>
|
|
|
|
| 11 |
|
| 12 |
<div class="topbar">
|
| 13 |
<div class="topbar-brand">
|
| 14 |
+
<img class="topbar-logo" src="/img/logo.jpeg" alt="SmiloCAD Dental Lab logo" width="140" height="38">
|
| 15 |
<div>
|
| 16 |
<div class="topbar-name">SmiloCAD Dental Laboratory</div>
|
| 17 |
<div class="topbar-sub">Invoice Management System</div>
|
|
|
|
| 65 |
</div>
|
| 66 |
</div>
|
| 67 |
|
| 68 |
+
<div class="form-grid form-grid-3" style="margin-top:15px">
|
| 69 |
+
<div class="form-group">
|
| 70 |
+
<label>Shade</label>
|
| 71 |
+
<select class="form-control" id="shade">
|
| 72 |
+
<option value="">Select shade</option>
|
| 73 |
+
<option value="A1">A1</option>
|
| 74 |
+
<option value="A2">A2</option>
|
| 75 |
+
<option value="A3">A3</option>
|
| 76 |
+
<option value="A3.5">A3.5</option>
|
| 77 |
+
<option value="A4">A4</option>
|
| 78 |
+
<option value="B1">B1</option>
|
| 79 |
+
<option value="B2">B2</option>
|
| 80 |
+
<option value="B3">B3</option>
|
| 81 |
+
<option value="B4">B4</option>
|
| 82 |
+
<option value="C1">C1</option>
|
| 83 |
+
<option value="C2">C2</option>
|
| 84 |
+
<option value="C3">C3</option>
|
| 85 |
+
<option value="C4">C4</option>
|
| 86 |
+
<option value="D2">D2</option>
|
| 87 |
+
<option value="D3">D3</option>
|
| 88 |
+
<option value="D4">D4</option>
|
| 89 |
+
</select>
|
| 90 |
+
</div>
|
| 91 |
</div>
|
| 92 |
</div>
|
| 93 |
|
|
|
|
| 177 |
</div>
|
| 178 |
<div class="print-info-right">
|
| 179 |
<div class="print-info-title">Bill To</div>
|
| 180 |
+
<div class="print-info-row"><span class="k">Doctor Name</span> <span class="v" id="print-client-name">Client Name</span></div>
|
| 181 |
+
<div class="print-info-row"><span class="k">Clinic Name</span> <span class="v" id="print-company-name">Company Name</span></div>
|
| 182 |
<div class="print-info-row"><span class="k">Address</span> <span class="v" id="print-address">Address</span></div>
|
| 183 |
<div class="print-info-row"><span class="k">Phone</span> <span class="v" id="print-phone">Phone</span></div>
|
| 184 |
<div class="print-info-row"><span class="k">Email</span> <span class="v" id="print-email">Email</span></div>
|
frontend/js/app.js
CHANGED
|
@@ -103,8 +103,8 @@ var App = (function() {
|
|
| 103 |
|
| 104 |
var clientEl = document.getElementById("print-client-name");
|
| 105 |
var companyEl = document.getElementById("print-company-name");
|
| 106 |
-
if (clientEl) clientEl.textContent = doctor || "
|
| 107 |
-
if (companyEl) companyEl.textContent = clinic || "
|
| 108 |
|
| 109 |
var rowsEl = document.getElementById("print-rows");
|
| 110 |
if (rowsEl) rowsEl.innerHTML = "";
|
|
|
|
| 103 |
|
| 104 |
var clientEl = document.getElementById("print-client-name");
|
| 105 |
var companyEl = document.getElementById("print-company-name");
|
| 106 |
+
if (clientEl) clientEl.textContent = doctor || "Doctor Name";
|
| 107 |
+
if (companyEl) companyEl.textContent = clinic || "Clinic Name";
|
| 108 |
|
| 109 |
var rowsEl = document.getElementById("print-rows");
|
| 110 |
if (rowsEl) rowsEl.innerHTML = "";
|
frontend/js/data.js
CHANGED
|
@@ -10,33 +10,22 @@ const LAB = {
|
|
| 10 |
};
|
| 11 |
|
| 12 |
const SERVICES = [
|
|
|
|
| 13 |
"Zirconium Crown",
|
| 14 |
-
"
|
| 15 |
"PFM Crown",
|
| 16 |
-
"PFM
|
| 17 |
-
"
|
| 18 |
-
"Zirconium Bridge + I Bar",
|
| 19 |
-
"Zirconium Bridge",
|
| 20 |
-
"Full Zirconium",
|
| 21 |
-
"E-Max Crown",
|
| 22 |
-
"E-Max Veneer",
|
| 23 |
-
"Metal Crown",
|
| 24 |
-
"Acrylic Crown",
|
| 25 |
-
"Implant Crown",
|
| 26 |
-
"Implant Abutment",
|
| 27 |
-
"Complete Denture",
|
| 28 |
-
"Partial Denture (RPD)",
|
| 29 |
-
"Immediate Denture",
|
| 30 |
"Night Guard",
|
| 31 |
"Retainer",
|
| 32 |
-
"
|
| 33 |
-
"
|
| 34 |
-
"
|
| 35 |
-
"
|
| 36 |
-
"
|
| 37 |
-
"Occlusal Splint",
|
| 38 |
-
"Other",
|
| 39 |
];
|
|
|
|
|
|
|
| 40 |
|
| 41 |
const DOCTORS = [
|
| 42 |
"Dr. Haroon Shah",
|
|
|
|
| 10 |
};
|
| 11 |
|
| 12 |
const SERVICES = [
|
| 13 |
+
"Veneer",
|
| 14 |
"Zirconium Crown",
|
| 15 |
+
"Zirconium Implant",
|
| 16 |
"PFM Crown",
|
| 17 |
+
"PFM Implant",
|
| 18 |
+
"D-sign Porcelain",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
"Night Guard",
|
| 20 |
"Retainer",
|
| 21 |
+
"Bleaching Tary",
|
| 22 |
+
"Soft Denture",
|
| 23 |
+
"EMAX Veneer",
|
| 24 |
+
"EMAX Crown",
|
| 25 |
+
"Zirconium bridge + I bar"
|
|
|
|
|
|
|
| 26 |
];
|
| 27 |
+
// Expose globally so rows.js can always access it
|
| 28 |
+
window.SERVICES = SERVICES;
|
| 29 |
|
| 30 |
const DOCTORS = [
|
| 31 |
"Dr. Haroon Shah",
|
frontend/js/rows.js
CHANGED
|
@@ -9,8 +9,8 @@ var Rows = (function() {
|
|
| 9 |
/* Build the <select> options HTML */
|
| 10 |
function _serviceOptions(selected) {
|
| 11 |
var html = '<option value="">— Select Service —</option>';
|
| 12 |
-
|
| 13 |
-
|
| 14 |
html += '<option' + (s === selected ? ' selected' : '') + '>' + s + '</option>';
|
| 15 |
});
|
| 16 |
return html;
|
|
@@ -150,4 +150,4 @@ var Rows = (function() {
|
|
| 150 |
|
| 151 |
return { add: add, remove: remove, reset: reset, load: load, collect: collect, subtotal: subtotal, update: update };
|
| 152 |
|
| 153 |
-
})();
|
|
|
|
| 9 |
/* Build the <select> options HTML */
|
| 10 |
function _serviceOptions(selected) {
|
| 11 |
var html = '<option value="">— Select Service —</option>';
|
| 12 |
+
var services = (typeof SERVICES !== "undefined" && SERVICES) ? SERVICES : [];
|
| 13 |
+
services.forEach(function(s) {
|
| 14 |
html += '<option' + (s === selected ? ' selected' : '') + '>' + s + '</option>';
|
| 15 |
});
|
| 16 |
return html;
|
|
|
|
| 150 |
|
| 151 |
return { add: add, remove: remove, reset: reset, load: load, collect: collect, subtotal: subtotal, update: update };
|
| 152 |
|
| 153 |
+
})();
|
main.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
from fastapi import FastAPI
|
| 3 |
from fastapi.staticfiles import StaticFiles
|
| 4 |
from fastapi.responses import FileResponse
|
|
@@ -9,13 +10,17 @@ from api.invoices import router as invoice_router
|
|
| 9 |
Base.metadata.create_all(bind=engine)
|
| 10 |
|
| 11 |
app = FastAPI(title="SmiloCAD Invoice API")
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# 1. Route to serve the index.html
|
| 16 |
@app.get("/")
|
| 17 |
async def serve_index():
|
| 18 |
-
return FileResponse("frontend/index.html")
|
| 19 |
|
| 20 |
# 2. Mount the CSS and JS folders so the HTML can find them
|
| 21 |
# This matches your folder names: frontend/css and frontend/js
|
|
|
|
| 1 |
import os
|
| 2 |
+
from pathlib import Path
|
| 3 |
from fastapi import FastAPI
|
| 4 |
from fastapi.staticfiles import StaticFiles
|
| 5 |
from fastapi.responses import FileResponse
|
|
|
|
| 10 |
Base.metadata.create_all(bind=engine)
|
| 11 |
|
| 12 |
app = FastAPI(title="SmiloCAD Invoice API")
|
| 13 |
+
|
| 14 |
+
# Always resolve static paths relative to this file (works regardless of CWD)
|
| 15 |
+
BASE_DIR = Path(__file__).resolve().parent
|
| 16 |
+
app.mount("/js", StaticFiles(directory=BASE_DIR / "frontend" / "js"), name="js")
|
| 17 |
+
app.mount("/css", StaticFiles(directory=BASE_DIR / "frontend" / "css"), name="css")
|
| 18 |
+
app.mount("/img", StaticFiles(directory=BASE_DIR / "frontend" / "img"), name="img")
|
| 19 |
|
| 20 |
# 1. Route to serve the index.html
|
| 21 |
@app.get("/")
|
| 22 |
async def serve_index():
|
| 23 |
+
return FileResponse(BASE_DIR / "frontend" / "index.html")
|
| 24 |
|
| 25 |
# 2. Mount the CSS and JS folders so the HTML can find them
|
| 26 |
# This matches your folder names: frontend/css and frontend/js
|
models/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# Package marker for local models to avoid name conflicts with site-packages.
|
models/__pycache__/__init__.cpython-313.pyc
ADDED
|
Binary file (173 Bytes). View file
|
|
|