update 20.10.2025
This commit is contained in:
parent
8c11130b5d
commit
a939cd51ef
616 changed files with 84821 additions and 4121 deletions
|
|
@ -27,100 +27,101 @@ class ModalController extends Controller
|
|||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
public function load(){
|
||||
public function load()
|
||||
{
|
||||
$data = Request::all();
|
||||
$ret = "";
|
||||
$status = false;
|
||||
if(Request::ajax()){
|
||||
if($data['action'] === 'shopping-order-change-member'){
|
||||
if (Request::ajax()) {
|
||||
if ($data['action'] === 'shopping-order-change-member') {
|
||||
$value = ShoppingOrder::find($data['id']);
|
||||
$route = route('admin_sales_customers_detail', [$value->id]);
|
||||
$ret = view("admin.modal.member", compact('value', 'data', 'route'))->render();
|
||||
}
|
||||
if($data['action'] === 'shopping-user-change-member'){
|
||||
if ($data['action'] === 'shopping-user-change-member') {
|
||||
$value = ShoppingUser::find($data['id']);
|
||||
$route = route('admin_customer_edit', [$value->id]);
|
||||
$ret = view("admin.modal.member", compact('value', 'data', 'route'))->render();
|
||||
}
|
||||
if($data['action'] === 'shopping-user-is-like-member'){
|
||||
if ($data['action'] === 'shopping-user-is-like-member') {
|
||||
$current = ShoppingUser::find($data['id']); //current user form order
|
||||
$possibles = [];
|
||||
if($current->is_like){
|
||||
if ($current->is_like) {
|
||||
$likes = $current->getNotice('like');
|
||||
foreach ($likes as $like_id=>$number){
|
||||
foreach ($likes as $like_id => $number) {
|
||||
$possibles[] = ShoppingUser::find($like_id);
|
||||
}
|
||||
}
|
||||
$ret = view("admin.modal.is_like_member", compact('current', 'possibles', 'data'))->render();
|
||||
}
|
||||
if($data['action'] === 'shopping-order-change-points'){
|
||||
if ($data['action'] === 'shopping-order-change-points') {
|
||||
$value = ShoppingOrder::find($data['id']);
|
||||
$route = route('admin_sales_customers_detail', [$value->id]);
|
||||
$ret = view("admin.modal.change_points", compact('value', 'data', 'route'))->render();
|
||||
}
|
||||
if($data['action'] === 'user-order-show-product'){
|
||||
if ($data['action'] === 'user-order-show-product') {
|
||||
$product = Product::find($data['id']); //current user form order
|
||||
$ret = view("admin.modal.show_product", compact('product', 'data'))->render();
|
||||
}
|
||||
|
||||
if($data['action'] === 'user-order-show-product'){
|
||||
if ($data['action'] === 'user-order-show-product') {
|
||||
$product = Product::find($data['id']); //current user form order
|
||||
$ret = view("admin.modal.show_product", compact('product', 'data'))->render();
|
||||
}
|
||||
|
||||
if($data['action'] === 'shop-user-order-detail'){
|
||||
$user = \Auth::user();
|
||||
if ($data['action'] === 'shop-user-order-detail') {
|
||||
$user = \Auth::user();
|
||||
$shopping_order = ShoppingOrder::findOrFail($data['id']);
|
||||
if(!$user->isAdmin() && $shopping_order->member_id !== $user->id){
|
||||
if (!$user->isAdmin() && $shopping_order->member_id !== $user->id) {
|
||||
abort(404);
|
||||
}
|
||||
$isAdmin = false ;
|
||||
$isAdmin = false;
|
||||
$ret = view("user.shop.sales.modal_api_order_detail", compact('shopping_order', 'isAdmin', 'data'))->render();
|
||||
}
|
||||
|
||||
if($data['action'] === 'shop-user-order-shipping-detail'){
|
||||
$user = \Auth::user();
|
||||
if ($data['action'] === 'shop-user-order-shipping-detail') {
|
||||
$user = \Auth::user();
|
||||
$shopping_order = ShoppingOrder::findOrFail($data['id']);
|
||||
if(!$user->isAdmin() && $shopping_order->auth_user_id !== $user->id){
|
||||
if (!$user->isAdmin() && $shopping_order->auth_user_id !== $user->id) {
|
||||
abort(404);
|
||||
}
|
||||
$isAdmin = false ;
|
||||
$isAdmin = false;
|
||||
$ret = view("user.shop.sales.modal_api_order_shipping_detail", compact('shopping_order', 'isAdmin', 'data'))->render();
|
||||
}
|
||||
|
||||
if($data['action'] === 'user-order-my-delivery-show'){
|
||||
if ($data['action'] === 'user-order-my-delivery-show') {
|
||||
$user = \Auth::user();
|
||||
$ret = view("admin.modal.show_user_customers", compact('user', 'data'))->render();
|
||||
}
|
||||
|
||||
if($data['action'] === 'user-order-my-delivery-add'){
|
||||
|
||||
if ($data['action'] === 'user-order-my-delivery-add') {
|
||||
$user = \Auth::user();
|
||||
/* $product = Product::find($data['id']); //current user form order
|
||||
/* $product = Product::find($data['id']); //current user form order
|
||||
$ret = view("admin.modal.show_product", compact('product', 'data'))->render(); */
|
||||
}
|
||||
if($data['action'] === 'homeparty-add-product') {
|
||||
if ($data['action'] === 'homeparty-add-product') {
|
||||
$homeparty = Homeparty::find($data['id']);
|
||||
$homeparty_user = HomepartyUser::find($data['user_id']);
|
||||
$data['homeparty'] = $homeparty;
|
||||
$ret = view("user.homeparty.modal_hp_show_products", compact( 'data', 'homeparty', 'homeparty_user'))->render();
|
||||
$ret = view("user.homeparty.modal_hp_show_products", compact('data', 'homeparty', 'homeparty_user'))->render();
|
||||
}
|
||||
|
||||
if($data['action'] === 'user-level-edit'){
|
||||
if ($data['action'] === 'user-level-edit') {
|
||||
$value = UserLevel::find($data['id']);
|
||||
$route = route('admin_level_store', [$value->id]);
|
||||
$ret = view("admin.modal.user_level_edit", compact('value', 'data', 'route'))->render();
|
||||
}
|
||||
if($data['action'] === 'user-level-add'){
|
||||
if ($data['action'] === 'user-level-add') {
|
||||
$value = new UserLevel();
|
||||
$route = route('admin_level_store', ['new']);
|
||||
$ret = view("admin.modal.user_level_edit", compact('value', 'data', 'route'))->render();
|
||||
}
|
||||
if($data['action'] === 'business-user-detail'){
|
||||
if ($data['action'] === 'business-user-detail') {
|
||||
$user = User::findOrFail($data['id']);
|
||||
if($data['init_from'] === 'admin'){
|
||||
if ($data['init_from'] === 'admin') {
|
||||
$data['month'] = session('business_user_filter_month');
|
||||
$data['year'] = session('business_user_filter_year');
|
||||
}else{
|
||||
} else {
|
||||
$data['month'] = session('team_user_filter_month');
|
||||
$data['year'] = session('team_user_filter_year');
|
||||
}
|
||||
|
|
@ -131,74 +132,72 @@ class ModalController extends Controller
|
|||
$ret = view("admin.modal.business_user_detail", compact('TreeCalcBot', 'user', 'data'))->render();
|
||||
}
|
||||
|
||||
if($data['action'] === 'business-user-show'){
|
||||
if ($data['action'] === 'business-user-show') {
|
||||
$user = User::find($data['id']);
|
||||
if($user && $user->account){
|
||||
if ($user && $user->account) {
|
||||
$route = "";
|
||||
$ret = view("admin.modal.business_user_show", compact('user', 'data'))->render();
|
||||
}
|
||||
$ret = view("admin.modal.business_user_notfound", compact('data'))->render();
|
||||
|
||||
}
|
||||
if($data['action'] === 'edit_user_sales_volume'){
|
||||
if ($data['action'] === 'edit_user_sales_volume') {
|
||||
$userSalesVolume = UserSalesVolume::findOrFail($data['id']);
|
||||
$route = route('admin_business_points_store', );
|
||||
$route = route('admin_business_points_store',);
|
||||
$ret = view("admin.business.modal_edit_points", compact('userSalesVolume', 'data', 'route'))->render();
|
||||
}
|
||||
if($data['action'] === 'add_user_sales_volume'){
|
||||
if ($data['action'] === 'add_user_sales_volume') {
|
||||
$userSalesVolume = new UserSalesVolume();
|
||||
$route = route('admin_business_points_store', );
|
||||
$route = route('admin_business_points_store',);
|
||||
$ret = view("admin.business.modal_add_points", compact('userSalesVolume', 'data', 'route'))->render();
|
||||
}
|
||||
if($data['action'] === 'add-user-credit'){
|
||||
}
|
||||
if ($data['action'] === 'add-user-credit') {
|
||||
$value = [];
|
||||
$ret = view("admin.payment.modal_add_credit", compact('value', 'data'))->render();
|
||||
}
|
||||
if($data['action'] === 'user-credit-status'){
|
||||
}
|
||||
if ($data['action'] === 'user-credit-status') {
|
||||
$UserCredit = UserCredit::find($data['id']); //current user form order
|
||||
$ret = view("admin.payment.modal_credit_status", compact('UserCredit', 'data'))->render();
|
||||
}
|
||||
if($data['action'] === 'abo_update_settings'){
|
||||
if ($data['action'] === 'abo_update_settings') {
|
||||
$user_abo = UserAbo::find($data['id']);
|
||||
if($data['view'] === 'admin'){
|
||||
if ($data['view'] === 'admin') {
|
||||
$route = route('admin_abos_update', [$user_abo->id]);
|
||||
}else{
|
||||
} else {
|
||||
$route = route('user_abos_update', [$data['view'], $user_abo->id]);
|
||||
}
|
||||
$ret = view("admin.abo.modal_abo_update", compact('user_abo', 'data', 'route'))->render();
|
||||
}
|
||||
if($data['action'] === 'abo-add-product') {
|
||||
if ($data['action'] === 'abo-add-product') {
|
||||
$user_abo = UserAbo::find($data['id']);
|
||||
$ret = view("user.abo.modal_abo_show_products", compact( 'data', 'user_abo'))->render();
|
||||
$ret = view("user.abo.modal_abo_show_products", compact('data', 'user_abo'))->render();
|
||||
}
|
||||
|
||||
if($data['action'] === 'create-dhl-shipment') {
|
||||
|
||||
if ($data['action'] === 'create-dhl-shipment') {
|
||||
$id = $data['id'] ?? null;
|
||||
$ret = $this->handleDhlShipmentModal($id, $data);
|
||||
}
|
||||
|
||||
}
|
||||
return response()->json(['response' => $data, 'html'=>$ret, 'status'=>$status]);
|
||||
return response()->json(['response' => $data, 'html' => $ret, 'status' => $status]);
|
||||
}
|
||||
|
||||
private function getForBusinessUserDetail(User $user, $data){
|
||||
private function getForBusinessUserDetail(User $user, $data)
|
||||
{
|
||||
|
||||
//$auth_user = \Auth::user();
|
||||
//if($auth_user->isAdmin() || $auth_user->id === $user->id){
|
||||
if($data['optimized']){
|
||||
if ($data['optimized']) {
|
||||
$TreeCalcBot = new TreeCalcBotOptimized($data['month'], $data['year'], $data['init_from'], $data['live']);
|
||||
}else{
|
||||
} else {
|
||||
$TreeCalcBot = new TreeCalcBot($data['month'], $data['year'], $data['init_from']);
|
||||
}
|
||||
$TreeCalcBot->initBusinesslUserDetail($user, $data['live']);
|
||||
//TODO is not Admin, read is user in Parent tree ...
|
||||
if(!$TreeCalcBot->business_user){
|
||||
abort(403, 'no user found');
|
||||
}
|
||||
return $TreeCalcBot;
|
||||
$TreeCalcBot->initBusinesslUserDetail($user, $data['live']);
|
||||
//TODO is not Admin, read is user in Parent tree ...
|
||||
if (!$TreeCalcBot->business_user) {
|
||||
abort(403, 'no user found');
|
||||
}
|
||||
return $TreeCalcBot;
|
||||
//}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -213,22 +212,21 @@ class ModalController extends Controller
|
|||
try {
|
||||
$dhlModalService = new DhlModalService();
|
||||
$modalData = $dhlModalService->prepareModalData($id, $data);
|
||||
|
||||
|
||||
// Merge the prepared data with the original request data
|
||||
$viewData = array_merge($data, $modalData, [
|
||||
'id' => $id,
|
||||
'data' => $data
|
||||
]);
|
||||
|
||||
|
||||
return view("admin.dhl.modal_create_shipment", $viewData)->render();
|
||||
|
||||
} catch (\Exception $e) {
|
||||
\Log::error('[ModalController] Error in DHL shipment modal', [
|
||||
'order_id' => $id,
|
||||
'error' => $e->getMessage(),
|
||||
'trace' => $e->getTraceAsString()
|
||||
]);
|
||||
|
||||
|
||||
// Return error view or fallback
|
||||
$errorData = [
|
||||
'id' => $id,
|
||||
|
|
@ -240,16 +238,14 @@ class ModalController extends Controller
|
|||
'productCodes' => [
|
||||
'V01PAK' => 'DHL Paket (National)',
|
||||
'V53WPAK' => 'DHL Paket International',
|
||||
'V54EPAK' => 'DHL Express'
|
||||
],
|
||||
'errors' => ['Fehler beim Laden der Daten: ' . $e->getMessage()],
|
||||
'warnings' => []
|
||||
];
|
||||
|
||||
|
||||
return view("admin.dhl.modal_create_shipment", $errorData)->render();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue