Allow unreconcile and expand API to block reconciled transactions.

This commit is contained in:
James Cole
2023-10-22 18:44:30 +02:00
parent a86a582d0f
commit 2c34bd36a5
50 changed files with 1267 additions and 1046 deletions

View File

@@ -220,6 +220,10 @@
class="fa fa-pencil"></span> {{ 'edit'|_ }}</a></li>
<li><a href="{{ route('transactions.delete', [transactionGroup.id]) }}"><span
class="fa fa-trash"></span> {{ 'delete'|_ }}</a></li>
{% if journal.reconciled %}
<li><a class="reconcile-button" href="{{ route('transactions.unreconcile', [journal.transaction_journal_id]) }}"><span
class="fa fa-history"></span> {{ 'unreconcile'|_ }}</a></li>
{% endif %}
<li role="separator" class="divider"></li>
{# convert to different type #}
@@ -504,9 +508,25 @@
var cloneGroupUrl = '{{ route('transactions.clone') }}';
var cloneAndEditUrl = '{{ route('transactions.clone') }}?redirect=edit';
$('.switch-link').on('click', switchLink);
$('.reconcile-button').on('click', unreconcile);
var switchLinkUrl = '{{ route('transactions.link.switch') }}';
function unreconcile(e) {
e.preventDefault();
var obj = $(e.currentTarget);
$.post(obj.attr('href'), {
_token: token
}).done(function () {
location.reload();
}).fail(function () {
console.error('I failed :(');
});
return false
}
function switchLink(e) {
e.preventDefault();
var obj = $(e.currentTarget);