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>
This commit is contained in:
2026-06-17 11:47:32 +02:00
co-authored by Claude Sonnet 4.6
parent 8a9fb5085a
commit b6b6759b9a
26 changed files with 2900 additions and 2125 deletions
+46
View File
@@ -0,0 +1,46 @@
{% extends "base.html" %}
{% block title %}Causali di Magazzino - Mago4 Demo{% endblock %}
{% block window_tabs %}<a href="/inventory-reasons" class="window-tab active"><i class="material-icons">rule</i> Causali</a>{% endblock %}
{% block content %}
<div class="module-bar">
<div class="module-title">Causali di Magazzino</div>
<div class="breadcrumb"><a href="/">Mago4</a><span class="sep">»</span><a href="/magazzino">Logistica</a><span class="sep">»</span><span class="current">Causali</span></div>
</div>
<div class="tab-strip">
<a href="/magazzino">Magazzino</a>
<a href="/inventory-movements">Movimenti</a>
<a href="/warehouse">Giacenze</a>
<a href="/inventory-reasons" class="active">Causali</a>
</div>
<div class="doc-toolbar">
<button class="tb-btn" title="Nuova causale" onclick="alert('Nuova causale (demo)')"><i class="material-icons">add_box</i></button>
<button class="tb-btn" title="Stampa"><i class="material-icons">print</i></button>
</div>
<div class="content-pad">
<div class="alert alert-info"><i class="material-icons">info</i> Le causali determinano se un movimento <b>carica</b> o <b>scarica</b> la giacenza (campo <span class="mono">DebitCreditSign</span> in Mago4).</div>
<div class="panel">
<div class="panel-header"><h3><i class="material-icons">rule</i> Elenco Causali</h3></div>
<table class="data-table">
<thead><tr><th>Codice</th><th>Descrizione</th><th class="text-center">Segno</th><th class="text-center">Numerazione Fiscale</th><th class="text-center">Aggiorna Giacenze</th></tr></thead>
<tbody>
{% for r in reasons %}
<tr>
<td class="text-bold mono">{{ r.code }}</td>
<td>{{ r.description }}</td>
<td class="text-center">
{% if r.sign.value == 'load' %}<span class="badge badge-load"><i class="material-icons">add</i> Carico (+)</span>
{% else %}<span class="badge badge-unload"><i class="material-icons">remove</i> Scarico ()</span>{% endif %}
</td>
<td class="text-center">{% if r.fiscal %}<i class="material-icons text-success">check_circle</i>{% else %}<i class="material-icons text-mute">remove</i>{% endif %}</td>
<td class="text-center">{% if r.updates_balance %}<i class="material-icons text-success">check_circle</i>{% else %}<i class="material-icons text-mute">remove</i>{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}