Guthaben aufladen, löschen, Ansichten

This commit is contained in:
Kevin Adametz 2021-04-26 16:07:03 +02:00
parent 6ac9fcc4d2
commit 3754f1c571
27 changed files with 603 additions and 89 deletions

View file

@ -94,7 +94,6 @@ class Payment
public static function addUserPayCredits(User $user, $credit, $status, $message, $shopping_order_id = null){
$new_credit_total = $user->payment_credit;
UserPayCredit::create([
'user_id' => $user->id,
'credit' => $credit,
@ -108,6 +107,7 @@ class Payment
$user->save();
}
public static function paymentStatusPaidAction(ShoppingOrder $shopping_order, $paid){
$send_link = false;
@ -136,7 +136,7 @@ class Payment
$user->payment_account = $date;
$user->wizard = 100;
$user->save();
self::addUserPayCredits($user, $shopping_order_item->product->price, 1, 'payment_for_account');
self::addUserPayCredits($user, $shopping_order_item->product->price, 1, 'payment_for_account', $shopping_order->id);
$shopping_order->setUserHistoryValue(['status' => 9]);
}
@ -173,7 +173,7 @@ class Payment
//is payment credit, reduce
if($shopping_order->shopping_order_margin->from_payment_credit > 0){
$credit = $shopping_order->shopping_order_margin->from_payment_credit * -1;
self::addUserPayCredits($shopping_order->auth_user, $credit, 2, 'user_order_deduction');
self::addUserPayCredits($shopping_order->auth_user, $credit, 2, 'user_order_deduction', $shopping_order->id);
}
}