Various small upgrades.

This commit is contained in:
James Cole 2016-10-23 12:37:12 +02:00
parent c39659b064
commit a79a8c8874
7 changed files with 14 additions and 12 deletions

View File

@ -26,6 +26,7 @@ use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use FireflyIII\Repositories\Journal\JournalTaskerInterface;
use Illuminate\Http\Request;
use Log;
use Preferences;
use Session;
use Steam;
@ -264,6 +265,7 @@ class SplitController extends Controller
$return = [];
$transactions = $request->get('transactions');
foreach ($transactions as $transaction) {
$return[] = [
'description' => $transaction['description'],
'source_account_id' => $transaction['source_account_id'] ?? 0,
@ -275,6 +277,7 @@ class SplitController extends Controller
'category' => $transaction['category'] ?? '',
];
}
Log::debug(sprintf('Found %d splits in request data.', count($return)));
return $return;
}

View File

@ -267,6 +267,7 @@ class JournalRepository implements JournalRepositoryInterface
$journal->description = $data['journal_description'];
$journal->date = $data['date'];
$journal->save();
Log::debug(sprintf('Updated split journal #%d', $journal->id));
// unlink all categories:
$journal->categories()->detach();
@ -282,8 +283,6 @@ class JournalRepository implements JournalRepositoryInterface
}
Log::debug(sprintf('Could not store meta field "%s" with value "%s" for journal #%d', json_encode($key), json_encode($value), $journal->id));
}
return $journal;
}
@ -297,6 +296,7 @@ class JournalRepository implements JournalRepositoryInterface
// store each transaction.
$identifier = 0;
Log::debug(sprintf('Count %d transactions in updateSplitJournal()', count($data['transactions'])));
foreach ($data['transactions'] as $transaction) {
Log::debug(sprintf('Split journal update split transaction %d', $identifier));
$transaction = $this->appendTransactionData($transaction, $data);

View File

@ -58,11 +58,11 @@ function sortStop(event, ui) {
});
if (parent.hasClass('rule-triggers')) {
$.post('rules/rules/trigger/reorder/' + ruleId, {_token: token, triggers: entries}).fail(function () {
$.post('rules/trigger/order/' + ruleId, {_token: token, triggers: entries}).fail(function () {
alert('Could not re-order rule triggers. Please refresh the page.');
});
} else {
$.post('rules/rules/action/reorder/' + ruleId, {_token: token, actions: entries}).fail(function () {
$.post('rules/action/order/' + ruleId, {_token: token, actions: entries}).fail(function () {
alert('Could not re-order rule actions. Please refresh the page.');
});

View File

@ -136,13 +136,13 @@ function resetSplits() {
// ends with ][description]
$.each($('input[name$="][description]"]'), function (i, v) {
var input = $(v);
input.attr('name', 'transaction[' + i + '][description]');
input.attr('name', 'transactions[' + i + '][description]');
console.log('description is now ' + input.attr('name'));
});
// ends with ][destination_account_name]
$.each($('input[name$="][destination_account_name]"]'), function (i, v) {
var input = $(v);
input.attr('name', 'transaction[' + i + '][destination_account_name]');
input.attr('name', 'transactions[' + i + '][destination_account_name]');
console.log('destination_account_name is now ' + input.attr('name'));
});
// ends with ][source_account_name]
@ -154,19 +154,19 @@ function resetSplits() {
// ends with ][amount]
$.each($('input[name$="][amount]"]'), function (i, v) {
var input = $(v);
input.attr('name', 'transaction[' + i + '][amount]');
input.attr('name', 'transactions[' + i + '][amount]');
console.log('amount is now ' + input.attr('name'));
});
// ends with ][budget_id]
$.each($('input[name$="][budget_id]"]'), function (i, v) {
var input = $(v);
input.attr('name', 'transaction[' + i + '][budget_id]');
input.attr('name', 'transactions[' + i + '][budget_id]');
console.log('budget_id is now ' + input.attr('name'));
});
// ends with ][category]
$.each($('input[name$="][category]"]'), function (i, v) {
var input = $(v);
input.attr('name', 'transaction[' + i + '][category]');
input.attr('name', 'transactions[' + i + '][category]');
console.log('category is now ' + input.attr('name'));
});
}

View File

@ -425,7 +425,6 @@ return [
'stored_new_bill' => 'Stored new bill ":name"',
'cannot_scan_inactive_bill' => 'Inactive bills cannot be scanned.',
'rescanned_bill' => 'Rescanned everything.',
'bill_date_little_relevance' => 'The only part of this date used by Firefly is the day. It is only useful when your bill arrives at exactly the same date every month. If the payment date of your bills varies, simply use the first of the month.',
'average_bill_amount_year' => 'Average bill amount (:year)',
'average_bill_amount_overall' => 'Average bill amount (overall)',

View File

@ -20,7 +20,7 @@
{{ ExpandedForm.tags('match') }}
{{ ExpandedForm.amount('amount_min') }}
{{ ExpandedForm.amount('amount_max') }}
{{ ExpandedForm.date('date',phpdate('Y-m-d'), {helpText: trans('firefly.bill_date_little_relevance')}) }}
{{ ExpandedForm.date('date',phpdate('Y-m-d')) }}
{{ ExpandedForm.select('repeat_freq',periods,'monthly') }}
</div>
</div>

View File

@ -21,7 +21,7 @@
{{ ExpandedForm.tags('match') }}
{{ ExpandedForm.amount('amount_min') }}
{{ ExpandedForm.amount('amount_max') }}
{{ ExpandedForm.date('date',bill.date.format('Y-m-d'), {helpText: trans('firefly.bill_date_little_relevance')}) }}
{{ ExpandedForm.date('date',bill.date.format('Y-m-d')) }}
{{ ExpandedForm.select('repeat_freq',periods) }}
</div>
</div>