Fixed recepit lenght

This commit is contained in:
2026-03-11 16:52:17 -03:00
parent 77fc5920a2
commit 1a048a0e07
2 changed files with 35 additions and 10 deletions

View File

@@ -6,12 +6,12 @@ def upgrade_db():
try:
with sqlite3.connect(DB_FILE) as conn:
# Add stock column
conn.execute("ALTER TABLE products ADD COLUMN stock REAL DEFAULT 0")
print("Successfully added 'stock' column.")
# conn.execute("ALTER TABLE products ADD COLUMN stock REAL DEFAULT 0")
# print("Successfully added 'stock' column.")
# App.py also expects unit_type, adding it to prevent future headaches
conn.execute("ALTER TABLE products ADD COLUMN unit_type TEXT DEFAULT 'unit'")
print("Successfully added 'unit_type' column.")
# # App.py also expects unit_type, adding it to prevent future headaches
# conn.execute("ALTER TABLE products ADD COLUMN unit_type TEXT DEFAULT 'unit'")
# print("Successfully added 'unit_type' column.")
conn.execute("ALTER TABLE dicom ADD COLUMN image_url TEXT;")
print("Successfully added 'image_url' column.")

View File

@@ -49,14 +49,39 @@
<div id="receipt-print-zone{{ id_suffix }}" class="d-none d-print-block">
<style>
@media print {
body * { visibility: hidden; }
#receipt-print-zone{{ id_suffix }}, #receipt-print-zone{{ id_suffix }} * { visibility: visible; }
/* Tell the browser this is a continuous 80mm thermal roll */
@page {
margin: 0;
size: 80mm auto;
}
/* Nuke the rest of the layout from the document flow so it takes up 0 height */
nav, .discord-card, .modal, .row {
display: none !important;
}
body * {
visibility: hidden;
}
/* Resurrect the receipt and put it in the top left corner */
#receipt-print-zone{{ id_suffix }}, #receipt-print-zone{{ id_suffix }} * {
visibility: visible;
}
#receipt-print-zone{{ id_suffix }} {
position: absolute; left: 0; top: 0; width: 80mm;
padding: 5mm; margin: 0; display: block !important;
font-family: 'Courier New', Courier, monospace; font-size: 10px; color: #000;
position: absolute;
left: 0;
top: 0;
width: 80mm;
padding: 2mm 5mm;
margin: 0;
display: block !important;
font-family: 'Courier New', Courier, monospace;
font-size: 10px;
color: #000;
}
}
.receipt-table { width: 100%; border-collapse: collapse; font-family: monospace; font-size: 12px; }
.receipt-header { text-align: center; margin-bottom: 10px; border-bottom: 1px dashed #000; padding-bottom: 5px; }
.receipt-total-row { border-top: 1px dashed #000; margin-top: 5px; padding-top: 5px; font-weight: bold; }