parse test

This commit is contained in:
merdan 2022-07-05 15:10:47 +05:00
parent 15874297a5
commit e481d8c975
1 changed files with 5 additions and 3 deletions

View File

@ -52,9 +52,11 @@ class OrderRepository extends WOrderRepository
$order->sub_total = $order->items()->sum('total');
$order->base_sub_total = $order->items()->sum('base_total');
// dd($order);
$order->grand_total = $order->shipping_amount + $order->sub_total - $order->items->sum('discount_amount') - $order->shipping_discount_amount;
$order->base_grand_total = $order->base_shipping_amount + $order->base_sub_total - $order->items->sum('base_discount_amount') - $order->base_shipping_discount_amount;
$order->discount_amount = $order->items()->sum('discount_amount');
$order->base_discount_amount = $order->items()->sum('discount_amount');
$order->grand_total = $order->shipping_amount + $order->sub_total - $order->discount - $order->shipping_discount_amount;
$order->base_grand_total = $order->base_shipping_amount + $order->base_sub_total - $order->base_discount_amount - $order->base_shipping_discount_amount;
$order->save();