diff --git a/CHANGELOG.md b/CHANGELOG.md index 256da35..47762fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 1557594..1194af9 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -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(); } diff --git a/resources/Views/about.php b/resources/Views/about.php index f9bb0b7..c69a711 100644 --- a/resources/Views/about.php +++ b/resources/Views/about.php @@ -5,7 +5,7 @@ - +
Bio-Manager Version2.6.12.6.2