Files
Alby96andClaude Sonnet 4.6 b6b6759b9a Restyle UI to match Mago4 and add invoicing, warehouse, scadenzario
Rework the demo into a faithful Mago4 look-and-feel and expand it with
core ERP modules modelled on the real Mago4 database schema.

UI (ispirata a Mago4):
- Blue header with logo/search/operation date, desktop-style window tabs
- White sidebar with coloured module icons (Anagrafiche, Vendite, Acquisti,
  Amministrazione, Logistica)
- Card-based module landing pages with breadcrumb + tab strip
- Document detail forms with left tabs, line grid and totals box

Fatturazione (InvoiceMng / MA_SaleDoc):
- Document types (Fattura Immediata, DDT, Nota di Credito, ProForma)
- Lines with discount/IVA, automatic taxable/tax/total computation
- Document states (draft -> printed -> issued / posted_to_inventory)

Magazzino (Inventory / MA_InventoryEntries + MA_InventoryReasons):
- Inventory movements with load/unload reasons (DebitCreditSign)
- Posting a movement actually updates item balances
- Causali and stock valuation pages

Amministrazione / Scadenzario (AP_AR / MA_PyblsRcvbls):
- Open items (receivables/payables) with due date, method, state
- Settle action closes the item and recomputes the cash forecast

Dashboard riprogettata (focus su scadenze e to-do):
- Overdue alert banner, KPI for overdue payables/receivables
- Upcoming deadlines table, prioritised "Cose da fare" action list
- 30-day cash-flow forecast and customer credit-limit check

Adds REST endpoints for invoices, movements, schedules and dashboard data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 11:47:32 +02:00

56 lines
3.6 KiB
HTML

{% extends "base.html" %}
{% block title %}Documenti Vendita - Mago4 Demo{% endblock %}
{% block window_tabs %}<a href="/invoices" class="window-tab active"><i class="material-icons">description</i> Documenti Vendita</a>{% endblock %}
{% block content %}
<div class="module-bar">
<div class="module-title">Documenti di Vendita</div>
<div class="breadcrumb"><a href="/">Mago4</a><span class="sep">»</span><a href="/vendite">Vendite</a><span class="sep">»</span><span class="current">Documenti Vendita</span></div>
</div>
<div class="tab-strip">
<a href="/invoices" class="{% if selected_type == 'all' %}active{% endif %}">Tutti</a>
<a href="/invoices?type=immediate_invoice" class="{% if selected_type == 'immediate_invoice' %}active{% endif %}">Fatture Immediate</a>
<a href="/invoices?type=delivery_note" class="{% if selected_type == 'delivery_note' %}active{% endif %}">DDT</a>
<a href="/invoices?type=credit_note" class="{% if selected_type == 'credit_note' %}active{% endif %}">Note di Credito</a>
<a href="/invoices?type=proforma_invoice" class="{% if selected_type == 'proforma_invoice' %}active{% endif %}">ProForma</a>
</div>
<div class="doc-toolbar">
<button class="tb-btn" title="Nuovo documento" onclick="alert('Nuovo documento (demo)')"><i class="material-icons">add_box</i></button>
<button class="tb-btn" title="Cerca"><i class="material-icons">search</i></button>
<div class="tb-sep"></div>
<button class="tb-btn" title="Stampa"><i class="material-icons">print</i></button>
<button class="tb-btn" title="Invia email"><i class="material-icons">email</i></button>
<button class="tb-btn" title="Esporta XML"><i class="material-icons">file_download</i></button>
</div>
<div class="content-pad">
<div class="panel">
<div class="panel-header"><h3><i class="material-icons">description</i> Elenco Documenti ({{ invoices|length }})</h3></div>
<table class="data-table">
<thead><tr><th>Tipo</th><th>Numero</th><th>Data</th><th>Cliente</th><th class="text-right">Imponibile</th><th class="text-right">IVA</th><th class="text-right">Totale</th><th>Stato</th><th class="text-center">Fatt.</th><th></th></tr></thead>
<tbody>
{% for i in invoices %}
<tr class="row-link" onclick="location.href='/invoices/{{ i.id }}'">
<td>{{ doc_type_label(i.doc_type) }}</td>
<td class="text-bold mono">{{ i.doc_no }}</td>
<td>{{ i.doc_date.strftime("%d/%m/%Y") }}</td>
<td>{{ i.customer_name }}</td>
<td class="text-right">€ {{ "%.2f"|format(i.taxable_total) }}</td>
<td class="text-right text-mute">€ {{ "%.2f"|format(i.tax_total) }}</td>
<td class="text-right text-bold">€ {{ "%.2f"|format(i.total) }}</td>
<td><span class="badge status-{{ i.status.value }}">{{ doc_status_label(i.status) }}</span></td>
<td class="text-center">
{% if i.issued %}<i class="material-icons text-success" title="Emesso" style="font-size:17px;">check_circle</i>
{% elif i.printed %}<i class="material-icons text-warning" title="Stampato" style="font-size:17px;">print</i>
{% else %}<i class="material-icons text-mute" title="Bozza" style="font-size:17px;">edit</i>{% endif %}
</td>
<td class="text-center"><i class="material-icons text-blue" style="font-size:17px;">chevron_right</i></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}