Skip to content

Commit

Permalink
Fixed triggered exception if an invoice was set to "is paid" and saved
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterZydra committed Dec 12, 2024
1 parent cf1da85 commit 9354a74
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ Types of changes: `Added`, `Changed`, `Deprecate`, `Removed`, `Fixed`, `Secruity

## [Unreleased]

### v2.6.2 - 12.12.2024 - New developer feature and bugfix for invoice logic

### Added
- Added developer feature to show the executed SQL queries

### Fixed
- Fixed triggered exception if an invoice was set to "is paid" and saved

## v2.6.1 - 03.10.2024 - Bugfix in 'Revenue and Profits' view

### Fixed
Expand Down
9 changes: 8 additions & 1 deletion app/Http/Controllers/InvoiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,14 @@ public function update(): void

foreach (Http::param('deliveryNote') as $deliveryNoteId) {
$parts = explode('-', $deliveryNoteId);
DeliveryNote::findById($parts[0])
$deliveryNote = DeliveryNote::findById($parts[0]);

// Check if delivery note requires an update
if ($deliveryNote->getInvoiceId() === $invoice->getId()) {
continue;
}

$deliveryNote
->setInvoiceId($parts[1] === "1" ? $invoice->getId(): null)
->save();
}
Expand Down
2 changes: 1 addition & 1 deletion resources/Views/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<table class="scrollable">
<tr>
<td>Bio-Manager Version</td>
<td class="right">2.6.1</td>
<td class="right">2.6.2</td>
</tr>
<tr>
<td><?= __('Developer') ?></td>
Expand Down

0 comments on commit 9354a74

Please sign in to comment.