diff --git a/app/receipts.py b/app/receipts.py
index f9bde15..c340ef3 100644
--- a/app/receipts.py
+++ b/app/receipts.py
@@ -18,6 +18,9 @@ def render_receipt_html(sale, items, customer, st):
store = st.get("store_name") or "RecordGod"
addr = st.get("store_address") or ""
footer = st.get("receipt_footer") or "thanks for digging"
+ logo = st.get("store_logo") or ""
+ logo_html = (f'
-
{_e(store)}
+{logo_html}
{_e(store)}
{f'
{_e(addr)}
' if addr else ''}
{_e(sale.get('sale_number',''))} · {_e(date)} · {_e(who)}
diff --git a/app/sales_routes.py b/app/sales_routes.py
index 6695763..e898702 100644
--- a/app/sales_routes.py
+++ b/app/sales_routes.py
@@ -292,7 +292,8 @@ async def _settings(db):
"tax_type": s.get("tax_type", "exclusive"),
"store_name": s.get("store_name", "RecordGod"),
"store_address": s.get("store_address", ""),
- "receipt_footer": s.get("receipt_footer", "thanks for digging")}
+ "receipt_footer": s.get("receipt_footer", "thanks for digging"),
+ "store_logo": s.get("store_logo", "")}
@router.get("/settings")
@@ -305,7 +306,7 @@ async def save_settings(body: dict, ident=Depends(require_token), db=Depends(get
m = {"currency_symbol": body.get("currency_symbol"), "default_tax_rate": body.get("tax_rate"),
"default_discount_rate": body.get("discount_rate"), "tax_type": body.get("tax_type"),
"store_name": body.get("store_name"), "store_address": body.get("store_address"),
- "receipt_footer": body.get("receipt_footer")}
+ "receipt_footer": body.get("receipt_footer"), "store_logo": body.get("store_logo")}
for k, v in m.items():
if v is None:
continue
diff --git a/site/pos.html b/site/pos.html
index e0f6fda..701447d 100644
--- a/site/pos.html
+++ b/site/pos.html
@@ -167,6 +167,7 @@
Store name
Address
Receipt footer
+
Logo URL
Currency
Tax %
added on top included (GST incl)
@@ -353,8 +354,8 @@ async function showReceipt(id){
}
function printReceipt(){
const w=window.open('','_blank','width=380,height=680'); if(!w){ alert('allow pop-ups to print the receipt'); return; }
- w.document.write('
Receipt '+rcptHtml+'');
- w.document.close(); w.focus(); setTimeout(()=>{ w.print(); }, 250);
+ w.document.write('
Receipt '+rcptHtml+'
window.onload=function(){setTimeout(function(){window.print()},350)} ');
+ w.document.close(); w.focus();
}
function newSale(){ $('#receiptPane').style.display='none'; $('#checkout').style.display='block'; resetCust(); $('#msg').textContent=''; setMethod('cash'); $('#q').focus(); }
function emailDlg(){
@@ -433,14 +434,14 @@ async function runBulk(){
/* ── settings ── */
async function loadSettings(){
const s=await get('/sales/settings'); CUR=s.currency_symbol||'$';
- $('#setName').value=s.store_name||''; $('#setAddr').value=s.store_address||''; $('#setFooter').value=s.receipt_footer||'';
+ $('#setName').value=s.store_name||''; $('#setAddr').value=s.store_address||''; $('#setFooter').value=s.receipt_footer||''; $('#setLogo').value=s.store_logo||'';
$('#setCur').value=CUR; $('#setTax').value=s.tax_rate; $('#setDisc').value=s.discount_rate; $('#setTaxType').value=s.tax_type||'exclusive';
if(!(+$('#tax').value)) $('#tax').value=s.tax_rate||0;
render();
}
async function saveSettings(){
await post('/sales/settings',{currency_symbol:$('#setCur').value,tax_rate:$('#setTax').value,discount_rate:$('#setDisc').value,
- tax_type:$('#setTaxType').value,store_name:$('#setName').value,store_address:$('#setAddr').value,receipt_footer:$('#setFooter').value});
+ tax_type:$('#setTaxType').value,store_name:$('#setName').value,store_address:$('#setAddr').value,receipt_footer:$('#setFooter').value,store_logo:$('#setLogo').value});
CUR=$('#setCur').value||'$'; $('#setMsg').textContent='saved'; setTimeout(()=>$('#setMsg').textContent='',1500); render();
}
async function emailTest(){
diff --git a/site/receipt-logo.webp b/site/receipt-logo.webp
new file mode 100644
index 0000000..267729b
Binary files /dev/null and b/site/receipt-logo.webp differ