Netdeploy2 Babyyyy
This commit is contained in:
58
templates/quotes/dashboard.html
Normal file
58
templates/quotes/dashboard.html
Normal file
@@ -0,0 +1,58 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
<h2>Dashboard</h2>
|
||||
|
||||
<p>
|
||||
<a href="{{ url_for('quotes.new_quote') }}">+ New Quote</a>
|
||||
</p>
|
||||
|
||||
<h3>Draft / Sent Quotes</h3>
|
||||
|
||||
<table border="1" cellpadding="6">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Title</th>
|
||||
<th>Status</th>
|
||||
<th>Total</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
{% for q in quotes if q.status in ['draft','sent'] %}
|
||||
<tr>
|
||||
<td>{{ q.id }}</td>
|
||||
<td>{{ q.title }}</td>
|
||||
<td>{{ q.status }}</td>
|
||||
<td>${{ q.total }}</td>
|
||||
<td><a href="{{ url_for('quotes.edit_quote', quote_id=q.id) }}">Open</a></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="5">None</td></tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
<hr>
|
||||
|
||||
<h3>Approved Quotes (Ready for Invoice)</h3>
|
||||
|
||||
<table border="1" cellpadding="6">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Title</th>
|
||||
<th>Total</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
{% for q in quotes if q.status == 'approved' %}
|
||||
<tr>
|
||||
<td>{{ q.id }}</td>
|
||||
<td>{{ q.title }}</td>
|
||||
<td>${{ q.total }}</td>
|
||||
<td><a href="{{ url_for('quotes.edit_quote', quote_id=q.id) }}">View</a></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="4">None</td></tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
||||
72
templates/quotes/edit.html
Normal file
72
templates/quotes/edit.html
Normal file
@@ -0,0 +1,72 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
<h2>Edit Quote #{{ q.id }}</h2>
|
||||
|
||||
<form method="POST">
|
||||
<p>
|
||||
<label>
|
||||
Title<br>
|
||||
<input name="title" value="{{ q.title or '' }}" style="width: 420px;">
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Category:</strong> {{ q.category }}<br>
|
||||
<strong>Status:</strong> {{ q.status }}
|
||||
</p>
|
||||
|
||||
<h3>Line Items</h3>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Description</th>
|
||||
<th style="width:110px;">Qty</th>
|
||||
<th style="width:140px;">Unit Price</th>
|
||||
<th style="width:140px;">Line Total</th>
|
||||
</tr>
|
||||
|
||||
{% for item in q.items %}
|
||||
<tr>
|
||||
<td>
|
||||
<!-- THIS is what makes saving work -->
|
||||
<input type="hidden" name="item_id" value="{{ item.id }}">
|
||||
|
||||
<input name="description" value="{{ item.description or '' }}" style="width: 100%;">
|
||||
</td>
|
||||
<td>
|
||||
<input name="qty" type="number" step="0.01" value="{{ item.qty or 0 }}" style="width: 100px;">
|
||||
</td>
|
||||
<td>
|
||||
<input name="unit_price" type="number" step="0.01" value="{{ item.unit_price or 0 }}" style="width: 120px;">
|
||||
</td>
|
||||
<td>
|
||||
${{ ((item.qty or 0) * (item.unit_price or 0)) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="4">No items yet. Click “Add Item”.</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
<p style="margin-top: 10px;">
|
||||
<button type="submit">Save Quote</button>
|
||||
<a href="{{ url_for('quotes.dashboard') }}" style="margin-left:10px;">Back</a>
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<form method="POST" action="{{ url_for('quotes.add_item', quote_id=q.id) }}">
|
||||
<button type="submit">Add Item</button>
|
||||
</form>
|
||||
|
||||
<hr>
|
||||
|
||||
<h3>Total: ${{ q.total }}</h3>
|
||||
|
||||
<form method="POST" action="{{ url_for('invoices.create_from_quote', quote_id=q.id) }}">
|
||||
<button type="submit">Create Invoice from Quote</button>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
38
templates/quotes/new.html
Normal file
38
templates/quotes/new.html
Normal file
@@ -0,0 +1,38 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
<h2>New Quote</h2>
|
||||
|
||||
<form method="POST">
|
||||
<p>
|
||||
<label>Title<br>
|
||||
<input name="title" required style="width: 360px;">
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>Category<br>
|
||||
<select name="category" required>
|
||||
<option value="web_design">Web Design</option>
|
||||
<option value="it_services">IT Services</option>
|
||||
<option value="pc_repair">PC Repair</option>
|
||||
</select>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>Client<br>
|
||||
<select name="client_id" required>
|
||||
{% for c in clients %}
|
||||
<option value="{{ c.id }}">{{ c.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
|
||||
<button type="submit">Create Quote</button>
|
||||
<a href="{{ url_for('quotes.dashboard') }}" style="margin-left: 10px;">Cancel</a>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user