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.
112 lines
3.2 KiB
112 lines
3.2 KiB
<!doctype html> |
|
<html> |
|
<head> |
|
<title>New Subscription</title> |
|
</head> |
|
<body> |
|
|
|
<h1>Add Subscription</h1> |
|
|
|
<p><a href="/">Home</a></p> |
|
<p><a href="/subscriptions">Back to Subscriptions</a></p> |
|
|
|
{% if errors %} |
|
<div style="border:1px solid red; padding:10px; margin-bottom:15px;"> |
|
<strong>Please fix the following:</strong> |
|
<ul> |
|
{% for error in errors %} |
|
<li>{{ error }}</li> |
|
{% endfor %} |
|
</ul> |
|
</div> |
|
{% endif %} |
|
|
|
<form method="post"> |
|
|
|
<p> |
|
Client *<br> |
|
<select name="client_id" required> |
|
<option value="">Select client</option> |
|
{% for c in clients %} |
|
<option value="{{ c.id }}" {% if form_data.get('client_id') == (c.id|string) %}selected{% endif %}> |
|
{{ c.client_code }} - {{ c.company_name }} |
|
</option> |
|
{% endfor %} |
|
</select> |
|
</p> |
|
|
|
<p> |
|
Service (optional)<br> |
|
<select name="service_id"> |
|
<option value="">None</option> |
|
{% for s in services %} |
|
<option value="{{ s.id }}" {% if form_data.get('service_id') == (s.id|string) %}selected{% endif %}> |
|
{{ s.service_code }} - {{ s.service_name }} |
|
</option> |
|
{% endfor %} |
|
</select> |
|
</p> |
|
|
|
<p> |
|
Subscription Name *<br> |
|
<input name="subscription_name" value="{{ form_data.get('subscription_name', '') }}" required> |
|
</p> |
|
|
|
<p> |
|
Billing Interval *<br> |
|
<select name="billing_interval" required> |
|
<option value="monthly" {% if form_data.get('billing_interval') == 'monthly' %}selected{% endif %}>monthly</option> |
|
<option value="quarterly" {% if form_data.get('billing_interval') == 'quarterly' %}selected{% endif %}>quarterly</option> |
|
<option value="yearly" {% if form_data.get('billing_interval') == 'yearly' %}selected{% endif %}>yearly</option> |
|
</select> |
|
</p> |
|
|
|
<p> |
|
Price *<br> |
|
<input type="number" step="0.00000001" min="0.00000001" name="price" value="{{ form_data.get('price', '') }}" required> |
|
</p> |
|
|
|
<p> |
|
Currency *<br> |
|
<select name="currency_code" required> |
|
<option value="CAD" {% if form_data.get('currency_code') == 'CAD' %}selected{% endif %}>CAD</option> |
|
<option value="USD" {% if form_data.get('currency_code') == 'USD' %}selected{% endif %}>USD</option> |
|
<option value="ETHO" {% if form_data.get('currency_code') == 'ETHO' %}selected{% endif %}>ETHO</option> |
|
<option value="EGAZ" {% if form_data.get('currency_code') == 'EGAZ' %}selected{% endif %}>EGAZ</option> |
|
<option value="ALT" {% if form_data.get('currency_code') == 'ALT' %}selected{% endif %}>ALT</option> |
|
</select> |
|
</p> |
|
|
|
<p> |
|
Start Date *<br> |
|
<input type="date" name="start_date" value="{{ form_data.get('start_date', '') }}" required> |
|
</p> |
|
|
|
<p> |
|
Next Invoice Date *<br> |
|
<input type="date" name="next_invoice_date" value="{{ form_data.get('next_invoice_date', '') }}" required> |
|
</p> |
|
|
|
<p> |
|
Status *<br> |
|
<select name="status" required> |
|
<option value="active" {% if form_data.get('status') == 'active' %}selected{% endif %}>active</option> |
|
<option value="paused" {% if form_data.get('status') == 'paused' %}selected{% endif %}>paused</option> |
|
<option value="cancelled" {% if form_data.get('status') == 'cancelled' %}selected{% endif %}>cancelled</option> |
|
</select> |
|
</p> |
|
|
|
<p> |
|
Notes<br> |
|
<textarea name="notes" rows="5" cols="60">{{ form_data.get('notes', '') }}</textarea> |
|
</p> |
|
|
|
<p> |
|
<button type="submit">Create Subscription</button> |
|
</p> |
|
|
|
</form> |
|
|
|
{% include "footer.html" %} |
|
</body> |
|
</html>
|
|
|