diff --git a/.env b/.env index a3b03a9..d58c144 100644 --- a/.env +++ b/.env @@ -21,6 +21,7 @@ APP_CHECKOUT_TEST_MAIL=kevin.adametz@me.com APP_INFO_TEST_MAIL=kevin.adametz@me.com APP_MAIN_TAX = 1.19 +APP_SHIPPING_TAX = 19 LOG_CHANNEL=stack diff --git a/app/Http/Controllers/Api/ShoppingUserController.php b/app/Http/Controllers/Api/ShoppingUserController.php index f6f1483..348492b 100755 --- a/app/Http/Controllers/Api/ShoppingUserController.php +++ b/app/Http/Controllers/Api/ShoppingUserController.php @@ -26,7 +26,7 @@ class ShoppingUserController extends Controller 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_incentives = isset($request->wp_incentives) ? $request->wp_incentives : ''; - $wp_notice = [ + $api_notice = [ 'wp_advertising' => $wp_advertising, '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){ $user = $this->prepareForShow($shopping_user); @@ -573,7 +573,7 @@ class ShoppingUserController extends Controller 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(); $ret = []; @@ -593,7 +593,8 @@ class ShoppingUserController extends Controller if ($order->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; @@ -604,7 +605,7 @@ class ShoppingUserController extends Controller if($ShippingCountry){ 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); $shopping_user->shopping_order = $shopping_order; @@ -613,7 +614,7 @@ class ShoppingUserController extends Controller return $ret; } - private function makeShoppingOrder($shopping_user, $wp_invoice_path, $wp_notice){ + private function makeShoppingOrder($shopping_user, $wp_invoice_path, $api_notice){ $data = [ 'shopping_user_id' => $shopping_user->id, @@ -634,7 +635,8 @@ class ShoppingUserController extends Controller 'paid' => true, 'txaction' => 'extern', 'wp_invoice_path' => $wp_invoice_path, - 'wp_notice' => $wp_notice, + 'api_notice' => $api_notice, + 'api_status' => 0, 'mode' => $shopping_user->mode, ]; $shopping_order = $shopping_user->shopping_order; diff --git a/app/Http/Controllers/ModalController.php b/app/Http/Controllers/ModalController.php index dd82c2b..8ec5c9f 100644 --- a/app/Http/Controllers/ModalController.php +++ b/app/Http/Controllers/ModalController.php @@ -53,11 +53,27 @@ class ModalController extends Controller $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'){ $user = \Auth::user(); $ret = view("admin.modal.show_user_customers", compact('user', 'data'))->render(); } - + if($data['action'] === 'user-order-my-delivery-add'){ $user = \Auth::user(); diff --git a/app/Http/Controllers/User/ShopApiController.php b/app/Http/Controllers/User/ShopApiController.php new file mode 100644 index 0000000..bfb1cd7 --- /dev/null +++ b/app/Http/Controllers/User/ShopApiController.php @@ -0,0 +1,180 @@ + '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 ''; + }) + ->addColumn('api_status', function (ShoppingOrder $ShoppingOrder) { + return ''.$ShoppingOrder->getAPIStatusType().''; + }) + ->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 ''; + }) + ->addColumn('total_shipping', function (ShoppingOrder $ShoppingOrder) { + return ''.$ShoppingOrder->getFormattedTotalShipping()." €"; + }) + ->addColumn('orders', function (ShoppingOrder $ShoppingOrder) { + return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->orders : ''; + }) + ->addColumn('user_shop_id', function (ShoppingOrder $ShoppingOrder) { + return $ShoppingOrder->user_shop ? ''.$ShoppingOrder->user_shop->getSubdomain(false).'' : ''; + }) + ->addColumn('payment_for', function (ShoppingOrder $ShoppingOrder) { + return ''.$ShoppingOrder->getPaymentForType().''; + }) + ->addColumn('shipped', function (ShoppingOrder $ShoppingOrder) { + return ''.$ShoppingOrder->getShippedType().' + '; + }) + + ->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); + } + + + +} \ No newline at end of file diff --git a/app/Http/Controllers/User/ShopSalesController.php b/app/Http/Controllers/User/ShopSalesController.php index 9238219..2914278 100755 --- a/app/Http/Controllers/User/ShopSalesController.php +++ b/app/Http/Controllers/User/ShopSalesController.php @@ -40,7 +40,7 @@ class ShopSalesController extends Controller public function ordersDatatable(){ $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) ->addColumn('id', function (ShoppingOrder $ShoppingOrder) { @@ -64,19 +64,21 @@ class ShopSalesController extends Controller ->addColumn('payment_for', function (ShoppingOrder $ShoppingOrder) { return ''.$ShoppingOrder->getPaymentForType().''; }) + ->addColumn('shipped', function (ShoppingOrder $ShoppingOrder) { + return ''.$ShoppingOrder->getShippedType().' + '; + }) ->addColumn('invoice', function (ShoppingOrder $ShoppingOrder) { return $ShoppingOrder->isInvoice() ? ' ' : '-'; }) ->orderColumn('payment_for', 'payment_for $1') - ->orderColumn('id', 'id $1') ->orderColumn('txaction', 'txaction $1') ->orderColumn('user_shop_id', 'user_shop_id $1') ->orderColumn('total_shipping', 'total_shipping $1') - - ->rawColumns(['id', 'txaction', 'user_shop_id', 'total_shipping', 'invoice', 'payment_for']) + ->rawColumns(['id', 'txaction', 'user_shop_id', 'total_shipping', 'invoice', 'shipped', 'payment_for']) ->make(true); } diff --git a/app/Models/ShoppingOrder.php b/app/Models/ShoppingOrder.php index fc3fd70..a78034e 100644 --- a/app/Models/ShoppingOrder.php +++ b/app/Models/ShoppingOrder.php @@ -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 whereWpInvoicePath($value) * @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 * @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereHomepartyId($value) * @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereWpNotice($value) @@ -119,14 +120,15 @@ class ShoppingOrder extends Model 'paid', 'txaction', 'wp_invoice_path', - 'wp_notice', + 'api_notice', + 'api_status', 'mode', 'shipped', 'tracking' ]; protected $casts = [ - 'wp_notice' => 'array', + 'api_notice' => 'array', 'tax_split' => 'array', ]; @@ -146,6 +148,19 @@ class ShoppingOrder extends Model 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 = [ 0 => 'warning', 1 => 'info', @@ -295,6 +310,15 @@ class ShoppingOrder extends Model 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() { return formatNumber($this->attributes['total']); diff --git a/app/Repositories/ShopApiRepository.php b/app/Repositories/ShopApiRepository.php new file mode 100644 index 0000000..add6d76 --- /dev/null +++ b/app/Repositories/ShopApiRepository.php @@ -0,0 +1,83 @@ +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; + } + } + + + +} \ No newline at end of file diff --git a/app/Services/ShopApiOrderCart.php b/app/Services/ShopApiOrderCart.php new file mode 100644 index 0000000..e038f77 --- /dev/null +++ b/app/Services/ShopApiOrderCart.php @@ -0,0 +1,191 @@ +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; + } +} \ No newline at end of file diff --git a/app/User.php b/app/User.php index 9f6dc2d..fc488c3 100755 --- a/app/User.php +++ b/app/User.php @@ -261,6 +261,15 @@ class User extends Authenticatable return false; } + + public function isUserHasApi() + { + if($this->id === 3){ + return true; + } + return false; + } + /** * @return bool */ diff --git a/config/app.php b/config/app.php index 40992aa..e2e1885 100755 --- a/config/app.php +++ b/config/app.php @@ -68,6 +68,8 @@ return [ 'info_test_mail' => env('APP_INFO_TEST_MAIL', 'devtest@mivita.care'), '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/'), diff --git a/database/migrations/2019_02_23_163527_create_shopping_orders_table.php b/database/migrations/2019_02_23_163527_create_shopping_orders_table.php index 1a1cdb4..a2b6408 100644 --- a/database/migrations/2019_02_23_163527_create_shopping_orders_table.php +++ b/database/migrations/2019_02_23_163527_create_shopping_orders_table.php @@ -45,14 +45,14 @@ class CreateShoppingOrdersTable extends Migration $table->boolean('paid')->default(false); $table->string('wp_invoice_path', 255)->nullable(); - $table->text('wp_notice')->nullable(); - - $table->string('txaction', 20)->nullable()->index(); + $table->text('api_notice')->nullable(); + $table->unsignedTinyInteger('api_status')->nullable(); $table->unsignedTinyInteger('shipped')->default(0); + + $table->string('txaction', 20)->nullable()->index(); $table->string('tracking', 255)->nullable(); - - + $table->char('mode', 4)->nullable(); $table->timestamps(); diff --git a/resources/views/admin/business/show.blade.php b/resources/views/admin/business/show.blade.php index 7032f12..911eaec 100644 --- a/resources/views/admin/business/show.blade.php +++ b/resources/views/admin/business/show.blade.php @@ -10,11 +10,6 @@ {!! Form::open(['url' => route('admin_payments_invoice'), 'class' => 'form-horizontal', 'id'=>'form_filter_business_user']) !!}
- {{--
- -
- --}} -
+ @foreach($api_action as $key=>$value) + + @endforeach + +
+
+   +
+ +
+ +
+
+

+ bestellen = Sammelbestellung aufgeben
+ entfernen = Bestellungen werden nach entfernt verschoben, für Stornos etc.
+ zurücksetzen = Bestellungen werden nur nach offen verschoben, Sammelbestellung werden nicht geändert +

+
+
+ + +
+ + + + + + + + + + + + + +
#{{__('Status') }} + {{__('Versand') }} + {{__('First name')}}{{__('Last name')}}{{__('E-Mail')}}{{__('Datum')}}{{__('Betrag')}}{{__('Detail')}}{{__('Art')}}
+
+ + + {!! Form::close() !!} + + +@endsection \ No newline at end of file diff --git a/resources/views/user/shop/sales/modal_api_order_detail.blade.php b/resources/views/user/shop/sales/modal_api_order_detail.blade.php new file mode 100644 index 0000000..f57b9e2 --- /dev/null +++ b/resources/views/user/shop/sales/modal_api_order_detail.blade.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/resources/views/user/shop/sales/orders.blade.php b/resources/views/user/shop/sales/orders.blade.php index fa88419..cebc8fa 100644 --- a/resources/views/user/shop/sales/orders.blade.php +++ b/resources/views/user/shop/sales/orders.blade.php @@ -21,7 +21,9 @@ {{__('Datum')}} {{__('Status')}} {{__('Betrag')}} + {{__('Versand')}} {{__('Rechnung')}} + {{__('Art')}} @@ -43,6 +45,7 @@ { data: 'created_at', name: 'created_at' }, { data: 'txaction', name: 'txaction' }, { data: 'total_shipping', name: 'total_shipping' }, + { data: 'shipped', name: 'shipped' }, { data: 'invoice', name: 'invoice', orderable: false }, { data: 'payment_for', name: 'payment_for' }, ], diff --git a/routes/web.php b/routes/web.php index f71765b..65f5f9f 100755 --- a/routes/web.php +++ b/routes/web.php @@ -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/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 Route::get('/user/team/members', 'User\TeamController@members')->name('user_team_members');