fix bug with invoice showing that doesn't belong to the order

This commit is contained in:
Omair Saleh
2023-05-25 15:35:56 +08:00
parent f7d0fe117e
commit 1cdd511f67
2 changed files with 0 additions and 3 deletions
-1
View File
@@ -51,7 +51,6 @@ class OrderResource extends JsonResource
];
}),
'invoices' => $this->whenLoaded('packingLists', function() use ($orderId) {
// return TransactionResource::collection(Transaction::whereHas('owner', function($query) use ($orderId) { return $query->where('owner_id', $orderId); })->get());
return TransactionResource::collection($this->transactions()->whereNotIn('transactions.status', [0, 1])->where('transactions.type', TransactionType::SHIPPING_INVOICE)->get());
}),
'remarks' => RemarkResource::collection($this->remarks),