HsiehMinChieh commited on
Commit ·
c530b0f
1
Parent(s): 42ac874
fix: resolve jinja2 sale.items built-in method dictionary naming collision gotcha
Browse files995 unmodified lines99699799899910001001100210031004100510061007100810091010101110121013995 unmodified lines{% if sales %}{% for sale in sales %}<tr><td style="font-family:monospace; font-weight:bold;">{{ sale.tx_id }}</td><td style="font-size:0.85rem; color:var(--text-secondary);">{{ sale.time }}</td><td><div style="display:flex; flex-direction:column; gap:2px; font-size:0.9rem;">{% for item in sale.items %}<div>🔹 {{ item.name }} (x{{ item.quantity }}) - ${% if item.price is defined %}{{ '{:,.0f}'.format(item.price * item.quantity) }}{% else %}0{% endif %}</div>{% endfor %}</div></td><td style="text-align:right; font-weight:700; color:var(--success-emerald);">${{ '{:,.0f}'.format(sale.total) }}</td><td style="text-align:right;">${{ '{:,.0f}'.format(sale.cash_received) }}</td><td style="text-align:right; color:var(--warning-amber);">${{ '{:,.0f}'.format(sale.change) }}</td></tr>{% endfor %}{% else %}995 unmodified lines99699799899910001001100210031004100510061007100810091010101110121013995 unmodified lines{% if sales %}{% for sale in sales %}<tr><td style="font-family:monospace; font-weight:bold;">{{ sale['tx_id'] }}</td><td style="font-size:0.85rem; color:var(--text-secondary);">{{ sale['time'] }}</td><td><div style="display:flex; flex-direction:column; gap:2px; font-size:0.9rem;">{% for item in sale['items'] %}<div>🔹 {{ item['name'] }} (x{{ item['quantity'] }}) - ${% if item['price'] is defined %}{{ '{:,.0f}'.format(item['price'] * item['quantity']) }}{% else %}0{% endif %}</div>{% endfor %}</div></td><td style="text-align:right; font-weight:700; color:var(--success-emerald);">${{ '{:,.0f}'.format(sale['total']) }}</td><td style="text-align:right;">${{ '{:,.0f}'.format(sale['cash_received']) }}</td><td style="text-align:right; color:var(--warning-amber);">${{ '{:,.0f}'.format(sale['change']) }}</td></tr>{% endfor %}{% else %}
templates/index.html+7-7