mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Ability to delete recurring transactions.
This commit is contained in:
70
app/Http/Controllers/Recurring/DeleteController.php
Normal file
70
app/Http/Controllers/Recurring/DeleteController.php
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* DeleteController.php
|
||||||
|
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||||
|
*
|
||||||
|
* This file is part of Firefly III.
|
||||||
|
*
|
||||||
|
* Firefly III is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Firefly III is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace FireflyIII\Http\Controllers\Recurring;
|
||||||
|
|
||||||
|
|
||||||
|
use FireflyIII\Http\Controllers\Controller;
|
||||||
|
use FireflyIII\Models\Recurrence;
|
||||||
|
use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class DeleteController
|
||||||
|
*/
|
||||||
|
class DeleteController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param Recurrence $recurrence
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||||
|
*/
|
||||||
|
public function delete(Recurrence $recurrence)
|
||||||
|
{
|
||||||
|
$subTitle = trans('firefly.delete_recurring', ['title' => $recurrence->title]);
|
||||||
|
// put previous url in session
|
||||||
|
$this->rememberPreviousUri('recurrences.delete.uri');
|
||||||
|
|
||||||
|
// todo actual number.
|
||||||
|
$journalsCreated = 5;
|
||||||
|
|
||||||
|
return view('recurring.delete', compact('recurrence', 'subTitle','journalsCreated'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param RecurringRepositoryInterface $repository
|
||||||
|
* @param Request $request
|
||||||
|
* @param Recurrence $recurrence
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||||
|
*/
|
||||||
|
public function destroy(RecurringRepositoryInterface $repository, Request $request, Recurrence $recurrence)
|
||||||
|
{
|
||||||
|
$repository->destroy($recurrence);
|
||||||
|
$request->session()->flash('success', (string)trans('firefly.' . 'recurrence_deleted', ['title' => $recurrence->title]));
|
||||||
|
app('preferences')->mark();
|
||||||
|
|
||||||
|
return redirect($this->getPreviousUri('recurrences.delete.uri'));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -101,6 +101,7 @@ class SpectreRoutine implements RoutineInterface
|
|||||||
$handler = app(StageImportDataHandler::class);
|
$handler = app(StageImportDataHandler::class);
|
||||||
$handler->setImportJob($this->importJob);
|
$handler->setImportJob($this->importJob);
|
||||||
$handler->run();
|
$handler->run();
|
||||||
|
// todo apply rules.
|
||||||
$this->repository->setStatus($this->importJob, 'provider_finished');
|
$this->repository->setStatus($this->importJob, 'provider_finished');
|
||||||
$this->repository->setStage($this->importJob, 'final');
|
$this->repository->setStage($this->importJob, 'final');
|
||||||
}
|
}
|
||||||
|
@@ -56,6 +56,8 @@ class CreateRecurringTransactions implements ShouldQueue
|
|||||||
$recurrences = $this->repository->getAll();
|
$recurrences = $this->repository->getAll();
|
||||||
Log::debug(sprintf('Count of collection is %d', $recurrences->count()));
|
Log::debug(sprintf('Count of collection is %d', $recurrences->count()));
|
||||||
|
|
||||||
|
$result = [];
|
||||||
|
|
||||||
/** @var Collection $filtered */
|
/** @var Collection $filtered */
|
||||||
$filtered = $recurrences->filter(
|
$filtered = $recurrences->filter(
|
||||||
function (Recurrence $recurrence) {
|
function (Recurrence $recurrence) {
|
||||||
@@ -66,12 +68,24 @@ class CreateRecurringTransactions implements ShouldQueue
|
|||||||
Log::debug(sprintf('Left after filtering is %d', $filtered->count()));
|
Log::debug(sprintf('Left after filtering is %d', $filtered->count()));
|
||||||
/** @var Recurrence $recurrence */
|
/** @var Recurrence $recurrence */
|
||||||
foreach ($filtered as $recurrence) {
|
foreach ($filtered as $recurrence) {
|
||||||
|
if (!isset($result[$recurrence->user_id])) {
|
||||||
|
$result[$recurrence->user_id] = new Collection;
|
||||||
|
}
|
||||||
|
|
||||||
$this->repository->setUser($recurrence->user);
|
$this->repository->setUser($recurrence->user);
|
||||||
$this->journalRepository->setUser($recurrence->user);
|
$this->journalRepository->setUser($recurrence->user);
|
||||||
Log::debug(sprintf('Now at recurrence #%d', $recurrence->id));
|
Log::debug(sprintf('Now at recurrence #%d', $recurrence->id));
|
||||||
$this->handleRepetitions($recurrence);
|
$created = $this->handleRepetitions($recurrence);
|
||||||
Log::debug(sprintf('Done with recurrence #%c', $recurrence->id));
|
Log::debug(sprintf('Done with recurrence #%c', $recurrence->id));
|
||||||
|
|
||||||
|
$result[$recurrence->user_id] = $result[$recurrence->user_id]->merge($created);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// will now send email to users.
|
||||||
|
foreach($result as $userId => $journals) {
|
||||||
|
$this->sendReport($userId, $journals);
|
||||||
|
}
|
||||||
|
|
||||||
Log::debug('Done with handle()');
|
Log::debug('Done with handle()');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,10 +174,12 @@ class CreateRecurringTransactions implements ShouldQueue
|
|||||||
* @param Recurrence $recurrence
|
* @param Recurrence $recurrence
|
||||||
* @param array $occurrences
|
* @param array $occurrences
|
||||||
*
|
*
|
||||||
|
* @return Collection
|
||||||
* @throws \FireflyIII\Exceptions\FireflyException
|
* @throws \FireflyIII\Exceptions\FireflyException
|
||||||
*/
|
*/
|
||||||
private function handleOccurrences(Recurrence $recurrence, array $occurrences): void
|
private function handleOccurrences(Recurrence $recurrence, array $occurrences): Collection
|
||||||
{
|
{
|
||||||
|
$collection = new Collection;
|
||||||
/** @var Carbon $date */
|
/** @var Carbon $date */
|
||||||
foreach ($occurrences as $date) {
|
foreach ($occurrences as $date) {
|
||||||
Log::debug(sprintf('Now at date %s.', $date->format('Y-m-d')));
|
Log::debug(sprintf('Now at date %s.', $date->format('Y-m-d')));
|
||||||
@@ -195,21 +211,29 @@ class CreateRecurringTransactions implements ShouldQueue
|
|||||||
];
|
];
|
||||||
$journal = $this->journalRepository->store($array);
|
$journal = $this->journalRepository->store($array);
|
||||||
Log::info(sprintf('Created new journal #%d', $journal->id));
|
Log::info(sprintf('Created new journal #%d', $journal->id));
|
||||||
|
// todo fire rules
|
||||||
|
$collection->push($journal);
|
||||||
// update recurring thing:
|
// update recurring thing:
|
||||||
$recurrence->latest_date = $date;
|
$recurrence->latest_date = $date;
|
||||||
$recurrence->save();
|
$recurrence->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Separate method that will loop all repetitions and do something with it:
|
* Separate method that will loop all repetitions and do something with it. Will return
|
||||||
|
* all created transaction journals.
|
||||||
*
|
*
|
||||||
* @param Recurrence $recurrence
|
* @param Recurrence $recurrence
|
||||||
*
|
*
|
||||||
|
* @return Collection
|
||||||
|
*
|
||||||
* @throws \FireflyIII\Exceptions\FireflyException
|
* @throws \FireflyIII\Exceptions\FireflyException
|
||||||
*/
|
*/
|
||||||
private function handleRepetitions(Recurrence $recurrence): void
|
private function handleRepetitions(Recurrence $recurrence): Collection
|
||||||
{
|
{
|
||||||
|
$collection = new Collection;
|
||||||
/** @var RecurrenceRepetition $repetition */
|
/** @var RecurrenceRepetition $repetition */
|
||||||
foreach ($recurrence->recurrenceRepetitions as $repetition) {
|
foreach ($recurrence->recurrenceRepetitions as $repetition) {
|
||||||
Log::debug(
|
Log::debug(
|
||||||
@@ -227,8 +251,11 @@ class CreateRecurringTransactions implements ShouldQueue
|
|||||||
), $this->debugArray($occurrences)
|
), $this->debugArray($occurrences)
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->handleOccurrences($recurrence, $occurrences);
|
$result = $this->handleOccurrences($recurrence, $occurrences);
|
||||||
|
$collection = $collection->merge($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -33,6 +33,7 @@ use FireflyIII\Models\RecurrenceMeta;
|
|||||||
use FireflyIII\Models\RecurrenceRepetition;
|
use FireflyIII\Models\RecurrenceRepetition;
|
||||||
use FireflyIII\Models\RecurrenceTransaction;
|
use FireflyIII\Models\RecurrenceTransaction;
|
||||||
use FireflyIII\Models\RecurrenceTransactionMeta;
|
use FireflyIII\Models\RecurrenceTransactionMeta;
|
||||||
|
use FireflyIII\Services\Internal\Destroy\RecurrenceDestroyService;
|
||||||
use FireflyIII\Services\Internal\Update\RecurrenceUpdateService;
|
use FireflyIII\Services\Internal\Update\RecurrenceUpdateService;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
@@ -47,6 +48,18 @@ class RecurringRepository implements RecurringRepositoryInterface
|
|||||||
/** @var User */
|
/** @var User */
|
||||||
private $user;
|
private $user;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroy a recurring transaction.
|
||||||
|
*
|
||||||
|
* @param Recurrence $recurrence
|
||||||
|
*/
|
||||||
|
public function destroy(Recurrence $recurrence): void
|
||||||
|
{
|
||||||
|
/** @var RecurrenceDestroyService $service */
|
||||||
|
$service = app(RecurrenceDestroyService::class);
|
||||||
|
$service->destroy($recurrence);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all of the user's recurring transactions.
|
* Returns all of the user's recurring transactions.
|
||||||
*
|
*
|
||||||
|
@@ -39,6 +39,13 @@ use Illuminate\Support\Collection;
|
|||||||
*/
|
*/
|
||||||
interface RecurringRepositoryInterface
|
interface RecurringRepositoryInterface
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Destroy a recurring transaction.
|
||||||
|
*
|
||||||
|
* @param Recurrence $recurrence
|
||||||
|
*/
|
||||||
|
public function destroy(Recurrence $recurrence): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all of the user's recurring transactions.
|
* Returns all of the user's recurring transactions.
|
||||||
*
|
*
|
||||||
@@ -48,19 +55,11 @@ interface RecurringRepositoryInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get ALL recurring transactions.
|
* Get ALL recurring transactions.
|
||||||
|
*
|
||||||
* @return Collection
|
* @return Collection
|
||||||
*/
|
*/
|
||||||
public function getAll(): Collection;
|
public function getAll(): Collection;
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the category from a recurring transaction transaction.
|
|
||||||
*
|
|
||||||
* @param RecurrenceTransaction $recurrenceTransaction
|
|
||||||
*
|
|
||||||
* @return null|string
|
|
||||||
*/
|
|
||||||
public function getCategory(RecurrenceTransaction $recurrenceTransaction): ?string;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the budget ID from a recurring transaction transaction.
|
* Get the budget ID from a recurring transaction transaction.
|
||||||
*
|
*
|
||||||
@@ -70,6 +69,15 @@ interface RecurringRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function getBudget(RecurrenceTransaction $recurrenceTransaction): ?int;
|
public function getBudget(RecurrenceTransaction $recurrenceTransaction): ?int;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the category from a recurring transaction transaction.
|
||||||
|
*
|
||||||
|
* @param RecurrenceTransaction $recurrenceTransaction
|
||||||
|
*
|
||||||
|
* @return null|string
|
||||||
|
*/
|
||||||
|
public function getCategory(RecurrenceTransaction $recurrenceTransaction): ?string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the notes.
|
* Get the notes.
|
||||||
*
|
*
|
||||||
|
48
app/Services/Internal/Destroy/RecurrenceDestroyService.php
Normal file
48
app/Services/Internal/Destroy/RecurrenceDestroyService.php
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* RecurrenceDestroyService.php
|
||||||
|
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||||
|
*
|
||||||
|
* This file is part of Firefly III.
|
||||||
|
*
|
||||||
|
* Firefly III is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Firefly III is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace FireflyIII\Services\Internal\Destroy;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use FireflyIII\Models\Recurrence;
|
||||||
|
use Log;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
* Class RecurrenceDestroyService
|
||||||
|
*/
|
||||||
|
class RecurrenceDestroyService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param Recurrence $recurrence
|
||||||
|
*/
|
||||||
|
public function destroy(Recurrence $recurrence): void
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$recurrence->delete();
|
||||||
|
} catch (Exception $e) { // @codeCoverageIgnore
|
||||||
|
Log::error(sprintf('Could not delete recurrence: %s', $e->getMessage())); // @codeCoverageIgnore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -1260,4 +1260,6 @@ return [
|
|||||||
'update_recurrence' => 'Update recurring transaction',
|
'update_recurrence' => 'Update recurring transaction',
|
||||||
'updated_recurrence' => 'Updated recurring transaction ":title"',
|
'updated_recurrence' => 'Updated recurring transaction ":title"',
|
||||||
'recurrence_is_inactive' => 'This recurring transaction is not active and will not generate new transactions.',
|
'recurrence_is_inactive' => 'This recurring transaction is not active and will not generate new transactions.',
|
||||||
|
'delete_recurring' => 'Delete recurring transaction ":title"',
|
||||||
|
'recurrence_deleted' => 'Recurring transaction ":title" deleted',
|
||||||
];
|
];
|
||||||
|
@@ -94,90 +94,93 @@ return [
|
|||||||
'convert_Deposit' => 'Convert deposit',
|
'convert_Deposit' => 'Convert deposit',
|
||||||
'convert_Transfer' => 'Convert transfer',
|
'convert_Transfer' => 'Convert transfer',
|
||||||
|
|
||||||
'amount' => 'Amount',
|
'amount' => 'Amount',
|
||||||
'foreign_amount' => 'Foreign amount',
|
'foreign_amount' => 'Foreign amount',
|
||||||
'existing_attachments' => 'Existing attachments',
|
'existing_attachments' => 'Existing attachments',
|
||||||
'date' => 'Date',
|
'date' => 'Date',
|
||||||
'interest_date' => 'Interest date',
|
'interest_date' => 'Interest date',
|
||||||
'book_date' => 'Book date',
|
'book_date' => 'Book date',
|
||||||
'process_date' => 'Processing date',
|
'process_date' => 'Processing date',
|
||||||
'category' => 'Category',
|
'category' => 'Category',
|
||||||
'tags' => 'Tags',
|
'tags' => 'Tags',
|
||||||
'deletePermanently' => 'Delete permanently',
|
'deletePermanently' => 'Delete permanently',
|
||||||
'cancel' => 'Cancel',
|
'cancel' => 'Cancel',
|
||||||
'targetdate' => 'Target date',
|
'targetdate' => 'Target date',
|
||||||
'startdate' => 'Start date',
|
'startdate' => 'Start date',
|
||||||
'tag' => 'Tag',
|
'tag' => 'Tag',
|
||||||
'under' => 'Under',
|
'under' => 'Under',
|
||||||
'symbol' => 'Symbol',
|
'symbol' => 'Symbol',
|
||||||
'code' => 'Code',
|
'code' => 'Code',
|
||||||
'iban' => 'IBAN',
|
'iban' => 'IBAN',
|
||||||
'accountNumber' => 'Account number',
|
'accountNumber' => 'Account number',
|
||||||
'creditCardNumber' => 'Credit card number',
|
'creditCardNumber' => 'Credit card number',
|
||||||
'has_headers' => 'Headers',
|
'has_headers' => 'Headers',
|
||||||
'date_format' => 'Date format',
|
'date_format' => 'Date format',
|
||||||
'specifix' => 'Bank- or file specific fixes',
|
'specifix' => 'Bank- or file specific fixes',
|
||||||
'attachments[]' => 'Attachments',
|
'attachments[]' => 'Attachments',
|
||||||
'store_new_withdrawal' => 'Store new withdrawal',
|
'store_new_withdrawal' => 'Store new withdrawal',
|
||||||
'store_new_deposit' => 'Store new deposit',
|
'store_new_deposit' => 'Store new deposit',
|
||||||
'store_new_transfer' => 'Store new transfer',
|
'store_new_transfer' => 'Store new transfer',
|
||||||
'add_new_withdrawal' => 'Add a new withdrawal',
|
'add_new_withdrawal' => 'Add a new withdrawal',
|
||||||
'add_new_deposit' => 'Add a new deposit',
|
'add_new_deposit' => 'Add a new deposit',
|
||||||
'add_new_transfer' => 'Add a new transfer',
|
'add_new_transfer' => 'Add a new transfer',
|
||||||
'title' => 'Title',
|
'title' => 'Title',
|
||||||
'notes' => 'Notes',
|
'notes' => 'Notes',
|
||||||
'filename' => 'File name',
|
'filename' => 'File name',
|
||||||
'mime' => 'Mime type',
|
'mime' => 'Mime type',
|
||||||
'size' => 'Size',
|
'size' => 'Size',
|
||||||
'trigger' => 'Trigger',
|
'trigger' => 'Trigger',
|
||||||
'stop_processing' => 'Stop processing',
|
'stop_processing' => 'Stop processing',
|
||||||
'start_date' => 'Start of range',
|
'start_date' => 'Start of range',
|
||||||
'end_date' => 'End of range',
|
'end_date' => 'End of range',
|
||||||
'export_start_range' => 'Start of export range',
|
'export_start_range' => 'Start of export range',
|
||||||
'export_end_range' => 'End of export range',
|
'export_end_range' => 'End of export range',
|
||||||
'export_format' => 'File format',
|
'export_format' => 'File format',
|
||||||
'include_attachments' => 'Include uploaded attachments',
|
'include_attachments' => 'Include uploaded attachments',
|
||||||
'include_old_uploads' => 'Include imported data',
|
'include_old_uploads' => 'Include imported data',
|
||||||
'accounts' => 'Export transactions from these accounts',
|
'accounts' => 'Export transactions from these accounts',
|
||||||
'delete_account' => 'Delete account ":name"',
|
'delete_account' => 'Delete account ":name"',
|
||||||
'delete_bill' => 'Delete bill ":name"',
|
'delete_bill' => 'Delete bill ":name"',
|
||||||
'delete_budget' => 'Delete budget ":name"',
|
'delete_budget' => 'Delete budget ":name"',
|
||||||
'delete_category' => 'Delete category ":name"',
|
'delete_category' => 'Delete category ":name"',
|
||||||
'delete_currency' => 'Delete currency ":name"',
|
'delete_currency' => 'Delete currency ":name"',
|
||||||
'delete_journal' => 'Delete transaction with description ":description"',
|
'delete_journal' => 'Delete transaction with description ":description"',
|
||||||
'delete_attachment' => 'Delete attachment ":name"',
|
'delete_attachment' => 'Delete attachment ":name"',
|
||||||
'delete_rule' => 'Delete rule ":title"',
|
'delete_rule' => 'Delete rule ":title"',
|
||||||
'delete_rule_group' => 'Delete rule group ":title"',
|
'delete_rule_group' => 'Delete rule group ":title"',
|
||||||
'delete_link_type' => 'Delete link type ":name"',
|
'delete_link_type' => 'Delete link type ":name"',
|
||||||
'delete_user' => 'Delete user ":email"',
|
'delete_user' => 'Delete user ":email"',
|
||||||
'user_areYouSure' => 'If you delete user ":email", everything will be gone. There is no undo, undelete or anything. If you delete yourself, you will lose access to this instance of Firefly III.',
|
'delete_recurring' => 'Delete recurring transaction ":title"',
|
||||||
'attachment_areYouSure' => 'Are you sure you want to delete the attachment named ":name"?',
|
'user_areYouSure' => 'If you delete user ":email", everything will be gone. There is no undo, undelete or anything. If you delete yourself, you will lose access to this instance of Firefly III.',
|
||||||
'account_areYouSure' => 'Are you sure you want to delete the account named ":name"?',
|
'attachment_areYouSure' => 'Are you sure you want to delete the attachment named ":name"?',
|
||||||
'bill_areYouSure' => 'Are you sure you want to delete the bill named ":name"?',
|
'account_areYouSure' => 'Are you sure you want to delete the account named ":name"?',
|
||||||
'rule_areYouSure' => 'Are you sure you want to delete the rule titled ":title"?',
|
'bill_areYouSure' => 'Are you sure you want to delete the bill named ":name"?',
|
||||||
'ruleGroup_areYouSure' => 'Are you sure you want to delete the rule group titled ":title"?',
|
'rule_areYouSure' => 'Are you sure you want to delete the rule titled ":title"?',
|
||||||
'budget_areYouSure' => 'Are you sure you want to delete the budget named ":name"?',
|
'ruleGroup_areYouSure' => 'Are you sure you want to delete the rule group titled ":title"?',
|
||||||
'category_areYouSure' => 'Are you sure you want to delete the category named ":name"?',
|
'budget_areYouSure' => 'Are you sure you want to delete the budget named ":name"?',
|
||||||
'currency_areYouSure' => 'Are you sure you want to delete the currency named ":name"?',
|
'category_areYouSure' => 'Are you sure you want to delete the category named ":name"?',
|
||||||
'piggyBank_areYouSure' => 'Are you sure you want to delete the piggy bank named ":name"?',
|
'recurring_areYouSure' => 'Are you sure you want to delete the recurring transaction titled ":title"?',
|
||||||
'journal_areYouSure' => 'Are you sure you want to delete the transaction described ":description"?',
|
'currency_areYouSure' => 'Are you sure you want to delete the currency named ":name"?',
|
||||||
'mass_journal_are_you_sure' => 'Are you sure you want to delete these transactions?',
|
'piggyBank_areYouSure' => 'Are you sure you want to delete the piggy bank named ":name"?',
|
||||||
'tag_areYouSure' => 'Are you sure you want to delete the tag ":tag"?',
|
'journal_areYouSure' => 'Are you sure you want to delete the transaction described ":description"?',
|
||||||
'journal_link_areYouSure' => 'Are you sure you want to delete the link between <a href=":source_link">:source</a> and <a href=":destination_link">:destination</a>?',
|
'mass_journal_are_you_sure' => 'Are you sure you want to delete these transactions?',
|
||||||
'linkType_areYouSure' => 'Are you sure you want to delete the link type ":name" (":inward" / ":outward")?',
|
'tag_areYouSure' => 'Are you sure you want to delete the tag ":tag"?',
|
||||||
'permDeleteWarning' => 'Deleting stuff from Firefly III is permanent and cannot be undone.',
|
'journal_link_areYouSure' => 'Are you sure you want to delete the link between <a href=":source_link">:source</a> and <a href=":destination_link">:destination</a>?',
|
||||||
'mass_make_selection' => 'You can still prevent items from being deleted by removing the checkbox.',
|
'linkType_areYouSure' => 'Are you sure you want to delete the link type ":name" (":inward" / ":outward")?',
|
||||||
'delete_all_permanently' => 'Delete selected permanently',
|
'permDeleteWarning' => 'Deleting stuff from Firefly III is permanent and cannot be undone.',
|
||||||
'update_all_journals' => 'Update these transactions',
|
'mass_make_selection' => 'You can still prevent items from being deleted by removing the checkbox.',
|
||||||
'also_delete_transactions' => 'The only transaction connected to this account will be deleted as well.|All :count transactions connected to this account will be deleted as well.',
|
'delete_all_permanently' => 'Delete selected permanently',
|
||||||
'also_delete_connections' => 'The only transaction linked with this link type will lose this connection.|All :count transactions linked with this link type will lose their connection.',
|
'update_all_journals' => 'Update these transactions',
|
||||||
'also_delete_rules' => 'The only rule connected to this rule group will be deleted as well.|All :count rules connected to this rule group will be deleted as well.',
|
'also_delete_transactions' => 'The only transaction connected to this account will be deleted as well.|All :count transactions connected to this account will be deleted as well.',
|
||||||
'also_delete_piggyBanks' => 'The only piggy bank connected to this account will be deleted as well.|All :count piggy bank connected to this account will be deleted as well.',
|
'also_delete_connections' => 'The only transaction linked with this link type will lose this connection.|All :count transactions linked with this link type will lose their connection.',
|
||||||
'bill_keep_transactions' => 'The only transaction connected to this bill will not be deleted.|All :count transactions connected to this bill will spared deletion.',
|
'also_delete_rules' => 'The only rule connected to this rule group will be deleted as well.|All :count rules connected to this rule group will be deleted as well.',
|
||||||
'budget_keep_transactions' => 'The only transaction connected to this budget will not be deleted.|All :count transactions connected to this budget will spared deletion.',
|
'also_delete_piggyBanks' => 'The only piggy bank connected to this account will be deleted as well.|All :count piggy bank connected to this account will be deleted as well.',
|
||||||
'category_keep_transactions' => 'The only transaction connected to this category will not be deleted.|All :count transactions connected to this category will spared deletion.',
|
'bill_keep_transactions' => 'The only transaction connected to this bill will not be deleted.|All :count transactions connected to this bill will be spared deletion.',
|
||||||
'tag_keep_transactions' => 'The only transaction connected to this tag will not be deleted.|All :count transactions connected to this tag will spared deletion.',
|
'budget_keep_transactions' => 'The only transaction connected to this budget will not be deleted.|All :count transactions connected to this budget will be spared deletion.',
|
||||||
'check_for_updates' => 'Check for updates',
|
'category_keep_transactions' => 'The only transaction connected to this category will not be deleted.|All :count transactions connected to this category will be spared deletion.',
|
||||||
|
'recurring_keep_transactions' => 'The only transaction created by this recurring transaction will not be deleted.|All :count transactions created by this recurring transaction will be spared deletion.',
|
||||||
|
'tag_keep_transactions' => 'The only transaction connected to this tag will not be deleted.|All :count transactions connected to this tag will be spared deletion.',
|
||||||
|
'check_for_updates' => 'Check for updates',
|
||||||
|
|
||||||
'email' => 'Email address',
|
'email' => 'Email address',
|
||||||
'password' => 'Password',
|
'password' => 'Password',
|
||||||
|
41
resources/views/recurring/delete.twig
Normal file
41
resources/views/recurring/delete.twig
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{% extends "./layout/default" %}
|
||||||
|
|
||||||
|
{% block breadcrumbs %}
|
||||||
|
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, recurrence) }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('recurring.destroy',recurrence.id) }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
|
||||||
|
<input name="_token" type="hidden" value="{{ csrf_token() }}">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-6 col-lg-offset-3 col-md-12 col-sm-12">
|
||||||
|
<div class="box box-danger">
|
||||||
|
<div class="box-header with-border">
|
||||||
|
<h3 class="box-title">{{ trans('form.delete_recurring', {'title': recurrence.title}) }}</h3>
|
||||||
|
</div>
|
||||||
|
<div class="box-body">
|
||||||
|
<p class="text-danger">
|
||||||
|
{{ trans('form.permDeleteWarning') }}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{{ trans('form.recurring_areYouSure', {'title': recurrence.title}) }}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{% if journalsCreated > 0 %}
|
||||||
|
{{ Lang.choice('form.recurring_keep_transactions', journalsCreated, {count: journalsCreated }) }}
|
||||||
|
{% endif %}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="box-footer">
|
||||||
|
<input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn btn-danger pull-right"/>
|
||||||
|
<a href="{{ URL.previous() }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
{% endblock %}
|
@@ -778,6 +778,14 @@ try {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Breadcrumbs::register(
|
||||||
|
'recurring.delete',
|
||||||
|
function (BreadCrumbsGenerator $breadcrumbs, Recurrence $recurrence) {
|
||||||
|
$breadcrumbs->parent('recurring.index');
|
||||||
|
$breadcrumbs->push(trans('firefly.delete_recurring', ['title' => $recurrence->title]), route('recurring.delete', [$recurrence->id]));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
Breadcrumbs::register(
|
Breadcrumbs::register(
|
||||||
'recurring.edit',
|
'recurring.edit',
|
||||||
function (BreadCrumbsGenerator $breadcrumbs, Recurrence $recurrence) {
|
function (BreadCrumbsGenerator $breadcrumbs, Recurrence $recurrence) {
|
||||||
|
@@ -626,6 +626,7 @@ Route::group(
|
|||||||
|
|
||||||
Route::post('store', ['uses' => 'CreateController@store', 'as' => 'store']);
|
Route::post('store', ['uses' => 'CreateController@store', 'as' => 'store']);
|
||||||
Route::post('update/{recurrence}', ['uses' => 'EditController@update', 'as' => 'update']);
|
Route::post('update/{recurrence}', ['uses' => 'EditController@update', 'as' => 'update']);
|
||||||
|
Route::post('destroy/{recurrence}', ['uses' => 'DeleteController@destroy', 'as' => 'destroy']);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user