5 changed files with 432 additions and 100 deletions
@ -0,0 +1,43 @@
|
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<title>Payments</title> |
||||
</head> |
||||
<body> |
||||
|
||||
<h1>Payments</h1> |
||||
|
||||
<p><a href="/">Home</a></p> |
||||
<p><a href="/payments/new">Record Payment</a></p> |
||||
|
||||
<table border="1" cellpadding="6"> |
||||
<tr> |
||||
<th>ID</th> |
||||
<th>Invoice</th> |
||||
<th>Client</th> |
||||
<th>Method</th> |
||||
<th>Currency</th> |
||||
<th>Amount</th> |
||||
<th>CAD Value</th> |
||||
<th>Reference</th> |
||||
<th>Received</th> |
||||
</tr> |
||||
|
||||
{% for p in payments %} |
||||
<tr> |
||||
<td>{{ p.id }}</td> |
||||
<td>{{ p.invoice_number }}</td> |
||||
<td>{{ p.client_code }} - {{ p.company_name }}</td> |
||||
<td>{{ p.payment_method }}</td> |
||||
<td>{{ p.payment_currency }}</td> |
||||
<td>{{ p.payment_amount }}</td> |
||||
<td>{{ p.cad_value_at_payment }}</td> |
||||
<td>{{ p.reference }}</td> |
||||
<td>{{ p.received_at }}</td> |
||||
</tr> |
||||
{% endfor %} |
||||
|
||||
</table> |
||||
|
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,102 @@
|
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<title>New Payment</title> |
||||
</head> |
||||
<body> |
||||
|
||||
<h1>Record Payment</h1> |
||||
|
||||
{% 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> |
||||
Invoice *<br> |
||||
<select name="invoice_id" required> |
||||
<option value="">Select invoice</option> |
||||
{% for i in invoices %} |
||||
<option value="{{ i.id }}" {% if form_data.get('invoice_id') == (i.id|string) %}selected{% endif %}> |
||||
{{ i.invoice_number }} - {{ i.client_code }} - {{ i.company_name }} - Due {{ i.total_amount - i.amount_paid }} {{ i.currency_code }} |
||||
</option> |
||||
{% endfor %} |
||||
</select> |
||||
</p> |
||||
|
||||
<p> |
||||
Payment Method *<br> |
||||
<select name="payment_method" required> |
||||
<option value="">Select method</option> |
||||
<option value="square" {% if form_data.get('payment_method') == 'square' %}selected{% endif %}>square</option> |
||||
<option value="etransfer" {% if form_data.get('payment_method') == 'etransfer' %}selected{% endif %}>etransfer</option> |
||||
<option value="crypto_etho" {% if form_data.get('payment_method') == 'crypto_etho' %}selected{% endif %}>crypto_etho</option> |
||||
<option value="crypto_egaz" {% if form_data.get('payment_method') == 'crypto_egaz' %}selected{% endif %}>crypto_egaz</option> |
||||
<option value="crypto_alt" {% if form_data.get('payment_method') == 'crypto_alt' %}selected{% endif %}>crypto_alt</option> |
||||
<option value="cash" {% if form_data.get('payment_method') == 'cash' %}selected{% endif %}>cash</option> |
||||
<option value="other" {% if form_data.get('payment_method') == 'other' %}selected{% endif %}>other</option> |
||||
</select> |
||||
</p> |
||||
|
||||
<p> |
||||
Payment Currency *<br> |
||||
<select name="payment_currency" required> |
||||
<option value="">Select currency</option> |
||||
<option value="CAD" {% if form_data.get('payment_currency') == 'CAD' %}selected{% endif %}>CAD</option> |
||||
<option value="ETHO" {% if form_data.get('payment_currency') == 'ETHO' %}selected{% endif %}>ETHO</option> |
||||
<option value="EGAZ" {% if form_data.get('payment_currency') == 'EGAZ' %}selected{% endif %}>EGAZ</option> |
||||
<option value="ALT" {% if form_data.get('payment_currency') == 'ALT' %}selected{% endif %}>ALT</option> |
||||
</select> |
||||
</p> |
||||
|
||||
<p> |
||||
Payment Amount *<br> |
||||
<input type="number" step="0.00000001" min="0.00000001" name="payment_amount" value="{{ form_data.get('payment_amount', '') }}" required> |
||||
</p> |
||||
|
||||
<p> |
||||
CAD Value At Payment *<br> |
||||
<input type="number" step="0.00000001" min="0" name="cad_value_at_payment" value="{{ form_data.get('cad_value_at_payment', '') }}" required> |
||||
</p> |
||||
|
||||
<p> |
||||
Reference<br> |
||||
<input name="reference" value="{{ form_data.get('reference', '') }}"> |
||||
</p> |
||||
|
||||
<p> |
||||
Sender Name<br> |
||||
<input name="sender_name" value="{{ form_data.get('sender_name', '') }}"> |
||||
</p> |
||||
|
||||
<p> |
||||
TXID<br> |
||||
<input name="txid" value="{{ form_data.get('txid', '') }}"> |
||||
</p> |
||||
|
||||
<p> |
||||
Wallet Address<br> |
||||
<input name="wallet_address" value="{{ form_data.get('wallet_address', '') }}"> |
||||
</p> |
||||
|
||||
<p> |
||||
Notes<br> |
||||
<textarea name="notes">{{ form_data.get('notes', '') }}</textarea> |
||||
</p> |
||||
|
||||
<p> |
||||
<button type="submit">Record Payment</button> |
||||
</p> |
||||
|
||||
</form> |
||||
|
||||
</body> |
||||
</html> |
||||
Loading…
Reference in new issue