5 changed files with 252 additions and 11 deletions
@ -0,0 +1,69 @@ |
|||||||
|
<!doctype html> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<title>Add Credit</title> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
|
||||||
|
<h1>Add Credit</h1> |
||||||
|
|
||||||
|
<p><a href="/">Home</a></p> |
||||||
|
<p><a href="/credits/{{ client.id }}">Back to Credit Ledger</a></p> |
||||||
|
|
||||||
|
<h3>{{ client.client_code }} - {{ client.company_name }}</h3> |
||||||
|
|
||||||
|
{% 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> |
||||||
|
Entry Type *<br> |
||||||
|
<select name="entry_type" required> |
||||||
|
<option value="manual_credit">manual_credit</option> |
||||||
|
<option value="payment_credit">payment_credit</option> |
||||||
|
<option value="invoice_deduction">invoice_deduction</option> |
||||||
|
<option value="refund">refund</option> |
||||||
|
<option value="adjustment">adjustment</option> |
||||||
|
</select> |
||||||
|
</p> |
||||||
|
|
||||||
|
<p> |
||||||
|
Amount *<br> |
||||||
|
<input type="number" step="0.00000001" name="amount" required> |
||||||
|
</p> |
||||||
|
|
||||||
|
<p> |
||||||
|
Currency Code *<br> |
||||||
|
<select name="currency_code" required> |
||||||
|
<option value="CAD">CAD</option> |
||||||
|
<option value="USD">USD</option> |
||||||
|
<option value="EUR">EUR</option> |
||||||
|
<option value="ETHO">ETHO</option> |
||||||
|
<option value="EGAZ">EGAZ</option> |
||||||
|
<option value="ALT">ALT</option> |
||||||
|
</select> |
||||||
|
</p> |
||||||
|
|
||||||
|
<p> |
||||||
|
Notes<br> |
||||||
|
<textarea name="notes" rows="5" cols="60"></textarea> |
||||||
|
</p> |
||||||
|
|
||||||
|
<p> |
||||||
|
<button type="submit">Add Credit Entry</button> |
||||||
|
</p> |
||||||
|
|
||||||
|
</form> |
||||||
|
|
||||||
|
{% include "footer.html" %} |
||||||
|
</body> |
||||||
|
</html> |
||||||
@ -0,0 +1,48 @@ |
|||||||
|
<!doctype html> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<title>Client Credit Ledger</title> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
|
||||||
|
<h1>Client Credit Ledger</h1> |
||||||
|
|
||||||
|
<p><a href="/">Home</a></p> |
||||||
|
<p><a href="/clients">Back to Clients</a></p> |
||||||
|
|
||||||
|
<h3>{{ client.client_code }} - {{ client.company_name }}</h3> |
||||||
|
|
||||||
|
<p><strong>Current Balance:</strong> {{ balance|money('CAD') }}</p> |
||||||
|
|
||||||
|
<p><a href="/credits/add/{{ client.id }}">Add Credit</a></p> |
||||||
|
|
||||||
|
<table border="1" cellpadding="6"> |
||||||
|
<tr> |
||||||
|
<th>ID</th> |
||||||
|
<th>Type</th> |
||||||
|
<th>Amount</th> |
||||||
|
<th>Currency</th> |
||||||
|
<th>Reference Type</th> |
||||||
|
<th>Reference ID</th> |
||||||
|
<th>Notes</th> |
||||||
|
<th>Created</th> |
||||||
|
</tr> |
||||||
|
|
||||||
|
{% for e in entries %} |
||||||
|
<tr> |
||||||
|
<td>{{ e.id }}</td> |
||||||
|
<td>{{ e.entry_type }}</td> |
||||||
|
<td>{{ e.amount|money(e.currency_code) }}</td> |
||||||
|
<td>{{ e.currency_code }}</td> |
||||||
|
<td>{{ e.reference_type }}</td> |
||||||
|
<td>{{ e.reference_id }}</td> |
||||||
|
<td>{{ e.notes }}</td> |
||||||
|
<td>{{ e.created_at|localtime }}</td> |
||||||
|
</tr> |
||||||
|
{% endfor %} |
||||||
|
|
||||||
|
</table> |
||||||
|
|
||||||
|
{% include "footer.html" %} |
||||||
|
</body> |
||||||
|
</html> |
||||||
Loading…
Reference in new issue