mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-19 16:10:00 +00:00
Lots of changes.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
$(function () {
|
||||
|
||||
if (typeof componentID !== 'undefined' && typeof repetitionID === 'undefined') {
|
||||
googleColumnChart('chart/category/' + componentID + '/spending/' + year, 'componentOverview');
|
||||
if (typeof categoryID !== 'undefined') {
|
||||
googleColumnChart('chart/category/' + categoryID + '/overview', 'componentOverview');
|
||||
googleColumnChart('chart/category/' + categoryID + '/period', 'periodOverview');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,39 +2,38 @@ $(function () {
|
||||
|
||||
$('.currencySelect').click(currencySelect);
|
||||
|
||||
$('#daterange').daterangepicker(
|
||||
{
|
||||
ranges: {
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')],
|
||||
'Next Month': [moment().add('month', 1).startOf('month'), moment().add('month', 1).endOf('month')],
|
||||
'Everything': [firstDate, moment()]
|
||||
},
|
||||
opens: 'left',
|
||||
|
||||
format: 'DD-MM-YYYY',
|
||||
startDate: start,
|
||||
endDate: end
|
||||
$('#daterange').daterangepicker(
|
||||
{
|
||||
ranges: {
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')],
|
||||
'Next Month': [moment().add(1, 'month').startOf('month'), moment().add(1, 'month').endOf('month')],
|
||||
'Everything': [firstDate, moment()]
|
||||
},
|
||||
function(start, end, label) {
|
||||
opens: 'left',
|
||||
|
||||
// send post.
|
||||
$.post(dateRangeURL, {
|
||||
start: start.format('YYYY-MM-DD'),
|
||||
end: end.format('YYYY-MM-DD'),
|
||||
label: label,
|
||||
_token: token
|
||||
}).success(function() {
|
||||
window.location.reload(true);
|
||||
}).fail(function() {
|
||||
alert('Could not change date range');
|
||||
format: 'DD-MM-YYYY',
|
||||
startDate: start,
|
||||
endDate: end
|
||||
},
|
||||
function (start, end, label) {
|
||||
|
||||
});
|
||||
// send post.
|
||||
$.post(dateRangeURL, {
|
||||
start: start.format('YYYY-MM-DD'),
|
||||
end: end.format('YYYY-MM-DD'),
|
||||
label: label,
|
||||
_token: token
|
||||
}).success(function () {
|
||||
window.location.reload(true);
|
||||
}).fail(function () {
|
||||
alert('Could not change date range');
|
||||
|
||||
//alert('A date range was chosen: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
|
||||
}
|
||||
});
|
||||
|
||||
);
|
||||
//alert('A date range was chosen: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -42,20 +42,9 @@ function searchRelatedTransactions(e, ID) {
|
||||
var searchValue = $('#relatedSearchValue').val();
|
||||
if (searchValue != '') {
|
||||
$.post('related/search/' + ID, {searchValue: searchValue,_token:token}).success(function (data) {
|
||||
// post each result to some div.
|
||||
$('#relatedSearchResults').empty();
|
||||
|
||||
$.each(data, function (i, row) {
|
||||
var tr = $('<tr>');
|
||||
|
||||
var checkBox = $('<td>').append($('<input>').attr('type', 'checkbox').data('relateto', ID).data('id', row.id).click(doRelateNewTransaction));
|
||||
var description = $('<td>').text(row.description);
|
||||
var amount = $('<td>').html(row.amount);
|
||||
tr.append(checkBox).append(description).append(amount);
|
||||
$('#relatedSearchResults').append(tr);
|
||||
//$('#relatedSearchResults').append($('<div>').text(row.id));
|
||||
});
|
||||
|
||||
// post the results to some div.
|
||||
$('#relatedSearchResultsTitle').show();
|
||||
$('#relatedSearchResults').empty().html(data);
|
||||
|
||||
}).fail(function () {
|
||||
alert('Could not search. Sorry.');
|
||||
|
||||
Reference in New Issue
Block a user