mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-11-04 05:15:39 +00:00 
			
		
		
		
	Expand budget box and clear some languages.
This commit is contained in:
		@@ -290,7 +290,19 @@ class BudgetController extends Controller
 | 
			
		||||
            /** @var JournalCollectorInterface $collector */
 | 
			
		||||
            $collector = app(JournalCollectorInterface::class);
 | 
			
		||||
            $collector->setAllAssetAccounts()->setRange($begin, $subDay)->setTypes([TransactionType::DEPOSIT])->withOpposingAccount();
 | 
			
		||||
            $result['earned'] = bcdiv(strval($collector->getJournals()->sum('transaction_amount')),strval($count));
 | 
			
		||||
            $result['earned'] = bcdiv(strval($collector->getJournals()->sum('transaction_amount')), strval($count));
 | 
			
		||||
 | 
			
		||||
            // amount spent in period
 | 
			
		||||
            /** @var JournalCollectorInterface $collector */
 | 
			
		||||
            $collector = app(JournalCollectorInterface::class);
 | 
			
		||||
            $collector->setAllAssetAccounts()->setRange($begin, $subDay)->setTypes([TransactionType::WITHDRAWAL])->withOpposingAccount();
 | 
			
		||||
            $result['spent'] = bcdiv(strval($collector->getJournals()->sum('transaction_amount')), strval($count));
 | 
			
		||||
            // suggestion starts with the amount spent
 | 
			
		||||
            $result['suggested'] = bcmul($result['spent'], '-1');
 | 
			
		||||
            $result['suggested'] = bccomp($result['suggested'], $result['earned']) === 1 ? $result['earned'] : $result['suggested'];
 | 
			
		||||
            // unless it's more than you earned. So min() of suggested/earned
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            $cache->store($result);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,9 @@ use Response;
 | 
			
		||||
class BoxController extends Controller
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @param BudgetRepositoryInterface $repository
 | 
			
		||||
     *
 | 
			
		||||
     * @return \Illuminate\Http\JsonResponse
 | 
			
		||||
     */
 | 
			
		||||
    public function available(BudgetRepositoryInterface $repository)
 | 
			
		||||
    {
 | 
			
		||||
@@ -61,7 +63,7 @@ class BoxController extends Controller
 | 
			
		||||
        if (bccomp($left, '0') === -1) {
 | 
			
		||||
            $left = '0';
 | 
			
		||||
        }
 | 
			
		||||
        $days   = $today->diffInDays($end);
 | 
			
		||||
        $days   = $today->diffInDays($end) + 1;
 | 
			
		||||
        $perDay = '0';
 | 
			
		||||
        if ($days !== 0) {
 | 
			
		||||
            $perDay = bcdiv($left, strval($days));
 | 
			
		||||
 
 | 
			
		||||
@@ -83,11 +83,9 @@ return [
 | 
			
		||||
    'cannot_redirect_to_account'                 => 'Firefly III cannot redirect you to the correct page. Apologies.',
 | 
			
		||||
    'sum_of_expenses'                            => 'Sum of expenses',
 | 
			
		||||
    'sum_of_income'                              => 'Sum of income',
 | 
			
		||||
    'total_sum'                                  => 'Total sum',
 | 
			
		||||
    'spent_in_specific_budget'                   => 'Spent in budget ":budget"',
 | 
			
		||||
    'sum_of_expenses_in_budget'                  => 'Spent total in budget ":budget"',
 | 
			
		||||
    'left_in_budget_limit'                       => 'Left to spend according to budgeting',
 | 
			
		||||
    'cannot_reset_demo_user'                     => 'You cannot reset the password of the demonstration account',
 | 
			
		||||
    'current_period'                             => 'Current period',
 | 
			
		||||
    'show_the_current_period_and_overview'       => 'Show the current period and overview',
 | 
			
		||||
    'pref_languages_locale'                      => 'For a language other than English to work properly, your operating system must be equipped with the correct locale-information. If these are not present, currency data, dates and amounts may be formatted wrong.',
 | 
			
		||||
@@ -159,7 +157,6 @@ return [
 | 
			
		||||
    'export_format'                              => 'Export format',
 | 
			
		||||
    'export_format_csv'                          => 'Comma separated values (CSV file)',
 | 
			
		||||
    'export_format_mt940'                        => 'MT940 compatible format',
 | 
			
		||||
    'export_included_accounts'                   => 'Export transactions from these accounts',
 | 
			
		||||
    'include_old_uploads_help'                   => 'Firefly III does not throw away the original CSV files you have imported in the past. You can include them in your export.',
 | 
			
		||||
    'do_export'                                  => 'Export',
 | 
			
		||||
    'export_status_never_started'                => 'The export has not started yet',
 | 
			
		||||
@@ -330,7 +327,6 @@ return [
 | 
			
		||||
    'location'                                   => 'Location',
 | 
			
		||||
    'without_date'                               => 'Without date',
 | 
			
		||||
    'result'                                     => 'Result',
 | 
			
		||||
    'total_result'                               => 'Total result',
 | 
			
		||||
    'sums_apply_to_range'                        => 'All sums apply to the selected range',
 | 
			
		||||
 | 
			
		||||
    // preferences
 | 
			
		||||
@@ -462,7 +458,6 @@ return [
 | 
			
		||||
    'convert_options_DepositWithdrawal'          => 'Convert a deposit into a withdrawal',
 | 
			
		||||
    'convert_options_TransferWithdrawal'         => 'Convert a transfer into a withdrawal',
 | 
			
		||||
    'convert_options_TransferDeposit'            => 'Convert a transfer into a deposit',
 | 
			
		||||
    'transaction_journal_convert_options'        => 'Convert this transaction',
 | 
			
		||||
    'convert_Withdrawal_to_deposit'              => 'Convert this withdrawal to a deposit',
 | 
			
		||||
    'convert_Withdrawal_to_transfer'             => 'Convert this withdrawal to a transfer',
 | 
			
		||||
    'convert_Deposit_to_withdrawal'              => 'Convert this deposit to a withdrawal',
 | 
			
		||||
@@ -534,8 +529,6 @@ return [
 | 
			
		||||
    'budget_period_navigator'                    => 'Period navigator',
 | 
			
		||||
    'info_on_available_amount'                   => 'What do I have available?',
 | 
			
		||||
    'available_amount_indication'                => 'Use these amounts to get an indication of what your total budget could be.',
 | 
			
		||||
    'amount_budgeted'                            => 'Amount budgeted',
 | 
			
		||||
    'amount_earned'                              => 'Amount earned',
 | 
			
		||||
    'suggested'                                  => 'Suggested',
 | 
			
		||||
    'average_between'                            => 'Average between :start and :end',
 | 
			
		||||
 | 
			
		||||
@@ -942,7 +935,6 @@ return [
 | 
			
		||||
    'transaction'                           => 'Transaction',
 | 
			
		||||
    'comments'                              => 'Comments',
 | 
			
		||||
    'to_link_not_found'                     => 'If the transaction you want to link to is not listed, simply enter its ID.',
 | 
			
		||||
    'invalid_link_data'                     => 'Invalid link type selected. Cannot link transaction.',
 | 
			
		||||
    'invalid_link_selection'                => 'Cannot link these transactions',
 | 
			
		||||
    'journals_linked'                       => 'Transactions are linked.',
 | 
			
		||||
    'journals_error_linked'                 => 'These transactions are already linked.',
 | 
			
		||||
 
 | 
			
		||||
@@ -13,14 +13,14 @@
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="box-body">
 | 
			
		||||
                    <div class="row">
 | 
			
		||||
                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
 | 
			
		||||
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
 | 
			
		||||
                            <small>{{ 'budgeted'|_ }}: <span id="budgetedAmount" class="text-success">{{ budgeted|formatAmountPlain }}</span></small>
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6" style="text-align:right;margin-bottom:3px;">
 | 
			
		||||
                            <small id="availableBar">{{ trans('firefly.available_between',{start : periodStart, end: periodEnd }) }}:
 | 
			
		||||
                                <span id="available" data-value="{{ available }}">{{ available|formatAmountPlain }}</span>
 | 
			
		||||
                        <div class="col-lg-9 col-md-9 col-sm-9 col-xs-9" style="text-align:right;margin-bottom:3px;">
 | 
			
		||||
                                <small id="availableBar">{{ trans('firefly.available_between',{start : periodStart, end: periodEnd }) }}:
 | 
			
		||||
                                    <span id="available" data-value="{{ available }}">{{ available|formatAmountPlain }}</span>
 | 
			
		||||
                                    <a href="#" class="updateIncome btn btn-default btn-xs"><i class="fa fa-pencil"></i></a>
 | 
			
		||||
                                <a href="#" class="infoIncome btn btn-info btn-xs"><i class="fa fa-info-circle"></i></a>
 | 
			
		||||
                                    <a href="#" class="infoIncome btn btn-info btn-xs"><i class="fa fa-info-circle"></i></a>
 | 
			
		||||
                            </small>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
                <table class="table table-bordered table-striped">
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <td>
 | 
			
		||||
                            {{ 'amount_budgeted'|_ }}
 | 
			
		||||
                            {{ 'budgeted'|_ }}
 | 
			
		||||
                            <small><br />
 | 
			
		||||
                                {{ trans('firefly.average_between', {start:begin.formatLocalized(monthAndDayFormat), end:currentEnd.formatLocalized(monthAndDayFormat)}) }}
 | 
			
		||||
                        </td>
 | 
			
		||||
@@ -25,16 +25,24 @@
 | 
			
		||||
                        </td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <td>{{ 'amount_earned'|_ }}
 | 
			
		||||
                        <td>{{ 'earned'|_ }}
 | 
			
		||||
                            <small><br />
 | 
			
		||||
                                {{ trans('firefly.average_between', {start:begin.formatLocalized(monthAndDayFormat), end:currentEnd.formatLocalized(monthAndDayFormat)}) }}
 | 
			
		||||
                            </small>
 | 
			
		||||
                        </td>
 | 
			
		||||
                        <td><span class="pull-right">{{ result.earned|formatAmount }}</span></td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <td>{{ 'spent'|_ }}
 | 
			
		||||
                            <small><br />
 | 
			
		||||
                                {{ trans('firefly.average_between', {start:begin.formatLocalized(monthAndDayFormat), end:currentEnd.formatLocalized(monthAndDayFormat)}) }}
 | 
			
		||||
                            </small>
 | 
			
		||||
                        </td>
 | 
			
		||||
                        <td><span class="pull-right">{{ result.spent|formatAmount }}</span></td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <td><strong>{{ 'suggested'|_ }}</strong></td>
 | 
			
		||||
                        <td><span class="pull-right">{{ ((result.available + result.earned) / 2)|formatAmount }}</span></td>
 | 
			
		||||
                        <td><span class="pull-right">{{ result.suggested|formatAmount }}</span></td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                </table>
 | 
			
		||||
            </div>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user