Hi! I'll show you how to keep the tax for yourself and not for the restaurant.
I am on version 2.7.2
it may work on old versions but :
- The lines I indicated may be different
- You must have in your database in "orders" a line "tax_amount"
Go to /app/Http/Controllers/DeliveryController.php
On line 588 and 668 you have
$restaurant_earning->amount += $order->total - ($order->delivery_charge + $order->tip_amount);
Replaced by
$restaurant_earning->amount += $order->total - ($order->delivery_charge + $order->tip_amount) - tax_amount;
On line 594 and 674 you have
$restaurant_earning->amount = $order->total - ($order->delivery_charge + $order->tip_amount);
Replaced by
$restaurant_earning->amount = $order->total - ($order->delivery_charge + $order->tip_amount) - tax_amount;
Save this file.
Go to /app/Http/Controllers/RestaurantOwnerController.php
On line 84 and 1230 you have
$totalEarning += $completedOrder->total - ($completedOrder->delivery_charge + $completedOrder->tip_amount);
Replaced by
$totalEarning += $completedOrder->total - ($completedOrder->delivery_charge + $completedOrder->tip_amount) - $completedOrder->tax_amount;
Save this file.
You have finished 🙂