We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cost of customer processing = cost of customer service over a period / total number of orders over a period
The text was updated successfully, but these errors were encountered:
public function getAverageCostPerOrder($startDate, $endDate) { $totalCost = \DB::table('order_lines') ->join('technical_cuts', 'order_lines.id', '=', 'technical_cuts.order_lines_id') ->join('orders', 'order_lines.orders_id', '=', 'orders.id') ->whereBetween('orders.created_at', [$startDate, $endDate]) ->sum(\DB::raw('technical_cuts.unit_cost * order_lines.qty')); $totalOrders = Orders::whereBetween('created_at', [$startDate, $endDate])->count(); return $totalOrders > 0 ? round($totalCost / $totalOrders, 2) : 0; }
Sorry, something went wrong.
SMEWebify
No branches or pull requests
Cost of customer processing = cost of customer service over a period / total number of orders over a period
The text was updated successfully, but these errors were encountered: