{% extends 'base.html' %} {%- set HD = (che_do == 'hoa_don') -%} {% block title %}{{ 'Mẫu hóa đơn' if HD else 'Mẫu giấy đảm bảo' }} — {{ brand.ten_app }}{% endblock %} {% block page_subtitle %}{{ 'Mẫu hóa đơn bán hàng của cửa hàng' if HD else 'Mẫu giấy đảm bảo của cửa hàng' }}{% endblock %} {% block extra_style %} .mg-the { background:#fff; border-radius:16px; box-shadow:0 1px 3px rgba(0,0,0,.08); padding:14px 16px; } .mg-tieu { font-weight:800; color:#1f2937; margin-bottom:6px; } .mg-goi { font-size:12px; color:#6b7280; } .mg-nut { font-weight:700; font-size:14px; padding:9px 14px; border-radius:12px; border:1px solid #d1d5db; background:#f9fafb; color:#111827; cursor:pointer; } .mg-nut:disabled { opacity:.5; cursor:not-allowed; } .mg-nut-chinh { background:#8b0000; border-color:#8b0000; color:#fff; } .mg-nut-vang { background:linear-gradient(135deg,#d4af37,#f5d76e); border-color:#c9a227; color:#3b2f00; } .mg-nut-do { color:#b91c1c; border-color:#fecaca; background:#fef2f2; } .mg-o-nhap { font-size:16px; padding:7px 10px; border:1px solid #d1d5db; border-radius:10px; background:#fff; } .mg-luoi { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; } .mg-luoi > div { min-width:0; } .mg-the select, .mg-the input { max-width:100%; } @media (min-width: 1024px) { .mg-luoi { grid-template-columns: 340px minmax(0,1fr); } } #mg-xem-ngoai { position:relative; width:100%; overflow:hidden; background:#e5e7eb; border-radius:12px; } #mg-xem { position:absolute; left:0; top:0; transform-origin:0 0; } #mg-xem .mg-trang { box-shadow:0 2px 10px rgba(0,0,0,.25); } #mg-xem .mg-o { cursor:move; outline:1px dashed rgba(37,99,235,.55); touch-action:none; min-height:1em; } #mg-xem .mg-o.mg-chon { outline:2px solid #2563eb; background:rgba(37,99,235,.08); } #mg-xem .mg-o.mg-loi { outline:2px solid #dc2626; } .mg-nhan-o { position:absolute; left:-1px; bottom:100%; font:700 9px/1.4 system-ui,Arial,sans-serif; background:#2563eb; color:#fff; padding:0 4px; border-radius:3px 3px 0 0; white-space:nowrap; pointer-events:none; } .mg-tay { position:absolute; right:-6px; top:50%; width:12px; height:22px; margin-top:-11px; background:#2563eb; border-radius:4px; cursor:ew-resize; touch-action:none; } .mg-ds-truong button { display:flex; width:100%; justify-content:space-between; align-items:center; text-align:left; padding:7px 10px; border-radius:10px; border:1px solid #e5e7eb; background:#fff; font-size:14px; cursor:pointer; margin-bottom:4px; } .mg-ds-truong button.dang-chon { border-color:#2563eb; background:#eff6ff; font-weight:700; } .mg-dong-ct { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:6px; font-size:14px; } .mg-dong-ct label { min-width:92px; color:#4b5563; font-size:13px; } .mg-msg-ok { color:#047857; font-weight:700; } .mg-msg-loi { color:#b91c1c; font-weight:700; } .mg-tay-vung { position:absolute; left:50%; bottom:-7px; width:46px; height:14px; margin-left:-23px; background:#dc2626; border-radius:6px; cursor:ns-resize; touch-action:none; } .mg-tay-vung::after { content:'⇕ đáy vùng hàng'; position:absolute; left:52px; top:-2px; white-space:nowrap; font:700 10px/1.6 system-ui,Arial,sans-serif; color:#dc2626; } #mg-ban-in { display:none; } body.mg-dang-in > *:not(#mg-ban-in) { display:none !important; } body.mg-dang-in #mg-ban-in { display:block !important; } body.mg-dang-in { padding:0 !important; margin:0 !important; background:#fff !important; } {% endblock %} {% block content %}
{% if HD %}
🧾 Mẫu hóa đơn bán hàng bằng ảnh của cửa hàng
Chọn ảnh hóa đơn của tiệm (PNG/JPG) → thêm thông tin + các cột hàng → kéo từng ô tới đúng chỗ → đặt vùng hàng (khung đỏ) → In thử → Lưu → ✅ Dùng mẫu này. Nhiều món hơn vùng hàng thì hóa đơn tự sang trang 2, 3… (không thu nhỏ chữ). Đây là hóa đơn bán hàng của tiệm — không phải hóa đơn điện tử. Chưa chọn mẫu nào thì vẫn in hóa đơn kiểu cũ như trước.
{% else %}
🧾 Mẫu giấy đảm bảo riêng của cửa hàng
Chọn ảnh giấy đảm bảo của tiệm (PNG/JPG) → thêm thông tin cần in → kéo từng ô tới đúng chỗ → In thử → Lưu. Từ đó nút 🖨️ In giấy đảm bảo của mỗi hóa đơn bán sẽ in theo mẫu này. Chưa có mẫu thì vẫn in giấy đảm bảo cũ như trước.
{% endif %}
{% if stores|length > 1 %} {% else %} {% endif %} {% if HD or not che_do %} {% endif %}
① Ảnh mẫu & khổ giấy
{% if HD %}
× mm (rộng × cao, khổ dọc)
Trên Dưới Trái Phải
{% endif %}
② Thông tin cần in
{% if HD %}
"Cột ..." là các cột của bảng hàng: mỗi món một dòng, nằm trong vùng hàng (khung đỏ). Kéo một cột lên/xuống = dời cả bảng. Ô thường có phạm vi: trang đầu / mọi trang / trang cuối.
{% else %}
"Cột ..." in mỗi món hàng một dòng — để khớp vào bảng kẻ sẵn trên giấy.
{% endif %}
{% if HD %}
④ Bảng hàng — tự sang trang khi nhiều món
từ % tới % chiều cao ảnh (kéo tay nắm đỏ ở đáy khung đỏ)
mm (0 = theo chữ; điền khoảng cách dòng kẻ in sẵn để chữ khớp dòng)
{% endif %}
{% if HD %}
{% endif %}
{% include '_mau_giay_ve.html' %} {% if HD %}{% include '_mau_hoa_don_ve.html' %}{% endif %} {% endblock %} {% block scripts %} {% endblock %}