billing frontend for mariadb. setup as otb_billing for outsidethebox.top accounting. also involved with outsidethedb
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

134 lines
4.1 KiB

<!doctype html>
<html>
<head>
<title>Services</title>
<link rel="icon" type="image/png" href="/static/favicon.png">
</head>
<body>
<h1>Services</h1>
<p><a href="/">Home</a></p>
<p>
<a href="/services/new">Add Service</a> |
<a href="/service-templates">Service Templates</a>
</p>
<div style="margin-bottom: 16px; padding: 10px; border: 1px solid #ccc;">
<p style="margin: 0 0 10px 0;"><strong>Active Services Summary</strong></p>
<table border="1" cellpadding="6" style="margin-bottom: 10px;">
<tr>
<th>Type</th>
<th>Active Services</th>
<th>Monthly Total</th>
</tr>
{% for row in summary_rows %}
<tr>
<td>{{ row.service_type }}</td>
<td>{{ row.service_count }}</td>
<td>{{ row.total_monthly|money('CAD') }}</td>
</tr>
{% endfor %}
{% if not summary_rows %}
<tr>
<td colspan="3" style="text-align:center;">No active services found.</td>
</tr>
{% endif %}
<tr>
<th>Total</th>
<th>{{ active_totals.service_count }}</th>
<th>{{ active_totals.total_monthly|money('CAD') }}</th>
</tr>
</table>
<p style="margin: 0; font-size: 0.95em;">
Summary is based on <strong>active</strong> services and their recurring amounts.
</p>
</div>
<form method="get" action="/services" style="margin-bottom: 16px; padding: 10px; border: 1px solid #ccc;">
<p style="margin: 0 0 10px 0;"><strong>Filters</strong></p>
<p style="margin: 0 0 10px 0;">
Service Type<br>
<select name="service_type">
<option value="" {% if not selected_type %}selected{% endif %}>All</option>
<option value="hosting" {% if selected_type == 'hosting' %}selected{% endif %}>hosting</option>
<option value="crypto_infra" {% if selected_type == 'crypto_infra' %}selected{% endif %}>crypto_infra</option>
<option value="saas" {% if selected_type == 'saas' %}selected{% endif %}>saas</option>
<option value="consulting" {% if selected_type == 'consulting' %}selected{% endif %}>consulting</option>
<option value="other" {% if selected_type == 'other' %}selected{% endif %}>other</option>
</select>
</p>
<p style="margin: 0 0 10px 0;">
Status<br>
<select name="status">
<option value="" {% if not selected_status %}selected{% endif %}>All</option>
<option value="pending" {% if selected_status == 'pending' %}selected{% endif %}>pending</option>
<option value="active" {% if selected_status == 'active' %}selected{% endif %}>active</option>
<option value="suspended" {% if selected_status == 'suspended' %}selected{% endif %}>suspended</option>
<option value="cancelled" {% if selected_status == 'cancelled' %}selected{% endif %}>cancelled</option>
</select>
</p>
<p style="margin: 0;">
<button type="submit">Apply Filters</button>
<a href="/services" style="margin-left: 10px;">Clear</a>
</p>
</form>
<p>
Showing <strong>{{ total_count }}</strong> service{% if total_count != 1 %}s{% endif %}
{% if selected_type %} | Type: <strong>{{ selected_type }}</strong>{% endif %}
{% if selected_status %} | Status: <strong>{{ selected_status }}</strong>{% endif %}
</p>
<table border="1" cellpadding="6">
<tr>
<th>ID</th>
<th>Service Code</th>
<th>Template</th>
<th>Client</th>
<th>Service Name</th>
<th>Type</th>
<th>Cycle</th>
<th>Currency</th>
<th>Amount</th>
<th>Status</th>
<th>Start Date</th>
<th>Actions</th>
</tr>
{% for s in services %}
<tr>
<td>{{ s.id }}</td>
<td>{{ s.service_code }}</td>
<td>{% if s.template_name %}{{ s.template_name }}{% else %}-{% endif %}</td>
<td>{{ s.client_code }} - {{ s.company_name }}</td>
<td>{{ s.service_name }}</td>
<td>{{ s.service_type }}</td>
<td>{{ s.billing_cycle }}</td>
<td>{{ s.currency_code }}</td>
<td>{{ s.recurring_amount|money(s.currency_code) }}</td>
<td>{{ s.status }}</td>
<td>{{ s.start_date }}</td>
<td><a href="/services/edit/{{ s.id }}">Edit</a></td>
</tr>
{% endfor %}
{% if not services %}
<tr>
<td colspan="12" style="text-align:center;">No services matched the selected filters.</td>
</tr>
{% endif %}
</table>
{% include "footer.html" %}
</body>
</html>