This commit is contained in:
James Cole 2019-09-23 17:11:01 +02:00
parent a1ae85660d
commit 3c8935c0a8
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
5 changed files with 24 additions and 1 deletions

View File

@ -264,6 +264,9 @@ class BillController extends Controller
return redirect(route('bills.show', [$bill->id]));
}
// unlink all journals:
$this->billRepository->unlinkAll($bill);
foreach ($set as $rule) {
// simply fire off all rules?
/** @var TransactionMatcher $matcher */

View File

@ -686,4 +686,12 @@ class BillRepository implements BillRepositoryInterface
return $service->update($bill, $data);
}
/**
* @param Bill $bill
*/
public function unlinkAll(Bill $bill): void
{
$this->user->transactionJournals()->where('bill_id', $bill->id)->update(['bill_id' => null]);
}
}

View File

@ -33,6 +33,12 @@ use Illuminate\Support\Collection;
*/
interface BillRepositoryInterface
{
/**
* @param Bill $bill
*/
public function unlinkAll(Bill $bill): void;
/**
* @param Bill $bill
*

View File

@ -723,6 +723,7 @@ return [
// bills:
'match_between_amounts' => 'Bill matches transactions between :low and :high.',
'running_again_loss' => 'Previously linked transactions to this bill may lose their connection, if they (no longer) match the rule(s).',
'bill_related_rules' => 'Rules related to this bill',
'repeats' => 'Repeats',
'connected_journals' => 'Connected transactions',

View File

@ -88,7 +88,12 @@
{% endif %}
</div>
<div class="box-footer">
<a id="billButtons" href="{{ route('bills.rescan',object.data.id) }}" class="btn btn-default">{{ 'rescan_old'|_ }}</a>
<p><a id="billButtons" href="{{ route('bills.rescan',object.data.id) }}" class="btn btn-default">{{ 'rescan_old'|_ }}</a></p>
<p><small class="text-muted">
{{ 'running_again_loss'|_ }}
</small>
</p>
</div>
</div>
{% if object.data.notes %}