Skip to content

Commit 9592f07

Browse files
committed
Fixed sortBy bug on quote, order, invoice, delivery & purchase order create
1 parent cba42c6 commit 9592f07

File tree

7 files changed

+10
-8
lines changed

7 files changed

+10
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
### Fixed
1919
### Removed --->
2020

21+
## 1.3.1 - 2024-04-07
22+
### Fixed
23+
- sortBy bug when creating new quotes, orders, invoices, deliveries & purchase orders
24+
2125
## 1.3.0 - 2024-04-04
2226
### Added
2327
- Quote, Order, Invoice, Delivery & Purchase Order Item order drag & drop

config/package.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
|
1414
*/
1515

16-
'version' => '1.3.0',
16+
'version' => '1.3.1',
1717

1818
];

src/Http/Livewire/LiveDeliveryItems.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class LiveDeliveryItems extends Component
4040
public function mount($delivery, $products, $old = null, $fromOrder = false)
4141
{
4242
$this->delivery = $delivery;
43-
$this->products = $products;
43+
$this->products = $products ? $products->sortBy('order') : null;;
4444
$this->old = $old;
4545
$this->fromOrder = $fromOrder;
4646

src/Http/Livewire/LiveInvoiceLines.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function boot(SettingService $settingService)
6161
public function mount($invoice, $invoiceLines, $old = null, $fromOrder = false)
6262
{
6363
$this->invoice = $invoice;
64-
$this->invoiceLines = $invoiceLines;
64+
$this->invoiceLines = $invoiceLines ? $invoiceLines->sortBy('order') : null;
6565
$this->old = $old;
6666
$this->fromOrder = $fromOrder;
6767

src/Http/Livewire/LiveOrderItems.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function boot(SettingService $settingService)
6767
public function mount($order, $products, $old = null, $fromQuote = false)
6868
{
6969
$this->order = $order;
70-
$this->products = $products->sortBy('order');
70+
$this->products = $products ? $products->sortBy('order') : null;
7171
$this->old = $old;
7272
$this->fromQuote = $fromQuote;
7373

src/Http/Livewire/LivePurchaseOrderLines.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function boot(SettingService $settingService)
6666
public function mount($purchaseOrder, $purchaseOrderLines, $old = null, $fromOrder = false)
6767
{
6868
$this->purchaseOrder = $purchaseOrder;
69-
$this->purchaseOrderLines = $purchaseOrderLines;
69+
$this->purchaseOrderLines = $purchaseOrderLines ? $purchaseOrderLines->sortBy('order') : null;
7070
$this->old = $old;
7171
$this->fromOrder = $fromOrder;
7272

src/Http/Livewire/LiveQuoteItems.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ public function boot(SettingService $settingService)
6060
public function mount($quote, $products, $old = null)
6161
{
6262
$this->quote = $quote;
63-
64-
$this->products = $products->sortBy('order');
65-
63+
$this->products = $products ? $products->sortBy('order') : null;
6664
$this->old = $old;
6765

6866
if ($this->old) {

0 commit comments

Comments
 (0)