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>
75 lines
3.5 KiB
HTML
75 lines
3.5 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Fornitori - Mago4 Demo{% endblock %}
|
|
{% block window_tabs %}<a href="/suppliers" class="window-tab active"><i class="material-icons">local_shipping</i> Fornitori</a>{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="module-bar">
|
|
<div class="module-title">Fornitori</div>
|
|
<div class="breadcrumb"><a href="/">Mago4</a><span class="sep">»</span><a href="/anagrafiche">Anagrafiche</a><span class="sep">»</span><span class="current">Fornitori</span></div>
|
|
</div>
|
|
<div class="tab-strip">
|
|
<a href="/anagrafiche">Anagrafiche</a>
|
|
<a href="/customers">Clienti</a>
|
|
<a href="/suppliers" class="active">Fornitori</a>
|
|
<a href="/products">Articoli</a>
|
|
</div>
|
|
|
|
<div class="doc-toolbar">
|
|
<button class="tb-btn" title="Nuovo" onclick="alert('Nuovo fornitore (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>
|
|
</div>
|
|
|
|
<div class="content-pad">
|
|
<div class="panel">
|
|
<div class="panel-header"><h3><i class="material-icons">local_shipping</i> Elenco Fornitori</h3></div>
|
|
<table class="data-table">
|
|
<thead><tr><th>Codice</th><th>Ragione Sociale</th><th>Partita IVA</th><th>Città</th><th>Paese</th><th class="text-center">Pagamento</th><th class="text-right">Saldo</th><th></th></tr></thead>
|
|
<tbody>
|
|
{% for s in suppliers %}
|
|
<tr>
|
|
<td class="text-bold mono">{{ s.code }}</td>
|
|
<td>{{ s.name }}</td>
|
|
<td class="mono">{{ s.vat_number or '—' }}</td>
|
|
<td>{{ s.city }}</td>
|
|
<td>{{ s.country }}</td>
|
|
<td class="text-center">{{ s.payment_terms_days }} gg</td>
|
|
<td class="text-right {% if s.balance > 0 %}text-warning{% endif %}">€ {{ "%.2f"|format(s.balance) }}</td>
|
|
<td class="text-center"><button class="btn-icon-sm act-view" onclick="viewSupplier({{ s.id }})"><i class="material-icons">visibility</i></button></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="genericModal" class="modal" onclick="if(event.target.id==='genericModal')closeGenericModal()">
|
|
<div class="modal-content">
|
|
<div class="modal-header"><h2 id="gmTitle">Dettagli</h2><button class="modal-close" onclick="closeGenericModal()"><i class="material-icons">close</i></button></div>
|
|
<div class="modal-body" id="gmBody"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function viewSupplier(id) {
|
|
fetch(`/api/suppliers/${id}`).then(r=>r.json()).then(d=>{
|
|
openGenericModal('Fornitore: ' + d.name, `
|
|
<div style="padding:16px">
|
|
<div class="form-section-title">Dati Principali</div>
|
|
<div class="form-grid-2">
|
|
${field('Codice', d.code)}${field('Ragione Sociale', d.name)}
|
|
${field('Partita IVA', d.vat_number || '—')}${field('Email', d.email)}
|
|
${field('Telefono', d.phone)}${field('Termini Pagamento', d.payment_terms_days + ' giorni')}
|
|
</div>
|
|
<div class="form-section-title">Indirizzo</div>
|
|
<div class="form-grid-2">
|
|
${field('Indirizzo', d.address)}${field('Città', d.city)}
|
|
${field('Paese', d.country)}${field('Saldo Debito', '€ ' + d.balance.toFixed(2))}
|
|
</div>
|
|
</div>`);
|
|
});
|
|
}
|
|
</script>
|
|
{% endblock %}
|