diff --git a/code/app/Http/Controllers/StatisticsController.php b/code/app/Http/Controllers/StatisticsController.php index 7cea362f..23b3a6e3 100644 --- a/code/app/Http/Controllers/StatisticsController.php +++ b/code/app/Http/Controllers/StatisticsController.php @@ -114,7 +114,7 @@ private function getSummary($start, $end, $type, $target) })->join('bookings', 'booked_products.booking_id', '=', 'bookings.id')->join('orders', 'bookings.order_id', '=', 'orders.id')->groupBy('orders.supplier_id'); if ($type == 'all') { - $data_for_suppliers_query->selectRaw('orders.supplier_id, SUM(price * booked_products.quantity) as price')->join('products', 'booked_products.product_id', '=', 'products.id'); + $data_for_suppliers_query->selectRaw('orders.supplier_id, SUM(products.price * booked_products.quantity) as price')->join('products', 'booked_products.product_id', '=', 'products.id'); } else { $data_for_suppliers_query->selectRaw('orders.supplier_id, SUM(final_price) as price'); diff --git a/code/app/Printers/Concerns/Summary.php b/code/app/Printers/Concerns/Summary.php index 17b30451..fa92a88d 100644 --- a/code/app/Printers/Concerns/Summary.php +++ b/code/app/Printers/Concerns/Summary.php @@ -43,7 +43,7 @@ protected function formatSummary($order, $document, $fields, $status, $shipping_ if ($shipping_place && $shipping_place == 'all_by_place') { $places = Delivery::orderBy('name', 'asc')->get(); foreach($places as $place) { - $table = $this->formatSummaryShipping($order, $document, $fields, $internal_offsets, $place->id); + $table = $this->formatSummaryShipping($order, $fields, $internal_offsets, $place->id); if ($table) { $document->append(new Header($place->printableName())); $document->append($table);