diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6b08db8..e0f926b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,26 +5,30 @@ - - - - - - + + - - - + + + + + + + + + + + + + - - @@ -272,13 +276,6 @@ - - - - - - - @@ -286,6 +283,13 @@ + + + + + + + @@ -534,6 +538,8 @@ + + @@ -614,29 +620,30 @@ - + + - + - + - + - + @@ -646,11 +653,6 @@ 15 diff --git a/app/Http/Controllers/SalesController.php b/app/Http/Controllers/SalesController.php index dc26e9b..fd74bdf 100755 --- a/app/Http/Controllers/SalesController.php +++ b/app/Http/Controllers/SalesController.php @@ -2,7 +2,9 @@ namespace App\Http\Controllers; +use App\Models\PaymentTransaction; use App\Models\ShoppingOrder; +use App\Models\ShoppingPayment; use App\Models\ShoppingUser; use App\Models\UserShop; use App\Services\CustomerPriority; @@ -47,10 +49,9 @@ class SalesController extends Controller return view('admin.sales.user_detail', $data); } - public function usersDatatable(){ - $query = ShoppingOrder::with('shopping_user', 'user_shop')->select('shopping_orders.*')->where('shopping_orders.auth_user_id', '!=', NULL); + $query = ShoppingOrder::with('shopping_user', 'user_shop', 'shopping_payments')->select('shopping_orders.*')->where('shopping_orders.auth_user_id', '!=', NULL); return \DataTables::eloquent($query) ->addColumn('id', function (ShoppingOrder $ShoppingOrder) { @@ -63,7 +64,25 @@ class SalesController extends Controller return Payment::getShoppingOrderBadge($ShoppingOrder); }) ->addColumn('total_shipping', function (ShoppingOrder $ShoppingOrder) { - return $ShoppingOrder->getFormattedTotalShipping(); + return $ShoppingOrder->getFormattedTotalShipping()." €"; + }) + ->addColumn('payment', function (ShoppingOrder $ShoppingOrder) { + return $ShoppingOrder->getLastShoppingPayment('getPaymentType'); + }) + ->addColumn('shipped', function (ShoppingOrder $ShoppingOrder) { + return ''.$ShoppingOrder->getShippedType().''; + }) + ->addColumn('is_for', function (ShoppingOrder $ShoppingOrder) { + if($ShoppingOrder->shopping_user->is_for === 'me'){ + return 'Berater'; + } + if($ShoppingOrder->shopping_user->is_for === 'ot'){ + return 'Kunde'; + } + return '-'; + }) + ->addColumn('reference', function (ShoppingOrder $ShoppingOrder) { + return $ShoppingOrder->getLastShoppingPayment('reference'); }) ->addColumn('orders', function (ShoppingOrder $ShoppingOrder) { return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->orders : ''; @@ -78,8 +97,10 @@ class SalesController extends Controller ->orderColumn('id', 'id $1') ->orderColumn('txaction', 'txaction $1') ->orderColumn('user_shop_id', 'user_shop_id $1') + ->orderColumn('shipped', 'shipped $1') + ->orderColumn('total_shipping', 'total_shipping $1') - ->rawColumns(['id', 'txaction', 'user_shop_id', 'auth_user_shop']) + ->rawColumns(['id', 'txaction', 'user_shop_id', 'auth_user_shop', 'is_for', 'shipped']) ->make(true); } @@ -185,9 +206,26 @@ class SalesController extends Controller return Payment::getShoppingOrderBadge($ShoppingOrder); }) ->addColumn('total_shipping', function (ShoppingOrder $ShoppingOrder) { - return $ShoppingOrder->getFormattedTotalShipping(); + return $ShoppingOrder->getFormattedTotalShipping()." €"; + }) + ->addColumn('payment', function (ShoppingOrder $ShoppingOrder) { + return $ShoppingOrder->getLastShoppingPayment('getPaymentType'); + }) + ->addColumn('shipped', function (ShoppingOrder $ShoppingOrder) { + return ''.$ShoppingOrder->getShippedType().''; + }) + ->addColumn('is_for', function (ShoppingOrder $ShoppingOrder) { + if($ShoppingOrder->shopping_user->is_for === 'me'){ + return 'Berater'; + } + if($ShoppingOrder->shopping_user->is_for === 'ot'){ + return 'Kunde'; + } + return '-'; + }) + ->addColumn('reference', function (ShoppingOrder $ShoppingOrder) { + return $ShoppingOrder->getLastShoppingPayment('reference'); }) - ->addColumn('member_id', function (ShoppingOrder $ShoppingOrder) { if($ShoppingOrder->member_id) { return $ShoppingOrder->member_id ? '' . $ShoppingOrder->member->getFullName() . '' : ''; @@ -211,8 +249,53 @@ class SalesController extends Controller ->orderColumn('txaction', 'txaction $1') ->orderColumn('user_shop_id', 'user_shop_id $1') ->orderColumn('member_id', 'member_id $1') - ->rawColumns(['id', 'member_id', 'txaction', 'user_shop_id']) + ->orderColumn('shipped', 'shipped $1') + ->orderColumn('total_shipping', 'total_shipping $1') + ->rawColumns(['id', 'member_id', 'txaction', 'user_shop_id', 'is_for', 'shipped']) ->make(true); } + public function store(){ + $data = Request::all(); + if(!isset($data['id'])){ + abort(404); + } + if(isset($data['action'])){ + if($data['action'] === 'store_shipped' && isset($data['shipped'])){ + $shopping_order = ShoppingOrder::findOrFail($data['id']); + $shopping_order->shipped = $data['shipped']; + $shopping_order->save(); + } + + if($data['action'] === 'store_txaction' && isset($data['txaction']) && isset($data['payment_id'])){ + $shopping_order = ShoppingOrder::findOrFail($data['id']); + $shopping_payment = ShoppingPayment::findOrFail($data['payment_id']); + + PaymentTransaction::create([ + 'shopping_payment_id' => $shopping_payment->id, + 'request' => 'transaction', + 'txid' => 0, + 'userid' => 0, + 'status' => 'FNCMIV', + 'transmitted_data' => NULL, + 'txaction' => $data['txaction'], + 'mode' => $shopping_payment->mode, + ]); + + $shopping_order->txaction = $data['txaction']; + $shopping_order->paid = true; + $shopping_order->save(); + $shopping_payment->txaction = $data['txaction']; + $shopping_payment->save(); + + //TODO can send MAIL + //Payment::paymentStatusSendMail($shopping_order, $shopping_payment, $data); + } + + } + if(isset($data['back'])){ + return redirect($data['back']); + } + } + } \ No newline at end of file diff --git a/app/Http/Controllers/User/CustomerController.php b/app/Http/Controllers/User/CustomerController.php index 5149c49..5dae854 100755 --- a/app/Http/Controllers/User/CustomerController.php +++ b/app/Http/Controllers/User/CustomerController.php @@ -91,7 +91,7 @@ class CustomerController extends Controller $step = 1; $shopping_user->same_as_billing = true; $shopping_user->faker_mail = true; - $billing_email = time()."@faker-mivita.care"; + $billing_email = time()."-faker@mivita.care"; } } $data = [ diff --git a/app/Http/Controllers/User/OrderController.php b/app/Http/Controllers/User/OrderController.php index e8cb3ba..e836c3f 100755 --- a/app/Http/Controllers/User/OrderController.php +++ b/app/Http/Controllers/User/OrderController.php @@ -29,6 +29,7 @@ class OrderController extends Controller public function index() { + $data = [ ]; return view('user.order.index', $data); @@ -41,6 +42,8 @@ class OrderController extends Controller if($shopping_order->auth_user_id !== $user->id){ abort(404); } + $shopping_order->getLastShoppingPayment(); + $data = [ 'shopping_order' => $shopping_order, 'isAdmin' => false, @@ -51,7 +54,7 @@ class OrderController extends Controller public function ordersDatatable(){ $user = User::find(\Auth::user()->id); - $query = ShoppingOrder::with('shopping_user')->select('shopping_orders.*')->where('auth_user_id', '=', $user->id)->where('txaction', '!=', NULL); + $query = ShoppingOrder::with('shopping_user', 'shopping_payments')->select('shopping_orders.*')->where('auth_user_id', '=', $user->id)->where('txaction', '!=', NULL); return \DataTables::eloquent($query) ->addColumn('id', function (ShoppingOrder $ShoppingOrder) { @@ -64,19 +67,32 @@ class OrderController extends Controller return Payment::getShoppingOrderBadge($ShoppingOrder); }) ->addColumn('total_shipping', function (ShoppingOrder $ShoppingOrder) { - return $ShoppingOrder->getFormattedTotalShipping(); + return $ShoppingOrder->getFormattedTotalShipping()." €"; }) - ->addColumn('orders', function (ShoppingOrder $ShoppingOrder) { - return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->orders : ''; + ->addColumn('payment', function (ShoppingOrder $ShoppingOrder) { + return $ShoppingOrder->getLastShoppingPayment('getPaymentType'); }) - ->addColumn('user_shop_id', function (ShoppingOrder $ShoppingOrder) { - return $ShoppingOrder->user_shop ? ''.$ShoppingOrder->user_shop->getSubdomain(false).'' : ''; + ->addColumn('shipped', function (ShoppingOrder $ShoppingOrder) { + return ''.$ShoppingOrder->getShippedType().''; }) + ->addColumn('is_for', function (ShoppingOrder $ShoppingOrder) { + if($ShoppingOrder->shopping_user->is_for === 'me'){ + return 'Berater'; + } + if($ShoppingOrder->shopping_user->is_for === 'ot'){ + return 'Kunde'; + } + return '-'; + }) + ->addColumn('reference', function (ShoppingOrder $ShoppingOrder) { + return $ShoppingOrder->getLastShoppingPayment('reference'); + }) + ->orderColumn('id', 'id $1') ->orderColumn('txaction', 'txaction $1') - ->orderColumn('user_shop_id', 'user_shop_id $1') - - ->rawColumns(['id', 'txaction', 'user_shop_id']) + ->orderColumn('shipped', 'shipped $1') + ->orderColumn('total_shipping', 'total_shipping $1') + ->rawColumns(['id', 'txaction', 'is_for', 'shipped']) ->make(true); } diff --git a/app/Http/Controllers/Web/CheckoutController.php b/app/Http/Controllers/Web/CheckoutController.php index 1eff5e8..88b59e7 100755 --- a/app/Http/Controllers/Web/CheckoutController.php +++ b/app/Http/Controllers/Web/CheckoutController.php @@ -41,10 +41,8 @@ class CheckoutController extends Controller public function checkout(){ - //TODO ZAHLDIENSTE FORM USER !!! // dump(Request::all()); - // dd("back"); // $user_shop = Util::getUserShop(); $shopping_data = Yard::instance('shopping')->getYardExtra('shopping_data'); @@ -87,8 +85,6 @@ class CheckoutController extends Controller } - - if(old('selected_country') && old('selected_country') === 'change'){ \Session::forget('_old_input.selected_country'); $shopping_user->billing_state = old('billing_state'); @@ -110,8 +106,10 @@ class CheckoutController extends Controller if($is_from !== 'shopping' && Util::getAuthUser()){ $user = Util::getAuthUser(); $payment_methods = $user->payment_methods; + $payment_data = $user->account->payment_data; }else{ - $payment_methods = PaymentMethod::getDefaultAsArray(); + $payment_methods = PaymentMethod::getDefaultAsArray()->toArray(); + $payment_data = false; } $payment_methods_active = \App\Models\PaymentMethod::where('active', true)->get()->pluck( 'id', 'short')->toArray(); @@ -124,6 +122,7 @@ class CheckoutController extends Controller 'shopping_mode' => Util::getUserShoppingMode(), 'payment_methods' => $payment_methods, 'payment_methods_active' => $payment_methods_active, + 'payment_data' => $payment_data, ]; return view('web.templates.checkout', $data); } @@ -147,6 +146,8 @@ class CheckoutController extends Controller $shopping_user->billing_phone = $user->account->phone; $shopping_user->billing_email = $user->email; $shopping_user->faker_mail = false; + $shopping_user->shipping_email = $user->email; + $shopping_user->accepted_data_checkbox = 1; $shopping_user->is_for = $is_for; $shopping_user->is_from = $is_from; @@ -154,7 +155,7 @@ class CheckoutController extends Controller if($is_from === 'user_order'){ if(isset($data['shopping_user_id']) && $data['is_for'] === 'ot'){ $s_user = ShoppingUser::findOrFail($data['shopping_user_id']); - $shopping_user->billing_salutation = $s_user->billing_salutation; + /* $shopping_user->billing_salutation = $s_user->billing_salutation; $shopping_user->billing_company = $s_user->billing_company; $shopping_user->billing_firstname = $s_user->billing_firstname; $shopping_user->billing_lastname = $s_user->billing_lastname; @@ -165,11 +166,14 @@ class CheckoutController extends Controller $shopping_user->billing_country_id = $s_user->billing_country_id; $shopping_user->billing_phone = $s_user->billing_phone; $shopping_user->billing_email = $s_user->billing_email; + ;*/ $shopping_user->faker_mail = $s_user->faker_mail; + if(!$s_user->faker_mail){ + $shopping_user->shipping_email = $s_user->billing_email; + } $shopping_user->shopping_user_id = $data['shopping_user_id']; $shopping_user->member_id = $s_user->member_id; } - $shopping_user->same_as_billing = false; $shopping_user->shipping_salutation = isset($data['shipping_salutation']) ? $data['shipping_salutation'] : ''; $shopping_user->shipping_company = isset($data['shipping_company']) ? $data['shipping_company'] : ''; @@ -179,7 +183,7 @@ class CheckoutController extends Controller $shopping_user->shipping_address_2 = isset($data['shipping_address_2']) ? $data['shipping_address_2'] : ''; $shopping_user->shipping_zipcode = isset($data['shipping_zipcode']) ? $data['shipping_zipcode'] : ''; $shopping_user->shipping_city = isset($data['shipping_city']) ? $data['shipping_city'] : ''; - $shopping_user->shipping_country_id = isset($data['shipping_state']) ? $data['shipping_state'] : ''; + $shopping_user->shipping_country_id = Yard::instance('shopping')->getShippingCountryCountryId(); $shopping_user->shipping_phone = isset($data['shipping_phone']) ? $data['shipping_phone'] : ''; }else{ @@ -211,7 +215,6 @@ class CheckoutController extends Controller Yard::instance('shopping')->setShippingCountryWithPrice($data['shipping_state'], $data['is_for']); } return back()->withInput(Request::all()); - } $rules = array( @@ -244,6 +247,7 @@ class CheckoutController extends Controller $data = Request::all(); //make User $shopping_user = $this->makeShoppingUser($data); + //make Order and Items $shopping_order = $this->makeShoppingOrder($shopping_user); //CustomerPriority @@ -294,7 +298,6 @@ class CheckoutController extends Controller $pay->init($shopping_user, $shopping_order); $amount = Yard::instance('shopping')->totalWithShipping(2, '.', '') * 100; $ret['elv'] = $pay->checkBankAccount($data, $amount, 'EUR', $shopping_user); - if($ret['elv']['status'] === 'ERROR' || $ret['elv']['status'] === 'INVALID'){ /* PaymentTransaction::create([ 'shopping_payment_id' => //is no shopping_payment_id at this moment, @@ -418,7 +421,7 @@ class CheckoutController extends Controller private function storeUserPaymentsData($shopping_user, $ret){ if($shopping_user->auth_user_id){ $user = User::find($shopping_user->auth_user_id); - if($user && $user->account && $shopping_user->abo_options){ + if($user && $user->account){ if(isset($ret['elv']) && is_array($ret['elv'])){ $user->account->payment_data = $ret['elv']; $user->account->save(); @@ -459,12 +462,20 @@ class CheckoutController extends Controller 'country_id' => Yard::instance('shopping')->getShippingCountryId(), 'user_shop_id' => $user_shop->id, 'payment_for' => Util::getUserPaymentFor(), + + 'total' => Yard::instance('shopping')->total(2, '.', ''), + 'subtotal' => Yard::instance('shopping')->subtotal(2, '.', ''), + 'shipping' => Yard::instance('shopping')->shipping(2, '.', ','), - 'subtotal' => Yard::instance('shopping')->subtotalWithShipping(2, '.', ''), - //'tax_rate' => Yard::getTaxRate(), + 'shipping_net' => Yard::instance('shopping')->shippingNet(2, '.', ''), + 'subtotal_ws' => Yard::instance('shopping')->subtotalWithShipping(2, '.', ''), + 'tax' => Yard::instance('shopping')->taxWithShipping(2, '.', ''), 'total_shipping' => Yard::instance('shopping')->totalWithShipping(2, '.', ''), + + 'points' => Yard::instance('shopping')->points(), + 'weight' => Yard::instance('shopping')->weight(), 'txaction' => 'prev', 'mode' => Util::getUserShoppingMode(), @@ -494,6 +505,7 @@ class CheckoutController extends Controller 'product_id' => $item->id, 'qty' => $item->qty, 'price' => $item->price, + 'price_net' => Yard::instance('shopping')->rowPriceNet($item, 3, '.', ''), 'tax_rate' => $item->taxRate, 'slug' => $item->options->slug, ])->save(); @@ -511,6 +523,7 @@ class CheckoutController extends Controller 'product_id' => $item->id, 'qty' => $item->qty, 'price' => $item->price, + 'price_net' => Yard::instance('shopping')->rowPriceNet($item, 3, '.', ''), 'tax_rate' => $item->taxRate, 'slug' => $item->options->slug ]); diff --git a/app/Http/Middleware/Checkout.php b/app/Http/Middleware/Checkout.php index 2344613..0a678a5 100755 --- a/app/Http/Middleware/Checkout.php +++ b/app/Http/Middleware/Checkout.php @@ -38,19 +38,18 @@ class Checkout } if($shopping_instance->back){ \Session::put('back_link', $shopping_instance->back); - } \Session::put('new_session', true); - Yard::instance('shopping')->destroy(); //restore yard Yard::instance('shopping')->restore($request->route('identifier')); + Yard::instance('shopping')->putYardExtra('user_shop_payment', $shopping_instance->payment); + Yard::instance('shopping')->putYardExtra('shopping_data', $shopping_instance->shopping_data); $is_for = isset($shopping_instance->shopping_data['is_for']) ? $shopping_instance->shopping_data['is_for'] : 'ot'; Yard::instance('shopping')->setShippingCountryWithPrice($shopping_instance->country_id, $is_for); - ShoppingInstance::where('identifier', $request->route('identifier'))->delete(); $request->route()->forgetParameter('identifier'); diff --git a/app/Models/ShoppingOrder.php b/app/Models/ShoppingOrder.php index 4416751..218d624 100644 --- a/app/Models/ShoppingOrder.php +++ b/app/Models/ShoppingOrder.php @@ -83,18 +83,38 @@ class ShoppingOrder extends Model 'country_id', 'user_shop_id', 'total', - 'shipping', 'subtotal', - //'tax_rate', + 'shipping', + 'shipping_net', + 'subtotal_ws', 'tax', 'total_shipping', + 'points', 'weight', 'paid', 'txaction', 'wp_invoice_path', 'mode', + 'shipped', + 'tracking' ]; + public static $shippedTypes = [ + 0 => 'offen', + 1 => 'versendet', + 2 => 'abgeschlossen', + 4 => 'In Bearbeitung', + + 50 => 'storiniert' + ]; + + public static $shippedColors = [ + 0 => 'warning', + 1 => 'success', + 2 => 'success', + 4 => 'info', + 50 => 'danger', + ]; public function shopping_user() { @@ -150,36 +170,63 @@ class ShoppingOrder extends Model } } - public function _format_number($value) - { - return preg_replace("/[^0-9,]/", "", $value); + public function getLastShoppingPayment($key=false){ + $shopping_payment = $this->shopping_payments->last(); + if($shopping_payment){ + if($key === 'getPaymentType'){ + return $shopping_payment->getPaymentType(); + } + if($key === 'reference'){ + return $shopping_payment->reference; + } + } + return ""; } + public function getShippedType(){ + return isset(self::$shippedTypes[$this->shipped]) ? self::$shippedTypes[$this->shipped] : ""; + } + + public function getShippedColor(){ + return isset(self::$shippedColors[$this->shipped]) ? self::$shippedColors[$this->shipped] : "default"; + } + + public function getFormattedTotal() + { + return formatNumber($this->attributes['total']); + } + + public function getFormattedSubtotal() + { + return formatNumber($this->attributes['subtotal']); + } public function getFormattedShipping() { - if (\App::getLocale() === "en") { - return number_format($this->attributes['shipping'], 2, '.', ','); - } - return number_format($this->attributes['shipping'], 2, ',', '.'); + return formatNumber($this->attributes['shipping']); + } + + public function getFormattedShippingNet() + { + return formatNumber($this->attributes['shipping_net']); + } + + public function getFormattedSubtotalWs() + { + return formatNumber($this->attributes['subtotal_ws']); + } + + public function getFormattedTax() + { + return formatNumber($this->attributes['tax']); } public function getFormattedTotalShipping() { - if (\App::getLocale() === "en") { - return number_format($this->attributes['total_shipping'], 2, '.', ','); - } - return number_format($this->attributes['total_shipping'], 2, ',', '.'); + return formatNumber($this->attributes['total_shipping']); } - public function getFormattedPrice() - { - if (\App::getLocale() === "en") { - return number_format($this->attributes['price'], 2, '.', ','); - } - return number_format($this->attributes['price'], 2, ',', '.'); - } public function getItemsCount(){ diff --git a/app/Models/ShoppingOrderItem.php b/app/Models/ShoppingOrderItem.php index 2ce7446..84193fd 100644 --- a/app/Models/ShoppingOrderItem.php +++ b/app/Models/ShoppingOrderItem.php @@ -55,6 +55,7 @@ class ShoppingOrderItem extends Model 'product_id', 'qty', 'price', + 'price_net', 'tax_rate', 'slug', ]; @@ -72,10 +73,22 @@ class ShoppingOrderItem extends Model public function getFormattedPrice() { - if (\App::getLocale() == "en") { - return number_format($this->attributes['price'], 2, '.', ','); - } - return number_format($this->attributes['price'], 2, ',', '.'); + return formatNumber($this->attributes['price']); + } + + public function getFormattedTotalPrice() + { + return formatNumber($this->attributes['price'] * $this->attributes['qty']); + } + + public function getFormattedPriceNet() + { + return formatNumber($this->attributes['price_net']); + } + + public function getFormattedTotalPriceNet() + { + return formatNumber($this->attributes['price_net'] * $this->attributes['qty']); } } \ No newline at end of file diff --git a/app/Models/ShoppingUser.php b/app/Models/ShoppingUser.php index 9835af1..c01721c 100644 --- a/app/Models/ShoppingUser.php +++ b/app/Models/ShoppingUser.php @@ -130,6 +130,7 @@ class ShoppingUser extends Model 'billing_phone', 'billing_email', 'faker_mail', + 'shipping_email', 'accepted_data_checkbox', 'same_as_billing', 'shipping_salutation', diff --git a/app/Services/Payment.php b/app/Services/Payment.php index d7e7ebc..5f2b613 100644 --- a/app/Services/Payment.php +++ b/app/Services/Payment.php @@ -17,15 +17,25 @@ class Payment 'failed' => "abbruch", 'extern' => "extern", 'invoice_open' => "Re. offen", + 'invoice_paid' => "Re. bezahlt", + 'invoice_non' => "keine Zahlung", 'NULL' => 'keine Zahlung', ]; + public static $txaction_invoice = [ + 'invoice_open' => "Re. offen", + 'invoice_paid' => "Re. bezahlt", + 'invoice_non' => 'keine Zahlung', + ]; + public static $txaction_color = [ 'paid' => "success", 'appointed' => "warning", 'failed' => "danger", 'extern' => "success", 'invoice_open' => "warning", + 'invoice_paid' => "success", + 'invoice_non' => "failed", ]; diff --git a/app/Services/Shop.php b/app/Services/Shop.php index bba7526..dea983e 100644 --- a/app/Services/Shop.php +++ b/app/Services/Shop.php @@ -11,7 +11,7 @@ class Shop { public static function userOrders() { $shopping_users = ShoppingUser::whereHas('shopping_order', function($q) { - $q->where('txaction', 'paid')->OrWhere('txaction', 'appointed')->OrWhere('txaction', 'extern'); + $q->where('txaction', 'paid')->OrWhere('txaction', 'appointed')->OrWhere('txaction', 'extern')->OrWhere('txaction', 'invoice_open')->OrWhere('txaction', 'invoice_paid'); })->where('orders', '=', NULL)->get(); foreach ($shopping_users as $shopping_user) { if ($shopping_user->number) { diff --git a/app/Services/Util.php b/app/Services/Util.php index 14ea9c8..ae5a558 100644 --- a/app/Services/Util.php +++ b/app/Services/Util.php @@ -2,6 +2,7 @@ namespace App\Services; use App\Models\UserHistory; +use Yard; class Util { @@ -158,9 +159,13 @@ class Util } public static function getUserPaymentFor(){ + if(Yard::instance('shopping')->getYardExtra('user_shop_payment')){ + return Yard::instance('shopping')->getYardExtra('user_shop_payment'); + } if(\Session::has('user_shop_payment')){ return \Session::get('user_shop_payment'); } + return null; } diff --git a/app/Services/Yard.php b/app/Services/Yard.php index 591de1f..4152c84 100644 --- a/app/Services/Yard.php +++ b/app/Services/Yard.php @@ -31,6 +31,14 @@ class Yard extends Cart $this->shipping_price = (float) ($this->getYardExtra('shipping_price')); } + if($this->getYardExtra('shipping_price_net')){ + $this->shipping_price_net = (float) ($this->getYardExtra('shipping_price_net')); + } + + if($this->getYardExtra('shipping_tax_rate')){ + $this->shipping_tax_rate = (float) ($this->getYardExtra('shipping_tax_rate')); + } + if($this->getYardExtra('shipping_tax')){ $this->shipping_tax = (float) ($this->getYardExtra('shipping_tax')); } diff --git a/database/migrations/2019_02_23_161530_create_shopping_users_table.php b/database/migrations/2019_02_23_161530_create_shopping_users_table.php index 152d91d..29d1e84 100644 --- a/database/migrations/2019_02_23_161530_create_shopping_users_table.php +++ b/database/migrations/2019_02_23_161530_create_shopping_users_table.php @@ -34,6 +34,7 @@ class CreateShoppingUsersTable extends Migration $table->string('billing_phone')->nullable(); $table->string('billing_email')->nullable(); $table->boolean('faker_mail')->default(false); + $table->string('shipping_email')->nullable(); $table->unsignedSmallInteger('orders')->nullable()->default(1); 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 cf9a2e1..091ce71 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 @@ -24,21 +24,32 @@ class CreateShoppingOrdersTable extends Migration $table->unsignedInteger('member_id')->nullable(); - $table->unsignedTinyInteger('payment_for'); + $table->unsignedTinyInteger('payment_for')->nullable(); $table->decimal('total', 13, 2)->nullable(); - $table->decimal('shipping', 8, 2)->nullable(); $table->decimal('subtotal', 13, 2)->nullable(); - $table->decimal('tax_rate', 5, 2)->nullable(); + + $table->decimal('shipping', 8, 2)->nullable(); + $table->decimal('shipping_net', 8, 2)->nullable(); + + $table->decimal('subtotal_ws', 13, 2)->nullable(); $table->decimal('tax', 8, 2)->nullable(); $table->decimal('total_shipping', 13, 2)->nullable(); + $table->unsignedInteger('points')->nullable(); + $table->unsignedInteger('weight')->nullable(); $table->boolean('paid')->default(false); $table->string('wp_invoice_path', 255)->nullable(); $table->string('txaction', 20)->nullable()->index(); + $table->unsignedTinyInteger('shipped')->default(0); + $table->string('tracking', 255)->nullable(); + + + + $table->char('mode', 4)->nullable(); $table->timestamps(); diff --git a/database/migrations/2019_02_23_163724_create_shopping_order_items_table.php b/database/migrations/2019_02_23_163724_create_shopping_order_items_table.php index a30406a..4aa0060 100644 --- a/database/migrations/2019_02_23_163724_create_shopping_order_items_table.php +++ b/database/migrations/2019_02_23_163724_create_shopping_order_items_table.php @@ -21,6 +21,8 @@ class CreateShoppingOrderItemsTable extends Migration $table->unsignedInteger('product_id'); $table->unsignedInteger('qty'); $table->decimal('price', 8, 2)->nullable(); + $table->decimal('price_net', 8, 3)->nullable(); + $table->decimal('tax_rate', 5, 2)->nullable(); $table->string('slug')->nullable(); diff --git a/resources/lang/de/email.php b/resources/lang/de/email.php index 3510c1b..4bf2ad7 100644 --- a/resources/lang/de/email.php +++ b/resources/lang/de/email.php @@ -49,6 +49,8 @@ 'checkout_mail_hl1' => 'Du hast folgende Artikel bestellt:', 'checkout_mail_shipping' => 'Verpackungs- u. Versandkosten', 'checkout_mail_status_info' => 'Statusinfo:', + 'checkout_mail_subtotal_ws' => 'Summe ohne MwSt.', + 'checkout_mail_tax' => 'zzgl. MwSt', 'checkout_mail_total' => 'Gesamtpreis', 'checkout_mail_tax_info' => 'Preis inkl. MwSt', 'checkout_mail_pay_info' => 'Zahlungsinfo:', @@ -58,6 +60,11 @@ 'checkout_mail_your_mail' => 'Deine E-Mai:', 'checkout_mail_invoice_addess' => 'Deine Rechnungsadresse:', 'checkout_mail_deliver_addess' => 'Deine Lieferadresse:', + 'checkout_mail_deliver_customer' => 'Lieferadresse des Kunde:', + 'checkout_mail_order_for_me' => 'Beraterbestellung für Dich:', + 'checkout_mail_order_for_ot' => 'Beraterbestellung für Deinen Kunden:', + 'checkout_mail_order_for_wizard' => 'Beraterbestellung zur Deiner Registrierung:', + 'checkout_mail_order_for_membership' => 'Beraterbestellung für Deine Mitgliedschaft:', 'checkout_mail_same_address' => 'Lieferadresse ist gleich Rechnungsadresse', 'checkout_mail_pay_error' => 'Die Zahlung ist fehlgeschlagen!', 'checkout_mail_pay_pre' => 'Bezahlung per Vorkasse:', diff --git a/resources/views/admin/sales/_detail.blade.php b/resources/views/admin/sales/_detail.blade.php index 5a11990..cff11ad 100644 --- a/resources/views/admin/sales/_detail.blade.php +++ b/resources/views/admin/sales/_detail.blade.php @@ -2,11 +2,32 @@
- Status: - - {!! \App\Services\Payment::getShoppingOrderBadge($shopping_order); !!} - - {{$shopping_order->created_at->format("d.m.Y")}} +
+
+ Status: + + {!! \App\Services\Payment::getShoppingOrderBadge($shopping_order); !!} + +
+
+ Versand: + + @if($isAdmin) + + @else + + {{$shopping_order->getShippedType()}} + + @endif +
+
+

@@ -14,18 +35,22 @@
-
+
Bestelldatum
{{$shopping_order->created_at->format("d.m.Y H:i")}}
-
+
Anzahl Artikel
{{$shopping_order->getItemsCount()}}
-
+
Preis gesamt
{{$shopping_order->getFormattedTotalShipping()}} €
+
+
Points gesamt
+ {{ $shopping_order->points }} +

@@ -47,7 +72,6 @@
@endif -
Zugewiesener Berater
@if($isView === 'sales_user') @if($shopping_order->user_shop) @@ -78,7 +102,6 @@ @endif
-
Gekauft im Shop
@if($shopping_order->user_shop->user->isActive() && $shopping_order->user_shop->user->isActiveShop()) @@ -96,7 +119,11 @@
- Rechnungsadresse + @if($shopping_order->shopping_user->is_from === 'shopping') + Rechnungsadresse des Kunden + @else + Rechnungsadresse des Berater + @endif
@if($shopping_order->shopping_user->billing_company) @@ -156,7 +183,22 @@
- Lieferadresse + @if($shopping_order->shopping_user->is_from === 'user_order') + @if($shopping_order->shopping_user->is_for === 'me') + Lieferadresse des Berater + @else + Lieferadresse des Kunden + @endif + @endif + @if($shopping_order->shopping_user->is_from === 'wizard') + Lieferadresse des Berater + @endif + @if($shopping_order->shopping_user->is_from === 'membership') + Lieferadresse des Berater + @endif + @if($shopping_order->shopping_user->is_from === 'shopping') + Lieferadresse des Kunden + @endif
@if($shopping_order->shopping_user->same_as_billing) {{__('email.checkout_mail_same_address')}} @@ -220,18 +262,52 @@
- Artikel + @if($shopping_order->shopping_user->is_from === 'user_order') + @if($shopping_order->shopping_user->is_for === 'me') + Bestellung für Berater + @else + Bestellung für Kunde + @endif + @endif + @if($shopping_order->shopping_user->is_from === 'wizard') + Beraterbestellung für Registrierung + @endif + @if($shopping_order->shopping_user->is_from === 'membership') + Beraterbestellung für Mitgliedschaft + @endif + @if($shopping_order->shopping_user->is_from === 'shopping') + Kundenbestellung über Shop + @endif
+
- +
- + - - + + + @foreach($shopping_order->shopping_order_items as $shopping_order_item) - + + - - @endforeach + + + + + + + + + + + + + + + + + + + +
ProduktAnzahlPreis + @if($shopping_order->shopping_user->is_from === 'user_order') + Netto-Preis + @else + Preis + @endif + AnzahlSumme
@if($shopping_order_item->product->images) @@ -251,17 +327,70 @@
+ @if($shopping_order->shopping_user->is_from === 'user_order') + {{ $shopping_order_item->getFormattedPriceNet() }} € + @else + {{ $shopping_order_item->getFormattedPrice() }} € + @endif + + {{ $shopping_order_item->qty }} - {{ $shopping_order_item->getFormattedPrice() }} € + + @if($shopping_order->shopping_user->is_from === 'user_order') + {{ $shopping_order_item->getFormattedTotalPriceNet() }} € + @else + {{ $shopping_order_item->getFormattedTotalPrice() }} € + @endif
+ {{__('email.checkout_mail_shipping')}} + + @if($shopping_order->shopping_user->is_from === 'user_order') + {{ $shopping_order->getFormattedShippingNet() }} € + @else + {{ $shopping_order->getFormattedShipping() }} € + @endif +
+ {{__('email.checkout_mail_subtotal_ws')}} + + {{ $shopping_order->getFormattedSubtotalWs() }} € +
+ {{__('email.checkout_mail_tax')}} + + {{ $shopping_order->getFormattedTax() }} € +
+ {{__('email.checkout_mail_total')}} + + {{ $shopping_order->getFormattedTotalShipping() }} € +
+ {{__('email.checkout_mail_tax_info')}} +
@@ -279,10 +408,10 @@ # Zahlungsart - @if($isAdmin)Referenznummer@endif Gesamt Status Datum + Referenznummer @@ -291,10 +420,23 @@ {{++$count}} {{$shopping_payment->getPaymentType()}} - @if($isAdmin){{$shopping_payment->reference}}@endif {{$shopping_payment->getPaymentAmount()}} - {!! \App\Services\Payment::getShoppingPaymentBadge($shopping_payment) !!} + + @if($isAdmin && $shopping_payment->clearingtype === 'fnc' && $shopping_payment->onlinebanktransfertype === 'MIV') + + @else + {!! \App\Services\Payment::getShoppingPaymentBadge($shopping_payment) !!} + @endif + {{$shopping_payment->created_at->format("d.m.Y H:i")}} + {{$shopping_payment->reference}} @if($isAdmin && $shopping_payment->payment_transactions) @php($ccount=0) @@ -329,5 +471,78 @@
+
-
\ No newline at end of file + @if($isAdmin) + + + + + + + + + + + @endif \ No newline at end of file diff --git a/resources/views/admin/sales/customers.blade.php b/resources/views/admin/sales/customers.blade.php index e2a465f..951b01d 100644 --- a/resources/views/admin/sales/customers.blade.php +++ b/resources/views/admin/sales/customers.blade.php @@ -49,14 +49,17 @@ # + {{__('Datum')}} + {{__('Betrag')}} + {{__('Zahlung')}} + {{__('Status')}} + {{__('Versand')}} {{__('First name')}} {{__('Last name')}} {{__('E-Mail')}} - {{__('Datum')}} - {{__('Status')}} - {{__('Betrag')}} - {{__('Käufe')}} {{__('zugewiesener Berater')}} + {{__('Rf-Nr.')}} + {{__('Käufe')}} {{__('Gekauft im Shop')}} @@ -78,15 +81,18 @@ }, "order": [[0, "desc" ]], "columns": [ - { data: 'id', name: 'id', searchable: false }, + { data: 'id', searchable: false }, + { data: 'created_at', name: 'shopping_orders.created_at' }, + { data: 'total_shipping', name: 'total_shipping' }, + { data: 'payment', name: 'payment', orderable: false }, + { data: 'txaction', name: 'txaction' }, + { 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: 'txaction', name: 'txaction' }, - { data: 'total_shipping', name: 'total_shipping' }, - { data: 'shopping_user.orders', name: 'shopping_user.orders' }, { data: 'member_id', name: 'member_id', searchable: false, orderable: false }, + { data: 'reference', name: 'reference' }, + { data: 'shopping_user.orders', name: 'shopping_user.orders' }, { data: 'user_shop_id', name: 'user_shop_id', searchable: false, orderable: true }, ], "bLengthChange": false, diff --git a/resources/views/admin/sales/users.blade.php b/resources/views/admin/sales/users.blade.php index fcc9157..fd1927f 100644 --- a/resources/views/admin/sales/users.blade.php +++ b/resources/views/admin/sales/users.blade.php @@ -15,12 +15,20 @@ # + {{__('Datum')}} + {{__('Betrag')}} + {{__('Zahlung')}} + {{__('Status')}} + {{__('Versand')}} + {{__('Für')}} {{__('First name')}} {{__('Last name')}} {{__('E-Mail')}} - {{__('Datum')}} - {{__('Status')}} - {{__('Betrag')}} + B.{{__('First name')}} + B.{{__('Last name')}} + B.{{__('E-Mail')}} + + {{__('Rf-Nr.')}} {{__('Käufe')}} {{__('Berater-Shop')}} @@ -37,12 +45,19 @@ "order": [[0, "desc" ]], "columns": [ { data: 'id', searchable: false }, - { 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: 'shopping_orders.created_at' }, - { data: 'txaction', name: 'txaction' }, { data: 'total_shipping', name: 'total_shipping' }, + { data: 'payment', name: 'payment', orderable: false }, + { data: 'txaction', name: 'txaction' }, + { data: 'shipped', name: 'shipped' }, + { data: 'is_for', name: 'is_for', orderable: false }, + { data: 'shopping_user.shipping_firstname', name: 'shopping_user.shipping_firstname', orderable: false }, + { data: 'shopping_user.shipping_lastname', name: 'shopping_user.shipping_lastname', orderable: false }, + { data: 'shopping_user.shipping_email', name: 'shopping_user.shipping_email', orderable: false }, + { data: 'shopping_user.billing_firstname', name: 'shopping_user.billing_firstname', orderable: false }, + { data: 'shopping_user.billing_lastname', name: 'shopping_user.billing_lastname', orderable: false }, + { data: 'shopping_user.billing_email', name: 'shopping_user.billing_email', orderable: false }, + { data: 'reference', name: 'reference' }, { data: 'shopping_user.orders', name: 'shopping_user.orders' }, { data: 'auth_user_shop', name: 'auth_user_shop' }, ], diff --git a/resources/views/emails/checkout.blade.php b/resources/views/emails/checkout.blade.php index ff1b8cb..0740367 100644 --- a/resources/views/emails/checkout.blade.php +++ b/resources/views/emails/checkout.blade.php @@ -149,60 +149,113 @@

- {{__('email.checkout_mail_hl1')}} + @if($shopping_order->shopping_user->is_from === 'user_order') + @if($shopping_order->shopping_user->is_for === 'me') + {{__('email.checkout_mail_order_for_me')}} + @else + {{__('email.checkout_mail_order_for_ot')}} + @endif + @endif + @if($shopping_order->shopping_user->is_from === 'wizard') + {{__('email.checkout_mail_order_for_wizard')}} + @endif + @if($shopping_order->shopping_user->is_from === 'membership') + {{__('email.checkout_mail_order_for_membership')}} + @endif + @if($shopping_order->shopping_user->is_from === 'shopping') + {{__('email.checkout_mail_hl1')}} + @endif - - @foreach($shopping_order->shopping_order_items as $shopping_order_item) - - - - - - @endforeach - - - - - - - - - - - - - - - - -
- {{ $shopping_order_item->qty }} x - - {{ $shopping_order_item->product->name }} - - {{ $shopping_order_item->getFormattedPrice() }} EUR -
-
-
-   - - {{__('email.checkout_mail_shipping')}} - - {{ $shopping_order->getFormattedShipping() }} EUR -
-
-
-   - - {{__('email.checkout_mail_total')}} - - {{ $shopping_order->getFormattedTotalShipping() }} EUR -
- {{__('email.checkout_mail_tax_info')}} -
+ + + + + + + + @foreach($shopping_order->shopping_order_items as $shopping_order_item) + + + + + + + @endforeach + + + + + + + + + + + + + + + + + + + + + + + +
Produkt + @if($shopping_order->shopping_user->is_from === 'user_order') + Netto-Preis + @else + Preis + @endif + AnzahlSumme
+ {{ $shopping_order_item->product->name }} + + @if($shopping_order->shopping_user->is_from === 'user_order') + {{ $shopping_order_item->getFormattedPriceNet() }} € + @else + {{ $shopping_order_item->getFormattedPrice() }} € + @endif + + {{ $shopping_order_item->qty }} + + @if($shopping_order->shopping_user->is_from === 'user_order') + {{ $shopping_order_item->getFormattedTotalPriceNet() }} € + @else + {{ $shopping_order_item->getFormattedTotalPrice() }} € + @endif +
+
+
+ {{__('email.checkout_mail_shipping')}} + + @if($shopping_order->shopping_user->is_from === 'user_order') + {{ $shopping_order->getFormattedShippingNet() }} € + @else + {{ $shopping_order->getFormattedShipping() }} € + @endif +
+
+
+ {{__('email.checkout_mail_subtotal_ws')}} + + {{ $shopping_order->getFormattedSubtotalWs() }} € +
+ {{__('email.checkout_mail_tax')}} + + {{ $shopping_order->getFormattedTax() }} € +
+ {{__('email.checkout_mail_total')}} + + {{ $shopping_order->getFormattedTotalShipping() }} € +
+ {{__('email.checkout_mail_tax_info')}} +
@@ -311,7 +364,15 @@ - {{__('email.checkout_mail_deliver_addess')}} + @if($shopping_order->shopping_user->is_from === 'user_order') + @if($shopping_order->shopping_user->is_for === 'me') + {{__('email.checkout_mail_deliver_addess')}} + @else + {{__('email.checkout_mail_deliver_customer')}} + @endif + @else + {{__('email.checkout_mail_deliver_addess')}} + @endif diff --git a/resources/views/emails/checkout_status.blade.php b/resources/views/emails/checkout_status.blade.php index 78485b4..49dea99 100644 --- a/resources/views/emails/checkout_status.blade.php +++ b/resources/views/emails/checkout_status.blade.php @@ -182,7 +182,6 @@ {{__('email.checkout_mail_system_status')}} {{$txaction}}
@endif - {{__('email.checkout_mail_pay_with')}} {{$shopping_payment->getPaymentType()}}
{{__('email.checkout_mail_pay_ref')}} {{$shopping_payment->reference}}
{{__('email.checkout_mail_your_mail')}} {{ $shopping_order->shopping_user->billing_email }}
@@ -196,55 +195,108 @@

- {{__('email.checkout_mail_hl1')}} + @if($shopping_order->shopping_user->is_from === 'user_order') + @if($shopping_order->shopping_user->is_for === 'me') + {{__('email.checkout_mail_order_for_me')}} + @else + {{__('email.checkout_mail_order_for_ot')}} + @endif + @endif + @if($shopping_order->shopping_user->is_from === 'wizard') + {{__('email.checkout_mail_order_for_wizard')}} + @endif + @if($shopping_order->shopping_user->is_from === 'membership') + {{__('email.checkout_mail_order_for_membership')}} + @endif + @if($shopping_order->shopping_user->is_from === 'shopping') + {{__('email.checkout_mail_hl1')}} + @endif + + + + + + @foreach($shopping_order->shopping_order_items as $shopping_order_item) - + + @endforeach - - - - - - + + + + + + + @@ -264,7 +316,6 @@
Produkt + @if($shopping_order->shopping_user->is_from === 'user_order') + Netto-Preis + @else + Preis + @endif + AnzahlSumme
- {{ $shopping_order_item->qty }} x - {{ $shopping_order_item->product->name }} + @if($shopping_order->shopping_user->is_from === 'user_order') + {{ $shopping_order_item->getFormattedPriceNet() }} € + @else + {{ $shopping_order_item->getFormattedPrice() }} € + @endif + + {{ $shopping_order_item->qty }} + - {{ $shopping_order_item->getFormattedPrice() }} EUR + @if($shopping_order->shopping_user->is_from === 'user_order') + {{ $shopping_order_item->getFormattedTotalPriceNet() }} € + @else + {{ $shopping_order_item->getFormattedTotalPrice() }} € + @endif
+
-   - + {{__('email.checkout_mail_shipping')}} - {{ $shopping_order->getFormattedShipping() }} EUR + @if($shopping_order->shopping_user->is_from === 'user_order') + {{ $shopping_order->getFormattedShippingNet() }} € + @else + {{ $shopping_order->getFormattedShipping() }} € + @endif
+
-   + + + {{__('email.checkout_mail_subtotal_ws')}} + + {{ $shopping_order->getFormattedSubtotalWs() }} € +
+ {{__('email.checkout_mail_tax')}} + + {{ $shopping_order->getFormattedTax() }} € +
{{__('email.checkout_mail_total')}} - {{ $shopping_order->getFormattedTotalShipping() }} EUR + {{ $shopping_order->getFormattedTotalShipping() }} €
{{__('email.checkout_mail_tax_info')}}
- @@ -312,7 +371,6 @@ @if($shopping_order->shopping_user->same_as_billing) {{__('email.checkout_mail_same_address')}} @else - @if($shopping_order->shopping_user->shipping_company) {{ $shopping_order->shopping_user->shipping_company }}
@endif diff --git a/resources/views/user/customer/add.blade.php b/resources/views/user/customer/add.blade.php index 40b4266..a09bbd9 100644 --- a/resources/views/user/customer/add.blade.php +++ b/resources/views/user/customer/add.blade.php @@ -79,7 +79,7 @@ diff --git a/resources/views/user/order/index.blade.php b/resources/views/user/order/index.blade.php index d026934..f05c32c 100644 --- a/resources/views/user/order/index.blade.php +++ b/resources/views/user/order/index.blade.php @@ -12,13 +12,16 @@ + + + + + + - - - - +
@@ -301,7 +352,15 @@
- {{__('email.checkout_mail_deliver_addess')}}: + @if($shopping_order->shopping_user->is_from === 'user_order') + @if($shopping_order->shopping_user->is_for === 'me') + {{__('email.checkout_mail_deliver_addess')}} + @else + {{__('email.checkout_mail_deliver_customer')}} + @endif + @else + {{__('email.checkout_mail_deliver_addess')}} + @endif
#{{__('Datum')}}{{__('Betrag')}}{{__('Zahlung')}}{{__('Status')}}{{__('Versand')}}{{__('Für')}} {{__('First name')}} {{__('Last name')}} {{__('E-Mail')}}{{__('Datum')}}{{__('Status')}}{{__('Betrag')}}{{__('Käufe')}}{{__('Rf-Nr.')}}
@@ -33,13 +36,16 @@ "order": [[0, "desc" ]], "columns": [ { data: 'id', searchable: false }, - { 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: 'shopping_orders.created_at' }, - { data: 'txaction', name: 'txaction' }, { data: 'total_shipping', name: 'total_shipping' }, - { data: 'shopping_user.orders', name: 'shopping_user.orders' }, + { data: 'payment', name: 'payment', orderable: false }, + { data: 'txaction', name: 'txaction' }, + { data: 'shipped', name: 'shipped' }, + { data: 'is_for', name: 'is_for', orderable: false }, + { data: 'shopping_user.shipping_firstname', name: 'shopping_user.shipping_firstname', orderable: false }, + { data: 'shopping_user.shipping_lastname', name: 'shopping_user.shipping_lastname', orderable: false }, + { data: 'shopping_user.shipping_email', name: 'shopping_user.shipping_email', orderable: false }, + { data: 'reference', name: 'reference' }, ], "bLengthChange": false, "iDisplayLength": 100, diff --git a/resources/views/web/templates/checkout.blade.php b/resources/views/web/templates/checkout.blade.php index bbe87e1..be3bfd6 100644 --- a/resources/views/web/templates/checkout.blade.php +++ b/resources/views/web/templates/checkout.blade.php @@ -176,6 +176,7 @@

Rechnung & Versand

+
@if($is_from === 'shopping')
@@ -287,24 +288,6 @@ @endif
- -
-
-
- - @if ($errors->has('accepted_data_checkbox')) - - @endif -
-
@else
@@ -372,7 +355,7 @@ {{ $shopping_user->billing_email }}
-

Hinterlegte Rechnungsdaten von Beratern können nur im Salescenter geändert werden.

+

Deine hinterlegten Rechnungsdaten können nur im Salescenter geändert werden.

@endif @@ -412,7 +395,16 @@
-

Versand Adresse

+ + @if($shopping_user->is_from === 'user_order') + @if($shopping_user->is_for === 'me') +

Meine Lieferadresse

+ @else +

Lieferadresse des Kunden

+ @endif + @else +

Versand Adresse

+ @endif
@@ -555,6 +547,7 @@ @if(($shopping_user->abo_options === 1) && (Util::getUserPaymentFor() >= 3)) + @if(array_key_exists('SEPA', $payment_methods_active) && in_array($payment_methods_active['SEPA'], $payment_methods))