API Shopping Order backend
This commit is contained in:
parent
7a040c3e19
commit
d01b4bd560
24 changed files with 1584 additions and 34 deletions
1
.env
1
.env
|
|
@ -21,6 +21,7 @@ APP_CHECKOUT_TEST_MAIL=kevin.adametz@me.com
|
||||||
APP_INFO_TEST_MAIL=kevin.adametz@me.com
|
APP_INFO_TEST_MAIL=kevin.adametz@me.com
|
||||||
|
|
||||||
APP_MAIN_TAX = 1.19
|
APP_MAIN_TAX = 1.19
|
||||||
|
APP_SHIPPING_TAX = 19
|
||||||
|
|
||||||
LOG_CHANNEL=stack
|
LOG_CHANNEL=stack
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class ShoppingUserController extends Controller
|
||||||
|
|
||||||
|
|
||||||
protected $successStatus = 200;
|
protected $successStatus = 200;
|
||||||
protected $member_id = 3; //thomas.krummel@gmail.com
|
protected $member_id = 3; //service@aloe-vera.bio
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -363,12 +363,12 @@ class ShoppingUserController extends Controller
|
||||||
$wp_advertising = isset($request->wp_advertising) ? $request->wp_advertising : '';
|
$wp_advertising = isset($request->wp_advertising) ? $request->wp_advertising : '';
|
||||||
$wp_incentives = isset($request->wp_incentives) ? $request->wp_incentives : '';
|
$wp_incentives = isset($request->wp_incentives) ? $request->wp_incentives : '';
|
||||||
|
|
||||||
$wp_notice = [
|
$api_notice = [
|
||||||
'wp_advertising' => $wp_advertising,
|
'wp_advertising' => $wp_advertising,
|
||||||
'wp_incentives' => $wp_incentives,
|
'wp_incentives' => $wp_incentives,
|
||||||
];
|
];
|
||||||
|
|
||||||
$wp_order = $this->prepareOrder($wp_order, $shopping_user, $wp_invoice_path, $wp_notice);
|
$wp_order = $this->prepareOrder($wp_order, $shopping_user, $wp_invoice_path, $api_notice);
|
||||||
|
|
||||||
if ($wp_order){
|
if ($wp_order){
|
||||||
$user = $this->prepareForShow($shopping_user);
|
$user = $this->prepareForShow($shopping_user);
|
||||||
|
|
@ -573,7 +573,7 @@ class ShoppingUserController extends Controller
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function prepareOrder($wp_shopping_order, $shopping_user, $wp_invoice_path, $wp_notice){
|
private function prepareOrder($wp_shopping_order, $shopping_user, $wp_invoice_path, $api_notice){
|
||||||
Yard::instance('shopping')->destroy();
|
Yard::instance('shopping')->destroy();
|
||||||
$ret = [];
|
$ret = [];
|
||||||
|
|
||||||
|
|
@ -593,7 +593,8 @@ class ShoppingUserController extends Controller
|
||||||
if ($order->price != ($product->price * 100)) {
|
if ($order->price != ($product->price * 100)) {
|
||||||
$error[] = "different price: " . ($product->price * 100);
|
$error[] = "different price: " . ($product->price * 100);
|
||||||
}
|
}
|
||||||
Yard::instance('shopping')->add($product->id, $product->name, (int) $order->qty, $product->price, false, false, ['image' => [], 'slug' => $product->slug, 'weight' => $product->weight, 'points' => $product->points, 'no_commission' => $product->no_commission]);
|
$cartItem = Yard::instance('shopping')->add($product->id, $product->name, (int) $order->qty, $product->price, false, false, ['image' => [], 'slug' => $product->slug, 'weight' => $product->weight, 'points' => $product->points, 'no_commission' => $product->no_commission]);
|
||||||
|
Yard::setTax($cartItem->rowId, $product->getTaxWith());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$order->message = $error;
|
$order->message = $error;
|
||||||
|
|
@ -604,7 +605,7 @@ class ShoppingUserController extends Controller
|
||||||
if($ShippingCountry){
|
if($ShippingCountry){
|
||||||
Yard::instance('shopping')->setShippingCountryWithPrice($ShippingCountry->id);
|
Yard::instance('shopping')->setShippingCountryWithPrice($ShippingCountry->id);
|
||||||
}
|
}
|
||||||
$shopping_order = $this->makeShoppingOrder($shopping_user, $wp_invoice_path, $wp_notice);
|
$shopping_order = $this->makeShoppingOrder($shopping_user, $wp_invoice_path, $api_notice);
|
||||||
$this->orderStatusSendMail($shopping_order);
|
$this->orderStatusSendMail($shopping_order);
|
||||||
|
|
||||||
$shopping_user->shopping_order = $shopping_order;
|
$shopping_user->shopping_order = $shopping_order;
|
||||||
|
|
@ -613,7 +614,7 @@ class ShoppingUserController extends Controller
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function makeShoppingOrder($shopping_user, $wp_invoice_path, $wp_notice){
|
private function makeShoppingOrder($shopping_user, $wp_invoice_path, $api_notice){
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'shopping_user_id' => $shopping_user->id,
|
'shopping_user_id' => $shopping_user->id,
|
||||||
|
|
@ -634,7 +635,8 @@ class ShoppingUserController extends Controller
|
||||||
'paid' => true,
|
'paid' => true,
|
||||||
'txaction' => 'extern',
|
'txaction' => 'extern',
|
||||||
'wp_invoice_path' => $wp_invoice_path,
|
'wp_invoice_path' => $wp_invoice_path,
|
||||||
'wp_notice' => $wp_notice,
|
'api_notice' => $api_notice,
|
||||||
|
'api_status' => 0,
|
||||||
'mode' => $shopping_user->mode,
|
'mode' => $shopping_user->mode,
|
||||||
];
|
];
|
||||||
$shopping_order = $shopping_user->shopping_order;
|
$shopping_order = $shopping_user->shopping_order;
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,27 @@ class ModalController extends Controller
|
||||||
$ret = view("admin.modal.show_product", compact('product', 'data'))->render();
|
$ret = view("admin.modal.show_product", compact('product', 'data'))->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
$shopping_order = ShoppingOrder::findOrFail($data['id']);
|
||||||
|
if($shopping_order->member_id !== $user->id){
|
||||||
|
abort(404);
|
||||||
|
}
|
||||||
|
$isAdmin = false;
|
||||||
|
$ret = view("user.shop.sales.modal_api_order_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();
|
$user = \Auth::user();
|
||||||
$ret = view("admin.modal.show_user_customers", compact('user', 'data'))->render();
|
$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();
|
$user = \Auth::user();
|
||||||
|
|
||||||
|
|
|
||||||
180
app/Http/Controllers/User/ShopApiController.php
Normal file
180
app/Http/Controllers/User/ShopApiController.php
Normal file
|
|
@ -0,0 +1,180 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\User;
|
||||||
|
use Request;
|
||||||
|
use App\User;
|
||||||
|
use App\Services\Payment;
|
||||||
|
use App\Models\ShoppingOrder;
|
||||||
|
use App\Services\UserService;
|
||||||
|
use App\Models\ShippingCountry;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use App\Repositories\ShopApiRepository;
|
||||||
|
|
||||||
|
|
||||||
|
class ShopApiController extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
private $api_action = [0 => 'bitte wählen', 'order' => 'markierte bestellen', 'remove' => 'markierte entfernen', 'reset' => 'markierte zurücksetzen/offen'];
|
||||||
|
private $filter_show = [10 => 'alle anzeigen', 1 => 'offen', 2 => 'bestellt', 5 => 'entfernt'];
|
||||||
|
protected $shopApiRepository;
|
||||||
|
|
||||||
|
public function __construct(ShopApiRepository $shopApiRepository)
|
||||||
|
{
|
||||||
|
$this->middleware('active.shop');
|
||||||
|
$this->shopApiRepository = $shopApiRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function orders()
|
||||||
|
{
|
||||||
|
$this->setFilterVars();
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'api_action' => $this->api_action,
|
||||||
|
'filter_show' => $this->filter_show,
|
||||||
|
];
|
||||||
|
return view('user.shop.sales.api_orders', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function action(){
|
||||||
|
$data = Request::all();
|
||||||
|
|
||||||
|
if(isset($data['user_shop_api_orders_action'])){
|
||||||
|
switch($data['user_shop_api_orders_action']){
|
||||||
|
case 'order':
|
||||||
|
$shopApiOrderCart = $this->shopApiRepository->order($data);
|
||||||
|
|
||||||
|
/*$user = User::find(Auth::user()->id);
|
||||||
|
$shipping_country = ShippingCountry::whereCountryId($user->account->country_id)->first();
|
||||||
|
UserService::checkUserTaxShippingCountry($user, $shipping_country->id);*/
|
||||||
|
|
||||||
|
//card_info = UserService::getYardInfo();
|
||||||
|
return view('user.shop.sales.api_order_list', compact('shopApiOrderCart', 'data'));
|
||||||
|
break;
|
||||||
|
case 'remove':
|
||||||
|
$this->shopApiRepository->remove($data);
|
||||||
|
break;
|
||||||
|
case 'reset':
|
||||||
|
$this->shopApiRepository->reset($data);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return redirect(route('user_shop_api_orders'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function checkout(){
|
||||||
|
|
||||||
|
$data = Request::all();
|
||||||
|
$shopApiOrderCart = $this->shopApiRepository->checkout($data);
|
||||||
|
//TODO store in ShopApiOrderCart
|
||||||
|
//TO checkout
|
||||||
|
dd($shopApiOrderCart);
|
||||||
|
|
||||||
|
|
||||||
|
return redirect(route('user_shop_api_orders'));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function setFilterVars(){
|
||||||
|
|
||||||
|
if(!session('user_shop_api_orders_filter')){
|
||||||
|
session(['user_shop_api_orders_filter' => 1]);
|
||||||
|
}
|
||||||
|
if(Request::get('user_shop_api_orders_filter')){
|
||||||
|
session(['user_shop_api_orders_filter' => Request::get('user_shop_api_orders_filter')]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function initSearch($archive = false, $request = true)
|
||||||
|
{
|
||||||
|
$this->setFilterVars();
|
||||||
|
|
||||||
|
$user = User::find(\Auth::user()->id);
|
||||||
|
$query = ShoppingOrder::with('shopping_user')->select('shopping_orders.*')
|
||||||
|
->where('shopping_orders.member_id', $user->id)
|
||||||
|
->where('shopping_orders.payment_for', 7); //7 payment for extern
|
||||||
|
|
||||||
|
|
||||||
|
if(Request::get('user_shop_api_orders_filter')){
|
||||||
|
if(Request::get('user_shop_api_orders_filter') < 10){
|
||||||
|
if(Request::get('user_shop_api_orders_filter') == 1){
|
||||||
|
$query->where(function($query) {
|
||||||
|
return $query->where('shopping_orders.api_status', 0)
|
||||||
|
->orWhere('shopping_orders.api_status', 1)
|
||||||
|
->orWhereNull('shopping_orders.api_status');
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
$query->where('shopping_orders.api_status', Request::get('user_shop_api_orders_filter'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function ordersDatatable(){
|
||||||
|
|
||||||
|
$query = $this->initSearch();
|
||||||
|
return \DataTables::eloquent($query)
|
||||||
|
|
||||||
|
->addColumn('id', function (ShoppingOrder $ShoppingOrder) {
|
||||||
|
return '<button type="button" class="btn icon-btn btn-sm btn-secondary" data-toggle="modal" data-target="#modals-load-content"
|
||||||
|
data-id="'.$ShoppingOrder->id.'"
|
||||||
|
data-action="shop-user-order-detail"
|
||||||
|
data-back=""
|
||||||
|
data-modal="modal-xl"
|
||||||
|
data-init_from="user"
|
||||||
|
data-route="'.route('modal_load').'"><span class="far fa-eye"></span></button>';
|
||||||
|
})
|
||||||
|
->addColumn('api_status', function (ShoppingOrder $ShoppingOrder) {
|
||||||
|
return '<span class="badge badge-pill badge-'.$ShoppingOrder->getAPIStatusColor().'">'.$ShoppingOrder->getAPIStatusType().'</span>';
|
||||||
|
})
|
||||||
|
->addColumn('created_at', function (ShoppingOrder $ShoppingOrder) {
|
||||||
|
return $ShoppingOrder->created_at->format("d.m.Y");
|
||||||
|
})
|
||||||
|
->addColumn('txaction', function (ShoppingOrder $ShoppingOrder) {
|
||||||
|
return Payment::getShoppingOrderBadge($ShoppingOrder);
|
||||||
|
})
|
||||||
|
|
||||||
|
->addColumn('api_action', function (ShoppingOrder $ShoppingOrder) {
|
||||||
|
return '<label class="custom-control custom-checkbox m-0">
|
||||||
|
<input type="checkbox" class="custom-control-input" name="api_action_list['.$ShoppingOrder->id.']" id="api_action_list_'.$ShoppingOrder->id.'">
|
||||||
|
<span class="custom-control-label"></span>
|
||||||
|
</label>';
|
||||||
|
})
|
||||||
|
->addColumn('total_shipping', function (ShoppingOrder $ShoppingOrder) {
|
||||||
|
return '<span class="no-line-break">'.$ShoppingOrder->getFormattedTotalShipping()." €</span>";
|
||||||
|
})
|
||||||
|
->addColumn('orders', function (ShoppingOrder $ShoppingOrder) {
|
||||||
|
return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->orders : '';
|
||||||
|
})
|
||||||
|
->addColumn('user_shop_id', function (ShoppingOrder $ShoppingOrder) {
|
||||||
|
return $ShoppingOrder->user_shop ? '<a href="'.$ShoppingOrder->user_shop->getSubdomain(false).'" target="_blank">'.$ShoppingOrder->user_shop->getSubdomain(false).'</span>' : '';
|
||||||
|
})
|
||||||
|
->addColumn('payment_for', function (ShoppingOrder $ShoppingOrder) {
|
||||||
|
return '<span class="badge badge-pill badge-'.$ShoppingOrder->getPaymentForColor().'">'.$ShoppingOrder->getPaymentForType().'</span>';
|
||||||
|
})
|
||||||
|
->addColumn('shipped', function (ShoppingOrder $ShoppingOrder) {
|
||||||
|
return '<span class="badge badge-pill badge-'.$ShoppingOrder->getShippedColor().'">'.$ShoppingOrder->getShippedType().'</span>
|
||||||
|
';
|
||||||
|
})
|
||||||
|
|
||||||
|
->orderColumn('payment_for', 'payment_for $1')
|
||||||
|
|
||||||
|
->orderColumn('id', 'id $1')
|
||||||
|
->orderColumn('api_action', 'id $1')
|
||||||
|
|
||||||
|
->orderColumn('txaction', 'txaction $1')
|
||||||
|
->orderColumn('user_shop_id', 'user_shop_id $1')
|
||||||
|
->orderColumn('total_shipping', 'total_shipping $1')
|
||||||
|
|
||||||
|
->rawColumns(['id', 'api_status', 'txaction', 'user_shop_id', 'api_action', 'shipped', 'total_shipping', 'payment_for'])
|
||||||
|
->make(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -40,7 +40,7 @@ class ShopSalesController extends Controller
|
||||||
public function ordersDatatable(){
|
public function ordersDatatable(){
|
||||||
|
|
||||||
$user = User::find(\Auth::user()->id);
|
$user = User::find(\Auth::user()->id);
|
||||||
$query = ShoppingOrder::with('shopping_user')->select('shopping_orders.*')->where('member_id', $user->id);
|
$query = ShoppingOrder::with('shopping_user')->select('shopping_orders.*')->where('shopping_orders.member_id', $user->id);
|
||||||
|
|
||||||
return \DataTables::eloquent($query)
|
return \DataTables::eloquent($query)
|
||||||
->addColumn('id', function (ShoppingOrder $ShoppingOrder) {
|
->addColumn('id', function (ShoppingOrder $ShoppingOrder) {
|
||||||
|
|
@ -64,19 +64,21 @@ class ShopSalesController extends Controller
|
||||||
->addColumn('payment_for', function (ShoppingOrder $ShoppingOrder) {
|
->addColumn('payment_for', function (ShoppingOrder $ShoppingOrder) {
|
||||||
return '<span class="badge badge-pill badge-'.$ShoppingOrder->getPaymentForColor().'">'.$ShoppingOrder->getPaymentForType().'</span>';
|
return '<span class="badge badge-pill badge-'.$ShoppingOrder->getPaymentForColor().'">'.$ShoppingOrder->getPaymentForType().'</span>';
|
||||||
})
|
})
|
||||||
|
->addColumn('shipped', function (ShoppingOrder $ShoppingOrder) {
|
||||||
|
return '<span class="badge badge-pill badge-'.$ShoppingOrder->getShippedColor().'">'.$ShoppingOrder->getShippedType().'</span>
|
||||||
|
';
|
||||||
|
})
|
||||||
->addColumn('invoice', function (ShoppingOrder $ShoppingOrder) {
|
->addColumn('invoice', function (ShoppingOrder $ShoppingOrder) {
|
||||||
return $ShoppingOrder->isInvoice() ? '<span class="no-line-break"><a href="'.route('storage_file', [$ShoppingOrder->id, 'invoice', 'download']).'" class="btn btn-primary btn-xs"><i class="fa fa-download"></i></a>
|
return $ShoppingOrder->isInvoice() ? '<span class="no-line-break"><a href="'.route('storage_file', [$ShoppingOrder->id, 'invoice', 'download']).'" class="btn btn-primary btn-xs"><i class="fa fa-download"></i></a>
|
||||||
<a href="'.route('storage_file', [$ShoppingOrder->id, 'invoice', 'stream']).'" target="_blank" class="btn btn-warning btn-xs"><i class="fa fa-eye"></i></a></span>' : '-';
|
<a href="'.route('storage_file', [$ShoppingOrder->id, 'invoice', 'stream']).'" target="_blank" class="btn btn-warning btn-xs"><i class="fa fa-eye"></i></a></span>' : '-';
|
||||||
})
|
})
|
||||||
->orderColumn('payment_for', 'payment_for $1')
|
->orderColumn('payment_for', 'payment_for $1')
|
||||||
|
|
||||||
->orderColumn('id', 'id $1')
|
->orderColumn('id', 'id $1')
|
||||||
->orderColumn('txaction', 'txaction $1')
|
->orderColumn('txaction', 'txaction $1')
|
||||||
->orderColumn('user_shop_id', 'user_shop_id $1')
|
->orderColumn('user_shop_id', 'user_shop_id $1')
|
||||||
->orderColumn('total_shipping', 'total_shipping $1')
|
->orderColumn('total_shipping', 'total_shipping $1')
|
||||||
|
|
||||||
|
->rawColumns(['id', 'txaction', 'user_shop_id', 'total_shipping', 'invoice', 'shipped', 'payment_for'])
|
||||||
->rawColumns(['id', 'txaction', 'user_shop_id', 'total_shipping', 'invoice', 'payment_for'])
|
|
||||||
->make(true);
|
->make(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,8 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder whereTracking($value)
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder whereTracking($value)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder whereWpInvoicePath($value)
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder whereWpInvoicePath($value)
|
||||||
* @property int|null $homeparty_id
|
* @property int|null $homeparty_id
|
||||||
* @property array|null $wp_notice
|
* @property array|null $api_notice
|
||||||
|
* @property int|null $api_status
|
||||||
* @property-read \App\Models\Homeparty|null $homeparty
|
* @property-read \App\Models\Homeparty|null $homeparty
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereHomepartyId($value)
|
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereHomepartyId($value)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereWpNotice($value)
|
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereWpNotice($value)
|
||||||
|
|
@ -119,14 +120,15 @@ class ShoppingOrder extends Model
|
||||||
'paid',
|
'paid',
|
||||||
'txaction',
|
'txaction',
|
||||||
'wp_invoice_path',
|
'wp_invoice_path',
|
||||||
'wp_notice',
|
'api_notice',
|
||||||
|
'api_status',
|
||||||
'mode',
|
'mode',
|
||||||
'shipped',
|
'shipped',
|
||||||
'tracking'
|
'tracking'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'wp_notice' => 'array',
|
'api_notice' => 'array',
|
||||||
'tax_split' => 'array',
|
'tax_split' => 'array',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -146,6 +148,19 @@ class ShoppingOrder extends Model
|
||||||
10 => 'cancel'
|
10 => 'cancel'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
public static $apiStatusTypes = [
|
||||||
|
0 => 'offen',
|
||||||
|
1 => 'offen / pre',
|
||||||
|
2 => 'bestellt',
|
||||||
|
5 => 'entfernt',
|
||||||
|
];
|
||||||
|
public static $apiStatusColors = [
|
||||||
|
0 => 'warning',
|
||||||
|
1 => 'warning',
|
||||||
|
2 => 'success',
|
||||||
|
5 => 'danger',
|
||||||
|
];
|
||||||
public static $shippedColors = [
|
public static $shippedColors = [
|
||||||
0 => 'warning',
|
0 => 'warning',
|
||||||
1 => 'info',
|
1 => 'info',
|
||||||
|
|
@ -295,6 +310,15 @@ class ShoppingOrder extends Model
|
||||||
return isset(self::$shippedColors[$this->shipped]) ? self::$shippedColors[$this->shipped] : "default";
|
return isset(self::$shippedColors[$this->shipped]) ? self::$shippedColors[$this->shipped] : "default";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getAPIStatusType(){
|
||||||
|
return isset(self::$apiStatusTypes[$this->api_status]) ? self::$apiStatusTypes[$this->api_status] : "offen";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAPIStatusColor(){
|
||||||
|
return isset(self::$apiStatusColors[$this->api_status]) ? self::$apiStatusColors[$this->api_status] : "warning";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getFormattedTotal()
|
public function getFormattedTotal()
|
||||||
{
|
{
|
||||||
return formatNumber($this->attributes['total']);
|
return formatNumber($this->attributes['total']);
|
||||||
|
|
|
||||||
83
app/Repositories/ShopApiRepository.php
Normal file
83
app/Repositories/ShopApiRepository.php
Normal file
|
|
@ -0,0 +1,83 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repositories;
|
||||||
|
|
||||||
|
use App\Models\ShoppingOrder;
|
||||||
|
use App\Services\ShopApiOrderCart;
|
||||||
|
|
||||||
|
class ShopApiRepository extends BaseRepository {
|
||||||
|
|
||||||
|
private $shopApiOrderCart;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
//$this->model = $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function order($data)
|
||||||
|
{
|
||||||
|
$this->shopApiOrderCart = new ShopApiOrderCart();
|
||||||
|
$this->performOrderActionList($data, 0);
|
||||||
|
return $this->shopApiOrderCart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function remove($data){
|
||||||
|
$this->performActionList($data, 5);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reset($data){
|
||||||
|
$this->performActionList($data, 0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function checkout($data){
|
||||||
|
$this->shopApiOrderCart = new ShopApiOrderCart();
|
||||||
|
$this->performOrderCheckoutList($data, 1);
|
||||||
|
return $this->shopApiOrderCart;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function performActionList($data, $status){
|
||||||
|
if(isset($data['api_action_list'])){
|
||||||
|
foreach($data['api_action_list'] as $orderItemId=>$v){
|
||||||
|
$ShoppingOrder = ShoppingOrder::findOrFail($orderItemId);
|
||||||
|
$ShoppingOrder->api_status = $status;
|
||||||
|
$ShoppingOrder->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function performOrderActionList($data, $status){
|
||||||
|
if(isset($data['api_action_list'])){
|
||||||
|
foreach($data['api_action_list'] as $orderItemId=>$v){
|
||||||
|
$ShoppingOrder = ShoppingOrder::findOrFail($orderItemId);
|
||||||
|
$this->shopApiOrderCart->add($ShoppingOrder);
|
||||||
|
$ShoppingOrder->api_status = $status; //<- no status change is the show list
|
||||||
|
$ShoppingOrder->save();
|
||||||
|
}
|
||||||
|
$this->shopApiOrderCart->calculate();
|
||||||
|
return $this->shopApiOrderCart;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function performOrderCheckoutList($data, $status){
|
||||||
|
if(isset($data['api_action_list'])){
|
||||||
|
foreach($data['api_action_list'] as $k=>$orderItemId){
|
||||||
|
$ShoppingOrder = ShoppingOrder::findOrFail($orderItemId);
|
||||||
|
$this->shopApiOrderCart->add($ShoppingOrder);
|
||||||
|
$ShoppingOrder->api_status = $status;
|
||||||
|
$ShoppingOrder->save();
|
||||||
|
}
|
||||||
|
$this->shopApiOrderCart->calculate();
|
||||||
|
$this->shopApiOrderCart->store();
|
||||||
|
|
||||||
|
return $this->shopApiOrderCart;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
191
app/Services/ShopApiOrderCart.php
Normal file
191
app/Services/ShopApiOrderCart.php
Normal file
|
|
@ -0,0 +1,191 @@
|
||||||
|
<?php
|
||||||
|
namespace App\Services;
|
||||||
|
|
||||||
|
use stdClass;
|
||||||
|
use App\Models\ShoppingOrder;
|
||||||
|
|
||||||
|
class ShopApiOrderCart
|
||||||
|
{
|
||||||
|
|
||||||
|
public $shipping;
|
||||||
|
public $shipping_net;
|
||||||
|
public $shipping_tax;
|
||||||
|
public $points;
|
||||||
|
public $points_total; //check
|
||||||
|
public $price_total_net;
|
||||||
|
public $price_total;
|
||||||
|
public $tax_total;
|
||||||
|
public $tax_split;
|
||||||
|
public $qty_total;
|
||||||
|
public $orders = [];
|
||||||
|
|
||||||
|
public $shop_items = [];
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->shipping = 0;
|
||||||
|
$this->shipping_net = 0;
|
||||||
|
$this->shipping_tax = 0;
|
||||||
|
$this->points_total = 0;
|
||||||
|
$this->price_total_net = 0;
|
||||||
|
$this->price_total = 0;
|
||||||
|
$this->tax_total = 0;
|
||||||
|
$this->tax_split = [];
|
||||||
|
$this->qty_total = 0;
|
||||||
|
|
||||||
|
$this->shop_items = [];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function add(ShoppingOrder $shopping_order){
|
||||||
|
|
||||||
|
$order = new stdClass();
|
||||||
|
$order->order_id = $shopping_order->id;
|
||||||
|
$order->wp_order_number = $shopping_order->shopping_user->wp_order_number;
|
||||||
|
$order->billing_address = $this->setOrderAdress('billing', $shopping_order->shopping_user);
|
||||||
|
$order->shipping_address = $this->setOrderAdress('shipping', $shopping_order->shopping_user);
|
||||||
|
$order->shopping_order = $shopping_order;
|
||||||
|
|
||||||
|
$this->shipping += $shopping_order->shipping;
|
||||||
|
$this->shipping_net += $shopping_order->shipping_net;
|
||||||
|
|
||||||
|
foreach ($shopping_order->shopping_order_items as $item){
|
||||||
|
|
||||||
|
$tax_rate = intval($item->product->tax);
|
||||||
|
$user_price_net = $this->calcuPriceWith($item->price, $tax_rate, $item->discount);
|
||||||
|
$user_price_net_qty = round($user_price_net * $item->qty, 2);
|
||||||
|
$user_tax = $this->calcuTaxWith($user_price_net, $tax_rate);
|
||||||
|
$user_tax_qty = round($user_tax * $item->qty, 2);
|
||||||
|
|
||||||
|
$shop_item_id = $item->product->id.'-'.$item->price;
|
||||||
|
//set to item
|
||||||
|
if(isset($this->shop_items[$shop_item_id])){
|
||||||
|
$shop_item = $this->shop_items[$shop_item_id];
|
||||||
|
$shop_item->user_price_total_net += $user_price_net_qty;
|
||||||
|
$shop_item->user_tax_total += $user_tax_qty;
|
||||||
|
$shop_item->points_total += ($item->points * $item->qty);
|
||||||
|
$shop_item->qty += $item->qty;
|
||||||
|
}else{
|
||||||
|
$shop_item = new stdClass();
|
||||||
|
$shop_item->pid = $item->product->id;
|
||||||
|
|
||||||
|
$shop_item->article = $item->product->wp_number;
|
||||||
|
$shop_item->number = $item->product->number;
|
||||||
|
$shop_item->name = $item->product->name;
|
||||||
|
$shop_item->qty = $item->qty;
|
||||||
|
|
||||||
|
$shop_item->tax_rate = $tax_rate;
|
||||||
|
$shop_item->points = $item->points;
|
||||||
|
$shop_item->user_price_net = $user_price_net;
|
||||||
|
$shop_item->user_price_total_net = $user_price_net_qty;
|
||||||
|
$shop_item->user_tax = $user_tax;
|
||||||
|
$shop_item->user_tax_total = $user_tax_qty;
|
||||||
|
$shop_item->points_total = ($item->points * $item->qty);
|
||||||
|
}
|
||||||
|
|
||||||
|
//only for tax split / tax and price on calculate function
|
||||||
|
|
||||||
|
$tax = isset($this->tax_split[$tax_rate]) ? $this->tax_split[$tax_rate] : 0;
|
||||||
|
$tax += $user_tax_qty;
|
||||||
|
$this->tax_split[$tax_rate] = $tax;
|
||||||
|
$this->tax_total += $user_tax_qty;
|
||||||
|
|
||||||
|
$this->price_total_net += $user_price_net_qty;
|
||||||
|
$this->points_total += ($item->points * $item->qty);
|
||||||
|
$this->qty_total += $item->qty;
|
||||||
|
|
||||||
|
$this->shop_items[$shop_item_id] = $shop_item;
|
||||||
|
}
|
||||||
|
$this->orders[] = $order;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function calculate(){
|
||||||
|
|
||||||
|
$this->shipping_tax = round($this->shipping - $this->shipping_net, 2);
|
||||||
|
$this->tax_total += $this->shipping_tax;
|
||||||
|
//add shipping tax to split
|
||||||
|
$tax = isset($this->tax_split[config('app.shipping_tax')]) ? $this->tax_split[config('app.shipping_tax')] : 0;
|
||||||
|
$tax += $this->shipping_tax;
|
||||||
|
$this->tax_split[config('app.shipping_tax')] = $tax;
|
||||||
|
|
||||||
|
$this->price_total_net += $this->shipping_net;
|
||||||
|
$this->price_total = round($this->tax_total + $this->price_total_net, 2);
|
||||||
|
|
||||||
|
//$this->price_total += round($user_price * $item->qty, 2);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(){
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
//price brutto calu with
|
||||||
|
private function calcuPriceWith($price, $tax_rate = null, $discount = null){
|
||||||
|
$tax_dec = ($tax_rate + 100) / 100;
|
||||||
|
$price / $tax_dec;
|
||||||
|
$margin = (($discount -100)*-1) / 100;
|
||||||
|
$price = $price * $margin;
|
||||||
|
return round($price, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function calcuTaxWith($price, $tax_rate = null){
|
||||||
|
$tax_dec = ($tax_rate + 100) / 100;
|
||||||
|
$tax = ($price * $tax_dec) - $price;
|
||||||
|
return round($tax, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setOrderAdress($from, $shopping_user){
|
||||||
|
$ret = "";
|
||||||
|
if($from === 'billing'){
|
||||||
|
$ret .= $shopping_user->billing_company ? 'Firma: '.$shopping_user->billing_company.' | ' : '';
|
||||||
|
$ret .= \App\Services\HTMLHelper::getSalutationLang($shopping_user->billing_salutation).' ';
|
||||||
|
$ret .= $shopping_user->billing_firstname.' ';
|
||||||
|
$ret .= $shopping_user->billing_lastname.' | ';
|
||||||
|
$ret .= $shopping_user->billing_address.' | ';
|
||||||
|
$ret .= $shopping_user->billing_zipcode.' ';
|
||||||
|
$ret .= $shopping_user->billing_city.' | ';
|
||||||
|
$ret .= $shopping_user->billing_country->getLocated().' | ';
|
||||||
|
$ret .= $shopping_user->billing_email;
|
||||||
|
|
||||||
|
}
|
||||||
|
if($from === 'shipping'){
|
||||||
|
if($shopping_user->same_as_billing == 1){
|
||||||
|
return 'Lieferadresse ist gleich Rechnungsadresse';
|
||||||
|
}
|
||||||
|
$ret .= $shopping_user->shipping_company ? 'Firma: '.$shopping_user->shipping_company.' | ' : '';
|
||||||
|
$ret .= \App\Services\HTMLHelper::getSalutationLang($shopping_user->shipping_salutation).' ';
|
||||||
|
$ret .= $shopping_user->shipping_firstname.' ';
|
||||||
|
$ret .= $shopping_user->shipping_lastname.' | ';
|
||||||
|
$ret .= $shopping_user->shipping_address.' | ';
|
||||||
|
$ret .= $shopping_user->shipping_zipcode.' ';
|
||||||
|
$ret .= $shopping_user->shipping_city.' | ';
|
||||||
|
$ret .= $shopping_user->shipping_country->getLocated().' | ';
|
||||||
|
|
||||||
|
}
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function getTotalTax()
|
||||||
|
{
|
||||||
|
return $this->tax_total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTotalPriceNetto()
|
||||||
|
{
|
||||||
|
return $this->price_total_net;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTotalPrice()
|
||||||
|
{
|
||||||
|
return $this->price_total;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getTaxSplit()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -261,6 +261,15 @@ class User extends Authenticatable
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function isUserHasApi()
|
||||||
|
{
|
||||||
|
if($this->id === 3){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,8 @@ return [
|
||||||
'info_test_mail' => env('APP_INFO_TEST_MAIL', 'devtest@mivita.care'),
|
'info_test_mail' => env('APP_INFO_TEST_MAIL', 'devtest@mivita.care'),
|
||||||
|
|
||||||
'main_tax' => env('APP_MAIN_TAX', 1.19),
|
'main_tax' => env('APP_MAIN_TAX', 1.19),
|
||||||
|
'shipping_tax' => env('APP_SHIPPING_TAX', 19),
|
||||||
|
|
||||||
/* 'url_backend' => env('APP_URL', 'http://mivita.local/'),
|
/* 'url_backend' => env('APP_URL', 'http://mivita.local/'),
|
||||||
'url_backend' => env('APP_URL', 'http://mivita.local/'),
|
'url_backend' => env('APP_URL', 'http://mivita.local/'),
|
||||||
'url_backend' => env('APP_URL', 'http://mivita.local/'),
|
'url_backend' => env('APP_URL', 'http://mivita.local/'),
|
||||||
|
|
|
||||||
|
|
@ -45,14 +45,14 @@ class CreateShoppingOrdersTable extends Migration
|
||||||
|
|
||||||
$table->boolean('paid')->default(false);
|
$table->boolean('paid')->default(false);
|
||||||
$table->string('wp_invoice_path', 255)->nullable();
|
$table->string('wp_invoice_path', 255)->nullable();
|
||||||
$table->text('wp_notice')->nullable();
|
$table->text('api_notice')->nullable();
|
||||||
|
$table->unsignedTinyInteger('api_status')->nullable();
|
||||||
$table->string('txaction', 20)->nullable()->index();
|
|
||||||
|
|
||||||
$table->unsignedTinyInteger('shipped')->default(0);
|
$table->unsignedTinyInteger('shipped')->default(0);
|
||||||
|
|
||||||
|
$table->string('txaction', 20)->nullable()->index();
|
||||||
$table->string('tracking', 255)->nullable();
|
$table->string('tracking', 255)->nullable();
|
||||||
|
|
||||||
|
|
||||||
$table->char('mode', 4)->nullable();
|
$table->char('mode', 4)->nullable();
|
||||||
|
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,6 @@
|
||||||
{!! Form::open(['url' => route('admin_payments_invoice'), 'class' => 'form-horizontal', 'id'=>'form_filter_business_user']) !!}
|
{!! Form::open(['url' => route('admin_payments_invoice'), 'class' => 'form-horizontal', 'id'=>'form_filter_business_user']) !!}
|
||||||
|
|
||||||
<div class="form-row align-items-center px-4 pb-2 pt-3">
|
<div class="form-row align-items-center px-4 pb-2 pt-3">
|
||||||
{{-- <div class="col-12 col-sm-4 col-md-4 col-lg-4 mb-1">
|
|
||||||
<input class="form-control on_keyup_invoice" name="business_user_filter_name" type="text" value="{{session('business_user_filter_name')}}" placeholder="Name">
|
|
||||||
</div>
|
|
||||||
--}}
|
|
||||||
|
|
||||||
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
|
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
|
||||||
<select class="custom-select on_change_invoice" name="business_user_filter_month">
|
<select class="custom-select on_change_invoice" name="business_user_filter_month">
|
||||||
@foreach($filter_months as $key=>$value)
|
@foreach($filter_months as $key=>$value)
|
||||||
|
|
|
||||||
|
|
@ -564,17 +564,17 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@if($shopping_order->wp_notice['wp_advertising'])
|
@if($shopping_order->api_notice['wp_advertising'])
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<b>Werbemittel: {!! $shopping_order->wp_notice['wp_advertising'] !!}<br></b>
|
<b>Werbemittel: {!! $shopping_order->api_notice['wp_advertising'] !!}<br></b>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@if($shopping_order->wp_notice['wp_incentives'])
|
@if($shopping_order->api_notice['wp_incentives'])
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<b>Incentives: {!! $shopping_order->wp_notice['wp_incentives'] !!}<br></b>
|
<b>Incentives: {!! $shopping_order->api_notice['wp_incentives'] !!}<br></b>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
|
||||||
|
|
@ -471,18 +471,18 @@
|
||||||
</td>
|
</td>
|
||||||
<tr>
|
<tr>
|
||||||
@endif
|
@endif
|
||||||
@if($shopping_order->wp_notice['wp_advertising'])
|
@if($shopping_order->api_notice['wp_advertising'])
|
||||||
<tr>
|
<tr>
|
||||||
<td class="sub_headline">
|
<td class="sub_headline">
|
||||||
<b>Werbemittel: {!! $shopping_order->wp_notice['wp_advertising'] !!}<br></b>
|
<b>Werbemittel: {!! $shopping_order->api_notice['wp_advertising'] !!}<br></b>
|
||||||
<hr>
|
<hr>
|
||||||
</td>
|
</td>
|
||||||
<tr>
|
<tr>
|
||||||
@endif
|
@endif
|
||||||
@if($shopping_order->wp_notice['wp_incentives'])
|
@if($shopping_order->api_notice['wp_incentives'])
|
||||||
<tr>
|
<tr>
|
||||||
<td class="sub_headline">
|
<td class="sub_headline">
|
||||||
<b>Incentives: {!! $shopping_order->wp_notice['wp_incentives'] !!}<br></b>
|
<b>Incentives: {!! $shopping_order->api_notice['wp_incentives'] !!}<br></b>
|
||||||
<hr>
|
<hr>
|
||||||
</td>
|
</td>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,11 @@
|
||||||
<li class="sidenav-item{{ Request::is('user/shop/orders', 'user/shop/order/*') ? ' active' : '' }}">
|
<li class="sidenav-item{{ Request::is('user/shop/orders', 'user/shop/order/*') ? ' active' : '' }}">
|
||||||
<a href="{{ route('user_shop_orders') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-cart"></i><div>{{ __('navigation.orders') }}</div></a>
|
<a href="{{ route('user_shop_orders') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-cart"></i><div>{{ __('navigation.orders') }}</div></a>
|
||||||
</li>
|
</li>
|
||||||
|
@if(Auth::user()->isUserHasApi())
|
||||||
|
<li class="sidenav-item{{ Request::is('user/shop/api/orders', 'user/shop/order/*') ? ' active' : '' }}">
|
||||||
|
<a href="{{ route('user_shop_api_orders') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-appstore"></i><div>Externe Bestellungen </div></a>
|
||||||
|
</li>
|
||||||
|
@endif
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
@endif
|
@endif
|
||||||
|
|
|
||||||
283
resources/views/user/homeparty/api_order_list.blade.php
Normal file
283
resources/views/user/homeparty/api_order_list.blade.php
Normal file
|
|
@ -0,0 +1,283 @@
|
||||||
|
@extends('layouts.layout-2')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.table-small {
|
||||||
|
font-size: 0.9em;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-small td {
|
||||||
|
padding: 0.225rem 1rem 0.225rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-md-extra {
|
||||||
|
padding: 0.3rem 0.6rem;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
line-height: 1.5;
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
}
|
||||||
|
.md-btn-extra {
|
||||||
|
width: calc(1.7rem + 2px) !important;
|
||||||
|
line-height: 1.5rem;
|
||||||
|
}
|
||||||
|
.form-control.input-extra {
|
||||||
|
padding: 0.28rem 0.6rem;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
font-weight: 500;
|
||||||
|
min-height: calc(1.8rem + 2px);
|
||||||
|
height: calc(1.8rem + 2px);
|
||||||
|
width: 44px;
|
||||||
|
}
|
||||||
|
.input-group-min-w {
|
||||||
|
min-width: 102px;
|
||||||
|
}
|
||||||
|
.img-extra {
|
||||||
|
min-width:55px;
|
||||||
|
max-height: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table td.border-top {
|
||||||
|
border: none;
|
||||||
|
border-top: 1px solid #ccccdb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table td {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table th {
|
||||||
|
border: none;
|
||||||
|
border-bottom: 1px solid #c3c3d2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
.default-style:not([dir=rtl]) div.card-datatable table.dataTable thead th:first-child,
|
||||||
|
.default-style:not([dir=rtl]) div.card-datatable table.dataTable tbody td:first-child,
|
||||||
|
.default-style:not([dir=rtl]) div.card-datatable table.dataTable tfoot th:first-child {
|
||||||
|
padding-left: 0.6rem !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
.img-extra {
|
||||||
|
min-width:35px;
|
||||||
|
max-height: 160px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.table .foot-small td {
|
||||||
|
padding: 0.225rem 0.625rem;
|
||||||
|
}
|
||||||
|
.table .text-body {
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
.table .options a.auto-delete-product {
|
||||||
|
font-size: 0.7em;
|
||||||
|
font-weight: bold;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
.table .min-width-80 {
|
||||||
|
min-width: 160px;
|
||||||
|
}
|
||||||
|
.bg-warning-light {
|
||||||
|
background-color: rgba(255, 217, 80, 0.6) !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<h4 class="font-weight-bold py-2 mb-2 d-flex justify-content-between align-items-center w-100 ">
|
||||||
|
<div>{{ __('navigation.my_homeparty') }} / {{ $homeparty->name }} - {{ $homeparty->date }}</div>
|
||||||
|
<a href="{{route('user_homepartys')}}" class="btn btn-sm btn-default float-right">zurück</a>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
@if(Session::has('custom-error'))
|
||||||
|
<div class="alert alert-dark-warning alert-dismissible fade show">
|
||||||
|
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||||
|
<strong>{{ Session::get('custom-error') }}</strong>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if($userHistoryPaymentOrder && $userHistoryPaymentOrder->status > 2)
|
||||||
|
<h6 class="alert badge-{{$userHistoryPaymentOrder->getStatusColor()}}">Eine Zahlung wurde ausgeführt. Status: {{ trans('payment.status.'.$userHistoryPaymentOrder->getStatusType())}}</h6>
|
||||||
|
@endif
|
||||||
|
<div class="card mb-4">
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">Bestellland</div>
|
||||||
|
{{ App\Services\UserService::getOrderInfo('billing_state') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">Lieferland</div>
|
||||||
|
{{ App\Services\UserService::getOrderInfo('shipping_state') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">MwSt</div>
|
||||||
|
{{ App\Services\UserService::getOrderInfo('tax_free') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">Reverse Charge Verfahren</div>
|
||||||
|
{{ App\Services\UserService::getOrderInfo('user_reverse_charge') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<i>Das Lieferland kann nicht mehr geändert werden.</i>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{!! Form::open(['url' => route('user_homeparty_order', [$homeparty->id]), 'class' => 'form-horizontal', 'id'=>'homeparty-order-form']) !!}
|
||||||
|
<div class="card mb-4">
|
||||||
|
<h5 class="card-header">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="d-flex justify-content-between align-items-center w-100">
|
||||||
|
<div>Bestellung anlegen</div>
|
||||||
|
@if(!$homeparty->completed)
|
||||||
|
<div class="float-right">
|
||||||
|
<a href="{{route('user_homeparty_detail', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-1"><i class="ion ion-ios-cog"></i> Verwalten</a>
|
||||||
|
<a href="{{route('user_homeparty_guests', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-1"><i class="ion ion-md-person-add"></i> Gäste anlegen</a>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</h5>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<h6>Lieferadresse
|
||||||
|
@if(!$homeparty->completed)
|
||||||
|
<a href="{{route('user_homeparty_detail', [$homeparty->id, 13])}}"><i class="fa fa-edit"></i> </a>
|
||||||
|
@endif
|
||||||
|
</h6>
|
||||||
|
@include('user.homeparty._address', ['homeparty_user' => $homeparty->homeparty_host])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- TODO Berechnung Bonus --}}
|
||||||
|
<div class="col-md-6">
|
||||||
|
<h6>Aktuelle Bonusansicht</h6>
|
||||||
|
<div id="insert_show_bonus">
|
||||||
|
@include('user.homeparty.show_bonus', ['homeparty' => $homeparty])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if($homeparty->homeparty_host)
|
||||||
|
<div class="card mb-3">
|
||||||
|
<h5 class="card-header">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="d-flex justify-content-between align-items-center w-100">
|
||||||
|
<div>Bestellung Gastgeber:in {{$homeparty->homeparty_host->billing_firstname}} {{$homeparty->homeparty_host->billing_lastname}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@if(!$homeparty->completed)
|
||||||
|
<div class="col-12">
|
||||||
|
<button type="button" class="btn btn-sm btn-secondary btn-block mt-2" data-toggle="modal" data-target="#modals-load-content"
|
||||||
|
data-id="{{ $homeparty->id }}"
|
||||||
|
data-action="homeparty-add-product"
|
||||||
|
data-user_id="{{$homeparty->homeparty_host->id}}"
|
||||||
|
data-route="{{ route('modal_load') }}"><i class="fa fa-plus-circle"></i> Produkt hinzufügen</button>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</h5>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="insert_show_products_order" id="insert_show_products_order_{{$homeparty->homeparty_host->id}}" data-homeparty-id="{{ $homeparty->id }}" data-homeparty-user-id="{{$homeparty->homeparty_host->id}}">
|
||||||
|
@include('user.homeparty.show_products_order', ['homeparty_guest' => $homeparty->homeparty_host])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if($homeparty->homeparty_guests)
|
||||||
|
@php($g_count = 1)
|
||||||
|
@foreach($homeparty->homeparty_guests as $homeparty_guest)
|
||||||
|
<div class="card mb-3">
|
||||||
|
<h5 class="card-header">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="d-flex justify-content-between align-items-center w-100">
|
||||||
|
<div>Bestellung {!! $g_count++ !!}. Gast {{$homeparty_guest->billing_firstname}} {{$homeparty_guest->billing_lastname}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@if(!$homeparty->completed)
|
||||||
|
<div class="col-12">
|
||||||
|
<button type="button" class="btn btn-sm btn-secondary btn-block mt-2" data-toggle="modal" data-target="#modals-load-content"
|
||||||
|
data-id="{{ $homeparty->id }}"
|
||||||
|
data-action="homeparty-add-product"
|
||||||
|
data-user_id="{{$homeparty_guest->id}}"
|
||||||
|
data-route="{{ route('modal_load') }}"><i class="fa fa-plus-circle"></i> Produkt hinzufügen</button>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</h5>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="insert_show_products_order" id="insert_show_products_order_{{$homeparty_guest->id}}" data-homeparty-id="{{ $homeparty->id }}" data-homeparty-user-id="{{$homeparty_guest->id}}">
|
||||||
|
@include('user.homeparty.show_products_order', ['homeparty_guest' => $homeparty_guest])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div class="card mb-4">
|
||||||
|
<h5 class="card-header">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="d-flex justify-content-between align-items-center w-100">
|
||||||
|
<div>Gesamtübersicht</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</h5>
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
<div id="insert_show_total_order">
|
||||||
|
@include('user.homeparty.show_total_order', ['homeparty' => $homeparty])
|
||||||
|
</div>
|
||||||
|
@if(!$homeparty->completed)
|
||||||
|
<hr>
|
||||||
|
@if($homeparty->homeparty_host && $homeparty->homeparty_host->isAddress())
|
||||||
|
<div class="float-right">
|
||||||
|
<button type="submit" class="btn btn-secondary"><i class="ion ion-ios-redo"></i> bestätigen und weiter zur Kasse</button>
|
||||||
|
</div>
|
||||||
|
<br><br>
|
||||||
|
<em class="small text-center"> <i class="fa fa-lock"></i> Du wirst auf unseren checkout Server weitergeletet, die Verbindung ist SSL verschlüsselt.</em>
|
||||||
|
@else
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
Die Bestellung kann erst abgesendet werden, wenn die Lieferadresse Gastgeber/in angelegt ist. <a href="{{route('user_homeparty_guest_detail', [$homeparty->id, $homeparty->homeparty_host->id])}}"><i class="fa fa-edit"></i> </a></h6>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="text-left mt-3">
|
||||||
|
@if(!$homeparty->completed)
|
||||||
|
<a href="{{route('user_homeparty_detail', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-2"><i class="ion ion-ios-cog"></i> Homparty verwalten</a>
|
||||||
|
@endif
|
||||||
|
<a href="{{route('user_homepartys')}}" class="btn btn-sm btn-default mb-2">zurück zur Übersicht</a>
|
||||||
|
</div>
|
||||||
|
{!! Form::close() !!}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@endsection
|
||||||
|
@section('scripts')
|
||||||
|
<script src="{{ asset('/js/iq-homeparty-cart.js') }}?v=1{{ get_file_last_time('/js/iq-homeparty-cart.js') }}"></script>
|
||||||
|
<script type="application/javascript">
|
||||||
|
var iqHomepartyCart = IqHomepartyCart.init();
|
||||||
|
|
||||||
|
|
||||||
|
$( document ).ready(function() {
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
@endsection
|
||||||
283
resources/views/user/order/api_order_list.blade.php
Normal file
283
resources/views/user/order/api_order_list.blade.php
Normal file
|
|
@ -0,0 +1,283 @@
|
||||||
|
@extends('layouts.layout-2')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.table-small {
|
||||||
|
font-size: 0.9em;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-small td {
|
||||||
|
padding: 0.225rem 1rem 0.225rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-md-extra {
|
||||||
|
padding: 0.3rem 0.6rem;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
line-height: 1.5;
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
}
|
||||||
|
.md-btn-extra {
|
||||||
|
width: calc(1.7rem + 2px) !important;
|
||||||
|
line-height: 1.5rem;
|
||||||
|
}
|
||||||
|
.form-control.input-extra {
|
||||||
|
padding: 0.28rem 0.6rem;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
font-weight: 500;
|
||||||
|
min-height: calc(1.8rem + 2px);
|
||||||
|
height: calc(1.8rem + 2px);
|
||||||
|
width: 44px;
|
||||||
|
}
|
||||||
|
.input-group-min-w {
|
||||||
|
min-width: 102px;
|
||||||
|
}
|
||||||
|
.img-extra {
|
||||||
|
min-width:55px;
|
||||||
|
max-height: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table td.border-top {
|
||||||
|
border: none;
|
||||||
|
border-top: 1px solid #ccccdb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table td {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table th {
|
||||||
|
border: none;
|
||||||
|
border-bottom: 1px solid #c3c3d2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
.default-style:not([dir=rtl]) div.card-datatable table.dataTable thead th:first-child,
|
||||||
|
.default-style:not([dir=rtl]) div.card-datatable table.dataTable tbody td:first-child,
|
||||||
|
.default-style:not([dir=rtl]) div.card-datatable table.dataTable tfoot th:first-child {
|
||||||
|
padding-left: 0.6rem !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
.img-extra {
|
||||||
|
min-width:35px;
|
||||||
|
max-height: 160px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.table .foot-small td {
|
||||||
|
padding: 0.225rem 0.625rem;
|
||||||
|
}
|
||||||
|
.table .text-body {
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
.table .options a.auto-delete-product {
|
||||||
|
font-size: 0.7em;
|
||||||
|
font-weight: bold;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
.table .min-width-80 {
|
||||||
|
min-width: 160px;
|
||||||
|
}
|
||||||
|
.bg-warning-light {
|
||||||
|
background-color: rgba(255, 217, 80, 0.6) !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<h4 class="font-weight-bold py-2 mb-2 d-flex justify-content-between align-items-center w-100 ">
|
||||||
|
<div>{{ __('navigation.my_homeparty') }} / {{ $homeparty->name }} - {{ $homeparty->date }}</div>
|
||||||
|
<a href="{{route('user_homepartys')}}" class="btn btn-sm btn-default float-right">zurück</a>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
@if(Session::has('custom-error'))
|
||||||
|
<div class="alert alert-dark-warning alert-dismissible fade show">
|
||||||
|
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||||
|
<strong>{{ Session::get('custom-error') }}</strong>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if($userHistoryPaymentOrder && $userHistoryPaymentOrder->status > 2)
|
||||||
|
<h6 class="alert badge-{{$userHistoryPaymentOrder->getStatusColor()}}">Eine Zahlung wurde ausgeführt. Status: {{ trans('payment.status.'.$userHistoryPaymentOrder->getStatusType())}}</h6>
|
||||||
|
@endif
|
||||||
|
<div class="card mb-4">
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">Bestellland</div>
|
||||||
|
{{ App\Services\UserService::getOrderInfo('billing_state') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">Lieferland</div>
|
||||||
|
{{ App\Services\UserService::getOrderInfo('shipping_state') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">MwSt</div>
|
||||||
|
{{ App\Services\UserService::getOrderInfo('tax_free') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">Reverse Charge Verfahren</div>
|
||||||
|
{{ App\Services\UserService::getOrderInfo('user_reverse_charge') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<i>Das Lieferland kann nicht mehr geändert werden.</i>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{!! Form::open(['url' => route('user_homeparty_order', [$homeparty->id]), 'class' => 'form-horizontal', 'id'=>'homeparty-order-form']) !!}
|
||||||
|
<div class="card mb-4">
|
||||||
|
<h5 class="card-header">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="d-flex justify-content-between align-items-center w-100">
|
||||||
|
<div>Bestellung anlegen</div>
|
||||||
|
@if(!$homeparty->completed)
|
||||||
|
<div class="float-right">
|
||||||
|
<a href="{{route('user_homeparty_detail', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-1"><i class="ion ion-ios-cog"></i> Verwalten</a>
|
||||||
|
<a href="{{route('user_homeparty_guests', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-1"><i class="ion ion-md-person-add"></i> Gäste anlegen</a>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</h5>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<h6>Lieferadresse
|
||||||
|
@if(!$homeparty->completed)
|
||||||
|
<a href="{{route('user_homeparty_detail', [$homeparty->id, 13])}}"><i class="fa fa-edit"></i> </a>
|
||||||
|
@endif
|
||||||
|
</h6>
|
||||||
|
@include('user.homeparty._address', ['homeparty_user' => $homeparty->homeparty_host])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- TODO Berechnung Bonus --}}
|
||||||
|
<div class="col-md-6">
|
||||||
|
<h6>Aktuelle Bonusansicht</h6>
|
||||||
|
<div id="insert_show_bonus">
|
||||||
|
@include('user.homeparty.show_bonus', ['homeparty' => $homeparty])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if($homeparty->homeparty_host)
|
||||||
|
<div class="card mb-3">
|
||||||
|
<h5 class="card-header">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="d-flex justify-content-between align-items-center w-100">
|
||||||
|
<div>Bestellung Gastgeber:in {{$homeparty->homeparty_host->billing_firstname}} {{$homeparty->homeparty_host->billing_lastname}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@if(!$homeparty->completed)
|
||||||
|
<div class="col-12">
|
||||||
|
<button type="button" class="btn btn-sm btn-secondary btn-block mt-2" data-toggle="modal" data-target="#modals-load-content"
|
||||||
|
data-id="{{ $homeparty->id }}"
|
||||||
|
data-action="homeparty-add-product"
|
||||||
|
data-user_id="{{$homeparty->homeparty_host->id}}"
|
||||||
|
data-route="{{ route('modal_load') }}"><i class="fa fa-plus-circle"></i> Produkt hinzufügen</button>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</h5>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="insert_show_products_order" id="insert_show_products_order_{{$homeparty->homeparty_host->id}}" data-homeparty-id="{{ $homeparty->id }}" data-homeparty-user-id="{{$homeparty->homeparty_host->id}}">
|
||||||
|
@include('user.homeparty.show_products_order', ['homeparty_guest' => $homeparty->homeparty_host])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if($homeparty->homeparty_guests)
|
||||||
|
@php($g_count = 1)
|
||||||
|
@foreach($homeparty->homeparty_guests as $homeparty_guest)
|
||||||
|
<div class="card mb-3">
|
||||||
|
<h5 class="card-header">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="d-flex justify-content-between align-items-center w-100">
|
||||||
|
<div>Bestellung {!! $g_count++ !!}. Gast {{$homeparty_guest->billing_firstname}} {{$homeparty_guest->billing_lastname}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@if(!$homeparty->completed)
|
||||||
|
<div class="col-12">
|
||||||
|
<button type="button" class="btn btn-sm btn-secondary btn-block mt-2" data-toggle="modal" data-target="#modals-load-content"
|
||||||
|
data-id="{{ $homeparty->id }}"
|
||||||
|
data-action="homeparty-add-product"
|
||||||
|
data-user_id="{{$homeparty_guest->id}}"
|
||||||
|
data-route="{{ route('modal_load') }}"><i class="fa fa-plus-circle"></i> Produkt hinzufügen</button>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</h5>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="insert_show_products_order" id="insert_show_products_order_{{$homeparty_guest->id}}" data-homeparty-id="{{ $homeparty->id }}" data-homeparty-user-id="{{$homeparty_guest->id}}">
|
||||||
|
@include('user.homeparty.show_products_order', ['homeparty_guest' => $homeparty_guest])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div class="card mb-4">
|
||||||
|
<h5 class="card-header">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="d-flex justify-content-between align-items-center w-100">
|
||||||
|
<div>Gesamtübersicht</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</h5>
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
<div id="insert_show_total_order">
|
||||||
|
@include('user.homeparty.show_total_order', ['homeparty' => $homeparty])
|
||||||
|
</div>
|
||||||
|
@if(!$homeparty->completed)
|
||||||
|
<hr>
|
||||||
|
@if($homeparty->homeparty_host && $homeparty->homeparty_host->isAddress())
|
||||||
|
<div class="float-right">
|
||||||
|
<button type="submit" class="btn btn-secondary"><i class="ion ion-ios-redo"></i> bestätigen und weiter zur Kasse</button>
|
||||||
|
</div>
|
||||||
|
<br><br>
|
||||||
|
<em class="small text-center"> <i class="fa fa-lock"></i> Du wirst auf unseren checkout Server weitergeletet, die Verbindung ist SSL verschlüsselt.</em>
|
||||||
|
@else
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
Die Bestellung kann erst abgesendet werden, wenn die Lieferadresse Gastgeber/in angelegt ist. <a href="{{route('user_homeparty_guest_detail', [$homeparty->id, $homeparty->homeparty_host->id])}}"><i class="fa fa-edit"></i> </a></h6>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="text-left mt-3">
|
||||||
|
@if(!$homeparty->completed)
|
||||||
|
<a href="{{route('user_homeparty_detail', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-2"><i class="ion ion-ios-cog"></i> Homparty verwalten</a>
|
||||||
|
@endif
|
||||||
|
<a href="{{route('user_homepartys')}}" class="btn btn-sm btn-default mb-2">zurück zur Übersicht</a>
|
||||||
|
</div>
|
||||||
|
{!! Form::close() !!}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@endsection
|
||||||
|
@section('scripts')
|
||||||
|
<script src="{{ asset('/js/iq-homeparty-cart.js') }}?v=1{{ get_file_last_time('/js/iq-homeparty-cart.js') }}"></script>
|
||||||
|
<script type="application/javascript">
|
||||||
|
var iqHomepartyCart = IqHomepartyCart.init();
|
||||||
|
|
||||||
|
|
||||||
|
$( document ).ready(function() {
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
@endsection
|
||||||
23
resources/views/user/shop/sales/api_order_detail.blade.php
Normal file
23
resources/views/user/shop/sales/api_order_detail.blade.php
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title">
|
||||||
|
{{ __('Bestellung Kunde') }} <span class="text-muted">#{{$shopping_order->id}}</span>
|
||||||
|
</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
@include('admin.sales._detail')
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$( document ).ready(function() {
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
194
resources/views/user/shop/sales/api_order_list.blade.php
Normal file
194
resources/views/user/shop/sales/api_order_list.blade.php
Normal file
|
|
@ -0,0 +1,194 @@
|
||||||
|
@extends('layouts.layout-2')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
<style>
|
||||||
|
tr.border-none td {
|
||||||
|
border:none;
|
||||||
|
}
|
||||||
|
tr.td-small td {
|
||||||
|
font-size: 0.9em;
|
||||||
|
padding-top: 0.2em;
|
||||||
|
padding-bottom: 0.2em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
<h4 class="font-weight-bold py-2 mb-2 d-flex justify-content-between align-items-center w-100 ">
|
||||||
|
<div>{{ __('Externe Bestellungen') }} | bestellen</div>
|
||||||
|
<a href="{{route('user_shop_api_orders')}}" class="btn btn-sm btn-default float-right">zurück</a>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
@if(Session::has('custom-error'))
|
||||||
|
<div class="alert alert-dark-warning alert-dismissible fade show">
|
||||||
|
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||||
|
<strong>{{ Session::get('custom-error') }}</strong>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{{-- Not includes in shopApiOrderCart
|
||||||
|
<div class="card mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">Bestellland</div>
|
||||||
|
{{ App\Services\UserService::getOrderInfo('billing_state') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">Lieferland</div>
|
||||||
|
{{ App\Services\UserService::getOrderInfo('shipping_state') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">MwSt</div>
|
||||||
|
{{ App\Services\UserService::getOrderInfo('tax_free') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">Reverse Charge Verfahren</div>
|
||||||
|
{{ App\Services\UserService::getOrderInfo('user_reverse_charge') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<i>Das Lieferland kann nicht mehr geändert werden.</i>
|
||||||
|
</div>
|
||||||
|
</div>--}}
|
||||||
|
|
||||||
|
|
||||||
|
@if($shopApiOrderCart)
|
||||||
|
@foreach($shopApiOrderCart->orders as $order)
|
||||||
|
<div class="card mb-3">
|
||||||
|
<div class="card-body pb-1">
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 mb-3">
|
||||||
|
Bestellnummer: {{ $order->order_id }} | WP Number: {{ $order->wp_order_number }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">Bestelldatum</div>
|
||||||
|
{{$order->shopping_order->created_at->format("d.m.Y H:i")}}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">Anzahl Artikel</div>
|
||||||
|
{{$order->shopping_order->getItemsCount()}}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">Preis gesamt</div>
|
||||||
|
{{$order->shopping_order->getFormattedTotalShipping()}} €
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-3">
|
||||||
|
<div class="text-muted small">Points gesamt</div>
|
||||||
|
{{ $order->shopping_order->points }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-12 mb-3">
|
||||||
|
<div class="text-muted small">Rechnungsadresse</div>
|
||||||
|
{{ $order->billing_address }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-12 mb-3">
|
||||||
|
<div class="text-muted small">Lieferadresse</div>
|
||||||
|
{{ $order->shipping_address }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body pt-1">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-product m-0" style="">
|
||||||
|
<tbody>
|
||||||
|
<tr class="">
|
||||||
|
<th class="text-left">Produkt</th>
|
||||||
|
<th class="text-right">
|
||||||
|
VK-Preis brutto
|
||||||
|
</th>
|
||||||
|
<th class="text-right">Anzahl</th>
|
||||||
|
<th class="text-right">Summe</th>
|
||||||
|
</tr>
|
||||||
|
@foreach($order->shopping_order->shopping_order_items as $shopping_order_item)
|
||||||
|
<tr class="">
|
||||||
|
<td class="py-2">
|
||||||
|
<strong>{{ $shopping_order_item->product->name }}</strong>
|
||||||
|
<span class="text-muted">#{{ $shopping_order_item->product->number }}</span>
|
||||||
|
</td>
|
||||||
|
<td class="align-middle py-2 nowrap text-right" style="min-width:100px;">
|
||||||
|
{{ $shopping_order_item->getFormattedPrice() }} €
|
||||||
|
</td>
|
||||||
|
<td class="align-middle py-2 text-right" style="min-width: 60px;">
|
||||||
|
{{ $shopping_order_item->qty }}
|
||||||
|
</td>
|
||||||
|
<td class="font-weight-semibold align-middle py-2 text-right" style="min-width:120px;">
|
||||||
|
{{ $shopping_order_item->getFormattedTotalPrice() }} €
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr class="td-small">
|
||||||
|
<td colspan="3">
|
||||||
|
{{__('email.checkout_mail_shipping')}}
|
||||||
|
</td>
|
||||||
|
<td style="color:#37302d; text-align: right; vertical-align: top;line-height:1.6em;">
|
||||||
|
{{ $order->shopping_order->getFormattedShipping() }} €
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="border-none td-small">
|
||||||
|
<td colspan="3">
|
||||||
|
{{__('email.checkout_mail_subtotal_ws')}}
|
||||||
|
</td>
|
||||||
|
<td style="color:#37302d; text-align: right; vertical-align: top;line-height:1.6em;">
|
||||||
|
{{ $order->shopping_order->getFormattedSubtotalWs() }} €
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="border-none td-small">
|
||||||
|
<td colspan="3">
|
||||||
|
{{__('email.checkout_mail_tax')}}
|
||||||
|
</td>
|
||||||
|
<td style="color:#37302d; text-align: right; vertical-align: top;line-height:1.6em;">
|
||||||
|
{{ $order->shopping_order->getFormattedTax() }} €
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="3">
|
||||||
|
<b>{{__('email.checkout_mail_total')}}</b>
|
||||||
|
</td>
|
||||||
|
<td style="color:#37302d; text-align: right; vertical-align: top;line-height:1.6em;">
|
||||||
|
<b>{{ $order->shopping_order->getFormattedTotalShipping() }} €</b>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
{!! Form::open(['url' => route('user_shop_api_orders_checkout'), 'class' => 'form-horizontal', 'id'=>'api-order-list-form']) !!}
|
||||||
|
|
||||||
|
@foreach($shopApiOrderCart->orders as $order)
|
||||||
|
{{ Form::hidden('api_action_list[]', $order->order_id) }}
|
||||||
|
@endforeach
|
||||||
|
<div class="card mb-4">
|
||||||
|
<h4 class="card-header">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="d-flex justify-content-between align-items-center w-100">
|
||||||
|
<div>Warenkorb</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</h4>
|
||||||
|
<div class="card-body">
|
||||||
|
@include('user.shop.sales.api_order_list_total')
|
||||||
|
<hr>
|
||||||
|
<div class="float-right">
|
||||||
|
<button type="submit" class="btn btn-secondary"><i class="ion ion-ios-redo"></i> bestätigen und weiter zur Kasse</button>
|
||||||
|
</div>
|
||||||
|
<br><br>
|
||||||
|
<em class="small text-center"> <i class="fa fa-lock"></i> Du wirst auf unseren checkout Server weitergeletet, die Verbindung ist SSL verschlüsselt.</em>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{!! Form::close() !!}
|
||||||
|
|
||||||
|
|
||||||
|
@endsection
|
||||||
125
resources/views/user/shop/sales/api_order_list_total.blade.php
Normal file
125
resources/views/user/shop/sales/api_order_list_total.blade.php
Normal file
|
|
@ -0,0 +1,125 @@
|
||||||
|
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="text-left">{{__('Produkt')}}</th>
|
||||||
|
<th class="text-right">{{__('Points')}}</th>
|
||||||
|
<th class="text-right">{{__('Netto-Preis')}}</th>
|
||||||
|
<th class="text-right">{{__('Anzahl')}}</th>
|
||||||
|
<th class="text-right">{{__('Summe Netto')}}</th>
|
||||||
|
<th class="text-right" style="max-width: 5%">{{__('%')}}</th>
|
||||||
|
<th class="text-right" style="max-width: 10%">{{__('MwSt')}}</th>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($shopApiOrderCart->shop_items as $shop_item)
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<strong>{{$shop_item->name}}</strong>
|
||||||
|
<span class="text-muted">#{{ $shop_item->number }}</span>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
{{$shop_item->points_total}}
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
{{ formatNumber($shop_item->user_price_net) }} €
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
{{$shop_item->qty}}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="text-right">
|
||||||
|
<strong>{{ formatNumber($shop_item->user_price_total_net) }} €</strong>
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
{{ formatNumber($shop_item->tax_rate, 0) }}
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
{{ formatNumber($shop_item->user_tax_total) }} €
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<strong>Gesamte Versandkosten</strong>
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
1
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
<strong>{{ formatNumber($shopApiOrderCart->shipping_net) }} €</strong>
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
{{ formatNumber($shopApiOrderCart->shipping_tax) }} €
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="7">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="1">
|
||||||
|
Summen:
|
||||||
|
</td>
|
||||||
|
<td class="text-right" colspan="1">
|
||||||
|
<strong>{{ $shopApiOrderCart->points_total }} <strong>
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
<strong>{{ $shopApiOrderCart->qty_total }}</strong>
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
<strong>{{ formatNumber($shopApiOrderCart->price_total_net) }} €</strong>
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
<strong>{{ formatNumber($shopApiOrderCart->tax_total) }} €</strong>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="6">
|
||||||
|
<strong>Gesamte netto</strong>
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
<strong>{{ formatNumber($shopApiOrderCart->price_total_net) }} €</strong>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="border-none td-small">
|
||||||
|
<td colspan="5">
|
||||||
|
zzgl. MwSt:
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="text-right" colspan="2">
|
||||||
|
@foreach ($shopApiOrderCart->tax_split as $rate => $tax )
|
||||||
|
{{ $rate }}% = {{ formatNumber($tax) }} € <br>
|
||||||
|
@endforeach
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="6">
|
||||||
|
<strong>Gesamtsumme Brutto: </strong>
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
<strong>{{ formatNumber($shopApiOrderCart->getTotalPrice()) }} €<strong>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
102
resources/views/user/shop/sales/api_orders.blade.php
Normal file
102
resources/views/user/shop/sales/api_orders.blade.php
Normal file
|
|
@ -0,0 +1,102 @@
|
||||||
|
@extends('layouts.layout-2')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
{!! Form::open(['url' => route('user_shop_api_orders_action'), 'class' => 'form-horizontal', 'id'=>'user_shop_api_orders-form']) !!}
|
||||||
|
<div class="card">
|
||||||
|
<h5 class="card-header">
|
||||||
|
{{ __('Externe Bestellungen') }}
|
||||||
|
add api_action change wp_notice to api_notice
|
||||||
|
</h5>
|
||||||
|
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<div class="form-row align-items-center px-4 pb-2 pt-3">
|
||||||
|
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
|
||||||
|
<select class="custom-select" name="user_shop_api_orders_action">
|
||||||
|
@foreach($api_action as $key=>$value)
|
||||||
|
<option value="{{$key}}">{{$value}}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
|
||||||
|
<button type="submit" class="btn btn-secondary">{{ __('save changes') }}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
|
||||||
|
<select class="custom-select on_change_datatable" name="user_shop_api_orders_filter">
|
||||||
|
@foreach($filter_show as $key=>$value)
|
||||||
|
<option value="{{$key}}" @if(session('user_shop_api_orders_filter') == $key) selected @endif>{{$value}}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 mb-0 mt-1">
|
||||||
|
<p class="mb-0">
|
||||||
|
bestellen = Sammelbestellung aufgeben<br>
|
||||||
|
entfernen = Bestellungen werden nach entfernt verschoben, für Stornos etc.<br>
|
||||||
|
zurücksetzen = Bestellungen werden nur nach offen verschoben, Sammelbestellung werden nicht geändert
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="card-datatable table-responsive pt-0">
|
||||||
|
<table class="datatable-shopping table table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>{{__('Status') }}
|
||||||
|
<th>{{__('Versand') }}
|
||||||
|
<th>{{__('First name')}}</th>
|
||||||
|
<th>{{__('Last name')}}</th>
|
||||||
|
<th>{{__('E-Mail')}}</th>
|
||||||
|
<th>{{__('Datum')}}</th>
|
||||||
|
<th>{{__('Betrag')}}</th>
|
||||||
|
<th>{{__('Detail')}}</th>
|
||||||
|
<th>{{__('Art')}}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{!! Form::close() !!}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$( document ).ready(function() {
|
||||||
|
var oTable = $('.datatable-shopping').DataTable({
|
||||||
|
"processing": true,
|
||||||
|
"serverSide": true,
|
||||||
|
ajax: {
|
||||||
|
url: '{!! route('user_shop_api_orders_datatable') !!}',
|
||||||
|
data: function(d) {
|
||||||
|
d.user_shop_api_orders_filter = $('select[name=user_shop_api_orders_filter]').val();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"order": [[0, "desc" ]],
|
||||||
|
"columns": [
|
||||||
|
{ data: 'api_action', name: 'api_action', searchable: false },
|
||||||
|
{ data: 'api_status', name: 'api_status', searchable: false },
|
||||||
|
{ data: 'shipped', name: 'shipped' },
|
||||||
|
{ data: 'shopping_user.billing_firstname', name: 'shopping_user.billing_firstname' },
|
||||||
|
{ data: 'shopping_user.billing_lastname', name: 'shopping_user.billing_lastname' },
|
||||||
|
{ data: 'shopping_user.billing_email', name: 'shopping_user.billing_email' },
|
||||||
|
{ data: 'created_at', name: 'created_at' },
|
||||||
|
{ data: 'total_shipping', name: 'total_shipping' },
|
||||||
|
{ data: 'id', searchable: false },
|
||||||
|
{ data: 'payment_for', name: 'payment_for' },
|
||||||
|
],
|
||||||
|
"bLengthChange": false,
|
||||||
|
"iDisplayLength": 100,
|
||||||
|
"language": {
|
||||||
|
"url": "/js/German.json"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('select.on_change_datatable').on('change', function(){
|
||||||
|
oTable.draw();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
@endsection
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title">
|
||||||
|
{{ __('Bestellung Kunde') }} <span class="text-muted">#{{$shopping_order->id}}</span>
|
||||||
|
</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
@include('admin.sales._detail')
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$( document ).ready(function() {
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
|
@ -21,7 +21,9 @@
|
||||||
<th>{{__('Datum')}}</th>
|
<th>{{__('Datum')}}</th>
|
||||||
<th>{{__('Status')}}</th>
|
<th>{{__('Status')}}</th>
|
||||||
<th>{{__('Betrag')}}</th>
|
<th>{{__('Betrag')}}</th>
|
||||||
|
<th>{{__('Versand')}}</th>
|
||||||
<th>{{__('Rechnung')}}</th>
|
<th>{{__('Rechnung')}}</th>
|
||||||
|
|
||||||
<th>{{__('Art')}}</th>
|
<th>{{__('Art')}}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
@ -43,6 +45,7 @@
|
||||||
{ data: 'created_at', name: 'created_at' },
|
{ data: 'created_at', name: 'created_at' },
|
||||||
{ data: 'txaction', name: 'txaction' },
|
{ data: 'txaction', name: 'txaction' },
|
||||||
{ data: 'total_shipping', name: 'total_shipping' },
|
{ data: 'total_shipping', name: 'total_shipping' },
|
||||||
|
{ data: 'shipped', name: 'shipped' },
|
||||||
{ data: 'invoice', name: 'invoice', orderable: false },
|
{ data: 'invoice', name: 'invoice', orderable: false },
|
||||||
{ data: 'payment_for', name: 'payment_for' },
|
{ data: 'payment_for', name: 'payment_for' },
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -236,6 +236,10 @@ Route::domain(config('app.pre_url_crm').config('app.domain').config('app.tld_car
|
||||||
Route::get('/user/shop/order/detail/{id}', 'User\ShopSalesController@orderDetail')->name('user_shop_order_detail');
|
Route::get('/user/shop/order/detail/{id}', 'User\ShopSalesController@orderDetail')->name('user_shop_order_detail');
|
||||||
Route::get('/user/shop/orders/datatable', 'User\ShopSalesController@ordersDatatable')->name('user_shop_orders_datatable');
|
Route::get('/user/shop/orders/datatable', 'User\ShopSalesController@ordersDatatable')->name('user_shop_orders_datatable');
|
||||||
|
|
||||||
|
Route::get('/user/shop/api/orders', 'User\ShopApiController@orders')->name('user_shop_api_orders');
|
||||||
|
Route::post('/user/shop/api/orders/action', 'User\ShopApiController@action')->name('user_shop_api_orders_action');
|
||||||
|
Route::post('/user/shop/api/orders/checkout', 'User\ShopApiController@checkout')->name('user_shop_api_orders_checkout');
|
||||||
|
Route::get('/user/shop/api/orders/datatable', 'User\ShopApiController@ordersDatatable')->name('user_shop_api_orders_datatable');
|
||||||
|
|
||||||
//user team
|
//user team
|
||||||
Route::get('/user/team/members', 'User\TeamController@members')->name('user_team_members');
|
Route::get('/user/team/members', 'User\TeamController@members')->name('user_team_members');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue