Muhammad Iqbal Afandi 3 лет назад
Родитель
Сommit
1204c4b955
1 измененных файлов: 2 добавлений и 2 удалений
  1. 2
    2
      app/Http/Controllers/TransactionController.php

+ 2
- 2
app/Http/Controllers/TransactionController.php Просмотреть файл

@@ -175,13 +175,13 @@ class TransactionController extends Controller
175 175
             if ($request->discount) {
176 176
                 $transaction->mutation()->create([
177 177
                     'type' => 1,
178
-                    'amount' => $transaction->totalPrice() < 0 ? $transaction->subTotal() : $transaction->totalPrice(),
178
+                    'amount' => $transaction->totalPrice(),
179 179
                     'outlet_id' => $request->user()->outlet_id,
180 180
                 ]);
181 181
 
182 182
                 $transaction->mutation()->create([
183 183
                     'type' => 2,
184
-                    'amount' => $transaction->totalPrice() < 0 ? $transaction->subTotal() : $transaction->totalPrice(),
184
+                    'amount' => $transaction->totalDiscountGiven(),
185 185
                     'outlet_id' => $request->user()->outlet_id,
186 186
                 ]);
187 187
             } else {