Erweiterungen / Korrekturen Beraterbestellungen

This commit is contained in:
Kevin Adametz 2020-09-08 19:22:07 +02:00
parent ecc71c616f
commit c4ed6b39db
36 changed files with 1104 additions and 617 deletions

5
.idea/codeStyles/codeStyleConfig.xml generated Normal file
View file

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

65
.idea/workspace.xml generated
View file

@ -5,32 +5,42 @@
</component>
<component name="ChangeListManager">
<list default="true" id="2fbaac5f-25ba-4502-a970-cc14728d7d55" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.idea/codeStyles/codeStyleConfig.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/order/_bak_shipping_me.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/order/_bak_shipping_ot.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/CustomerController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/CustomerController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/SalesController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/SalesController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/ShippingController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/ShippingController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/User/CustomerController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/User/CustomerController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/User/OrderController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/User/OrderController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/Web/CheckoutController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Web/CheckoutController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Middleware/Checkout.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Middleware/Checkout.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/ShoppingOrder.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShoppingOrder.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/ShippingCountry.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShippingCountry.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/ShippingPrice.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShippingPrice.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/ShoppingOrderItem.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShoppingOrderItem.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/ShoppingUser.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShoppingUser.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Services/Payment.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Services/Payment.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Services/Shop.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Services/Shop.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Services/Util.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Services/Util.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Services/HTMLHelper.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Services/HTMLHelper.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Services/Yard.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Services/Yard.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database/migrations/2019_02_23_161530_create_shopping_users_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2019_02_23_161530_create_shopping_users_table.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database/migrations/2019_02_23_163527_create_shopping_orders_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2019_02_23_163527_create_shopping_orders_table.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database/migrations/2019_01_06_004849_create_shipping_prices_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2019_01_06_004849_create_shipping_prices_table.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database/migrations/2019_02_23_163724_create_shopping_order_items_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2019_02_23_163724_create_shopping_order_items_table.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/lang/de/email.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/lang/de/email.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/public/js/iq-shopping-cart.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/js/iq-shopping-cart.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/lang/de/navigation.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/lang/de/navigation.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/customer/_detail.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/customer/_detail.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/customer/_edit.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/customer/_edit.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/sales/_detail.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/sales/_detail.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/sales/customers.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/sales/customers.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/sales/users.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/sales/users.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/emails/checkout.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/emails/checkout.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/emails/checkout_status.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/emails/checkout_status.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/shipping/edit.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/shipping/edit.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/customer/add.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/customer/add.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/customer/edit.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/customer/edit.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/order/comp_product.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/comp_product.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/order/delivery.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/delivery.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/order/index.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/index.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/order/list.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/list.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/order/shipping_me.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/shipping_me.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/order/shipping_ot.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/shipping_ot.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/order/yard_view_form.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/yard_view_form.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/templates/card.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/card.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/templates/checkout-final.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/checkout-final.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/templates/checkout.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/checkout.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/routes/web.php" beforeDir="false" afterPath="$PROJECT_DIR$/routes/web.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -274,15 +284,9 @@
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="nodejs_package_manager_path" value="npm" />
<property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
<property name="vue.rearranger.settings.migration" value="true" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resources/views/user/order" />
<recent name="$PROJECT_DIR$/public/js" />
<recent name="$PROJECT_DIR$/resources/views/admin/customer" />
<recent name="$PROJECT_DIR$/resources/views/admin/modal" />
<recent name="$PROJECT_DIR$/app/Http/Controllers/SyS" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resources/views/user/order" />
<recent name="$PROJECT_DIR$/resources/views/user/customer" />
@ -290,6 +294,13 @@
<recent name="$PROJECT_DIR$/public/vendor/libs" />
<recent name="$PROJECT_DIR$/resources/views/admin/user" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resources/views/user/order" />
<recent name="$PROJECT_DIR$/public/js" />
<recent name="$PROJECT_DIR$/resources/views/admin/customer" />
<recent name="$PROJECT_DIR$/resources/views/admin/modal" />
<recent name="$PROJECT_DIR$/app/Http/Controllers/SyS" />
</key>
</component>
<component name="RunManager" selected="Shell Script.composer-post-update.sh">
<configuration name="de" type="PHPUnitRunConfigurationType" factoryName="PHPUnit" temporary="true">
@ -540,6 +551,10 @@
<workItem from="1598016608485" duration="9648000" />
<workItem from="1598255562481" duration="22043000" />
<workItem from="1598282618629" duration="1154000" />
<workItem from="1598434849256" duration="514000" />
<workItem from="1598971116331" duration="4130000" />
<workItem from="1599033832974" duration="4000" />
<workItem from="1599558681455" duration="23060000" />
</task>
<servers />
</component>
@ -612,10 +627,6 @@
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state width="2421" height="501" key="GridCell.Tab.1.right/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1595683782557" />
<state x="1002" y="464" key="NewPhpClassDialog" timestamp="1589893405691">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="1002" y="464" key="NewPhpClassDialog/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1589893405691" />
<state x="758" y="370" key="SettingsEditor" timestamp="1596269067229">
<screen x="0" y="23" width="2560" height="1417" />
</state>
@ -629,11 +640,11 @@
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="951" y="549" key="com.jetbrains.php.test.PhpNewTestDialog/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1591961096724" />
<state x="863" y="438" width="1115" height="793" key="find.popup" timestamp="1598284238338">
<state x="531" y="536" width="1497" height="794" key="find.popup" timestamp="1599579446337">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="-1755" y="444" width="1115" height="793" key="find.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@-2560.23.2560.1417" timestamp="1589974580416" />
<state x="531" y="536" width="1497" height="794" key="find.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1598024943525" />
<state x="531" y="536" width="1497" height="794" key="find.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1598972717568" />
<state x="531" y="536" width="1497" height="794" key="find.popup/-2560.23.2560.1417/2560.-555.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1599579446337" />
<state x="863" y="438" width="1115" height="793" key="find.popup/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1598284238338" />
<state width="600" height="428" key="javadoc.popup" timestamp="1594733832314">
<screen x="0" y="23" width="2560" height="1417" />

View file

@ -153,6 +153,9 @@ class CustomerController extends Controller
->addColumn('id', function (ShoppingUser $ShoppingUser) {
return '<a href="' . route('admin_customer_detail', [$ShoppingUser->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="far fa-edit"></span></a>';
})
->addColumn('billing_email', function (ShoppingUser $ShoppingUser) {
return $ShoppingUser->faker_mail ? "-" : $ShoppingUser->billing_email;
})
->addColumn('billing_salutation', function (ShoppingUser $ShoppingUser) {
return HTMLHelper::getSalutationLang($ShoppingUser->billing_salutation);
})
@ -183,9 +186,15 @@ class CustomerController extends Controller
->addColumn('subscribed', function (ShoppingUser $ShoppingUser) {
return get_active_badge($ShoppingUser->subscribed);
})
->filterColumn('billing_email', function($query, $keyword) {
if($keyword != ""){
$query->where('billing_email', 'LIKE', '%'.$keyword.'%');
}
})
->orderColumn('id', 'id $1')
->orderColumn('billing_country_id', 'billing_country_id $1')
->orderColumn('billing_salutation', 'billing_salutation $1')
->orderColumn('billing_email', 'billing_email $1')
->orderColumn('created_at', 'created_at $1')
->orderColumn('isMember', 'auth_user_id $1')
->orderColumn('member_id', 'member_id $1')

View file

@ -74,10 +74,10 @@ class SalesController extends Controller
})
->addColumn('is_for', function (ShoppingOrder $ShoppingOrder) {
if($ShoppingOrder->shopping_user->is_for === 'me'){
return '<span class="badge badge-pill badge-secondary">Berater</span>';
return '<span class="badge badge-pill badge-secondary">Beraterbestellung</span>';
}
if($ShoppingOrder->shopping_user->is_for === 'ot'){
return '<span class="badge badge-pill badge-info">Kunde</span>';
return '<span class="badge badge-pill badge-info">Kundenbestellung</span>';
}
return '-';
})
@ -216,10 +216,10 @@ class SalesController extends Controller
})
->addColumn('is_for', function (ShoppingOrder $ShoppingOrder) {
if($ShoppingOrder->shopping_user->is_for === 'me'){
return '<span class="badge badge-pill badge-secondary">Berater</span>';
return '<span class="badge badge-pill badge-secondary">Beraterbestellung</span>';
}
if($ShoppingOrder->shopping_user->is_for === 'ot'){
return '<span class="badge badge-pill badge-info">Kunde</span>';
return '<span class="badge badge-pill badge-info">Kundenbestellung</span>';
}
return '-';
})

View file

@ -140,6 +140,9 @@ class ShippingController extends Controller
public function deleteCountry($id)
{
$model = ShippingCountry::findOrFail($id);
if($model->shopping_orders->count()){
abort(403, 'Einträge vorhanden');
}
$shipping = $model->shipping;
$model->delete();
\Session()->flash('alert-success', "Preis gelöscht");

View file

@ -211,7 +211,7 @@ class CustomerController extends Controller
{
$user = User::find(\Auth::user()->id);
$query = ShoppingUser::select(['id', 'billing_company', 'billing_salutation', 'billing_firstname', 'billing_lastname', 'billing_email', 'billing_zipcode', 'billing_city', 'billing_country_id', 'orders', 'subscribed', 'created_at', 'number', 'mode', 'is_like', 'wp_order_number'])
$query = ShoppingUser::select(['id', 'billing_company', 'billing_salutation', 'billing_firstname', 'billing_lastname', 'billing_email', 'faker_mail', 'billing_zipcode', 'billing_city', 'billing_country_id', 'orders', 'subscribed', 'created_at', 'number', 'mode', 'is_like', 'wp_order_number'])
->where('shopping_users.member_id', '=', $user->id);
//->groupBy('shopping_users.number');
@ -224,6 +224,9 @@ class CustomerController extends Controller
->addColumn('send_to', function (ShoppingUser $ShoppingUser) {
return $ShoppingUser->is_like ? '<span class="badge badge-pill badge-warning"><i class="fa fa-clock"></i> in Prüfung</span>' : '<a href="' . route('user_order_my_delivery', ['ot', $ShoppingUser->id]) . '" class="btn btn-sm btn-secondary"><span class="fa fa-shopping-cart"></span> wählen</a>';
})
->addColumn('billing_email', function (ShoppingUser $ShoppingUser) {
return $ShoppingUser->faker_mail ? "-" : $ShoppingUser->billing_email;
})
->addColumn('id', function (ShoppingUser $ShoppingUser) {
return '<a href="' . route('user_customer_detail', [$ShoppingUser->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
@ -248,8 +251,14 @@ class CustomerController extends Controller
->addColumn('extras', function (ShoppingUser $ShoppingUser) {
return $ShoppingUser->wp_order_number.($ShoppingUser->mode==='dev' ? ' <span class="badge badge-warning">dev</span>' : '');
})
->filterColumn('billing_email', function($query, $keyword) {
if($keyword != ""){
$query->where('billing_email', 'LIKE', '%'.$keyword.'%');
}
})
->orderColumn('send_to', 'id $1')
->orderColumn('id', 'id $1')
->orderColumn('billing_email', 'billing_email $1')
->orderColumn('billing_country_id', 'billing_country_id $1')
->orderColumn('billing_salutation', 'billing_salutation $1')
->orderColumn('first_created_at', 'created_at $1')

View file

@ -77,17 +77,16 @@ class OrderController extends Controller
})
->addColumn('is_for', function (ShoppingOrder $ShoppingOrder) {
if($ShoppingOrder->shopping_user->is_for === 'me'){
return '<span class="badge badge-pill badge-secondary">Berater</span>';
return '<span class="badge badge-pill badge-secondary">Beraterbestellung</span>';
}
if($ShoppingOrder->shopping_user->is_for === 'ot'){
return '<span class="badge badge-pill badge-info">Kunde</span>';
return '<span class="badge badge-pill badge-info">Kundenbestellung</span>';
}
return '-';
})
->addColumn('reference', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->getLastShoppingPayment('reference');
})
->orderColumn('id', 'id $1')
->orderColumn('txaction', 'txaction $1')
->orderColumn('shipped', 'shipped $1')
@ -148,11 +147,6 @@ class OrderController extends Controller
Yard::instance('shopping')->setShippingCountryWithPrice($shipping_country_id, $for);
$comp_products = null;
if($for === 'me'){
$comp_products = Product::whereActive(true)->where('show_at', '=', 1)->where('shipping_addon', true)->orderBy('pos', 'DESC')->get();
}
$data = [
'shopping_user' => $shopping_user,
'user' => $user,
@ -160,7 +154,7 @@ class OrderController extends Controller
'isView' => 'customer',
'for' => $for,
'delivery_id' => $delivery_id,
'comp_products' => $comp_products,
'comp_products' => $this->getCompProducts($for),
];
return view('user.order.list', $data);
}
@ -179,10 +173,27 @@ class OrderController extends Controller
'shipping_state' => 'required',
);
$validator = Validator::make(Request::all(), $rules);
if ($validator->fails()) {
return back()->withErrors($validator)->withInput(Request::all());
}
if(Yard::instance('shopping')->getNumComp() > 0){
if(!isset($data['switchers-comp-product'])){
$validator->errors()->add('switchers-comp-product', __('Bitte wähle ein Kompensationsprodukt aus'));
}else{
if(!is_array($data['switchers-comp-product'])){
$validator->errors()->add('switchers-comp-product', __('Bitte wähle ein Kompensationsprodukt aus'));
}else{
if(count($data['switchers-comp-product']) !== Yard::instance('shopping')->getNumComp()){
$validator->errors()->add('switchers-comp-product', __('Bitte wähle :count Kompensationsprodukte aus', ['count'=>Yard::instance('shopping')->getNumComp()]));
}
}
}
if ($validator->errors()->count()) {
return back()->withErrors($validator)->withInput(Request::all());
}
}
do {
$identifier = Util::getToken();
} while( ShoppingInstance::where('identifier', $identifier)->count() );
@ -267,6 +278,26 @@ class OrderController extends Controller
//->orderBy('id', 'DESC');
return \DataTables::eloquent($query)
->addColumn('product', function (Product $product) {
$cartItem = Yard::instance('shopping')->getCartItemByProduct($product->id);
$qty = isset($cartItem->qty) ? $cartItem->qty : 0;
$rowId = isset($cartItem->rowId) ? $cartItem->rowId : '';
return '<strong>'.$product->name.'</strong><br><div class="no-line-break input-group-min-w">
<div class="input-group d-inline-flex w-auto">
<span class="input-group-prepend">
<button type="button" class="btn btn-secondary icon-btn md-btn-extra remove-product-basket" data-row-id="'.$rowId.'" data-product-id="'.$product->id.'">-</button>
</span>
<input type="text" class="form-control text-center input-extra table-input-event-onchange" name="product_qty_'.$product->id.'" data-row-id="'.$rowId.'" data-product-id="'.$product->id.'" value="'.$qty.'">
<span class="input-group-append">
<button type="button" class="btn btn-secondary icon-btn md-btn-extra add-product-basket" data-row-id="'.$rowId.'" data-product-id="'.$product->id.'">+</button>
</span>
</div>
</div>';
})
/*
->addColumn('add_card', function (Product $product) {
return '<button type="button" class="btn btn-sm btn-md-extra btn-secondary add-product-basket" data-product-id="'.$product->id.'">
<strong>&euro; '.$product->getFormattedPriceWith().'</strong>&nbsp; +<span class="ion ion-md-cart"></span>
@ -288,7 +319,7 @@ class OrderController extends Controller
</div>
</div>';
})
})*/
->addColumn('picture', function (Product $product) {
if(count($product->images)){
return '<img class="img-fluid img-extra" alt="" src="'.route('product_image', [$product->images->first()->slug]).'">';
@ -309,16 +340,22 @@ class OrderController extends Controller
data-toggle="modal" data-target="#modals-load-content" data-id="'.$product->id.'" data-route="'.route('modal_load').'"
data-action="user-order-show-product" data-view="customer"><i class="ion ion-md-eye"></i></button>';
})
->filterColumn('product', function($query, $keyword) {
if($keyword != ""){
$query->where('name', 'LIKE', '%'.$keyword.'%');
}
})
->orderColumn('name', 'name $1')
->orderColumn('product', 'name $1')
->orderColumn('number', 'number $1')
->orderColumn('points', 'points $1')
->orderColumn('price_net', 'price_net $1')
->orderColumn('price_gross', 'price_gross $1')
->orderColumn('price_vk_gross', 'price_vk_gross $1')
->orderColumn('price_vk_gross', 'price $1')
->orderColumn('contents_total', 'contents_total $1')
->orderColumn('weight', 'weight $1')
->rawColumns(['add_card', 'quantity', 'picture', 'action'])
->rawColumns(['add_card', 'product', 'quantity', 'picture', 'action'])
->make(true);
}
@ -327,6 +364,10 @@ class OrderController extends Controller
if(Request::ajax()) {
$data = Request::all();
$is_for = isset($data['shipping_is_for']) ? $data['shipping_is_for'] : 'ot';
$data['comp_products'] = $this->getCompProducts($is_for);
if($data['action'] === 'updateCart' && isset($data['product_id'])){
if($product = Product::find($data['product_id'])){
$image = "";
@ -344,61 +385,86 @@ class OrderController extends Controller
//if 0 get the item by qty:1 and remove it
Yard::instance('shopping')->remove($cartItem->rowId);
}
$this->updateCompProduct($data);
//
Yard::instance('shopping')->reCalculateShippingPrice();
$html = view("user.order.yard_view_form", $data)->render();
return response()->json(['response' => true, 'data'=>$data, 'html'=>$html]);
$this->checkCompProduct(Yard::instance('shopping')->getNumComp());
$html_card = view("user.order.yard_view_form", $data)->render();
$html_comp = view("user.order.comp_product", $data)->render();
return response()->json(['response' => true, 'data'=>$data, 'html_card'=>$html_card, 'html_comp'=>$html_comp]);
}
}
if($data['action'] === 'clearCart') {
Yard::instance('shopping')->destroy();
return response()->json(['response' => true, 'data'=>Yard::instance('shopping')->count(), 'html'=>'']);
return response()->json(['response' => true, 'data'=>Yard::instance('shopping')->count(), 'html_card'=>'', 'html_comp'=>'']);
}
if($data['action'] === 'updateShippingCountry') {
if(isset($data['shipping_country_id'])){
$is_for = isset($data['shipping_is_for']) ? $data['shipping_is_for'] : 'ot';
if($shipping_country = ShippingCountry::find($data['shipping_country_id'])){
Yard::instance('shopping')->setShippingCountryWithPrice($shipping_country->id, $is_for);
$this->updateCompProduct($data);
$this->checkCompProduct(Yard::instance('shopping')->getNumComp());
}
}
$html = view("user.order.yard_view_form", $data)->render();
return response()->json(['response' => true, 'data'=>$data, 'html'=>$html]);
$html_card = view("user.order.yard_view_form", $data)->render();
$html_comp = view("user.order.comp_product", $data)->render();
return response()->json(['response' => true, 'data'=>$data, 'html_card'=>$html_card, 'html_comp'=>$html_comp]);
}
if($data['action'] === 'updateCompProduct'){
// $data['comp_product_id']
// $data['comp_num']
//count_comp_products
$this->updateCompProduct($data);
Yard::instance('shopping')->reCalculateShippingPrice();
$html = view("user.order.yard_view_form", $data)->render();
return response()->json(['response' => true, 'data'=>$data, 'html'=>$html]);
$html_card = view("user.order.yard_view_form", $data)->render();
$html_comp = view("user.order.comp_product", $data)->render();
return response()->json(['response' => true, 'data'=>$data, 'html_card'=>$html_card, 'html_comp'=>$html_comp]);
}
return response()->json(['response' => false, 'data'=>$data]);
}
}
private function checkCompProduct($count_comp_products){
foreach (Yard::instance('shopping')->content() as $row) {
//wenn gleich löschen, da neue Versandkosten
if($row->options->comp > $count_comp_products) {
Yard::instance('shopping')->remove($row->rowId);
}
}
}
private function updateCompProduct($data){
//clear old
foreach (Yard::instance('shopping')->content() as $row) {
if($row->options->comp) {
//wenn kleiner wurde ein produkt entfernt aufgrund der Anzahl
//wenn gleich löschen, da neue Versandkosten
if($row->options->comp === $data['comp_num'] || $row->options->comp > $data['count_comp_products']) {
Yard::instance('shopping')->remove($row->rowId);
}
}
if(isset($data['comp_product_id'])) {
if ($product = Product::find($data['comp_product_id'])) {
if(isset($data['comp_product_id'])) {
if ($product = Product::find($data['comp_product_id'])) {
$image = "";
if ($product->images->count()) {
$image = $product->images->first()->slug;
}
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, 0, ['image' => $image, 'slug' => $product->slug, 'weight' => 0, 'points' => 0, 'comp' => $product->id]);
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, 0,
['image' => $image, 'slug' => $product->slug, 'weight' => 0, 'points' => 0,
'comp' => $data['comp_num'], 'product_id' => $product->id]);
Yard::setTax($cartItem->rowId, 0);
}
}
}
private function getCompProducts($for){
if($for === 'me'){
return Product::whereActive(true)->where('show_at', '=', 1)->where('shipping_addon', true)->orderBy('pos', 'DESC')->get();
}
return null;
}
}

View file

@ -83,7 +83,9 @@ class CheckoutController extends Controller
$shopping_user->billing_state = Shop::getCountryShippingCountryId($shopping_user->billing_country_id);
$shopping_user->shipping_state = Shop::getCountryShippingCountryId($shopping_user->shipping_country_id);
}
if($shopping_user->same_as_billing === NULL){
$shopping_user->same_as_billing = false;
}
if(old('selected_country') && old('selected_country') === 'change'){
\Session::forget('_old_input.selected_country');
@ -99,9 +101,7 @@ class CheckoutController extends Controller
//$shopping_user->save();
}
if($shopping_user->same_as_billing === NULL){
$shopping_user->same_as_billing = true;
}
if($is_from !== 'shopping' && Util::getAuthUser()){
$user = Util::getAuthUser();
@ -174,7 +174,7 @@ class CheckoutController extends Controller
$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->same_as_billing = true;
$shopping_user->shipping_salutation = isset($data['shipping_salutation']) ? $data['shipping_salutation'] : '';
$shopping_user->shipping_company = isset($data['shipping_company']) ? $data['shipping_company'] : '';
$shopping_user->shipping_firstname = isset($data['shipping_firstname']) ? $data['shipping_firstname'] : '';
@ -187,7 +187,7 @@ class CheckoutController extends Controller
$shopping_user->shipping_phone = isset($data['shipping_phone']) ? $data['shipping_phone'] : '';
}else{
$shopping_user->same_as_billing = $user->account->same_as_billing;
$shopping_user->same_as_billing = $user->account->same_as_billing ? false : true;
$shopping_user->shipping_salutation = $user->account->shipping_salutation;
$shopping_user->shipping_company = $user->account->shipping_company;
$shopping_user->shipping_firstname = $user->account->shipping_firstname;
@ -209,7 +209,7 @@ class CheckoutController extends Controller
$data = Request::all();
//change selected Country
if(isset($data['selected_country']) && $data['selected_country'] === 'change'){
if(Request::get('same_as_billing')){
if(!Request::get('same_as_billing')){
Yard::instance('shopping')->setShippingCountryWithPrice($data['billing_state'], $data['is_for']);
}else{
Yard::instance('shopping')->setShippingCountryWithPrice($data['shipping_state'], $data['is_for']);
@ -228,7 +228,7 @@ class CheckoutController extends Controller
'accepted_data_checkbox' => 'accepted',
);
if(!Request::get('same_as_billing')){
if(Request::get('same_as_billing')){
$rules = array_merge($rules, [
'shipping_firstname'=>'required',
'shipping_lastname'=>'required',
@ -432,7 +432,7 @@ class CheckoutController extends Controller
private function makeShoppingUser($data){
$data['same_as_billing'] = isset($data['same_as_billing']) ? true : false;
$data['same_as_billing'] = isset($data['same_as_billing']) ? false : true; //reinvert
$data['accepted_data_checkbox'] = isset($data['accepted_data_checkbox']) ? true : false;
$shopping_user = false;
@ -494,7 +494,7 @@ class CheckoutController extends Controller
$this->putPayments('shopping_order_id', $shopping_order->id);
$items = Yard::instance('shopping')->content();
$items = Yard::instance('shopping')->getContentByOrder();
$shopping_order->shopping_order_items()->each(function($model) use ($items, $shopping_order) {
foreach ($items as $item) {
@ -503,6 +503,7 @@ class CheckoutController extends Controller
'shopping_order_id' => $shopping_order->id,
'row_id' => $item->rowId,
'product_id' => $item->id,
'comp' => $item->options->comp,
'qty' => $item->qty,
'price' => $item->price,
'price_net' => Yard::instance('shopping')->rowPriceNet($item, 3, '.', ''),
@ -521,6 +522,7 @@ class CheckoutController extends Controller
'shopping_order_id' => $shopping_order->id,
'row_id' => $item->rowId,
'product_id' => $item->id,
'comp' => $item->options->comp,
'qty' => $item->qty,
'price' => $item->price,
'price_net' => Yard::instance('shopping')->rowPriceNet($item, 3, '.', ''),
@ -528,7 +530,6 @@ class CheckoutController extends Controller
'slug' => $item->options->slug
]);
};
return $shopping_order;
}
@ -567,8 +568,10 @@ class CheckoutController extends Controller
$shopping_order->txaction = 'invoice_open';
$shopping_order->save();
$shopping_payment = ShoppingPayment::where('reference', $payt->transmitted_data['reference'])->first();
$shopping_payment->txaction = 'invoice_open';
$shopping_payment->save();
if($shopping_payment){
$shopping_payment->txaction = 'invoice_open';
$shopping_payment->save();
}
$send_link = Payment::paymentStatusPaidAction($shopping_order, false);
$data = [
'mode' => $payt->transmitted_data['mode'],

View file

@ -43,4 +43,9 @@ class ShippingCountry extends Model
return $this->belongsTo('App\Models\Country', 'country_id');
}
public function shopping_orders()
{
return $this->hasMany('App\Models\ShoppingOrder', 'country_id');
}
}

View file

@ -43,7 +43,7 @@ class ShippingPrice extends Model
protected $table = 'shipping_prices';
protected $fillable = [
'shipping_id', 'price', 'price_comp', 'tax_rate', 'factor', 'total_from', 'total_to', 'weight_from', 'weight_to',
'shipping_id', 'price', 'price_comp', 'num_comp', 'tax_rate', 'factor', 'total_from', 'total_to', 'weight_from', 'weight_to',
];
public function shipping()

View file

@ -53,6 +53,7 @@ class ShoppingOrderItem extends Model
'shopping_order_id',
'row_id',
'product_id',
'comp',
'qty',
'price',
'price_net',

View file

@ -242,6 +242,14 @@ class HTMLHelper
return $ret;
}
public static function getCountryNameFormShipping($id){
$value = ShippingCountry::find($id);
if($value){
return $value->country->getLocated();
}
return "not defined";
}
public static function getCountriesForShipping($id, $all=false){#
$values = ShippingCountry::all();
$ret = "";

View file

@ -19,6 +19,7 @@ class Yard extends Cart
private $shipping_tax = 0;
private $shipping_country_id = 0; //default de
private $shipping_is_for;
private $num_comp;
private $ysession;
private $yinstance;
private $shopping_data = [];
@ -51,6 +52,10 @@ class Yard extends Cart
$this->shipping_is_for = $this->getYardExtra('shipping_is_for');
}
if($this->getYardExtra('num_comp')){
$this->num_comp = $this->getYardExtra('num_comp');
}
parent::__construct($session, $events);
@ -160,8 +165,10 @@ class Yard extends Cart
}
if($shipping_price){
$price = $shipping_price->price;
$this->num_comp = 0;
if($this->shipping_is_for === 'me'){
$price = $shipping_price->price_comp;
$this->num_comp = $shipping_price->num_comp;
}
$this->shipping_price = $price;
@ -169,6 +176,7 @@ class Yard extends Cart
$this->shipping_price_net = round($price / ((100+$shipping_price->tax_rate) / 100), 2);
$this->shipping_tax = round($price / (100+$shipping_price->tax_rate) * 100, 2);
$this->putYardExtra('num_comp', $this->num_comp);
$this->putYardExtra('shipping_price', $this->shipping_price);
$this->putYardExtra('shipping_tax_rate', $this->shipping_tax_rate);
$this->putYardExtra('shipping_tax', $this->shipping_tax);
@ -394,7 +402,33 @@ class Yard extends Cart
return $this->numberFormat(($price * $row->qty), $decimals, $decimalPoint, $thousandSeperator);
}
public function getNumComp(){
return $this->num_comp;
}
public function getCompProductBy($comp, $product_id=false){
foreach ($this->content() as $row) {
if($row->options->comp == $comp) {
return $row->options->product_id;
}
}
return false;
}
public function getContentByOrder(){
$ret = [];
$comp = [];
foreach ($this->content() as $row) {
if($row->options->comp){
$comp[100+$row->options->comp] = $row;
}else{
$ret[] = $row;
}
}
ksort($comp);
$ret = array_merge($ret, $comp);
return $ret;
}
/**
* Get the Formated number

View file

@ -19,6 +19,7 @@ class CreateShippingPricesTable extends Migration
$table->decimal('price', 8, 2)->nullable();
$table->decimal('price_comp', 8, 2)->nullable();
$table->unsignedTinyInteger('num_comp')->nullable();
$table->decimal('tax_rate', 5, 2)->nullable();
$table->decimal('factor', 5, 2)->nullable();

View file

@ -19,10 +19,15 @@ class CreateShoppingOrderItemsTable extends Migration
$table->unsignedInteger('shopping_order_id');
$table->string('row_id', 40)->nullable();
$table->unsignedInteger('product_id');
$table->unsignedTinyInteger('comp')->nullable();
$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();

View file

@ -4,32 +4,28 @@ var IqShoppingCart = {
btn_add: '.add-product-basket',
btn_remove: '.remove-product-basket',
card_holder: '#holder_html_view_card',
comp_holder: '#holder_html_view_comp_product',
is_for: null,
url: null,
btn_clear: '#clear-products-basket',
modal: null,
oTable: null,
cProductId: null,
table_input: '.table-input-event-onchange',
cart_input: '.cart-input-event-onchange',
remove_item: '.remove_item_form_cart',
shipping_state: '#change_shipping_state',
comp_product: 'switchers-comp-product',
comp_products: 'switchers-comp-product',
count_comp_products: 'count_comp_products',
shipping_is_for: 'shipping_is_for',
init: function () {
var _self = this;
_self.url = $(_self.table).data('url');
_self.is_for = $('input[name="'+_self.shipping_is_for+'"]').val();
_self.cProductId = $('input[name="'+_self.comp_product+'"]:checked').val();
_self.showInit();
$(_self.shipping_state).on('change', function(){
_self.update_shipping_state($(this));
});
$('input[name="'+_self.comp_product+'"]').on('change', function(){
_self.update_comp_product();
});
// _self.update_comp_product();
return _self;
},
setDatabase: function (oTable){
@ -58,10 +54,15 @@ var IqShoppingCart = {
$(_self.cart_input).on('change', function(){
_self.update_input_cart($(this));
});
$(_self.remove_item).on('click', function(){
$(_self.remove_item).on('click', function(event){
event.preventDefault();
_self.update_cart_database($(this).data('product-id'), 0);
});
if(_self.is_for === 'me'){
$('input[name^="'+_self.comp_products+'"]').on('change', function(){
_self.update_comp_product($(this));
});
}
},
update_shipping_state : function (_obj){
var _self = this;
@ -84,10 +85,9 @@ var IqShoppingCart = {
_obj.val(qty);
_self.update_cart_database(_obj.data('product-id'), qty);
},
update_comp_product: function (){
update_comp_product: function (_obj){
var _self = this;
_self.cProductId = $('input[name="'+_self.comp_product+'"]:checked').val();
_self.performRequest({action: 'updateCompProduct'})
_self.performRequest({comp_product_id: _obj.val(), comp_num: _obj.data('comp_num'), count_comp_products: $('input[name="'+_self.count_comp_products+'"]').val(), action: 'updateCompProduct'})
.done(_self.refreshItemsAndView);
},
add_product: function (_obj){
@ -120,24 +120,27 @@ var IqShoppingCart = {
},
refreshItemsAndView: function (data){
var _self = IqShoppingCart;
$(_self.card_holder).html(data.html);
$(_self.card_holder).html(data.html_card);
$(_self.comp_holder).html(data.html_comp);
_self.showInit();
},
refreshDatabaseAndView: function (data) {
var _self = IqShoppingCart;
$(_self.card_holder).html(data.html);
$(_self.card_holder).html(data.html_card);
$(_self.comp_holder).html(data.html_comp);
var input = $(_self.table).find('input[name="product_qty_'+data.data.product_id+'"]');
input.val(data.data.qty);
_self.showInit();
},
refreshDatabaseRefreshAndView : function (data){
var _self = IqShoppingCart;
$(_self.card_holder).html(data.html);
$(_self.card_holder).html(data.html_card);
$(_self.comp_holder).html(data.html_comp);
_self.showInit();
_self.oTable.draw();
_self.update_comp_product();
},
checkNumber : function(number){
if(number < 0 || isNaN(number)){
@ -154,7 +157,6 @@ var IqShoppingCart = {
contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
data.shipping_is_for = _self.is_for;
data.comp_product_id = _self.cProductId;
console.log(data);
console.log(url);

View file

@ -16,7 +16,7 @@ return [
'my_membership' => 'Meine Mitgliedschaft',
'orders'=>'Bestellungen',
'trigger'=>'auslösen',
'do_order'=>'bestellen',
'do_order'=>'Bestellung aufgeben',
'clients'=>'Kunden',
'products'=>'Produkte',
'overview'=>'Übersicht',

View file

@ -7,7 +7,11 @@
<div class="row">
<div class="col-md-3 mb-3">
<div class="text-muted small">E-Mail</div>
{{ $shopping_user->billing_email }}
@if($shopping_user->faker_mail)
-
@else
{{ $shopping_user->billing_email }}
@endif
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Kundennummer</div>
@ -25,7 +29,11 @@
<div class="row">
<div class="col-md-3 mb-3">
<div class="text-muted small">E-Mail</div>
{{ $shopping_user->billing_email }}
@if($shopping_user->faker_mail)
-
@else
{{ $shopping_user->billing_email }}
@endif
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Kundennummer</div>

View file

@ -220,13 +220,13 @@
</div>
</div>
</div>
<hr>
<div class="form-group">
<label class="custom-control custom-checkbox m-0">
<input type="checkbox" class="custom-control-input" name="same_as_billing" id="same_as_billing" @if($shopping_user->same_as_billing) checked="checked" @endif>
<span class="custom-control-label">{{__('Versand an die gleiche Adresse')}}</span>
</label>
</div>
<hr>
</div>
</div>
@if($isView === 'customer')
@ -234,8 +234,10 @@
@endif
<div class="card mb-4">
<div class="card-body">
<div class="form-group">
<label class="custom-control custom-checkbox m-0">
<input type="checkbox" class="custom-control-input" name="has_buyed" id="has_buyed" @if($shopping_user->has_buyed) checked="checked" @endif>
@ -252,34 +254,43 @@
</div>
</div>
<hr>
{{ Form::hidden('faker_mail', $shopping_user->faker_mail) }}
@if($isView === 'customer-add')
{{ Form::hidden('billing_email_1', $billing_email) }}
{{ Form::hidden('billing_email-confirm_1', $billing_email) }}
{{ Form::hidden('faker_mail', $shopping_user->faker_mail) }}
<div class="form-row">
<div class="form-group col-md-6">
<label class="form-label" for="billing_email">{{ __('E-Mail Address') }}*</label>
{{ Form::text('billing_email', $billing_email, array('placeholder'=>'E-Mail', 'class'=>'form-control', 'id'=>'billing_email', 'readonly')) }}
@if($shopping_user->faker_mail)
{{ Form::hidden('billing_email', $billing_email) }}
{{ Form::hidden('billing_email-confirm', $billing_email) }}
@else
<div class="form-row">
<div class="form-group col-md-6">
<label class="form-label" for="billing_email">{{ __('E-Mail Address') }}*</label>
{{ Form::text('billing_email', $billing_email, array('placeholder'=>'E-Mail', 'class'=>'form-control', 'id'=>'billing_email', 'readonly')) }}
</div>
<div class="form-group col-md-6">
<label class="form-label" for="billing_email-confirm">{{ __('Confirm E-Mail') }}</label>
{{ Form::text('billing_email-confirm', $billing_email, array('placeholder'=>__('Confirm E-Mail'), 'class'=>'form-control', 'id'=>'billing_email-confirm', 'readonly')) }}
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="billing_email-confirm">{{ __('Confirm E-Mail') }}</label>
{{ Form::text('billing_email-confirm', $billing_email, array('placeholder'=>__('Confirm E-Mail'), 'class'=>'form-control', 'id'=>'billing_email-confirm', 'readonly')) }}
</div>
</div>
@endif
@else
@if($shopping_user->faker_mail)
{{ Form::hidden('billing_email', $shopping_user->billing_email) }}
{{ Form::hidden('billing_email-confirm', $shopping_user->billing_email) }}
@else
<div class="form-row">
<div class="form-group col-md-6">
<label class="form-label" for="billing_email">{{ __('E-Mail Address') }}*</label>
{{ Form::text('billing_email', $shopping_user->billing_email, array('placeholder'=>'E-Mail', 'class'=>'form-control', 'id'=>'billing_email')) }}
faker_mail
</div>
<div class="form-group col-md-6">
<label class="form-label" for="billing_email-confirm">{{ __('Confirm E-Mail') }}</label>
{{ Form::text('billing_email-confirm', $shopping_user->billing_email, array('placeholder'=>__('Confirm E-Mail'), 'class'=>'form-control', 'id'=>'billing_email-confirm')) }}
</div>
</div>
@endif
@endif
</div>
</div>

View file

@ -122,7 +122,7 @@
@if($shopping_order->shopping_user->is_from === 'shopping')
Rechnungsadresse des Kunden
@else
Rechnungsadresse des Berater
Rechnungsadresse des Beraters
@endif
</h6>
<div class="row">

View file

@ -20,7 +20,7 @@
<th>{{__('Zahlung')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('Versand')}}</th>
<th>{{__('Für')}}</th>
<th>{{__('Art')}}</th>
<th>{{__('First name')}}</th>
<th>{{__('Last name')}}</th>
<th>{{__('E-Mail')}}</th>

View file

@ -70,6 +70,7 @@
<th style="max-width: 60px;">&nbsp;</th>
<th>{{__('Kunden Preis')}}</th>
<th>{{__('Kompensation Preis')}}</th>
<th>{{__('Anzahl KP')}}</th>
<th>{{__('Tax')}}</th>
<th>{{__('Preis von - bis')}}</th>
<th>{{__('Gewicht von - bis')}}</th>
@ -85,6 +86,7 @@
data-id="{{ $price->id }}"
data-price="{{ $price->getFormattedPrice() }}"
data-price_comp="{{ $price->getFormattedPriceComp() }}"
data-num_comp="{{ $price->num_comp }}"
data-tax_rate="{{ $price->getFormattedTaxRate() }}"
data-factor="{{ $price->getFormattedFactor() }}"
data-total_from="{{ $price->getFormatTotalFrom() }}"
@ -96,6 +98,7 @@
</td>
<td>{{ $price->getFormattedPrice() }}</td>
<td>{{ $price->getFormattedPriceComp() }}</td>
<td>{{ $price->num_comp }}</td>
<td>{{ $price->getFormattedTaxRate() }}</td>
<td>{{ $price->getFormatTotalFrom() }} - {{ $price->getFormattedTotalTo() }}</td>
<td>{{ $price->weight_from }} - {{ $price->weight_to }}</td>
@ -110,6 +113,7 @@
data-id="new"
data-price=""
data-price_comp=""
data-num_comp=""
data-tax_rate=""
data-factor="1"
data-total_from=""
@ -153,6 +157,10 @@
<label for="tax_rate" class="form-label">{{__('enthaltene Tax (%)')}}</label>
<input type="text" class="form-control" name="tax_rate" placeholder="{{__('Tax in %')}}">
</div>
<div class="form-group col-6">
<label for="num_comp" class="form-label">{{__('Anzahl Kompensationsprodukte')}}*</label>
<input type="text" class="form-control" name="num_comp" placeholder="{{__('Anzahl Kompensationsprodukte')}}" required>
</div>
</div>
<div class="form-row">
@ -204,7 +212,13 @@
<td>
{{ $country->country->de }}
</td>
<td><a class="text-danger" href="{{ route('admin_shipping_country_delete', [$country->id]) }}" onclick="return confirm('{{__('Really delete entry?')}}');"><i class="far fa-trash-alt"></i></a></td>
<td>
@if(!$country->shopping_orders->count())
<a class="text-danger" href="{{ route('admin_shipping_country_delete', [$country->id]) }}" onclick="return confirm('{{__('Really delete entry?')}}');"><i class="far fa-trash-alt"></i></a>
@else
-
@endif
</td>
</tr>
@endforeach
@ -261,6 +275,7 @@
$(this).find(".modal-content input[name='id']").val(button.data('id'));
$(this).find(".modal-body input[name='price']").val(button.data('price'));
$(this).find(".modal-body input[name='price_comp']").val(button.data('price_comp'));
$(this).find(".modal-body input[name='num_comp']").val(button.data('num_comp'));
$(this).find(".modal-body input[name='tax_rate']").val(button.data('tax_rate'));
$(this).find(".modal-body input[name='factor']").val(button.data('factor'));
$(this).find(".modal-body input[name='total_from']").val(button.data('total_from'));

View file

@ -79,8 +79,7 @@
</div>
</div>
<div class="text-left" style="display: none" id="show-button-without-email">
<p class="mt-2">Hinweis: Der Kunden bekommt eine Platzhalter E-Mail (...-faker@mivita.care), da die E-Mail das primäre Feld für die Kundenhoheit ist.<br>
Wird der Kunden mit seiner E-Mail von einem anderen Berater angelegt oder bestellt in einem anderen Beratershop, wird dem Berater der Kunde zugewiesen.</p>
<p class="mt-2">Hinweis: Du kannst Deine Kunden auch ohne Email-Adresse anlegen. Das System gleicht dann Nachname und Postleitzahl ab. Sollte es hier mal Übereinstimmungen geben, gleicht der Support von MIVITA die Kundensätze ab und ordnet sie den Beratern entsprechend zu. Daher empfehlen wir im besten Fall immer die Angabe einer Email-Adresse. Diese ist einzigartig und damit eindeutig einem Kunden zuzuordnen.</p>
<button type="submit" class="btn btn-secondary" name="action" value="add_customer_without_email">{{ __('weiter ohne E-Mail') }}</button>&nbsp;
</div>
{!! Form::close() !!}

View file

@ -3,7 +3,7 @@
@section('content')
<h4 class="font-weight-bold py-2 mb-2">
<a href="{{route('user_customer_edit', [$shopping_user->id])}}" class="btn btn-sm btn-default float-right">zurück</a>
<a href="{{route('user_customer_detail', [$shopping_user->id])}}" class="btn btn-sm btn-default float-right">zurück</a>
{{ __('Kunden Details') }} bearbeiten
</h4>
{!! Form::open(['url' => route('user_customer_edit', [$shopping_user->id]), 'class' => 'form-horizontal', 'id'=>'lead-form-validation']) !!}
@ -12,5 +12,5 @@
<button type="submit" class="btn btn-secondary" name="action" value="shopping-user-store">{{ __('save changes') }}</button>&nbsp;
</div>
{!! Form::close() !!}
<a href="{{route('user_customer_edit', [$shopping_user->id])}}" class="btn btn-sm btn-default float-right">zurück</a>
<a href="{{route('user_customer_detail', [$shopping_user->id])}}" class="btn btn-sm btn-default float-right">zurück</a>
@endsection

View file

@ -0,0 +1,215 @@
@if($user->account)
@if($user->account->same_as_billing)
<!-- Billing -->
<div class="">
<div class="form-row">
<div class="form-group col-md-12">
<label for="shipping_company" class="form-label">{{ __('Company name') }} (optional)</label>
{{ Form::text('shipping_company', $user->account->company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_salutation') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Salutation') }}*</label>
<select class="selectpicker" data-style="btn-light" name="shipping_salutation" id="shipping_salutation" required>
{!! HTMLHelper::getSalutation($user->account->salutation) !!}
</select>
@if ($errors->has('shipping_salutation'))
<span class="help-block">
<strong>{{ $errors->first('shipping_salutation') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_firstname') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_firstname">{{ __('First name') }}*</label>
{{ Form::text('shipping_firstname', $user->account->first_name, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_firstname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_firstname') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_lastname') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_lastname">{{ __('Last name') }}*</label>
{{ Form::text('shipping_lastname', $user->account->last_name, array('placeholder'=>__('Last name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_lastname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_lastname') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_address">{{ __('Street') }} / {{ __('House number') }}*</label>
{{ Form::text('shipping_address', $user->account->address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_address'))
<span class="help-block">
<strong>{{ $errors->first('shipping_address') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address_2') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_address_2">{{ __('Wohnung / Gebäude (optional)') }}</label>
{{ Form::text('shipping_address_2', $user->account->address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_zipcode') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_zipcode">{{ __('Postcode') }}*</label>
{{ Form::text('shipping_zipcode', $user->account->zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_zipcode'))
<span class="help-block">
<strong>{{ $errors->first('shipping_zipcode') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_city') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_city">{{ __('City') }}*</label>
{{ Form::text('shipping_city', $user->account->city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_city'))
<span class="help-block">
<strong>{{ $errors->first('shipping_city') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_state') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Lieferland') }}*</label>
<select name="shipping_state" class="selectpicker" id="change_shipping_state" data-is-for="me">
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId()) !!}
</select>
@if ($errors->has('shipping_state'))
<span class="help-block">
<strong>{{ $errors->first('shipping_state') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label class="form-label" for="shipping_phone">{{ __('Phone') }}</label>
{{ Form::text('shipping_phone', $user->account->phone, array('placeholder'=>__('Phone'), 'class'=>'form-control')) }}
</div>
</div>
</div>
<!-- / Billing -->
@else
<div class="">
<div class="form-row">
<div class="form-group col-md-12">
<label for="shipping_company" class="form-label">{{ __('Company name') }} (optional)</label>
{{ Form::text('shipping_company', $user->account->shipping_company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_salutation') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Salutation') }}*</label>
<select class="selectpicker" data-style="btn-light" name="shipping_salutation" id="shipping_salutation" required>
{!! HTMLHelper::getSalutation($user->account->shipping_salutation) !!}
</select>
@if ($errors->has('shipping_salutation'))
<span class="help-block">
<strong>{{ $errors->first('shipping_salutation') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_firstname') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_firstname">{{ __('First name') }}*</label>
{{ Form::text('shipping_firstname', $user->account->shipping_firstname, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_firstname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_firstname') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_lastname') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_lastname">{{ __('Last Name') }}*</label>
{{ Form::text('shipping_lastname', $user->account->shipping_lastname, array('placeholder'=>__('Last Name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_lastname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_lastname') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_address">{{ __('Street') }} / {{ __('House number') }}*</label>
{{ Form::text('shipping_address', $user->account->shipping_address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_address'))
<span class="help-block">
<strong>{{ $errors->first('shipping_address') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address_2') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_address_2">{{ __('Wohnung / Gebäude (optional)') }}</label>
{{ Form::text('shipping_address_2', $user->account->shipping_address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }}
@if ($errors->has('shipping_address_2'))
<span class="help-block">
<strong>{{ $errors->first('shipping_address_2') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_zipcode') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_zipcode">{{ __('Postcode') }}*</label>
{{ Form::text('shipping_zipcode', $user->account->shipping_zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_zipcode'))
<span class="help-block">
<strong>{{ $errors->first('shipping_zipcode') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_city') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_city">{{ __('City') }}*</label>
{{ Form::text('shipping_city', $user->account->shipping_city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_city'))
<span class="help-block">
<strong>{{ $errors->first('shipping_city') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_state') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Lieferland') }}*</label>
<select name="shipping_state" class="selectpicker" id="change_shipping_state" data-is-for="me">
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId()) !!}
</select>
@if ($errors->has('shipping_state'))
<span class="help-block">
<strong>{{ $errors->first('shipping_state') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label class="form-label" for="shipping_phone">{{ __('Phone') }}</label>
{{ Form::text('shipping_phone', $user->account->shipping_phone, array('placeholder'=>__('Phone'), 'class'=>'form-control')) }}
</div>
</div>
</div>
@endif
@else
<h4>Fehler: Keine Adressdaten gefunden!</h4>
@endif

View file

@ -0,0 +1,210 @@
@if($shopping_user->same_as_billing)
<!-- Billing -->
<div class="">
<div class="form-row">
<div class="form-group col-md-12">
<label for="shipping_company" class="form-label">{{ __('Company name') }} (optional)</label>
{{ Form::text('shipping_company', $shopping_user->billing_company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_salutation') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Salutation') }}*</label>
<select class="selectpicker" data-style="btn-light" name="shipping_salutation" id="shipping_salutation" required>
{!! HTMLHelper::getSalutation($shopping_user->billing_salutation) !!}
</select>
@if ($errors->has('shipping_salutation'))
<span class="help-block">
<strong>{{ $errors->first('shipping_salutation') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_firstname') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_firstname">{{ __('First name') }}*</label>
{{ Form::text('shipping_firstname', $shopping_user->billing_firstname, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_firstname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_firstname') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_lastname') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_lastname">{{ __('Last name') }}*</label>
{{ Form::text('shipping_lastname', $shopping_user->billing_lastname, array('placeholder'=>__('Last name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_lastname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_lastname') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_address">{{ __('Street') }} / {{ __('House number') }}*</label>
{{ Form::text('shipping_address', $shopping_user->billing_address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_address'))
<span class="help-block">
<strong>{{ $errors->first('shipping_address') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address_2') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_address_2">{{ __('Wohnung / Gebäude (optional)') }}</label>
{{ Form::text('shipping_address_2', $shopping_user->billing_address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_zipcode') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_zipcode">{{ __('Postcode') }}*</label>
{{ Form::text('shipping_zipcode', $shopping_user->billing_zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_zipcode'))
<span class="help-block">
<strong>{{ $errors->first('shipping_zipcode') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_city') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_city">{{ __('City') }}*</label>
{{ Form::text('shipping_city', $shopping_user->billing_city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_city'))
<span class="help-block">
<strong>{{ $errors->first('shipping_city') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_state') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Lieferland') }}*</label>
<select name="shipping_state" class="selectpicker" id="change_shipping_state" data-is-for="ot">
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId()) !!}
</select>
@if ($errors->has('shipping_state'))
<span class="help-block">
<strong>{{ $errors->first('shipping_state') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label class="form-label" for="shipping_phone">{{ __('Phone') }}</label>
{{ Form::text('shipping_phone', $shopping_user->billing_phone, array('placeholder'=>__('Phone'), 'class'=>'form-control')) }}
</div>
</div>
</div>
<!-- / Billing -->
@else
<div class="">
<div class="form-row">
<div class="form-group col-md-12">
<label for="shipping_company" class="form-label">{{ __('Company name') }} (optional)</label>
{{ Form::text('shipping_company', $shopping_user->shipping_company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_salutation') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Salutation') }}*</label>
<select class="selectpicker" data-style="btn-light" name="shipping_salutation" id="shipping_salutation" required>
{!! HTMLHelper::getSalutation($shopping_user->shipping_salutation) !!}
</select>
@if ($errors->has('shipping_salutation'))
<span class="help-block">
<strong>{{ $errors->first('shipping_salutation') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_firstname') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_firstname">{{ __('First name') }}*</label>
{{ Form::text('shipping_firstname', $shopping_user->shipping_firstname, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_firstname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_firstname') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_lastname') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_lastname">{{ __('Last Name') }}*</label>
{{ Form::text('shipping_lastname', $shopping_user->shipping_lastname, array('placeholder'=>__('Last Name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_lastname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_lastname') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_address">{{ __('Street') }} / {{ __('House number') }}*</label>
{{ Form::text('shipping_address', $shopping_user->shipping_address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_address'))
<span class="help-block">
<strong>{{ $errors->first('shipping_address') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address_2') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_address_2">{{ __('Wohnung / Gebäude (optional)') }}</label>
{{ Form::text('shipping_address_2', $shopping_user->shipping_address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }}
@if ($errors->has('shipping_address_2'))
<span class="help-block">
<strong>{{ $errors->first('shipping_address_2') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_zipcode') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_zipcode">{{ __('Postcode') }}*</label>
{{ Form::text('shipping_zipcode', $shopping_user->shipping_zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_zipcode'))
<span class="help-block">
<strong>{{ $errors->first('shipping_zipcode') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_city') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_city">{{ __('City') }}*</label>
{{ Form::text('shipping_city', $shopping_user->shipping_city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_city'))
<span class="help-block">
<strong>{{ $errors->first('shipping_city') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_state') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Lieferland') }}*</label>
<select name="shipping_state" class="selectpicker" id="change_shipping_state" data-is-for="ot">
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId()) !!}
</select>
@if ($errors->has('shipping_state'))
<span class="help-block">
<strong>{{ $errors->first('shipping_state') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label class="form-label" for="shipping_phone">{{ __('Phone') }}</label>
{{ Form::text('shipping_phone', $shopping_user->shipping_phone, array('placeholder'=>__('Phone'), 'class'=>'form-control')) }}
</div>
</div>
</div>
@endif

View file

@ -1,35 +1,42 @@
<div class="card mt-4">
<div class="card-body">
<h4>Versand Kompensationsprodukt</h4>
@if($comp_products)
<div class="row no-gutters row-bordered">
@php($counter = 1)
@foreach($comp_products as $comp_product)
<div class="media col-md-6 col-lg-4 p-4">
<div class="d-block ui-w-80 ui-bordered mr-3">
@if(count($comp_product->images))
<img src="{{ route('product_image', [$comp_product->images->first()->slug]) }}" class="img-fluid" alt="">
@endif
</div>
<div class="media-body">
<label class="switcher switcher-secondary">
<input type="radio" class="switcher-input" value="{{$comp_product->id}}" name="switchers-comp-product" @if($counter == 1) checked @endif >
<span class="switcher-indicator">
<span class="switcher-yes"></span>
<span class="switcher-no"></span>
</span>
<span class="switcher-label"></span>
</label>
<div class="text-body mt-2"><strong>{{ $comp_product->name }}</strong></div>
<div class="">Art-Nr.: {{ $comp_product->number }}</div>
@if($comp_products && Yard::instance('shopping')->getNumComp() > 0)
<input type="hidden" name="count_comp_products" value="{{Yard::instance('shopping')->getNumComp()}}">
@for($i = 1; $i <= Yard::instance('shopping')->getNumComp(); $i++)
@if(Yard::instance('shopping')->getNumComp() > 1)
<h4 class="border-bottom pb-2">{{$i}}. Versand Kompensationsprodukt</h4>
@else
<h4 class="border-bottom pb-2">Versand Kompensationsprodukt</h4>
@endif
<div class="row no-gutters row-bordered">
@php($counter = 1)
@php($checked_id = Yard::instance('shopping')->getCompProductBy($i))
@foreach($comp_products as $comp_product)
<div class="media col-md-6 col-lg-4 p-4">
<div class="d-block ui-w-80 ui-bordered mr-3">
@if(count($comp_product->images))
<img src="{{ route('product_image', [$comp_product->images->first()->slug]) }}" class="img-fluid" alt="">
@endif
</div>
<div class="media-body">
<label class="switcher switcher-secondary">
<input type="radio" class="switcher-input" value="{{$comp_product->id}}" data-comp_num="{{$i}}" name="switchers-comp-product[{{$i}}]" @if($checked_id == $comp_product->id) checked @endif required>
<span class="switcher-indicator">
<span class="switcher-yes"></span>
<span class="switcher-no"></span>
</span>
<span class="switcher-label"></span>
</label>
<div class="text-body mt-2"><strong>{{ $comp_product->name }}</strong></div>
<div class="">Art-Nr.: {{ $comp_product->number }}</div>
</div>
</div>
@php($counter++)
@endforeach
</div>
@php($counter++)
@endforeach
</div>
@endfor
@endif
</div>
</div>

View file

@ -58,6 +58,8 @@
@endif
<div class="show-is-for-customer">
<h4>An diesen Kunde versenden</h4>
<p>Sollten unten stehend Angaben nicht korrekt sein oder aktualisiert werden müssen, ändere diese bitte vorerst unter:
<a href="{{route('user_customers')}}">Meine Kunden -> Übersicht</a> -> <a href="{{route('user_customer_detail', $shopping_user->id)}}"><i class="fa fa-edit"></i> Kunde</a></a></p>
@include('admin.customer._customer_detail')
</div>
@endif

View file

@ -17,7 +17,7 @@
<th>{{__('Zahlung')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('Versand')}}</th>
<th>{{__('Für')}}</th>
<th>{{__('Art')}}</th>
<th>{{__('First name')}}</th>
<th>{{__('Last name')}}</th>
<th>{{__('E-Mail')}}</th>

View file

@ -4,6 +4,7 @@
<h4 class="font-weight-bold py-2 mb-2">
{{ __('navigation.my_orders') }} / {{ __('navigation.do_order') }}
<a href="{{ route('user_order_my_delivery', [$for, $delivery_id]) }}" class="btn btn-sm btn-default float-right">zurück</a>
<div class="clearfix"></div>
</h4>
<style>
.btn-md-extra {
@ -31,7 +32,43 @@
min-width:55px;
max-height: 160px;
}
@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;
}
}
</style>
@if($user->user_level)
<p>Die Produktpreise werden entsprechend deinem Karriere-Level <strong>{{$user->user_level->name}}</strong> abzüglich <strong>{{$user->user_level->getFormattedMargin()}} %</strong> Marge angezeigt.<br>
Hinweis: Wenn Du den Warenkorb verlässt, gehen alle Einstellungen verloren.</p>
@else
<p>Hinweis: Dir wurde noch kein Karriere-Level zugewisen. Bitte wende dich an info@mivita.care</p>
@endif
@if($errors->has('switchers-comp-product'))
<div class="row">
<div class="col-sm-12">
<div class="alert alert-danger" id="gotocomp">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
</div>
</div>
@endif
<div class="card">
<div class="card-datatable table-responsive">
@ -39,16 +76,13 @@
<thead>
<tr>
<th>{{__('Bild')}}</th>
<th>#</th>
<th>{{__('Anzahl')}}</th>
<th>{{__('Produkt')}}</th>
<th>{{__('Artikelnummer')}}</th>
<th>{{__('Netto-Preis')}}</th>
<th>{{__('Brutto-Preis')}}</th>
<th>{{__('VK-Brutto-Preis')}}</th>
<th>{{__('Mein Preis netto')}}</th>
<th>{{__('Mein Preis brutto')}}</th>
<th>{{__('Points')}}</th>
<th>{{__('VK-Preis brutto')}}</th>
<th><span class="no-line-break">{{__('Inhalt (ml)')}}</span></th>
<th><span class="no-line-break">{{__('Gewicht (g)')}}</span></th>
<th>{{__('Artikelnummer')}}</th>
<th>#</th>
</tr>
</thead>
@ -60,22 +94,25 @@
{!! Form::open(['url' => route('user_order_my_payment', [$for, $delivery_id]), 'class' => 'form-horizontal']) !!}
<input type="hidden" name="shipping_is_for" value="{{$for}}">
<div class="card mt-4">
<div class="card-body">
@if($for === 'ot')
<h4>Lieferadresse des Kunden</h4>
<h4>Lieferland des Kunden</h4>
@include('user.order.shipping_ot')
@endif
@if($for === 'me')
<h4>Meine Lieferadresse</h4>
<h4>Mein Lieferland</h4>
@include('user.order.shipping_me')
<i>Kann bei der Zahlung/Checkout nicht mehr geändert werden.</i>
@endif
</div>
</div>
@if($for === 'me')
@include('user.order.comp_product')
<div id="holder_html_view_comp_product">
@include('user.order.comp_product')
</div>
@endif
<div class="card mt-4">
@ -110,17 +147,14 @@
},
"order": [[4, "asc" ]],
"columns": [
{ data: 'picture', name: 'picture', searchable: false, orderable: false },
{ data: 'add_card', name: 'add_card', searchable: false, orderable: false},
{ data: 'quantity', name: 'quantity', searchable: false, orderable: false},
{ data: 'name', name: 'name' },
{ data: 'number', name: 'number' },
{ data: 'price_net', name: 'price_net', searchable: false },
{ data: 'price_gross', name: 'price_gross', searchable: false },
{ data: 'price_vk_gross', name: 'price_vk_gross', searchable: false },
{ data: 'picture', name: 'picture', searchable: false, width: 35 },
{ data: 'product', name: 'product' },
{ data: 'price_net', name: 'price_net', searchable: false, orderable: false },
{ data: 'price_gross', name: 'price_gross', searchable: false, orderable: false },
{ data: 'points', name: 'points', searchable: false },
{ data: 'price_vk_gross', name: 'price_vk_gross', searchable: false },
{ data: 'contents_total', name: 'contents_total', searchable: false },
{ data: 'weight', name: 'weight', searchable: false },
{ data: 'number', name: 'number' },
{ data: 'action', name: 'action', searchable: false, orderable: false },
],
"bLengthChange": false,
@ -143,6 +177,9 @@
});
*/
/*{ data: 'add_card', name: 'add_card', searchable: false, orderable: false},
{ data: 'quantity', name: 'quantity', searchable: false, orderable: false},*/
$('body').tooltip({
selector: '.product-tooltip'
});

View file

@ -3,87 +3,19 @@
@if($user->account->same_as_billing)
<!-- Billing -->
{{ Form::hidden('shipping_company', $user->account->company) }}
{{ Form::hidden('shipping_salutation', $user->account->salutation) }}
{{ Form::hidden('shipping_firstname', $user->account->first_name) }}
{{ Form::hidden('shipping_lastname', $user->account->last_name) }}
{{ Form::hidden('shipping_address', $user->account->address) }}
{{ Form::hidden('shipping_address_2', $user->account->address_2) }}
{{ Form::hidden('shipping_zipcode', $user->account->zipcode) }}
{{ Form::hidden('shipping_city', $user->account->city) }}
{{ Form::hidden('shipping_phone', $user->account->phone) }}
<div class="">
<div class="form-row">
<div class="form-group col-md-12">
<label for="shipping_company" class="form-label">{{ __('Company name') }} (optional)</label>
{{ Form::text('shipping_company', $user->account->company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_salutation') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Salutation') }}*</label>
<select class="selectpicker" data-style="btn-light" name="shipping_salutation" id="shipping_salutation" required>
{!! HTMLHelper::getSalutation($user->account->salutation) !!}
</select>
@if ($errors->has('shipping_salutation'))
<span class="help-block">
<strong>{{ $errors->first('shipping_salutation') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_firstname') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_firstname">{{ __('First name') }}*</label>
{{ Form::text('shipping_firstname', $user->account->first_name, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_firstname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_firstname') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_lastname') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_lastname">{{ __('Last name') }}*</label>
{{ Form::text('shipping_lastname', $user->account->last_name, array('placeholder'=>__('Last name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_lastname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_lastname') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_address">{{ __('Street') }} / {{ __('House number') }}*</label>
{{ Form::text('shipping_address', $user->account->address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_address'))
<span class="help-block">
<strong>{{ $errors->first('shipping_address') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address_2') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_address_2">{{ __('Wohnung / Gebäude (optional)') }}</label>
{{ Form::text('shipping_address_2', $user->account->address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_zipcode') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_zipcode">{{ __('Postcode') }}*</label>
{{ Form::text('shipping_zipcode', $user->account->zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_zipcode'))
<span class="help-block">
<strong>{{ $errors->first('shipping_zipcode') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_city') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_city">{{ __('City') }}*</label>
{{ Form::text('shipping_city', $user->account->city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_city'))
<span class="help-block">
<strong>{{ $errors->first('shipping_city') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_state') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Versandland') }}*</label>
<select name="shipping_state" class="selectpicker" id="change_shipping_state" data-is-for="me">
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId()) !!}
</select>
@ -94,103 +26,22 @@
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label class="form-label" for="shipping_phone">{{ __('Phone') }}</label>
{{ Form::text('shipping_phone', $user->account->phone, array('placeholder'=>__('Phone'), 'class'=>'form-control')) }}
</div>
</div>
</div>
<!-- / Billing -->
@else
{{ Form::hidden('shipping_company', $user->account->shipping_company) }}
{{ Form::hidden('shipping_salutation', $user->account->shipping_salutation) }}
{{ Form::hidden('shipping_firstname', $user->account->shipping_firstname) }}
{{ Form::hidden('shipping_lastname', $user->account->shipping_lastname) }}
{{ Form::hidden('shipping_address', $user->account->shipping_address) }}
{{ Form::hidden('shipping_address_2', $user->account->shipping_address_2) }}
{{ Form::hidden('shipping_zipcode', $user->account->shipping_zipcode) }}
{{ Form::hidden('shipping_city', $user->account->shipping_city) }}
{{ Form::hidden('shipping_phone', $user->account->shipping_phone) }}
<div class="">
<div class="form-row">
<div class="form-group col-md-12">
<label for="shipping_company" class="form-label">{{ __('Company name') }} (optional)</label>
{{ Form::text('shipping_company', $user->account->shipping_company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_salutation') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Salutation') }}*</label>
<select class="selectpicker" data-style="btn-light" name="shipping_salutation" id="shipping_salutation" required>
{!! HTMLHelper::getSalutation($user->account->shipping_salutation) !!}
</select>
@if ($errors->has('shipping_salutation'))
<span class="help-block">
<strong>{{ $errors->first('shipping_salutation') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_firstname') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_firstname">{{ __('First name') }}*</label>
{{ Form::text('shipping_firstname', $user->account->shipping_firstname, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_firstname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_firstname') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_lastname') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_lastname">{{ __('Last Name') }}*</label>
{{ Form::text('shipping_lastname', $user->account->shipping_lastname, array('placeholder'=>__('Last Name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_lastname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_lastname') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_address">{{ __('Street') }} / {{ __('House number') }}*</label>
{{ Form::text('shipping_address', $user->account->shipping_address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_address'))
<span class="help-block">
<strong>{{ $errors->first('shipping_address') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address_2') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_address_2">{{ __('Wohnung / Gebäude (optional)') }}</label>
{{ Form::text('shipping_address_2', $user->account->shipping_address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }}
@if ($errors->has('shipping_address_2'))
<span class="help-block">
<strong>{{ $errors->first('shipping_address_2') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_zipcode') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_zipcode">{{ __('Postcode') }}*</label>
{{ Form::text('shipping_zipcode', $user->account->shipping_zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_zipcode'))
<span class="help-block">
<strong>{{ $errors->first('shipping_zipcode') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_city') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_city">{{ __('City') }}*</label>
{{ Form::text('shipping_city', $user->account->shipping_city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_city'))
<span class="help-block">
<strong>{{ $errors->first('shipping_city') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_state') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Versandland') }}*</label>
<select name="shipping_state" class="selectpicker" id="change_shipping_state" data-is-for="me">
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId()) !!}
</select>

View file

@ -1,87 +1,21 @@
@if($shopping_user->same_as_billing)
<!-- Billing -->
{{ Form::hidden('shipping_company', $shopping_user->billing_company) }}
{{ Form::hidden('shipping_salutation', $shopping_user->billing_salutation) }}
{{ Form::hidden('shipping_firstname', $shopping_user->billing_first_name) }}
{{ Form::hidden('shipping_lastname', $shopping_user->billing_last_name) }}
{{ Form::hidden('shipping_address', $shopping_user->billing_address) }}
{{ Form::hidden('shipping_address_2', $shopping_user->billing_address_2) }}
{{ Form::hidden('shipping_zipcode', $shopping_user->billing_zipcode) }}
{{ Form::hidden('shipping_city', $shopping_user->billing_city) }}
{{ Form::hidden('shipping_phone', $shopping_user->billing_phone) }}
<div class="">
<div class="form-row">
<div class="form-group col-md-12">
<label for="shipping_company" class="form-label">{{ __('Company name') }} (optional)</label>
{{ Form::text('shipping_company', $shopping_user->billing_company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_salutation') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Salutation') }}*</label>
<select class="selectpicker" data-style="btn-light" name="shipping_salutation" id="shipping_salutation" required>
{!! HTMLHelper::getSalutation($shopping_user->billing_salutation) !!}
</select>
@if ($errors->has('shipping_salutation'))
<span class="help-block">
<strong>{{ $errors->first('shipping_salutation') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_firstname') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_firstname">{{ __('First name') }}*</label>
{{ Form::text('shipping_firstname', $shopping_user->billing_firstname, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_firstname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_firstname') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_lastname') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_lastname">{{ __('Last name') }}*</label>
{{ Form::text('shipping_lastname', $shopping_user->billing_lastname, array('placeholder'=>__('Last name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_lastname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_lastname') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_address">{{ __('Street') }} / {{ __('House number') }}*</label>
{{ Form::text('shipping_address', $shopping_user->billing_address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_address'))
<span class="help-block">
<strong>{{ $errors->first('shipping_address') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address_2') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_address_2">{{ __('Wohnung / Gebäude (optional)') }}</label>
{{ Form::text('shipping_address_2', $shopping_user->billing_address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_zipcode') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_zipcode">{{ __('Postcode') }}*</label>
{{ Form::text('shipping_zipcode', $shopping_user->billing_zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_zipcode'))
<span class="help-block">
<strong>{{ $errors->first('shipping_zipcode') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_city') ? 'has-error' : '' }}">
<label class="form-label" for=shipping_city">{{ __('City') }}*</label>
{{ Form::text('shipping_city', $shopping_user->billing_city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_city'))
<span class="help-block">
<strong>{{ $errors->first('shipping_city') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_state') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Versandland') }}*</label>
<select name="shipping_state" class="selectpicker" id="change_shipping_state" data-is-for="ot">
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId()) !!}
</select>
@ -92,119 +26,31 @@
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label class="form-label" for="shipping_phone">{{ __('Phone') }}</label>
{{ Form::text('shipping_phone', $shopping_user->billing_phone, array('placeholder'=>__('Phone'), 'class'=>'form-control')) }}
</div>
</div>
</div>
<!-- / Billing -->
@else
{{ Form::hidden('shipping_company', $shopping_user->shipping_company) }}
{{ Form::hidden('shipping_salutation', $shopping_user->shipping_salutation) }}
{{ Form::hidden('shipping_firstname', $shopping_user->shipping_firstname) }}
{{ Form::hidden('shipping_lastname', $shopping_user->shipping_lastname) }}
{{ Form::hidden('shipping_address', $shopping_user->shipping_address) }}
{{ Form::hidden('shipping_address_2', $shopping_user->shipping_address_2) }}
{{ Form::hidden('shipping_zipcode', $shopping_user->shipping_zipcode) }}
{{ Form::hidden('shipping_city', $shopping_user->shipping_city) }}
{{ Form::hidden('shipping_phone', $shopping_user->shipping_phone) }}
<div class="">
<div class="form-row">
<div class="form-group col-md-12">
<label for="shipping_company" class="form-label">{{ __('Company name') }} (optional)</label>
{{ Form::text('shipping_company', $shopping_user->shipping_company, array('placeholder'=>__('Company name'), 'class'=>'form-control')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_salutation') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Salutation') }}*</label>
<select class="selectpicker" data-style="btn-light" name="shipping_salutation" id="shipping_salutation" required>
{!! HTMLHelper::getSalutation($shopping_user->shipping_salutation) !!}
</select>
@if ($errors->has('shipping_salutation'))
<span class="help-block">
<strong>{{ $errors->first('shipping_salutation') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_firstname') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_firstname">{{ __('First name') }}*</label>
{{ Form::text('shipping_firstname', $shopping_user->shipping_firstname, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_firstname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_firstname') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_lastname') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_lastname">{{ __('Last Name') }}*</label>
{{ Form::text('shipping_lastname', $shopping_user->shipping_lastname, array('placeholder'=>__('Last Name'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_lastname'))
<span class="help-block">
<strong>{{ $errors->first('shipping_lastname') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_address">{{ __('Street') }} / {{ __('House number') }}*</label>
{{ Form::text('shipping_address', $shopping_user->shipping_address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_address'))
<span class="help-block">
<strong>{{ $errors->first('shipping_address') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_address_2') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_address_2">{{ __('Wohnung / Gebäude (optional)') }}</label>
{{ Form::text('shipping_address_2', $shopping_user->shipping_address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control')) }}
@if ($errors->has('shipping_address_2'))
<span class="help-block">
<strong>{{ $errors->first('shipping_address_2') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 {{ $errors->has('shipping_zipcode') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_zipcode">{{ __('Postcode') }}*</label>
{{ Form::text('shipping_zipcode', $shopping_user->shipping_zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_zipcode'))
<span class="help-block">
<strong>{{ $errors->first('shipping_zipcode') }}</strong>
</span>
@endif
</div>
<div class="form-group col-md-6 {{ $errors->has('shipping_city') ? 'has-error' : '' }}">
<label class="form-label" for="shipping_city">{{ __('City') }}*</label>
{{ Form::text('shipping_city', $shopping_user->shipping_city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true)) }}
@if ($errors->has('shipping_city'))
<span class="help-block">
<strong>{{ $errors->first('shipping_city') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_state') ? 'has-error' : '' }}">
<label class="form-label">{{ __('Versandland') }}*</label>
<select name="shipping_state" class="selectpicker" id="change_shipping_state" data-is-for="ot">
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId()) !!}
</select>
@if ($errors->has('shipping_state'))
<span class="help-block">
<strong>{{ $errors->first('shipping_state') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label class="form-label" for="shipping_phone">{{ __('Phone') }}</label>
{{ Form::text('shipping_phone', $shopping_user->shipping_phone, array('placeholder'=>__('Phone'), 'class'=>'form-control')) }}
</div>
<div class="form-row">
<div class="form-group col-md-12 {{ $errors->has('shipping_state') ? 'has-error' : '' }}">
<select name="shipping_state" class="selectpicker" id="change_shipping_state" data-is-for="ot">
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId()) !!}
</select>
@if ($errors->has('shipping_state'))
<span class="help-block">
<strong>{{ $errors->first('shipping_state') }}</strong>
</span>
@endif
</div>
</div>
</div>
@endif

View file

@ -2,30 +2,126 @@
@if(Yard::instance('shopping')->content()->count())
@if(Yard::instance('shopping')->compCount() > 0)
<!-- Shopping cart table -->
<div class="table-responsive">
<table class="table table-bordered m-0">
<thead>
<tr>
<!-- Set columns width -->
<th class="text-center py-3 px-4" style="min-width: 400px;">Produkt</th>
<th class="text-right py-3 px-4" style="width: 120px;"><div class="no-line-break">Netto-Preis</div></th>
<th class="text-center py-3 px-2" style="width: 125px;">Anzahl</th>
<th class="text-right py-3 px-4" style="width: 120px;">Summe</th>
</tr>
</thead>
<tbody>
<style>
.yard-items-head {
border-bottom: 1px solid #ddd;
padding-bottom: 8px;
margin-bottom: 8px;
}
@foreach(Yard::instance('shopping')->content() as $row)
.yard-item {
position: relative;
padding-top: 8px;
border-bottom: 1px solid #ddd;
padding-bottom: 8px;
}
.yard-item a.shop-item-hl {
color: #9aa983;
font-size: 1.1em;
font-weight: bold;
}
.yard-item .options {
margin-top: 4px;
}
.yard-item a.auto-delete-product {
font-size: 0.7em;
font-weight: bold;
text-transform: uppercase;
}
.yard-item .quantity {
position: relative;
}
.quantity-select {
text-align: right;
}
.quantity-select select.form-control:not([size]):not([multiple]) {
width: auto;
min-width: 5em;
display: inline-block;
}
.yard-item .price-total {
margin-top: 6px;
white-space: nowrap;
}
.yard-item .font-semi-bold {
color: #393939;
font-weight: 500;
}
.yard-item .font-semi-bold .small {
font-size: 1rem;
}
.yard-item .font-bold {
color: #393939;
font-weight: bold;
}
.price-single {
white-space: nowrap;
}
.price-total {
font-weight: 600;
font-size: 0.95rem;
white-space: nowrap;
}
.quantity-select {
text-align: right;
}
.quantity-select input.form-control {
width: auto;
min-width: 4em;
display: inline-block;
}
}
}
</style>
<div id="cartContent">
<div class="yard-items-head d-none d-sm-block">
<div class="row">
<div class="col-3 col-sm-2">
<div class="row">&nbsp;</div>
</div>
<div class="col-9 col-sm-10">
<div class="row">
<div class="col-12 col-sm-6 col-md-7">
Artikel
</div>
<div class="col-6 col-sm-3 col-md-2 text-left">
Einzelpreis
</div>
<div class="col-6 col-sm-3 col-md-3 text-right">
Anzahl
</div>
</div>
</div>
</div>
</div>
@foreach(Yard::instance('shopping')->getContentByOrder() as $row)
@php($product = \App\Models\Product::find($row->id))
<tr>
<td class="p-4">
<div class="media align-items-center">
@if($row->options->has('image'))
<img src="{{ route('product_image', [$row->options->image]) }}" class="d-block ui-w-80 ui-bordered mr-4" alt="">
@else
<img src="{{ asset('/assets/images/1x1.png') }}" class="d-block ui-w-80 ui-bordered mr-4" alt="">
@endif
<div class="row yard-item">
<div class="col-3 col-sm-2">
@if($row->options->has('image'))
<img src="{{ route('product_image', [$row->options->image]) }}" class="d-block ui-w-80 ui-bordered mr-4" alt="">
@else
<img src="{{ asset('/assets/images/1x1.png') }}" class="d-block ui-w-80 ui-bordered mr-4" alt="">
@endif
</div>
<div class="col-9 col-sm-10">
<div class="row">
<div class="col-12 col-sm-6 col-md-7 description">
<div class="media-body">
<div class="d-block text-body" style="font-size: 15px; font-weight: 500;">{{ $row->name }}</div>
<div class="text-body">
@ -33,32 +129,45 @@
<div>Art.-Nr.: {{ $product->number }}</div>
</div>
</div>
</div>
</td>
<td class="text-right font-weight-semibold align-middle p-4">
<div class="no-line-break">{{ Yard::instance('shopping')->rowPriceNet($row, 3) }} &euro;</div>
</td>
<td class="align-middle p-2">
@if($row->options->comp)
<div class="text-center product-tooltip" data-toggle="tooltip" title="Kompensationsprodukt">1x KP</div>
@else
<div class="input-group d-inline-flex" style="width: 110px">
<input type="number" class="form-control text-center cart-input-event-onchange" data-row-id="{{$row->rowId}}" data-product-id="{{ $product->id }}" value="{{ $row->qty }}" name="quantity[{{$row->rowId}}]" maxlength="3" max="999" min="1">
<span class="input-group-append">
<button type="button" class="btn btn-default btn-sm remove_item_form_cart product-tooltip" data-row-id="{{$row->rowId}}" data-product-id="{{ $product->id }}">x</button>
</span>
</div>
@endif
</td>
<div class="options">
@if(!$row->options->comp)
<a href="#" class="auto-delete-product remove_item_form_cart product-tooltip" data-row-id="{{$row->rowId}}" data-product-id="{{ $product->id }}"><i class="fa fa-times"></i> Artikel entfernen</a>
@else
@if(Yard::instance('shopping')->getNumComp() > 1)
{{$row->options->comp}}. Kompensationsprodukt
@else
Kompensationsprodukt
@endif
<td class="text-right font-weight-semibold align-middle p-4">
<div class="no-line-break">{{ Yard::instance('shopping')->rowSubtotalNet($row) }} &euro;</div>
</td>
</tr>
@endif
</div>
</div>
<div class="col-6 col-sm-3 col-md-2 text-left font-semi-bold price-single">
<div class="no-line-break">{{ Yard::instance('shopping')->rowPriceNet($row, 3) }} &euro;</div>
</div>
<div class="col-6 col-sm-3 col-md-3 quantity">
<div class="quantity-select">
@if($row->options->comp)
<span class="text-right product-tooltip" data-toggle="tooltip" title="Kompensationsprodukt">1 x</span>
@else
<input type="number" class="form-control text-center cart-input-event-onchange" data-row-id="{{$row->rowId}}" data-product-id="{{ $product->id }}" value="{{ $row->qty }}" name="quantity[{{$row->rowId}}]" maxlength="3" max="999" min="1">
@endif
</div>
<div class="price-total text-right">
<div class="no-line-break">{{ Yard::instance('shopping')->rowSubtotalNet($row) }} &euro;</div>
</div>
</div>
</div>
</div>
</div>
@endforeach
</tbody>
</table>
</div>
<div class="clearfix"></div>
</div>
<!-- / Shopping cart table -->
<div class="d-flex flex-wrap justify-content-between pb-4">
<div class="mt-2">
@ -75,7 +184,7 @@
<td style="border-top:none;">{{ Yard::instance('shopping')->subtotal() }} </td>
</tr>
<tr>
<td class="text-left">Versandland:</td>
<td class="text-left">Lieferland:</td>
<td>{{ Yard::instance('shopping')->getShippingCountryName() }}</td>
</tr>
<tr>

View file

@ -315,7 +315,7 @@
<hr class="mt-4 mb-4">
<div class="clearfix mb-2">
<div class=" small">Versandland:</div>
<div class=" small">Lieferland:</div>
<div class="small">
<form action="{{ url(Util::getPostRoute().'card/show') }}" method="GET" style="margin-bottom: 0;">
<select name="selected_country" class="form-control" onchange="this.form.submit()">

View file

@ -93,7 +93,7 @@
<div class="panel panel-default">
<div class="panel-body">
<h3>Vielen Dank, </h3>
<p>Deine Bestellung wurde aufgenommen. In Kürze erhälst du von uns eine Bestellbestätigungs-E-Mail.</p>
<p>Deine Bestellung ist bei uns eingegangen. In Kürze erhälst du von uns eine Bestellbestätigungsmail.</p>
<h4>Deine Bestellnummer ist: {{ $order_reference }}</h4>
<hr />

View file

@ -175,7 +175,7 @@
<div class="col-lg-7 col-sm-7">
<!-- BILLING -->
<fieldset class="mb-0 box-border-shadow p-20">
<h4>Rechnung &amp; Versand</h4>
<h4>Rechnungsadresse</h4>
<hr />
@if($is_from === 'shopping')
@ -262,11 +262,11 @@
<div class="row">
<div class="col-md-12 col-sm-12">
<label class="mt-0 fs-14 fw-400" for="billing_state">Land *</label>
<select id="billing_state" name="billing_state" class="form-control required">
<select id="billing_state" name="billing_state" class="form-control" required>
{!! HTMLHelper::getCountriesForShipping($shopping_user->billing_state) !!}
</select>
<input type="hidden" name="billing_country_id" value="{{ \App\Services\Shop::getShippingCountryCountryId($shopping_user->billing_state)}}">
<span class="info-small" id="show_shipping_country_info">Bei der Änderung des Versandlandes werden die Versandkosten neu berechnet.</span>
<span class="info-small" id="show_shipping_country_info">Bei der Änderung des Lieferlandes werden die Versandkosten neu berechnet.</span>
</div>
</div>
@ -306,56 +306,70 @@
{!! Form::hidden('billing_country_id', \App\Services\Shop::getShippingCountryCountryId($shopping_user->billing_state)) !!}
<div class="row">
<style>
.ex-small {
color: #868686 !important;
font-size: 12px;
font-weight: bold;
}
.text-normal {
color: #404040 !important;
font-size: 14px;
font-weight: normal;
margin-bottom: 6px;
}
</style>
@if($shopping_user->billing_company)
<div class="col-md-12 mb-3">
<div class="text-muted small">Firma</div>
{{ $shopping_user->billing_company }}
<div class="ex-small">Firma</div>
<div class="text-normal">{{ $shopping_user->billing_company }}</div>
</div>
@endif
<div class="col-md-3 mb-3">
<div class="text-muted small">Anrede</div>
{{ \App\Services\HTMLHelper::getSalutationLang($shopping_user->billing_salutation) }}
<div class="ex-small">Anrede</div>
<div class="text-normal">{{ \App\Services\HTMLHelper::getSalutationLang($shopping_user->billing_salutation) }}</div>
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Vorname</div>
{{ $shopping_user->billing_firstname }}
<div class="ex-small">Vorname</div>
<div class="text-normal">{{ $shopping_user->billing_firstname }}</div>
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Nachname</div>
{{ $shopping_user->billing_lastname }}
<div class="ex-small">Nachname</div>
<div class="text-normal">{{ $shopping_user->billing_lastname }}</div>
</div>
</div>
<div class="row">
<div class="col-md-3 mb-3">
<div class="text-muted small">Straße</div>
{{ $shopping_user->billing_address }}
<div class="ex-small">Straße</div>
<div class="text-normal">{{ $shopping_user->billing_address }}</div>
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Zusatz</div>
{{ $shopping_user->billing_address_2 }}
<div class="ex-small">Zusatz</div>
<div class="text-normal">{{ $shopping_user->billing_address_2 }}</div>
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">PLZ</div>
{{ $shopping_user->billing_zipcode }}
<div class="ex-small">PLZ</div>
<div class="text-normal">{{ $shopping_user->billing_zipcode }}</div>
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Stadt</div>
{{ $shopping_user->billing_city }}
<div class="ex-small">Stadt</div>
<div class="text-normal">{{ $shopping_user->billing_city }}</div>
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Land</div>
{{ $shopping_user->billing_country->getLocated() }}
<div class="ex-small">Land</div>
<div class="text-normal">{{ $shopping_user->billing_country->getLocated() }}</div>
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">Telefon</div>
{{ $shopping_user->billing_phone }}
<div class="ex-small">Telefon</div>
<div class="text-normal">{{ $shopping_user->billing_phone }}</div>
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">E-Mail</div>
{{ $shopping_user->billing_email }}
<div class="ex-small">E-Mail</div>
<div class="text-normal">{{ $shopping_user->billing_email }}</div>
</div>
</div>
<p class="text-muted small mb-0"><i>Deine hinterlegten Rechnungsdaten können nur im Salescenter geändert werden.</i></p>
<hr class="mb-3 mt-1">
<p class="text-muted small mb-0"><i>Deine Rechnungsadresse kann nur im Salescenter geändert werden.</i></p>
</div>
@endif
@ -376,18 +390,15 @@
@endif
</div>
</div>
<div class="row">
<div class="col-lg-12 nomargin clearfix">
<hr>
<label class="mt-0 fs-14 fw-400 checkbox pull-left"><!-- see assets/js/view/demo.shop.js - CHECKOUT section -->
{!! Form::checkbox('same_as_billing', 1, $shopping_user->same_as_billing, ['id'=>'shipswitch', 'class' => '']) !!}
<i></i> <span class="weight-300">Versand an die gleiche Adresse</span>
</label>
<div class="row" @if($is_from === 'user_order') style="display: none" @endif>
<div class="col-lg-12 nomargin clearfix">
<hr>
<label class="mt-0 fs-14 fw-500 checkbox pull-left">
{!! Form::checkbox('same_as_billing', 1, $shopping_user->same_as_billing, ['id'=>'shipswitch']) !!}
<i></i> <span class="weight-400">Abweichende Lieferadresse</span>
</label>
</div>
</div>
</div>
</fieldset>
<!-- /BILLING -->
@ -403,7 +414,7 @@
<h4>Lieferadresse des Kunden</h4>
@endif
@else
<h4>Versand Adresse</h4>
<h4>Lieferadresse</h4>
@endif
<hr />
@ -494,12 +505,16 @@
<div class="row">
<div class="col-md-12 col-sm-12">
<label class="mt-0 fs-14 fw-400" for="shipping_state">Land *</label>
<select id="shipping_state" name="shipping_state" class="form-control required">
{!! HTMLHelper::getCountriesForShipping($shopping_user->shipping_state) !!}
</select>
<input type="hidden" name="shipping_country_id" value="{{ \App\Services\Shop::getShippingCountryCountryId($shopping_user->shipping_state) }}">
<span class="info-small">Bei der Änderung des Landes werden die Versandkosten neu berechnet.</span>
<input type="hidden" name="shipping_country_id" value="{{ \App\Services\Shop::getShippingCountryCountryId($shopping_user->shipping_state) }}">
<label class="mt-0 fs-14 fw-400" for="shipping_state">Lieferland *</label>
<select id="shipping_state" name="shipping_state" class="form-control" required @if($is_from === 'user_order' && $is_for === 'me') disabled style="background-color: #d4d4d4;" @endif>
{!! HTMLHelper::getCountriesForShipping($shopping_user->shipping_state) !!}
</select>
@if($is_from === 'user_order' && $is_for === 'me')
<span class="info-small">Das Lieferland kann nur bei der Bestellübersicht geändert werden.</span>
@else
<span class="info-small">Bei der Änderung des Landes werden die Versandkosten neu berechnet.</span>
@endif
</div>
</div>
@ -793,7 +808,7 @@
<div class="clearfix mb-2">
<span class="pull-right small">{{ Yard::instance('shopping')->getShippingCountryName() }}</span>
<span class="pull-left small">Versandland:</span>
<span class="pull-left small">Lieferland:</span>
</div>
<hr class="mt-4 mb-4">
@ -870,22 +885,22 @@
}
if(jQuery('#shipping').is(":visible")) {
_scrollTo('#shipping', 150);
showShippingCountryFor('shipping');
}else{
showShippingCountryFor('billing');
}else{
showShippingCountryFor('shipping');
}
});
});
if(!jQuery('#shipswitch').is(':checked')){
showShippingCountryFor('billing');
}else{
jQuery('#shipping').show();
showShippingCountryFor('shipping');
}else{
showShippingCountryFor('billing');
}
jQuery('.quick-cart-box-close').on('click', function () {
jQuery('.quick-cart-box').css('display', 'none');
});