diff --git a/sstreasury/jinja2/sstreasury/claim_edit.html b/sstreasury/jinja2/sstreasury/claim_edit.html
index 28efb97..6cc60bd 100644
--- a/sstreasury/jinja2/sstreasury/claim_edit.html
+++ b/sstreasury/jinja2/sstreasury/claim_edit.html
@@ -76,10 +76,14 @@
-
+
+
+
+
{% if bsb_lookedup %}{{ bsb_lookedup }}{% endif %}
+
@@ -193,5 +197,15 @@
return el.classList.contains('totalrow');
}
});
+
+ $('input[name="payee_bsb"]').blur(function() {
+ $.get('{{ url('bsb_lookup') }}?bsb=' + this.value, function(data, status, xhr) {
+ if (data.result) {
+ $('#bsb_lookedup').text(data.result);
+ } else {
+ $('#bsb_lookedup').text('');
+ }
+ });
+ })
{% endblock %}
diff --git a/sstreasury/views.py b/sstreasury/views.py
index af809e0..4cedc83 100644
--- a/sstreasury/views.py
+++ b/sstreasury/views.py
@@ -585,8 +585,11 @@ def claim_edit(request, claim):
else:
return redirect(reverse('claim_edit', kwargs={'id': claim.id}))
else:
+ bsb_lookedup = do_bsb_lookup(claim.payee_bsb)
+
return render(request, 'sstreasury/claim_edit.html', {
- 'claim': claim
+ 'claim': claim,
+ 'bsb_lookedup': bsb_lookedup
})
@login_required