diff --git a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php index 86d330715..0d68e3f26 100644 --- a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php @@ -69,19 +69,19 @@ class ProductDataGrid ], //for getting the attribute values. - [ - 'join' => 'leftjoin', - 'table' => 'product_attribute_values as pav', - 'primaryKey' => 'prods.id', - 'condition' => '=', - 'secondaryKey' => 'pav.product_id', - 'withAttributes' => [ - 'condition' => [ - 'attribute_id' => 2, - 'select' => 'name', - ] - ] - ], + // [ + // 'join' => 'leftjoin', + // 'table' => 'product_attribute_values as pav', + // 'primaryKey' => 'prods.id', + // 'condition' => '=', + // 'secondaryKey' => 'pav.product_id', + // 'withAttributes' => [ + // 'condition' => [ + // 'attribute_id' => 2, + // 'select' => 'name', + // ] + // ] + // ], // for getting the inventory quantity of a product [ diff --git a/packages/Webkul/Admin/src/Http/Controllers/Controller.php b/packages/Webkul/Admin/src/Http/Controllers/Controller.php new file mode 100644 index 000000000..0a0005bde --- /dev/null +++ b/packages/Webkul/Admin/src/Http/Controllers/Controller.php @@ -0,0 +1,13 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class InvoiceController extends Controller +{ + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + protected $_config; + + /** + * OrderRepository object + * + * @var array + */ + protected $order; + + /** + * InvoiceRepository object + * + * @var array + */ + protected $invoice; + + /** + * Create a new controller instance. + * + * @param Webkul\Sales\Repositories\OrderRepository $order + * @param Webkul\Sales\Repositories\InvoiceRepository $invoice + * @return void + */ + public function __construct(Invoice $invoice, Order $order) + { + $this->middleware('admin'); + + $this->_config = request('_config'); + + $this->order = $order; + + $this->invoice = $invoice; + + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view($this->_config['view']); + } + + /** + * Show the form for creating a new resource. + * + * @param int $orderId + * @return \Illuminate\Http\Response + */ + public function create($orderId) + { + $order = $this->order->find($orderId); + + return view($this->_config['view'], compact('order')); + } + + /** + * Store a newly created resource in storage. + * + * @param int $orderId + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(Request $request, $orderId) + { + $order = $this->order->find($orderId); + + if(!$order->canInvoice()) { + session()->flash('error', 'Order invoice creation is not allowed.'); + + return redirect()->back(); + } + + $this->validate(request(), [ + 'invoice.items.*' => 'required|numeric|min:0', + ]); + + $data = request()->all(); + + $haveProductToInvoice = false; + foreach ($data['invoice']['items'] as $itemId => $qty) { + if($qty) { + $haveProductToInvoice = true; + break; + } + } + + if(!$haveProductToInvoice) { + session()->flash('error', 'Invoice can not be created without products.'); + + return redirect()->back(); + } + + $this->invoice->create(array_merge($data, ['order_id' => $orderId])); + + session()->flash('success', 'Invoice created successfully.'); + + return redirect()->route($this->_config['redirect'], $orderId); + } + + /** + * Show the view for the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function view($id) + { + $invoice = $this->invoice->find($id); + + return view($this->_config['view'], compact('invoice')); + } +} diff --git a/packages/Webkul/Admin/src/Http/Controllers/Sales/OrderController.php b/packages/Webkul/Admin/src/Http/Controllers/Sales/OrderController.php new file mode 100644 index 000000000..84b192988 --- /dev/null +++ b/packages/Webkul/Admin/src/Http/Controllers/Sales/OrderController.php @@ -0,0 +1,70 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class OrderController extends Controller +{ + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + protected $_config; + + /** + * OrderRepository object + * + * @var array + */ + protected $order; + + /** + * Create a new controller instance. + * + * @param Webkul\Sales\Repositories\OrderRepository $order + * @return void + */ + public function __construct(Order $order) + { + $this->middleware('admin'); + + $this->_config = request('_config'); + + $this->order = $order; + + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view($this->_config['view']); + } + + /** + * Show the view for the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function view($id) + { + $order = $this->order->find($id); + + return view($this->_config['view'], compact('order')); + } +} diff --git a/packages/Webkul/Admin/src/Http/Controllers/Sales/ShipmentController.php b/packages/Webkul/Admin/src/Http/Controllers/Sales/ShipmentController.php new file mode 100644 index 000000000..69e8cda8d --- /dev/null +++ b/packages/Webkul/Admin/src/Http/Controllers/Sales/ShipmentController.php @@ -0,0 +1,140 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class ShipmentController extends Controller +{ + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + protected $_config; + + /** + * OrderRepository object + * + * @var array + */ + protected $order; + + /** + * ShipmentRepository object + * + * @var array + */ + protected $shipment; + + /** + * Create a new controller instance. + * + * @param Webkul\Sales\Repositories\OrderRepository $order + * @param Webkul\Sales\Repositories\ShipmentRepository $shipment + * @return void + */ + public function __construct(Shipment $shipment, Order $order) + { + $this->middleware('admin'); + + $this->_config = request('_config'); + + $this->order = $order; + + $this->shipment = $shipment; + + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view($this->_config['view']); + } + + /** + * Show the form for creating a new resource. + * + * @param int $orderId + * @return \Illuminate\Http\Response + */ + public function create($orderId) + { + $order = $this->order->find($orderId); + + return view($this->_config['view'], compact('order')); + } + + /** + * Store a newly created resource in storage. + * + * @param int $orderId + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(Request $request, $orderId) + { + $order = $this->order->find($orderId); + + if(!$order->canShip()) { + session()->flash('error', 'Order shipment creation is not allowed.'); + + return redirect()->back(); + } + + $this->validate(request(), [ + 'shipment.carrier_title' => 'required', + 'shipment.track_number' => 'required', + 'shipment.items.*' => 'required|numeric|min:0', + ]); + + $data = request()->all(); + + $haveProductToShip = false; + foreach ($data['shipment']['items'] as $itemId => $qty) { + if($qty) { + $haveProductToShip = true; + break; + } + } + + if(!$haveProductToShip) { + session()->flash('error', 'Shipment can not be created without products.'); + + return redirect()->back(); + } + + $this->shipment->create(array_merge($data, ['order_id' => $orderId])); + + session()->flash('success', 'Shipment created successfully.'); + + return redirect()->route($this->_config['redirect'], $orderId); + } + + /** + * Show the view for the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function view($id) + { + $shipment = $this->shipment->find($id); + + return view($this->_config['view'], compact('shipment')); + } +} diff --git a/packages/Webkul/Admin/src/Http/routes.php b/packages/Webkul/Admin/src/Http/routes.php index b4e0c7229..c7c62a1af 100644 --- a/packages/Webkul/Admin/src/Http/routes.php +++ b/packages/Webkul/Admin/src/Http/routes.php @@ -77,11 +77,53 @@ Route::group(['middleware' => ['web']], function () { 'redirect' => 'admin.customer.index' ])->name('admin.customer.update'); - // dummy number i.e-1 is used for creating view only + // Sales Routes + Route::prefix('sales')->group(function () { + // Sales Order Routes + Route::get('/orders', 'Webkul\Admin\Http\Controllers\Sales\OrderController@index')->defaults('_config', [ + 'view' => 'admin::sales.orders.index' + ])->name('admin.sales.orders.index'); - Route::get('customer/orders/1', 'Webkul\User\Http\Controllers\UserController@index')->defaults('_config', [ - 'view' => 'admin::customers.orders.order' - ])->name('admin.customer.orders.order'); + Route::get('/orders/view/{id}', 'Webkul\Admin\Http\Controllers\Sales\OrderController@view')->defaults('_config', [ + 'view' => 'admin::sales.orders.view' + ])->name('admin.sales.orders.view'); + + + // Sales Invoices Routes + Route::get('/invoices', 'Webkul\Admin\Http\Controllers\Sales\InvoiceController@index')->defaults('_config', [ + 'view' => 'admin::sales.invoices.index' + ])->name('admin.sales.invoices.index'); + + Route::get('/invoices/create/{order_id}', 'Webkul\Admin\Http\Controllers\Sales\InvoiceController@create')->defaults('_config', [ + 'view' => 'admin::sales.invoices.create' + ])->name('admin.sales.invoices.create'); + + Route::post('/invoices/create/{order_id}', 'Webkul\Admin\Http\Controllers\Sales\InvoiceController@store')->defaults('_config', [ + 'redirect' => 'admin.sales.orders.view' + ])->name('admin.sales.invoices.store'); + + Route::get('/invoices/view/{id}', 'Webkul\Admin\Http\Controllers\Sales\InvoiceController@view')->defaults('_config', [ + 'view' => 'admin::sales.invoices.view' + ])->name('admin.sales.invoices.view'); + + + // Sales Shipments Routes + Route::get('/shipments', 'Webkul\Admin\Http\Controllers\Sales\ShipmentController@index')->defaults('_config', [ + 'view' => 'admin::sales.shipments.index' + ])->name('admin.sales.shipments.index'); + + Route::get('/shipments/create/{order_id}', 'Webkul\Admin\Http\Controllers\Sales\ShipmentController@create')->defaults('_config', [ + 'view' => 'admin::sales.shipments.create' + ])->name('admin.sales.shipments.create'); + + Route::post('/shipments/create/{order_id}', 'Webkul\Admin\Http\Controllers\Sales\ShipmentController@store')->defaults('_config', [ + 'redirect' => 'admin.sales.orders.view' + ])->name('admin.sales.shipments.store'); + + Route::get('/shipments/view/{id}', 'Webkul\Admin\Http\Controllers\Sales\ShipmentController@view')->defaults('_config', [ + 'view' => 'admin::sales.shipments.view' + ])->name('admin.sales.shipments.view'); + }); // Catalog Routes Route::prefix('catalog')->group(function () { diff --git a/packages/Webkul/Admin/src/Providers/EventServiceProvider.php b/packages/Webkul/Admin/src/Providers/EventServiceProvider.php index 599550acd..6a061305b 100644 --- a/packages/Webkul/Admin/src/Providers/EventServiceProvider.php +++ b/packages/Webkul/Admin/src/Providers/EventServiceProvider.php @@ -42,6 +42,8 @@ class EventServiceProvider extends ServiceProvider Event::listen('admin.menu.build', function ($menu) { $menu->add('dashboard', 'Dashboard', 'admin.dashboard.index', 1, 'dashboard-icon'); + $menu->add('sales', 'Sales', 'admin.sales.orders.index', 1, 'sales-icon'); + $menu->add('catalog', 'Catalog', 'admin.catalog.products.index', 3, 'catalog-icon'); $menu->add('catalog.products', 'Products', 'admin.catalog.products.index', 1); @@ -56,9 +58,7 @@ class EventServiceProvider extends ServiceProvider $menu->add('customers.customers', 'Customers', 'admin.customer.index', 1, ''); - $menu->add('customers.orders', 'Orders', 'admin.customer.orders.index', 2, ''); - - $menu->add('customers.reviews', 'Review', 'admin.customer.review.index', 3, ''); + $menu->add('customers.reviews', 'Review', 'admin.customer.review.index', 2, ''); // $menu->add('customers.blocked_customer', 'Blocked Customers', 'admin.account.edit', 2, ''); diff --git a/packages/Webkul/Admin/src/Resources/assets/sass/app.scss b/packages/Webkul/Admin/src/Resources/assets/sass/app.scss index 506819344..cba8a969a 100644 --- a/packages/Webkul/Admin/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Admin/src/Resources/assets/sass/app.scss @@ -180,6 +180,10 @@ body { .page-action { float: right; + + * { + display: inline-block; + } } .control-group { @@ -276,26 +280,327 @@ body { // admin dashboard css ends here -// customer oder css for admin start here +// admin dashboard component +.dashboard-card { + height: 100px; + width: 22%; + background: #FFFFFF; + border: 1px solid #E7E7E7; + box-shadow: 0 5px 10px 2px rgba(0,0,0,0.08); + border-radius: 5px; -.order-place-detail { + .visitor-content { + padding: 15px; - .order-account-information { - margin-left: 10px; - } + .title { + + span { + padding-top:10px; + font-size: 14px; + color: #A2A2A2; + letter-spacing: -0.26px; + } + } + + .data { + padding-top: 3px; + + span { + font-size: 32px; + color: #0041FF; + letter-spacing: -0.6px; - .address { - margin-left: 10px; - } + img { + margin-left: 75px; + height: 24px; + width:24px; + } + } - .payment-shipping{ - margin-left: 10px; - } - - .order-products{ - margin-left: 10px; + span.right { + padding-top: 12px; + float: right; + font-size: 14px; + color: #8E8E8E; + letter-spacing: -0.7px; + } + } } } +.dashboard-card:nth-last-child(1) { + margin-left: 30px; +} + +.dashboard-card:nth-last-child(2) { + margin-left: 30px; +} + +.dashboard-card:nth-last-child(3) { + margin-left: 30px; +} + + +.dashboard-graph { + height: 413px; + width: 70.5%; + background: #FFFFFF; + border: 1px solid #E7E7E7; + box-shadow: 0 5px 10px 2px rgba(0,0,0,0.08); + border-radius: 2px; +} -// customer oder css for admin end here +.sale { + height: 465px; + width: 30.1%; + background: #FFFFFF; + border: 1px solid #E7E7E7; + box-shadow: 0 5px 10px 2px rgba(0,0,0,0.08); + border-radius: 2px; + + .top-sale { + margin-left: 20px; + margin-top: 27px; + + .title { + + span { + font-size: 14px; + color: #A2A2A2; + letter-spacing: -0.26px; + } + } + + .sale-info { + + ul { + + li { + + .pro-attribute{ + display: flex; + margin-top: 10px; + + .pro-img { + height: 60px; + width: 60px; + border: 1px solid green; + } + + .product-description { + margin-left: 15px; + margin-top: 8px; + width: 75%; + + .product-name { + + span { + font-size: 14px; + color: #0041FF; + letter-spacing: -0.26px; + } + + .right-side { + float: right; + margin-top: 10px; + height: 20px; + width: 20px; + } + } + + .product-info { + + span { + font-size: 14px; + color: #3A3A3A; + letter-spacing: -0.26px; + } + } + } + } + + .horizontal-rule { + border: .5px solid #A2A2A2; + opacity: 0.2; + margin-top: 10px; + } + } + + li:last-child { + .horizontal-rule { + display: none; + } + } + } + } + } +} + +.sale:nth-last-child(1) { + margin-left: 31px; +} + +.sale:nth-last-child(2) { + margin-left: 31px; +} +// admin dashboard css ends here + +.performing-category { + height: 413px; + width: 22%; + margin-left: 30px; + background: #FFFFFF; + border: 1px solid #E7E7E7; + box-shadow: 0 5px 10px 2px rgba(0,0,0,0.08); + border-radius: 2px; + + .category { + margin-left: 20px; + margin-top: 20px; + + .title { + + span { + font-size: 14px; + color: #A2A2A2; + letter-spacing: -0.26px; + } + } + + .category-info { + margin-top: 30px; + + + ul { + + li { + + .category-list { + margin-top: 10px; + + .cat-name { + + span { + font-size: 16px; + color: #0041FF; + letter-spacing: -0.3px; + + } + + .right-side { + float: right; + margin-right: 12px; + margin-top: 10px; + height: 20px; + width: 20px; + } + } + + .product-info { + margin-top: 5px; + + span { + font-size: 16px; + color: #3A3A3A; + letter-spacing: -0.3px; + } + } + + .horizon-rule { + margin-top: 8px; + border: .7px solid #D8D8D8; + } + } + } + + li:last-child { + + .category-list { + .horizon-rule { + display: none; + } + } + } + } + } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + +// customer oder css for admin start here +.sale-container { + .sale-section { + font-size: 16px; + + .secton-title { + font-size: 18px; + color: #8E8E8E; + padding: 15px 0; + border-bottom: 1px solid $border-color; + } + + .section-content { + display: block; + padding: 20px 0; + + .row { + display: block; + padding: 7px 0; + + .title { + width: 200px; + color: $font-color; + letter-spacing: -0.26px; + display: inline-block; + } + + .value { + color: $font-color; + letter-spacing: -0.26px; + display: inline-block; + } + } + } + } + + .sale-summary { + margin-top: 2%; + height: 130px; + float: right; + + tr { + + td { + padding: 3px 8px; + } + + &.bold { + font-weight: 600; + } + } + } +} +// customer oder css for admin end here \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index 37eafd1c0..6e037f9a3 100644 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -1,6 +1,9 @@ [ + 'no-result-found' => 'We couldn\'t find any records.' + ], 'account' => [ 'header-title' => 'My Account', 'save-btn-title' => 'Save', @@ -64,6 +67,81 @@ return [ 'submit-btn-title' => 'Sign In' ] ], + 'sales' => [ + 'orders' => [ + 'title' => 'Orders', + 'view-title' => 'Order #:order_id', + 'shipment-btn-title' => 'Ship', + 'invoice-btn-title' => 'Invoice', + 'info' => 'Information', + 'invoices' => 'Invoices', + 'shipments' => 'Shipments', + 'order-and-account' => 'Order and Account', + 'order-info' => 'Order Information', + 'order-date' => 'Order Date', + 'order-status' => 'Order Status', + 'channel' => 'Channel', + 'customer-name' => 'Customer Name', + 'email' => 'Email', + 'contact-number' => 'Contact Number', + 'account-info' => 'Account Information', + 'address' => 'Address', + 'shipping-address' => 'Shipping Address', + 'billing-address' => 'Billing Address', + 'payment-and-shipping' => 'Payment and Shipping', + 'payment-info' => 'Payment Information', + 'payment-method' => 'Payment Method', + 'currency' => 'Currency', + 'shipping-info' => 'Shipping Information', + 'shipping-method' => 'Shipping Method', + 'shipping-price' => 'Shipping Price', + 'products-ordered' => 'Products Ordered', + 'SKU' => 'SKU', + 'product-name' => 'Product Name', + 'qty' => 'Qty', + 'item-status' => 'Item Status', + 'price' => 'Price', + 'total' => 'Total', + 'subtotal' => 'Subtotal', + 'shipping-handling' => 'Shipping & Handling', + 'tax' => 'Tax', + 'tax-percent' => 'Tax Percent', + 'tax-amount' => 'Tax Amount', + 'discount-amount' => 'Discount Amount', + 'grand-total' => 'Grand Total' + ], + 'invoices' => [ + 'id' => 'Id', + 'date' => 'Invoice Date', + 'order-id' => 'Order Id', + 'customer-name' => 'Customer Name', + 'status' => 'Status', + 'amount' => 'Amount', + 'action' => 'Action', + 'add-title' => 'Create Invoice', + 'save-btn-title' => 'Save Invoice', + 'qty' => 'Qty', + 'qty-ordered' => 'Qty Ordered', + 'qty-to-invoice' => 'Qty to Invoice', + 'view-title' => 'Invoice #:invoice_id', + ], + 'shipments' => [ + 'id' => 'Id', + 'date' => 'Shipment Date', + 'order-id' => 'Order Id', + 'order-date' => 'Order date', + 'customer-name' => 'Customer Name', + 'total-qty' => 'Total Qty', + 'action' => 'Action', + 'add-title' => 'Create Shipment', + 'save-btn-title' => 'Save Shipment', + 'qty-ordered' => 'Qty Ordered', + 'qty-to-ship' => 'Qty to Ship', + 'carrier-title' => 'Carrier Title', + 'tracking-number' => 'Tracking Number', + 'view-title' => 'Shipment #:shipment_id', + ] + ], 'catalog' => [ 'products' => [ 'products' => 'Products', diff --git a/packages/Webkul/Admin/src/Resources/views/customers/orders/index.blade.php b/packages/Webkul/Admin/src/Resources/views/customers/orders/index.blade.php deleted file mode 100644 index 9dd651cf4..000000000 --- a/packages/Webkul/Admin/src/Resources/views/customers/orders/index.blade.php +++ /dev/null @@ -1,25 +0,0 @@ -@extends('admin::layouts.content') - -@section('page_title') - -@stop - -@section('content') - -
- - -
-
-
- -@stop diff --git a/packages/Webkul/Admin/src/Resources/views/customers/orders/order.blade.php b/packages/Webkul/Admin/src/Resources/views/customers/orders/order.blade.php deleted file mode 100644 index da1b1081e..000000000 --- a/packages/Webkul/Admin/src/Resources/views/customers/orders/order.blade.php +++ /dev/null @@ -1,353 +0,0 @@ - -@extends('admin::layouts.master') - -@section('content-wrapper') - - -
- -
- -
- -
-
- Order Information - - Edit - -
-
- - - - - - -
- - - -
-
-
- -
- - - -
- -
-
- Shipping Address - - Edit - -
-
-
- 0933 Crossing Suite 12B - Dallas , Texas - United States - 75001 -
-
- -
-
- Billing Address - - Edit - -
-
-
- 0933 Crossing Suite 12B - Dallas , Texas - United States - 75001 -
-
- -
- -
- -
- -
- -
- -
-
- Payment Information -
-
- -
-
- - Payment Method - -
-
- - Bank Wire Transfer - -
-
- -
-
- - Currency - -
-
- - US Dollar - -
-
- -
- -
-
- Shipping Information -
-
- -
-
- - Shipping Method - -
-
- - Flat Rate-Fixed-$10.00 - -
-
- -
-
- - Expected Delivery - -
-
- - 3 Days - -
-
- -
- - -
-
-
- -
- - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SKUProduct NameItem StatusPriceQtyRow total
PROD124Apple iPhone 7- White-32GBPacked (2)$350.002$700.00
PROD128Blue Linen T-Shirt for Men- Small- RedShipped (2)$45.002$35.00
-
- -
- -
- -
- - Subtotal - - - - - - - $805.00 - -
- -
- - Shipping & handling - - - - - - - $5.00 - -
- -
- - Discounts - - - - - - - $15.00 - -
- -
- - Grand Total - - - - - - - $15.00 - -
- -
- - Total Due - - - - - - - $15.00 - -
- -
- -
- -
-
- -
-
- -@stop - - - diff --git a/packages/Webkul/Admin/src/Resources/views/sales/address.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/address.blade.php new file mode 100644 index 000000000..845fd9e6e --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/sales/address.blade.php @@ -0,0 +1,4 @@ +{{ $address->name }}
+{{ $address->address1 }}, {{ $address->address2 ? $address->address2 . ',' : '' }} {{ $address->state }}
+{{ country()->name($address->country) }} {{ $address->postcode }}
+{{ __('shop::app.checkout.onepage.contact') }} : {{ $address->phone }} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/sales/invoices/create.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/invoices/create.blade.php new file mode 100644 index 000000000..7c68bba07 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/sales/invoices/create.blade.php @@ -0,0 +1,250 @@ +@extends('admin::layouts.master') + +@section('page_title') + {{ __('admin::app.sales.invoices.add-title') }} +@stop + +@section('content-wrapper') +
+
+ @csrf() + + + +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.order-info') }} +
+ +
+
+ + {{ __('admin::app.sales.invoices.order-id') }} + + + + #{{ $order->id }} + +
+ +
+ + {{ __('admin::app.sales.orders.order-date') }} + + + + {{ $order->created_at }} + +
+ +
+ + {{ __('admin::app.sales.orders.order-status') }} + + + + {{ $order->status_label }} + +
+ +
+ + {{ __('admin::app.sales.orders.channel') }} + + + + {{ $order->channel_name }} + +
+
+
+ +
+
+ {{ __('admin::app.sales.orders.account-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.customer-name') }} + + + + {{ $order->customer_full_name }} + +
+ +
+ + {{ __('admin::app.sales.orders.email') }} + + + + {{ $order->customer_email }} + +
+
+
+ +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.billing-address') }} +
+ +
+ + @include ('admin::sales.address', ['address' => $order->billing_address]) + +
+
+ + @if($order->shipping_address) +
+
+ {{ __('admin::app.sales.orders.shipping-address') }} +
+ +
+ + @include ('admin::sales.address', ['address' => $order->shipping_address]) + +
+
+ @endif + +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.payment-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.payment-method') }} + + + + {{ core()->getConfigData('paymentmethods.' . $order->payment->method . '.title') }} + +
+ +
+ + {{ __('admin::app.sales.orders.currency') }} + + + + {{ $order->order_currency_code }} + +
+
+
+ +
+
+ {{ __('admin::app.sales.orders.shipping-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.shipping-method') }} + + + + {{ $order->shipping_title }} + +
+ +
+ + {{ __('admin::app.sales.orders.shipping-price') }} + + + + {{ core()->formatBasePrice($order->base_shipping_amount) }} + +
+
+
+
+
+ + +
+ +
+ + + + + + + + + + + + + @foreach ($order->items as $item) + @if ($item->qty_to_invoice > 0) + + + + + + + @endif + @endforeach + + +
{{ __('admin::app.sales.orders.SKU') }}{{ __('admin::app.sales.orders.product-name') }}{{ __('admin::app.sales.invoices.qty-ordered') }}{{ __('admin::app.sales.invoices.qty-to-invoice') }}
{{ $item->type == 'configurable' ? $item->child->sku : $item->sku }}{{ $item->name }}{{ $item->qty_ordered }} +
+ + + + @verbatim + {{ errors.first('invoice[items][id ?>]') }} + @endverbatim + +
+
+
+ +
+
+ +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/sales/invoices/view.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/invoices/view.blade.php new file mode 100644 index 000000000..c1e9d5abe --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/sales/invoices/view.blade.php @@ -0,0 +1,266 @@ +@extends('admin::layouts.master') + +@section('page_title') + {{ __('admin::app.sales.invoices.view-title', ['invoice_id' => $invoice->id]) }} +@stop + +@section('content-wrapper') + order; ?> + +
+ + +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.order-info') }} +
+ +
+
+ + {{ __('admin::app.sales.invoices.order-id') }} + + + + #{{ $order->id }} + +
+ +
+ + {{ __('admin::app.sales.orders.order-date') }} + + + + {{ $order->created_at }} + +
+ +
+ + {{ __('admin::app.sales.orders.order-status') }} + + + + {{ $order->status_label }} + +
+ +
+ + {{ __('admin::app.sales.orders.channel') }} + + + + {{ $order->channel_name }} + +
+
+
+ +
+
+ {{ __('admin::app.sales.orders.account-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.customer-name') }} + + + + {{ $invoice->address->name }} + +
+ +
+ + {{ __('admin::app.sales.orders.email') }} + + + + {{ $invoice->address->email }} + +
+
+
+ +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.billing-address') }} +
+ +
+ + @include ('admin::sales.address', ['address' => $order->billing_address]) + +
+
+ + @if($order->shipping_address) +
+
+ {{ __('admin::app.sales.orders.shipping-address') }} +
+ +
+ + @include ('admin::sales.address', ['address' => $order->shipping_address]) + +
+
+ @endif + +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.payment-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.payment-method') }} + + + + {{ core()->getConfigData('paymentmethods.' . $order->payment->method . '.title') }} + +
+ +
+ + {{ __('admin::app.sales.orders.currency') }} + + + + {{ $order->order_currency_code }} + +
+
+
+ +
+
+ {{ __('admin::app.sales.orders.shipping-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.shipping-method') }} + + + + {{ $order->shipping_title }} + +
+ +
+ + {{ __('admin::app.sales.orders.shipping-price') }} + + + + {{ core()->formatBasePrice($order->base_shipping_amount) }} + +
+
+
+
+
+ + +
+ +
+ + + + + + + + + + + + + + + + @foreach ($invoice->items as $item) + + + + + + + + + + @endforeach + + +
{{ __('admin::app.sales.orders.SKU') }}{{ __('admin::app.sales.orders.product-name') }}{{ __('admin::app.sales.orders.price') }}{{ __('admin::app.sales.orders.qty') }}{{ __('admin::app.sales.orders.subtotal') }}{{ __('admin::app.sales.orders.tax-amount') }}{{ __('admin::app.sales.orders.grand-total') }}
{{ $item->child ? $item->child->sku : $item->sku }}{{ $item->name }}{{ core()->formatBasePrice($item->base_price) }}{{ $item->qty }}{{ core()->formatBasePrice($item->base_total) }}{{ core()->formatBasePrice($item->base_tax_amount) }}{{ core()->formatBasePrice($item->base_total + $item->base_tax_amount) }}
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{{ __('admin::app.sales.orders.subtotal') }}-{{ core()->formatBasePrice($invoice->base_sub_total) }}
{{ __('admin::app.sales.orders.shipping-handling') }}-{{ core()->formatBasePrice($invoice->base_shipping_amount) }}
{{ __('admin::app.sales.orders.tax') }}-{{ core()->formatBasePrice($invoice->base_tax_amount) }}
{{ __('admin::app.sales.orders.grand-total') }}-{{ core()->formatBasePrice($invoice->base_grand_total) }}
+ +
+
+ +
+
+ +
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/sales/orders/index.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/orders/index.blade.php new file mode 100644 index 000000000..77b45387e --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/sales/orders/index.blade.php @@ -0,0 +1,22 @@ +@extends('admin::layouts.master') + +@section('page_title') + {{ __('admin::app.sales.orders.title') }} +@stop + +@section('content-wrapper') +
+ + +
+ +
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/sales/orders/view.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/orders/view.blade.php new file mode 100644 index 000000000..5ae99d096 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/sales/orders/view.blade.php @@ -0,0 +1,365 @@ +@extends('admin::layouts.master') + +@section('page_title') + {{ __('admin::app.sales.orders.view-title', ['order_id' => $order->id]) }} +@stop + +@section('content-wrapper') + +
+ + + +
+ + + +
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.order-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.order-date') }} + + + + {{ $order->created_at }} + +
+ +
+ + {{ __('admin::app.sales.orders.order-status') }} + + + + {{ $order->status_label }} + +
+ +
+ + {{ __('admin::app.sales.orders.channel') }} + + + + {{ $order->channel_name }} + +
+
+
+ +
+
+ {{ __('admin::app.sales.orders.account-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.customer-name') }} + + + + {{ $order->customer_full_name }} + +
+ +
+ + {{ __('admin::app.sales.orders.email') }} + + + + {{ $order->customer_email }} + +
+
+
+ +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.billing-address') }} +
+ +
+ + @include ('admin::sales.address', ['address' => $order->billing_address]) + +
+
+ + @if($order->shipping_address) +
+
+ {{ __('admin::app.sales.orders.shipping-address') }} +
+ +
+ + @include ('admin::sales.address', ['address' => $order->shipping_address]) + +
+
+ @endif + +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.payment-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.payment-method') }} + + + + {{ core()->getConfigData('paymentmethods.' . $order->payment->method . '.title') }} + +
+ +
+ + {{ __('admin::app.sales.orders.currency') }} + + + + {{ $order->order_currency_code }} + +
+
+
+ +
+
+ {{ __('admin::app.sales.orders.shipping-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.shipping-method') }} + + + + {{ $order->shipping_title }} + +
+ +
+ + {{ __('admin::app.sales.orders.shipping-price') }} + + + + {{ core()->formatBasePrice($order->base_shipping_amount) }} + +
+
+
+
+
+ + +
+ +
+ + + + + + + + + + + + + + + + + + @foreach ($order->items as $item) + + + + + + + + + + + + @endforeach +
{{ __('admin::app.sales.orders.SKU') }}{{ __('admin::app.sales.orders.product-name') }}{{ __('admin::app.sales.orders.price') }}{{ __('admin::app.sales.orders.qty') }}{{ __('admin::app.sales.orders.item-status') }}{{ __('admin::app.sales.orders.subtotal') }}{{ __('admin::app.sales.orders.tax-percent') }}{{ __('admin::app.sales.orders.tax-amount') }}{{ __('admin::app.sales.orders.grand-total') }}
+ {{ $item->type == 'configurable' ? $item->child->sku : $item->sku }} + {{ $item->name }}{{ core()->formatBasePrice($item->base_price) }}{{ $item->qty_ordered }}Packed (2){{ core()->formatBasePrice($item->base_total) }}{{ $item->tax_percent }}%{{ core()->formatBasePrice($item->base_tax_amount) }}{{ core()->formatBasePrice($item->base_total + $item->base_tax_amount) }}
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{{ __('admin::app.sales.orders.subtotal') }}-{{ core()->formatBasePrice($order->base_sub_total) }}
{{ __('admin::app.sales.orders.shipping-handling') }}-{{ core()->formatBasePrice($order->base_shipping_amount) }}
{{ __('admin::app.sales.orders.tax') }}-{{ core()->formatBasePrice($order->base_tax_amount) }}
{{ __('admin::app.sales.orders.grand-total') }}-{{ core()->formatBasePrice($order->base_grand_total) }}
+ +
+
+ +
+
+ + + +
+ + + + + + + + + + + + + + + + @foreach ($order->invoices as $invoice) + + + + + + + + + + @endforeach + + @if (!$order->invoices->count()) + + + + @endif +
{{ __('admin::app.sales.invoices.id') }}{{ __('admin::app.sales.invoices.date') }}{{ __('admin::app.sales.invoices.order-id') }}{{ __('admin::app.sales.invoices.customer-name') }}{{ __('admin::app.sales.invoices.status') }}{{ __('admin::app.sales.invoices.amount') }}{{ __('admin::app.sales.invoices.action') }}
#{{ $invoice->id }}{{ $invoice->created_at }}#{{ $invoice->order->id }}{{ $invoice->address->name }}{{ $invoice->status_label }}{{ core()->formatBasePrice($invoice->base_grand_total) }} + + + +
{{ __('admin::app.common.no-result-found') }}
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + @foreach ($order->shipments as $shipment) + + + + + + + + + + @endforeach + + @if (!$order->shipments->count()) + + + + @endif +
{{ __('admin::app.sales.shipments.id') }}{{ __('admin::app.sales.shipments.date') }}{{ __('admin::app.sales.shipments.order-id') }}{{ __('admin::app.sales.shipments.order-date') }}{{ __('admin::app.sales.shipments.customer-name') }}{{ __('admin::app.sales.shipments.total-qty') }}{{ __('admin::app.sales.shipments.action') }}
#{{ $shipment->id }}{{ $shipment->created_at }}#{{ $shipment->order->id }}{{ $shipment->order->created_at }}{{ $shipment->address->name }}{{ $shipment->total_qty }} + + + +
{{ __('admin::app.common.no-result-found') }}
+
+ +
+
+
+ +
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/sales/shipments/create.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/shipments/create.blade.php new file mode 100644 index 000000000..481384e26 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/sales/shipments/create.blade.php @@ -0,0 +1,266 @@ +@extends('admin::layouts.master') + +@section('page_title') + {{ __('admin::app.sales.shipments.add-title') }} +@stop + +@section('content-wrapper') +
+
+ @csrf() + + + +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.order-info') }} +
+ +
+
+ + {{ __('admin::app.sales.shipments.order-id') }} + + + + #{{ $order->id }} + +
+ +
+ + {{ __('admin::app.sales.orders.order-date') }} + + + + {{ $order->created_at }} + +
+ +
+ + {{ __('admin::app.sales.orders.order-status') }} + + + + {{ $order->status_label }} + +
+ +
+ + {{ __('admin::app.sales.orders.channel') }} + + + + {{ $order->channel_name }} + +
+
+
+ +
+
+ {{ __('admin::app.sales.orders.account-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.customer-name') }} + + + + {{ $order->customer_full_name }} + +
+ +
+ + {{ __('admin::app.sales.orders.email') }} + + + + {{ $order->customer_email }} + +
+
+
+ +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.billing-address') }} +
+ +
+ + @include ('admin::sales.address', ['address' => $order->billing_address]) + +
+
+ + @if($order->shipping_address) +
+
+ {{ __('admin::app.sales.orders.shipping-address') }} +
+ +
+ + @include ('admin::sales.address', ['address' => $order->shipping_address]) + +
+
+ @endif + +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.payment-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.payment-method') }} + + + + {{ core()->getConfigData('paymentmethods.' . $order->payment->method . '.title') }} + +
+ +
+ + {{ __('admin::app.sales.orders.currency') }} + + + + {{ $order->order_currency_code }} + +
+
+
+ +
+
+ {{ __('admin::app.sales.orders.shipping-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.shipping-method') }} + + + + {{ $order->shipping_title }} + +
+ +
+ + {{ __('admin::app.sales.orders.shipping-price') }} + + + + {{ core()->formatBasePrice($order->base_shipping_amount) }} + +
+ +
+ + + + @{{ errors.first('shipment[carrier_title]') }} + +
+ +
+ + + + @{{ errors.first('shipment[track_number]') }} + +
+
+
+
+
+ + +
+ +
+ + + + + + + + + + + + + @foreach ($order->items as $item) + @if ($item->qty_to_ship > 0) + + + + + + + @endif + @endforeach + + +
{{ __('admin::app.sales.orders.SKU') }}{{ __('admin::app.sales.orders.product-name') }}{{ __('admin::app.sales.shipments.qty-ordered') }}{{ __('admin::app.sales.shipments.qty-to-ship') }}
{{ $item->type == 'configurable' ? $item->child->sku : $item->sku }}{{ $item->name }}{{ $item->qty_ordered }} +
+ + + + @verbatim + {{ errors.first('shipment[items][id ?>]') }} + @endverbatim + +
+
+
+ +
+
+ +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/sales/shipments/view.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/shipments/view.blade.php new file mode 100644 index 000000000..fd8c5ae50 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/sales/shipments/view.blade.php @@ -0,0 +1,251 @@ +@extends('admin::layouts.master') + +@section('page_title') + {{ __('admin::app.sales.shipments.view-title', ['shipment_id' => $shipment->id]) }} +@stop + +@section('content-wrapper') + order; ?> + +
+ + +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.order-info') }} +
+ +
+
+ + {{ __('admin::app.sales.shipments.order-id') }} + + + + #{{ $order->id }} + +
+ +
+ + {{ __('admin::app.sales.orders.order-date') }} + + + + {{ $order->created_at }} + +
+ +
+ + {{ __('admin::app.sales.orders.order-status') }} + + + + {{ $order->status_label }} + +
+ +
+ + {{ __('admin::app.sales.orders.channel') }} + + + + {{ $order->channel_name }} + +
+
+
+ +
+
+ {{ __('admin::app.sales.orders.account-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.customer-name') }} + + + + {{ $shipment->address->name }} + +
+ +
+ + {{ __('admin::app.sales.orders.email') }} + + + + {{ $shipment->address->email }} + +
+
+
+ +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.billing-address') }} +
+ +
+ + @include ('admin::sales.address', ['address' => $order->billing_address]) + +
+
+ + @if($order->shipping_address) +
+
+ {{ __('admin::app.sales.orders.shipping-address') }} +
+ +
+ + @include ('admin::sales.address', ['address' => $order->shipping_address]) + +
+
+ @endif + +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.payment-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.payment-method') }} + + + + {{ core()->getConfigData('paymentmethods.' . $order->payment->method . '.title') }} + +
+ +
+ + {{ __('admin::app.sales.orders.currency') }} + + + + {{ $order->order_currency_code }} + +
+
+
+ +
+
+ {{ __('admin::app.sales.orders.shipping-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.shipping-method') }} + + + + {{ $order->shipping_title }} + +
+ +
+ + {{ __('admin::app.sales.orders.shipping-price') }} + + + + {{ core()->formatBasePrice($order->base_shipping_amount) }} + +
+ +
+ + {{ __('admin::app.sales.shipments.carrier-title') }} + + + + {{ $shipment->carrier_title }} + +
+ +
+ + {{ __('admin::app.sales.shipments.tracking-number') }} + + + + {{ $shipment->track_number }} + +
+
+
+
+
+ + +
+ +
+ + + + + + + + + + + + @foreach ($shipment->items as $item) + + + + + + @endforeach + + +
{{ __('admin::app.sales.orders.SKU') }}{{ __('admin::app.sales.orders.product-name') }}{{ __('admin::app.sales.orders.qty') }}
{{ $item->sku }}{{ $item->name }}{{ $item->qty }}
+
+ +
+
+ +
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Checkout/src/Cart.php b/packages/Webkul/Checkout/src/Cart.php index 1a60ef414..f6a95a0e1 100644 --- a/packages/Webkul/Checkout/src/Cart.php +++ b/packages/Webkul/Checkout/src/Cart.php @@ -633,17 +633,22 @@ class Cart { $cart->grand_total = 0; $cart->base_grand_total = 0; + $cart->sub_total = 0; $cart->base_sub_total = 0; - $cart->sub_total_with_discount = 0; - $cart->base_sub_total_with_discount = 0; + + $cart->tax_total = 0; + $cart->base_tax_total = 0; foreach ($cart->items()->get() as $item) { $cart->grand_total = (float) $cart->grand_total + $item->total; $cart->base_grand_total = (float) $cart->base_grand_total + $item->base_total; - $cart->sub_total = (float) $cart->sub_total + $item->price * $item->quantity; - $cart->base_sub_total = (float) $cart->base_sub_total + $item->base_price * $item->quantity; + $cart->sub_total = (float) $cart->sub_total + $item->total; + $cart->base_sub_total = (float) $cart->base_sub_total + $item->base_total; + + $cart->tax_total = (float) $cart->tax_total + $item->tax_amount; + $cart->base_tax_total = (float) $cart->base_tax_total + $item->base_tax_amount; } if($shipping = $cart->selected_shipping_rate) { @@ -882,6 +887,7 @@ class Cart { 'customer' => auth()->guard('customer')->check() ? auth()->guard('customer')->user : null, 'shipping_method' => $data['selected_shipping_rate']['method'], + 'shipping_title' => $data['selected_shipping_rate']['carrier_title'] . ' - ' . $data['selected_shipping_rate']['method_title'], 'shipping_description' => $data['selected_shipping_rate']['method_description'], 'shipping_amount' => $data['selected_shipping_rate']['price'], 'base_shipping_amount' => $data['selected_shipping_rate']['base_price'], @@ -895,10 +901,14 @@ class Cart { 'base_grand_total' => $data['base_grand_total'], 'sub_total' => $data['sub_total'], 'base_sub_total' => $data['base_sub_total'], + 'tax_amount' => $data['tax_total'], + 'base_tax_amount' => $data['base_tax_total'], 'shipping_address' => array_except($data['shipping_address'], ['id', 'cart_id']), 'billing_address' => array_except($data['billing_address'], ['id', 'cart_id']), 'payment' => array_except($data['payment'], ['id', 'cart_id']), + + 'channel' => core()->getCurrentChannel(), ]; foreach($data['items'] as $item) { @@ -927,6 +937,9 @@ class Cart { 'base_price' => $data['base_price'], 'total' => $data['total'], 'base_total' => $data['base_total'], + 'tax_percent' => $data['tax_percent'], + 'tax_amount' => $data['tax_amount'], + 'base_tax_amount' => $data['base_tax_amount'], 'additional' => $data['additional'], ]; diff --git a/packages/Webkul/Checkout/src/Database/Migrations/2018_09_05_150444_create_cart_table.php b/packages/Webkul/Checkout/src/Database/Migrations/2018_09_05_150444_create_cart_table.php index be526e01e..dfe93a40a 100644 --- a/packages/Webkul/Checkout/src/Database/Migrations/2018_09_05_150444_create_cart_table.php +++ b/packages/Webkul/Checkout/src/Database/Migrations/2018_09_05_150444_create_cart_table.php @@ -26,16 +26,24 @@ class CreateCartTable extends Migration $table->integer('items_count')->nullable(); $table->decimal('items_qty', 12, 4)->nullable(); $table->decimal('exchange_rate', 12, 4)->nullable(); + $table->string('global_currency_code')->nullable(); $table->string('base_currency_code')->nullable(); $table->string('channel_currency_code')->nullable(); $table->string('cart_currency_code')->nullable(); + $table->decimal('grand_total', 12, 4)->default(0)->nullable(); $table->decimal('base_grand_total', 12, 4)->default(0)->nullable(); + $table->decimal('sub_total', 12, 4)->default(0)->nullable(); $table->decimal('base_sub_total', 12, 4)->default(0)->nullable(); + + $table->decimal('tax_total', 12, 4)->default(0)->nullable(); + $table->decimal('base_tax_total', 12, 4)->default(0)->nullable(); + $table->decimal('sub_total_with_discount', 12, 4)->default(0)->nullable(); $table->decimal('base_sub_total_with_discount', 12, 4)->default(0)->nullable(); + $table->string('checkout_method')->nullable(); $table->boolean('is_guest')->nullable(); $table->boolean('is_active')->nullable()->default(1); diff --git a/packages/Webkul/Checkout/src/Database/Migrations/2018_09_05_150915_create_cart_items_table.php b/packages/Webkul/Checkout/src/Database/Migrations/2018_09_05_150915_create_cart_items_table.php index 0c106ef06..897b98c4a 100644 --- a/packages/Webkul/Checkout/src/Database/Migrations/2018_09_05_150915_create_cart_items_table.php +++ b/packages/Webkul/Checkout/src/Database/Migrations/2018_09_05_150915_create_cart_items_table.php @@ -15,34 +15,44 @@ class CreateCartItemsTable extends Migration { Schema::create('cart_items', function (Blueprint $table) { $table->increments('id'); - $table->integer('product_id')->unsigned(); - $table->foreign('product_id')->references('id')->on('products'); $table->integer('quantity')->unsigned()->default(1); - $table->integer('cart_id')->unsigned(); - $table->foreign('cart_id')->references('id')->on('cart')->onDelete('cascade'); $table->string('sku')->nullable(); $table->string('type')->nullable(); $table->string('name')->nullable(); $table->integer('parent_id')->unsigned()->nullable(); - $table->integer('tax_category_id')->unsigned()->nullable(); - $table->foreign('tax_category_id')->references('id')->on('tax_categories'); $table->string('coupon_code')->nullable(); $table->decimal('weight', 12,4)->default(1); $table->decimal('total_weight', 12,4)->default(0); $table->decimal('base_total_weight', 12,4)->default(0); + $table->decimal('price', 12,4)->default(1); $table->decimal('base_price', 12,4)->default(0); $table->decimal('custom_price', 12,4)->default(0); + $table->decimal('total', 12,4)->default(0); $table->decimal('base_total', 12,4)->default(0); + + $table->decimal('tax_percent', 12, 4)->default(0)->nullable(); + $table->decimal('tax_amount', 12, 4)->default(0)->nullable(); + $table->decimal('base_tax_amount', 12, 4)->default(0)->nullable(); + $table->decimal('total_with_discount', 12,4)->default(0); $table->decimal('base_total_with_discount', 12,4)->default(0); + $table->decimal('discount_percent', 12,4)->default(0); $table->decimal('discount_amount', 12,4)->default(0); $table->decimal('base_discount_amount', 12,4)->default(0); $table->boolean('no_discount')->nullable()->default(0); + $table->boolean('free_shipping')->nullable()->default(0); $table->json('additional')->nullable(); + + $table->integer('product_id')->unsigned(); + $table->foreign('product_id')->references('id')->on('products'); + $table->integer('cart_id')->unsigned(); + $table->foreign('cart_id')->references('id')->on('cart')->onDelete('cascade'); + $table->integer('tax_category_id')->unsigned()->nullable(); + $table->foreign('tax_category_id')->references('id')->on('tax_categories'); $table->timestamps(); }); diff --git a/packages/Webkul/Core/src/Core.php b/packages/Webkul/Core/src/Core.php index fe9cfb457..716f842df 100644 --- a/packages/Webkul/Core/src/Core.php +++ b/packages/Webkul/Core/src/Core.php @@ -249,6 +249,9 @@ class Core */ public function currency($amount = 0) { + if(is_null($amount)) + $price = 0; + $currencyCode = $this->getCurrentCurrency()->code; return currency($this->convertPrice($amount), $currencyCode); @@ -262,9 +265,26 @@ class Core */ public function formatPrice($price, $currencyCode) { + if(is_null($price)) + $price = 0; + return currency($price, $currencyCode); } + /** + * Format price with base currency symbol + * + * @param float $price + * @return string + */ + public function formatBasePrice($price) + { + if(is_null($price)) + $price = 0; + + return currency($price, $this->getBaseCurrencyCode()); + } + /** * Checks if current date of the given channel (in the channel timezone) is within the range * diff --git a/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_113154_create_orders_table.php b/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_113154_create_orders_table.php index add5ecc37..cf473522b 100644 --- a/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_113154_create_orders_table.php +++ b/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_113154_create_orders_table.php @@ -17,6 +17,7 @@ class CreateOrdersTable extends Migration $table->increments('id'); $table->string('increment_id'); $table->string('status')->nullable(); + $table->string('channel_name')->nullable(); $table->boolean('is_guest')->nullable(); $table->string('customer_email')->nullable(); @@ -24,6 +25,7 @@ class CreateOrdersTable extends Migration $table->string('customer_last_name')->nullable(); $table->string('shipping_method')->nullable(); + $table->string('shipping_title')->nullable(); $table->string('shipping_description')->nullable(); $table->string('coupon_code')->nullable(); $table->boolean('is_gift')->default(0); diff --git a/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_115029_create_shipment_items_table.php b/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_115029_create_shipment_items_table.php index 2d92a3802..20f8e3f54 100644 --- a/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_115029_create_shipment_items_table.php +++ b/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_115029_create_shipment_items_table.php @@ -23,6 +23,7 @@ class CreateShipmentItemsTable extends Migration $table->decimal('price', 12, 4)->default(0)->nullable(); $table->decimal('base_price', 12, 4)->default(0)->nullable(); + $table->decimal('total', 12, 4)->default(0)->nullable(); $table->decimal('base_total', 12, 4)->default(0)->nullable(); $table->integer('product_id')->unsigned()->nullable(); @@ -30,9 +31,6 @@ class CreateShipmentItemsTable extends Migration $table->integer('order_item_id')->unsigned()->nullable(); $table->integer('shipment_id')->unsigned(); $table->foreign('shipment_id')->references('id')->on('shipments')->onDelete('cascade'); - $table->integer('parent_id')->unsigned()->nullable(); - $table->foreign('parent_id')->references('id')->on('shipment_items')->onDelete('cascade'); - $table->json('additional')->nullable(); $table->timestamps(); }); diff --git a/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_115135_create_invoices_table.php b/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_115135_create_invoices_table.php index 8499953d8..2d98c577b 100644 --- a/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_115135_create_invoices_table.php +++ b/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_115135_create_invoices_table.php @@ -15,16 +15,11 @@ class CreateInvoicesTable extends Migration { Schema::create('invoices', function (Blueprint $table) { $table->increments('id'); - $table->string('increment_id'); + $table->string('increment_id')->nullable(); $table->string('state')->nullable(); $table->boolean('email_sent')->default(0); - $table->string('shipping_method')->nullable(); - $table->string('shipping_description')->nullable(); - $table->string('coupon_code')->nullable(); - $table->boolean('is_gift')->default(0); - $table->integer('total_item_count')->nullable(); - $table->integer('total_qty_ordered')->nullable(); + $table->integer('total_qty')->nullable(); $table->string('base_currency_code')->nullable(); $table->string('channel_currency_code')->nullable(); @@ -45,11 +40,8 @@ class CreateInvoicesTable extends Migration $table->decimal('discount_amount', 12, 4)->default(0)->nullable(); $table->decimal('base_discount_amount', 12, 4)->default(0)->nullable(); - $table->integer('customer_id')->unsigned()->nullable(); - $table->string('customer_type')->nullable(); - $table->integer('channel_id')->unsigned()->nullable(); - $table->string('channel_type')->nullable(); - $table->foreign('channel_id')->references('id')->on('channels')->onDelete('set null'); + $table->integer('order_id')->unsigned()->nullable(); + $table->foreign('order_id')->references('id')->on('orders')->onDelete('cascade'); $table->integer('order_address_id')->unsigned()->nullable(); $table->foreign('order_address_id')->references('id')->on('order_address')->onDelete('set null'); $table->timestamps(); diff --git a/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_115144_create_invoice_items_table.php b/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_115144_create_invoice_items_table.php index 93b98a143..253286080 100644 --- a/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_115144_create_invoice_items_table.php +++ b/packages/Webkul/Sales/src/Database/Migrations/2018_09_27_115144_create_invoice_items_table.php @@ -35,7 +35,7 @@ class CreateInvoiceItemsTable extends Migration $table->integer('invoice_id')->unsigned()->nullable(); $table->foreign('invoice_id')->references('id')->on('invoices')->onDelete('cascade'); $table->integer('parent_id')->unsigned()->nullable(); - $table->foreign('parent_id')->references('id')->on('shipment_items')->onDelete('cascade'); + $table->foreign('parent_id')->references('id')->on('invoice_items')->onDelete('cascade'); $table->json('additional')->nullable(); $table->timestamps(); diff --git a/packages/Webkul/Sales/src/Models/Invoice.php b/packages/Webkul/Sales/src/Models/Invoice.php index 35a8d782d..de93d73c7 100644 --- a/packages/Webkul/Sales/src/Models/Invoice.php +++ b/packages/Webkul/Sales/src/Models/Invoice.php @@ -7,6 +7,30 @@ use Webkul\Sales\Contracts\Invoice as InvoiceContract; class Invoice extends Model implements InvoiceContract { + protected $guarded = ['id', 'created_at', 'updated_at']; + + protected $statusLabel = [ + 'pending' => 'Pending', + 'paid' => 'Paid', + 'refunded' => 'Refunded', + ]; + + /** + * Returns the status label from status code + */ + public function getStatusLabelAttribute() + { + return isset($this->statusLabel[$this->state]) ? $this->statusLabel[$this->state] : ''; + } + + /** + * Get the order that belongs to the invoice. + */ + public function order() + { + return $this->belongsTo(OrderProxy::modelClass()); + } + /** * Get the invoice items record associated with the invoice. */ @@ -31,42 +55,10 @@ class Invoice extends Model implements InvoiceContract } /** - * Get the addresses for the invoice. + * Get the addresses for the shipment. */ - public function addresses() + public function address() { - return $this->hasMany(OrderAddressProxy::modelClass()); - } - - /** - * Get the biling address for the invoice. - */ - public function billing_address() - { - return $this->addresses()->where('address_type', 'billing'); - } - - /** - * Get billing address for the invoice. - */ - public function getBillingAddressAttribute() - { - return $this->billing_address()->first(); - } - - /** - * Get the shipping address for the invoice. - */ - public function shipping_address() - { - return $this->addresses()->where('address_type', 'shipping'); - } - - /** - * Get shipping address for the invoice. - */ - public function getShippingAddressAttribute() - { - return $this->shipping_address()->first(); + return $this->belongsTo(OrderAddressProxy::modelClass(), 'order_address_id'); } } \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Models/InvoiceItem.php b/packages/Webkul/Sales/src/Models/InvoiceItem.php index 908096afd..d59513356 100644 --- a/packages/Webkul/Sales/src/Models/InvoiceItem.php +++ b/packages/Webkul/Sales/src/Models/InvoiceItem.php @@ -7,6 +7,8 @@ use Webkul\Sales\Contracts\InvoiceItem as InvoiceItemContract; class InvoiceItem extends Model implements InvoiceItemContract { + protected $guarded = ['id', 'created_at', 'updated_at']; + /** * Get the invoice record associated with the invoice item. */ @@ -36,6 +38,6 @@ class InvoiceItem extends Model implements InvoiceItemContract */ public function child() { - return $this->belongsTo(InvoiceItemProxy::modelClass(), 'parent_id'); + return $this->hasOne(InvoiceItemProxy::modelClass(), 'parent_id'); } } \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Models/Order.php b/packages/Webkul/Sales/src/Models/Order.php index 7c30a7723..9bb83b3f5 100644 --- a/packages/Webkul/Sales/src/Models/Order.php +++ b/packages/Webkul/Sales/src/Models/Order.php @@ -7,7 +7,29 @@ use Webkul\Sales\Contracts\Order as OrderContract; class Order extends Model implements OrderContract { - protected $guarded = ['id', 'items', 'shipping_address', 'billing_address', 'payment', 'created_at', 'updated_at']; + protected $guarded = ['id', 'items', 'shipping_address', 'billing_address', 'channel', 'payment', 'created_at', 'updated_at']; + + protected $statusLabel = [ + 'pending' => 'Pending', + 'processing' => 'Processing', + 'canceled' => 'Canceled', + 'closed' => 'Closed', + ]; + + /** + * Get the order items record associated with the order. + */ + public function getCustomerFullNameAttribute() { + return $this->customer_first_name . ' ' . $this->customer_last_name; + } + + /** + * Returns the status label from status code + */ + public function getStatusLabelAttribute() + { + return $this->statusLabel[$this->status]; + } /** * Get the order items record associated with the order. @@ -51,7 +73,7 @@ class Order extends Model implements OrderContract */ public function payment() { - return $this->hasMany(OrderPaymentProxy::modelClass()); + return $this->hasOne(OrderPaymentProxy::modelClass()); } /** @@ -93,4 +115,32 @@ class Order extends Model implements OrderContract { return $this->morphTo(); } + + /** + * Checks if new shipment is allow or not + */ + public function canShip() + { + foreach ($this->items as $item) { + if ($item->qty_to_ship > 0) { + return true; + } + } + + return false; + } + + /** + * Checks if new invoice is allow or not + */ + public function canInvoice() + { + foreach ($this->items as $item) { + if ($item->qty_to_invoice > 0) { + return true; + } + } + + return false; + } } \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Models/OrderItem.php b/packages/Webkul/Sales/src/Models/OrderItem.php index 795bee0f5..789bd61bd 100644 --- a/packages/Webkul/Sales/src/Models/OrderItem.php +++ b/packages/Webkul/Sales/src/Models/OrderItem.php @@ -9,6 +9,20 @@ class OrderItem extends Model implements OrderItemContract { protected $guarded = ['id', 'child', 'created_at', 'updated_at']; + /** + * Get remaining qty for shipping. + */ + public function getQtyToShipAttribute() { + return $this->qty_ordered - $this->qty_shipped - $this->qty_refunded; + } + + /** + * Get remaining qty for invoice. + */ + public function getQtyToInvoiceAttribute() { + return $this->qty_ordered - $this->qty_invoiced - $this->qty_refunded; + } + /** * Get the order record associated with the order item. */ @@ -30,13 +44,27 @@ class OrderItem extends Model implements OrderItemContract */ public function child() { - return $this->belongsTo(OrderItemProxy::modelClass(), 'parent_id'); + return $this->hasOne(OrderItemProxy::modelClass(), 'parent_id'); } /** * Get the inventories record associated with the order item. */ public function inventories() { - return $this->hasMany(CartItemInventoyrProxy::modelClass()); + return $this->hasMany(CartItemInventoryProxy::modelClass()); + } + + /** + * Get the invoice items record associated with the order item. + */ + public function invoice_items() { + return $this->hasMany(InvoiceItemProxy::modelClass()); + } + + /** + * Get the shipment items record associated with the order item. + */ + public function shipment_items() { + return $this->hasMany(ShipmentItemProxy::modelClass()); } } \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Models/Shipment.php b/packages/Webkul/Sales/src/Models/Shipment.php index ae6d7f9b2..15baba7df 100644 --- a/packages/Webkul/Sales/src/Models/Shipment.php +++ b/packages/Webkul/Sales/src/Models/Shipment.php @@ -7,11 +7,21 @@ use Webkul\Sales\Contracts\Shipment as ShipmentContract; class Shipment extends Model implements ShipmentContract { + protected $guarded = ['id', 'created_at', 'updated_at']; + + /** + * Get the order that belongs to the invoice. + */ + public function order() + { + return $this->belongsTo(OrderProxy::modelClass()); + } + /** * Get the shipment items record associated with the shipment. */ public function items() { - return $this->hasMany(ShipmentItemProxy::modelClass())->whereNull('parent_id'); + return $this->hasMany(ShipmentItemProxy::modelClass()); } /** @@ -25,40 +35,8 @@ class Shipment extends Model implements ShipmentContract /** * Get the addresses for the shipment. */ - public function addresses() + public function address() { - return $this->hasMany(OrderAddressProxy::modelClass()); - } - - /** - * Get the biling address for the shipment. - */ - public function billing_address() - { - return $this->addresses()->where('address_type', 'billing'); - } - - /** - * Get billing address for the shipment. - */ - public function getBillingAddressAttribute() - { - return $this->billing_address()->first(); - } - - /** - * Get the shipping address for the shipment. - */ - public function shipping_address() - { - return $this->addresses()->where('address_type', 'shipping'); - } - - /** - * Get shipping address for the shipment. - */ - public function getShippingAddressAttribute() - { - return $this->shipping_address()->first(); + return $this->belongsTo(OrderAddressProxy::modelClass(), 'order_address_id'); } } \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Models/ShipmentItem.php b/packages/Webkul/Sales/src/Models/ShipmentItem.php index 2b849ee69..d9a4cc2d8 100644 --- a/packages/Webkul/Sales/src/Models/ShipmentItem.php +++ b/packages/Webkul/Sales/src/Models/ShipmentItem.php @@ -7,6 +7,8 @@ use Webkul\Sales\Contracts\ShipmentItem as ShipmentItemContract; class ShipmentItem extends Model implements ShipmentItemContract { + protected $guarded = ['id', 'child', 'created_at', 'updated_at']; + /** * Get the shipment record associated with the shipment item. */ diff --git a/packages/Webkul/Sales/src/Models/create.blade.php b/packages/Webkul/Sales/src/Models/create.blade.php new file mode 100644 index 000000000..481384e26 --- /dev/null +++ b/packages/Webkul/Sales/src/Models/create.blade.php @@ -0,0 +1,266 @@ +@extends('admin::layouts.master') + +@section('page_title') + {{ __('admin::app.sales.shipments.add-title') }} +@stop + +@section('content-wrapper') +
+
+ @csrf() + + + +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.order-info') }} +
+ +
+
+ + {{ __('admin::app.sales.shipments.order-id') }} + + + + #{{ $order->id }} + +
+ +
+ + {{ __('admin::app.sales.orders.order-date') }} + + + + {{ $order->created_at }} + +
+ +
+ + {{ __('admin::app.sales.orders.order-status') }} + + + + {{ $order->status_label }} + +
+ +
+ + {{ __('admin::app.sales.orders.channel') }} + + + + {{ $order->channel_name }} + +
+
+
+ +
+
+ {{ __('admin::app.sales.orders.account-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.customer-name') }} + + + + {{ $order->customer_full_name }} + +
+ +
+ + {{ __('admin::app.sales.orders.email') }} + + + + {{ $order->customer_email }} + +
+
+
+ +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.billing-address') }} +
+ +
+ + @include ('admin::sales.address', ['address' => $order->billing_address]) + +
+
+ + @if($order->shipping_address) +
+
+ {{ __('admin::app.sales.orders.shipping-address') }} +
+ +
+ + @include ('admin::sales.address', ['address' => $order->shipping_address]) + +
+
+ @endif + +
+
+ + +
+ +
+
+ {{ __('admin::app.sales.orders.payment-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.payment-method') }} + + + + {{ core()->getConfigData('paymentmethods.' . $order->payment->method . '.title') }} + +
+ +
+ + {{ __('admin::app.sales.orders.currency') }} + + + + {{ $order->order_currency_code }} + +
+
+
+ +
+
+ {{ __('admin::app.sales.orders.shipping-info') }} +
+ +
+
+ + {{ __('admin::app.sales.orders.shipping-method') }} + + + + {{ $order->shipping_title }} + +
+ +
+ + {{ __('admin::app.sales.orders.shipping-price') }} + + + + {{ core()->formatBasePrice($order->base_shipping_amount) }} + +
+ +
+ + + + @{{ errors.first('shipment[carrier_title]') }} + +
+ +
+ + + + @{{ errors.first('shipment[track_number]') }} + +
+
+
+
+
+ + +
+ +
+ + + + + + + + + + + + + @foreach ($order->items as $item) + @if ($item->qty_to_ship > 0) + + + + + + + @endif + @endforeach + + +
{{ __('admin::app.sales.orders.SKU') }}{{ __('admin::app.sales.orders.product-name') }}{{ __('admin::app.sales.shipments.qty-ordered') }}{{ __('admin::app.sales.shipments.qty-to-ship') }}
{{ $item->type == 'configurable' ? $item->child->sku : $item->sku }}{{ $item->name }}{{ $item->qty_ordered }} +
+ + + + @verbatim + {{ errors.first('shipment[items][id ?>]') }} + @endverbatim + +
+
+
+ +
+
+ +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php b/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php index 173305183..3837f2b42 100644 --- a/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php +++ b/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php @@ -3,7 +3,12 @@ namespace Webkul\Sales\Repositories; use Illuminate\Container\Container as App; +use Illuminate\Support\Facades\Event; +use Illuminate\Support\Facades\DB; use Webkul\Core\Eloquent\Repository; +use Webkul\Sales\Repositories\OrderRepository as Order; +use Webkul\Sales\Repositories\OrderItemRepository as OrderItem; +use Webkul\Sales\Repositories\InvoiceItemRepository as InvoiceItem; /** * Invoice Reposotory @@ -14,6 +19,51 @@ use Webkul\Core\Eloquent\Repository; class InvoiceRepository extends Repository { + /** + * OrderRepository object + * + * @var Object + */ + protected $order; + + /** + * OrderItemRepository object + * + * @var Object + */ + protected $orderItem; + + /** + * InvoiceItemRepository object + * + * @var Object + */ + protected $invoiceItem; + + /** + * Create a new repository instance. + * + * @param Webkul\Sales\Repositories\OrderRepository $order + * @param Webkul\Sales\Repositories\OrderItemRepository $orderItem + * @param Webkul\Sales\Repositories\InvoiceItemRepository $orderItem + * @return void + */ + public function __construct( + Order $order, + OrderItem $orderItem, + InvoiceItem $invoiceItem, + App $app + ) + { + $this->order = $order; + + $this->orderItem = $orderItem; + + $this->invoiceItem = $invoiceItem; + + parent::__construct($app); + } + /** * Specify Model class name * @@ -24,4 +74,142 @@ class InvoiceRepository extends Repository { return 'Webkul\Sales\Contracts\Invoice'; } + + /** + * @param array $data + * @return mixed + */ + public function create(array $data) + { + DB::beginTransaction(); + + try { + Event::fire('sales.invoice.save.before', $data); + + $order = $this->order->find($data['order_id']); + + $totalQty = array_sum($data['invoice']['items']); + + $invoice = $this->model->create([ + 'order_id' => $order->id, + 'total_qty' => $totalQty, + 'base_currency_code' => $order->base_currency_code, + 'channel_currency_code' => $order->channel_currency_code, + 'order_currency_code' => $order->order_currency_code, + 'order_address_id' => $order->billing_address->id, + ]); + + foreach ($data['invoice']['items'] as $itemId => $qty) { + if(!$qty) continue; + + $orderItem = $this->orderItem->find($itemId); + + if($qty > $orderItem->qty_to_invoice) + $qty = $orderItem->qty_to_invoice; + + $invoiceItem = $this->invoiceItem->create([ + 'invoice_id' => $invoice->id, + 'order_item_id' => $orderItem->id, + 'name' => $orderItem->name, + 'sku' => $orderItem->sku, + 'qty' => $qty, + 'price' => $orderItem->price, + 'base_price' => $orderItem->base_price, + 'total' => $orderItem->price * $qty, + 'base_total' => $orderItem->base_price * $qty, + 'tax_amount' => ( ($orderItem->tax_amount / $orderItem->qty_ordered) * $qty ), + 'base_tax_amount' => ( ($orderItem->base_tax_amount / $orderItem->qty_ordered) * $qty ), + 'product_id' => $orderItem->product_id, + 'product_type' => $orderItem->product_type, + 'additional' => $orderItem->additional, + ]); + + if($orderItem->type == 'configurable' && $orderItem->child) { + $childOrderItem = $orderItem->child; + + $invoiceItem->child = $this->invoiceItem->create([ + 'invoice_id' => $invoice->id, + 'order_item_id' => $childOrderItem->id, + 'parent_id' => $invoiceItem->id, + 'name' => $childOrderItem->name, + 'sku' => $childOrderItem->sku, + 'qty' => $qty, + 'price' => $childOrderItem->price, + 'base_price' => $childOrderItem->base_price, + 'total' => $childOrderItem->price * $qty, + 'base_total' => $childOrderItem->base_price * $qty, + 'tax_amount' => ( ($childOrderItem->tax_amount / $childOrderItem->qty_ordered) * $qty ), + 'base_tax_amount' => ( ($childOrderItem->base_tax_amount / $childOrderItem->qty_ordered) * $qty ), + 'product_id' => $childOrderItem->product_id, + 'product_type' => $childOrderItem->product_type, + 'additional' => $childOrderItem->additional, + ]); + } + + $this->orderItem->collectTotals($orderItem); + } + + $this->collectTotals($invoice); + + $this->order->collectTotals($order); + + $this->order->updateOrderStatus($order->id); + } catch (\Exception $e) { + DB::rollBack(); + + throw $e; + } + + DB::commit(); + + Event::fire('sales.invoice.save.after', $invoice); + + return $invoice; + } + + /** + * @param mixed $invoice + * @return mixed + */ + public function collectTotals($invoice) + { + $subTotal = $baseSubTotal = 0; + $taxAmount = $baseTaxAmount = 0; + + foreach($invoice->items as $invoiceItem) { + $subTotal += $invoiceItem->total; + $baseSubTotal += $invoiceItem->base_total; + + $taxAmount += $invoiceItem->tax_amount; + $baseTaxAmount += $invoiceItem->base_tax_amount; + } + + $shippingAmount = $invoice->order->shipping_amount; + $baseShippingAmount = $invoice->order->base_shipping_amount; + + if ($invoice->order->shipping_amount) { + foreach($invoice->order->invoices as $prevInvoice) { + if((float) $prevInvoice->shipping_amount) { + $shippingAmount = 0; + $baseShippingAmount = 0; + } + } + } + + $invoice->sub_total = $subTotal; + $invoice->base_sub_total = $baseSubTotal; + + $invoice->shipping_amount = $shippingAmount; + $invoice->base_shipping_amount = $baseShippingAmount; + + $invoice->tax_amount = $taxAmount; + $invoice->base_tax_amount = $baseTaxAmount; + + $invoice->grand_total = $subTotal + $taxAmount + $shippingAmount; + $invoice->base_grand_total = $baseSubTotal + $baseTaxAmount + $baseShippingAmount; + + $invoice->save(); + + return $invoice; + } } \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Repositories/OrderItemRepository.php b/packages/Webkul/Sales/src/Repositories/OrderItemRepository.php index 50b3f2d1d..30f9d5dd1 100644 --- a/packages/Webkul/Sales/src/Repositories/OrderItemRepository.php +++ b/packages/Webkul/Sales/src/Repositories/OrderItemRepository.php @@ -40,4 +40,42 @@ class OrderItemRepository extends Repository return $this->model->create($data); } + + /** + * @param mixed $orderItem + * @return mixed + */ + public function collectTotals($orderItem) + { + $qtyShipped = $qtyInvoiced = 0; + $totalInvoiced = $baseTotalInvoiced = 0; + $taxInvoiced = $baseTaxInvoiced = 0; + + foreach($orderItem->invoice_items as $invoiceItem) { + $qtyInvoiced += $invoiceItem->qty; + + $totalInvoiced += $invoiceItem->total; + $baseTotalInvoiced += $invoiceItem->base_total; + + $taxInvoiced += $invoiceItem->tax_amount; + $baseTaxInvoiced += $invoiceItem->base_tax_amount; + } + + foreach($orderItem->shipment_items as $shipmentItem) { + $qtyShipped += $shipmentItem->qty; + } + + $orderItem->qty_shipped = $qtyShipped; + $orderItem->qty_invoiced = $qtyInvoiced; + + $orderItem->total_invoiced = $totalInvoiced; + $orderItem->base_total_invoiced = $baseTotalInvoiced; + + $orderItem->tax_amount_invoiced = $taxInvoiced; + $orderItem->base_tax_amount_invoiced = $baseTaxInvoiced; + + $orderItem->save(); + + return $orderItem; + } } \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Repositories/OrderRepository.php b/packages/Webkul/Sales/src/Repositories/OrderRepository.php index 25428b334..d72e8c86e 100644 --- a/packages/Webkul/Sales/src/Repositories/OrderRepository.php +++ b/packages/Webkul/Sales/src/Repositories/OrderRepository.php @@ -75,13 +75,21 @@ class OrderRepository extends Repository try { Event::fire('checkout.order.save.before', $data); - if(isset($data['customer']) && $data['customer'] instanceof Model) { + if(isset($data['customer']) && $data['customer']) { $data['customer_id'] = $data['customer']->id; $data['customer_type'] = get_class($data['customer']); } else { unset($data['customer']); } + if(isset($data['channel']) && $data['channel']) { + $data['channel_id'] = $data['channel']->id; + $data['channel_type'] = get_class($data['channel']); + $data['channel_name'] = $data['channel']->name; + } else { + unset($data['channel']); + } + $data['status'] = core()->getConfigData('paymentmethods.' . $data['payment']['method'] . '.status') ?? 'pending'; $order = $this->model->create(array_merge($data, ['increment_id' => $this->generateIncrementId()])); @@ -125,4 +133,51 @@ class OrderRepository extends Repository return $lastId + 1; } + + /** + * @param int $orderId + * @return void + */ + public function updateOrderStatus(int $orderId) + { + $order = $this->find($orderId); + } + + /** + * @param mixed $order + * @return mixed + */ + public function collectTotals($order) + { + $subTotalInvoiced = $baseSubTotalInvoiced = 0; + $shippingInvoiced = $baseShippingInvoiced = 0; + $taxInvoiced = $baseTaxInvoiced = 0; + + foreach($order->invoices as $invoice) { + $subTotalInvoiced += $invoice->sub_total; + $baseSubTotalInvoiced += $invoice->base_sub_total; + + $shippingInvoiced += $invoice->shipping_amount; + $baseShippingInvoiced += $invoice->base_shipping_amount; + + $taxInvoiced += $invoice->tax_amount; + $baseTaxInvoiced += $invoice->base_tax_amount; + } + + $order->sub_total_invoiced = $subTotalInvoiced; + $order->base_sub_total_invoiced = $baseSubTotalInvoiced; + + $order->shipping_invoiced = $shippingInvoiced; + $order->base_shipping_invoiced = $baseShippingInvoiced; + + $order->tax_amount_invoiced = $taxInvoiced; + $order->base_tax_amount_invoiced = $baseTaxInvoiced; + + $order->grand_total_invoiced = $subTotalInvoiced + $shippingInvoiced + $taxInvoiced; + $order->base_grand_total_invoiced = $baseSubTotalInvoiced + $shippingInvoiced + $baseTaxInvoiced; + + $order->save(); + + return $order; + } } \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Repositories/ShipmentRepository.php b/packages/Webkul/Sales/src/Repositories/ShipmentRepository.php index 4bb2ccc56..337db3169 100644 --- a/packages/Webkul/Sales/src/Repositories/ShipmentRepository.php +++ b/packages/Webkul/Sales/src/Repositories/ShipmentRepository.php @@ -3,7 +3,12 @@ namespace Webkul\Sales\Repositories; use Illuminate\Container\Container as App; +use Illuminate\Support\Facades\Event; +use Illuminate\Support\Facades\DB; use Webkul\Core\Eloquent\Repository; +use Webkul\Sales\Repositories\OrderRepository as Order; +use Webkul\Sales\Repositories\OrderItemRepository as OrderItem; +use Webkul\Sales\Repositories\ShipmentItemRepository as ShipmentItem; /** * Shipment Reposotory @@ -14,6 +19,51 @@ use Webkul\Core\Eloquent\Repository; class ShipmentRepository extends Repository { + /** + * OrderRepository object + * + * @var Object + */ + protected $order; + + /** + * OrderItemRepository object + * + * @var Object + */ + protected $orderItem; + + /** + * ShipmentItemRepository object + * + * @var Object + */ + protected $shipmentItem; + + /** + * Create a new repository instance. + * + * @param Webkul\Sales\Repositories\OrderRepository $order + * @param Webkul\Sales\Repositories\OrderItemRepository $orderItem + * @param Webkul\Sales\Repositories\ShipmentItemRepository $orderItem + * @return void + */ + public function __construct( + Order $order, + OrderItem $orderItem, + ShipmentItem $shipmentItem, + App $app + ) + { + $this->order = $order; + + $this->orderItem = $orderItem; + + $this->shipmentItem = $shipmentItem; + + parent::__construct($app); + } + /** * Specify Model class name * @@ -24,4 +74,70 @@ class ShipmentRepository extends Repository { return 'Webkul\Sales\Contracts\Shipment'; } + + /** + * @param array $data + * @return mixed + */ + public function create(array $data) + { + DB::beginTransaction(); + + try { + Event::fire('sales.shipment.save.before', $data); + + $order = $this->order->find($data['order_id']); + + $totalQty = array_sum($data['shipment']['items']); + + $shipment = $this->model->create([ + 'order_id' => $order->id, + 'total_qty' => $totalQty, + 'carrier_title' => $data['shipment']['carrier_title'], + 'track_number' => $data['shipment']['track_number'], + 'customer_id' => $order->customer_id, + 'customer_type' => $order->customer_type, + 'order_address_id' => $order->shipping_address->id, + ]); + + foreach ($data['shipment']['items'] as $itemId => $qty) { + if(!$qty) continue; + + $orderItem = $this->orderItem->find($itemId); + + if($qty > $orderItem->qty_to_ship) + $qty = $orderItem->qty_to_ship; + + $shipmentItem = $this->shipmentItem->create([ + 'shipment_id' => $shipment->id, + 'order_item_id' => $orderItem->id, + 'name' => $orderItem->name, + 'sku' => ($orderItem->type == 'configurable' ? $orderItem->child->sku : $orderItem->sku), + 'qty' => $qty, + 'weight' => $orderItem->weight * $qty, + 'price' => $orderItem->price, + 'base_price' => $orderItem->base_price, + 'total' => $orderItem->price * $qty, + 'base_total' => $orderItem->base_price * $qty, + 'product_id' => $orderItem->product_id, + 'product_type' => $orderItem->product_type, + 'additional' => $orderItem->additional, + ]); + + $this->orderItem->update(['qty_shipped' => $orderItem->qty_shipped + $qty], $orderItem->id); + } + + $this->order->updateOrderStatus($order->id); + } catch (\Exception $e) { + DB::rollBack(); + + throw $e; + } + + DB::commit(); + + Event::fire('sales.shipment.save.after', $shipment); + + return $shipment; + } } \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/lang/en/app.php b/packages/Webkul/Shop/src/Resources/lang/en/app.php index 7f4684f60..2aa802a9f 100644 --- a/packages/Webkul/Shop/src/Resources/lang/en/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/en/app.php @@ -131,6 +131,7 @@ return [ 'sub-total' => 'Items', 'grand-total' => 'Grand Total', 'delivery-charges' => 'Delivery Charges', + 'tax' => 'Tax', 'price' => 'price' ], diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/total/summary.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/total/summary.blade.php index 6f6583a47..65d200ef8 100644 --- a/packages/Webkul/Shop/src/Resources/views/checkout/total/summary.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/total/summary.blade.php @@ -21,6 +21,13 @@
@endif + @if ($cart->base_tax_total) +
+ + +
+ @endif +
diff --git a/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php b/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php index 92c29476a..ffd66af30 100644 --- a/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php @@ -97,9 +97,15 @@
+ \ No newline at end of file diff --git a/packages/Webkul/Ui/src/Resources/assets/js/components/tabs/tabs.vue b/packages/Webkul/Ui/src/Resources/assets/js/components/tabs/tabs.vue new file mode 100644 index 000000000..fb501e0a6 --- /dev/null +++ b/packages/Webkul/Ui/src/Resources/assets/js/components/tabs/tabs.vue @@ -0,0 +1,37 @@ + + + \ No newline at end of file diff --git a/packages/Webkul/Ui/src/Resources/assets/sass/app.scss b/packages/Webkul/Ui/src/Resources/assets/sass/app.scss index 23248599b..4af87b700 100644 --- a/packages/Webkul/Ui/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Ui/src/Resources/assets/sass/app.scss @@ -234,6 +234,10 @@ h2 { vertical-align: middle; } } + + &.empty { + text-align: center; + } } tbody tr:last-child td { @@ -1032,562 +1036,4 @@ h2 { background-image: none; } } -} - - - -// admin dashboard component - - .dashboard-card { - height: 100px; - width: 22%; - background: #FFFFFF; - border: 1px solid #E7E7E7; - box-shadow: 0 5px 10px 2px rgba(0,0,0,0.08); - border-radius: 5px; - - .visitor-content { - padding: 15px; - - .title { - - span { - padding-top:10px; - font-size: 14px; - color: #A2A2A2; - letter-spacing: -0.26px; - } - } - - .data { - padding-top: 3px; - - span { - font-size: 32px; - color: #0041FF; - letter-spacing: -0.6px; - - img { - margin-left: 75px; - height: 24px; - width:24px; - } - } - - span.right { - padding-top: 12px; - float: right; - font-size: 14px; - color: #8E8E8E; - letter-spacing: -0.7px; - } - } - } - } - - .dashboard-card:nth-last-child(1) { - margin-left: 30px; - } - - .dashboard-card:nth-last-child(2) { - margin-left: 30px; - } - - .dashboard-card:nth-last-child(3) { - margin-left: 30px; - } - - - .dashboard-graph { - height: 413px; - width: 70.5%; - background: #FFFFFF; - border: 1px solid #E7E7E7; - box-shadow: 0 5px 10px 2px rgba(0,0,0,0.08); - border-radius: 2px; - } - - .performing-category { - height: 413px; - width: 22%; - margin-left: 30px; - background: #FFFFFF; - border: 1px solid #E7E7E7; - box-shadow: 0 5px 10px 2px rgba(0,0,0,0.08); - border-radius: 2px; - - .category { - margin-left: 20px; - margin-top: 20px; - - .title { - - span { - font-size: 14px; - color: #A2A2A2; - letter-spacing: -0.26px; - } - } - - .category-info { - margin-top: 30px; - - - ul { - - li { - - .category-list { - margin-top: 10px; - - .cat-name { - - span { - font-size: 16px; - color: #0041FF; - letter-spacing: -0.3px; - - } - - .right-side { - float: right; - margin-right: 12px; - margin-top: 10px; - height: 20px; - width: 20px; - } - } - - .product-info { - margin-top: 5px; - - span { - font-size: 16px; - color: #3A3A3A; - letter-spacing: -0.3px; - } - } - - .horizon-rule { - margin-top: 8px; - border: .7px solid #D8D8D8; - } - } - } - - li:last-child { - - .category-list { - .horizon-rule { - display: none; - } - } - } - } - } - } - } - - .sale { - height: 465px; - width: 30.1%; - background: #FFFFFF; - border: 1px solid #E7E7E7; - box-shadow: 0 5px 10px 2px rgba(0,0,0,0.08); - border-radius: 2px; - - .top-sale { - margin-left: 20px; - margin-top: 27px; - - .title { - - span { - font-size: 14px; - color: #A2A2A2; - letter-spacing: -0.26px; - } - } - - .sale-info { - - ul { - - li { - - .pro-attribute{ - display: flex; - margin-top: 10px; - - .pro-img { - height: 60px; - width: 60px; - border: 1px solid green; - } - - .product-description { - margin-left: 15px; - margin-top: 8px; - width: 75%; - - .product-name { - - span { - font-size: 14px; - color: #0041FF; - letter-spacing: -0.26px; - } - - .right-side { - float: right; - margin-top: 10px; - height: 20px; - width: 20px; - } - } - - .product-info { - - span { - font-size: 14px; - color: #3A3A3A; - letter-spacing: -0.26px; - } - } - } - } - - .horizontal-rule { - border: .5px solid #A2A2A2; - opacity: 0.2; - margin-top: 10px; - } - } - - li:last-child { - .horizontal-rule { - display: none; - } - } - } - } - } - } - - .sale:nth-last-child(1) { - margin-left: 31px; - } - - .sale:nth-last-child(2) { - margin-left: 31px; - } - - // admin dashboard css ends here - - - // customer order information for admin css start here - - .order-information { - - .order-info { - - span{ - font-size: 18px; - color: #8E8E8E; - letter-spacing: -0.29px; - } - - .edit { - float :right; - font-size: 16px; - color: #0041FF; - letter-spacing: -0.29px; - text-align: right; - } - } - - .horizotal-rule { - width:100%; - border:1px solid #A2A2A2; - opacity: 0.2; - margin-top: 16px; - } - - .order-account{ - display:flex; - flex-direction: row; - margin-top: 20px; - - .left-content { - width: 200px; - - span { - font-size: 16px; - color: #3A3A3A; - letter-spacing: -0.26px; - } - } - - .right-content { - - span { - font-size: 16px; - color: #3A3A3A; - letter-spacing: -0.26px; - } - } - } - } - - .account-information { - margin-top: 30px; - - .account-info { - - span{ - font-size: 18px; - color: #8E8E8E; - letter-spacing: -0.29px; - } - - .edit { - float :right; - font-size: 16px; - color: #0041FF; - letter-spacing: -0.29px; - text-align: right; - } - } - - .horizotal-rule { - width:100%; - border:1px solid #A2A2A2; - opacity: 0.2; - margin-top: 16px; - } - - .order-account{ - display:flex; - flex-direction: row; - margin-top: 20px; - - .left-content { - width: 200px; - - span { - font-size: 16px; - color: #3A3A3A; - letter-spacing: -0.26px; - } - - } - - .right-content { - - span { - font-size: 16px; - color: #3A3A3A; - letter-spacing: -0.26px; - } - - .name { - color: #0041FF; - } - } - } - } - - .address-information { - - .address-name { - - span{ - font-size: 18px; - color: #8E8E8E; - letter-spacing: -0.29px; - } - - .edit { - float :right; - font-size: 16px; - color: #0041FF; - letter-spacing: -0.29px; - text-align: right; - } - } - - .horizotal-rule { - width:100%; - border:1px solid #A2A2A2; - opacity: 0.2; - margin-top: 16px; - } - - .address-detail{ - margin-top: 10px; - - span { - font-size: 16px; - color: #3A3A3A; - letter-spacing: -0.26px; - display: block; - } - } - } - - .address-information:last-child { - margin-top: 15px; - } - - .payment-information { - - .title { - - span{ - font-size: 18px; - color: #8E8E8E; - letter-spacing: -0.29px; - } - } - - .horizotal-rule { - width:100%; - border:1px solid #A2A2A2; - opacity: 0.2; - margin-top: 16px; - } - - .payment-info{ - display:flex; - flex-direction: row; - margin-top: 20px; - - .left-content { - width: 200px; - - span { - font-size: 16px; - color: #3A3A3A; - letter-spacing: -0.26px; - } - } - - .right-content { - - span { - font-size: 16px; - color: #3A3A3A; - letter-spacing: -0.26px; - } - } - } - } - - .payment-information:last-child { - margin-top: 25px; - } - - .total { - margin-top: 2%; - height: 130px; - - .calculate { - margin-right: 8%; - float: right; - - .sub-total { - - span { - font-size: 14px; font-size: 14px; - color: #3A3A3A; - color: #3A3A3A; - } - - .left { - margin-left: 109px; - } - - .middle { - margin-right: 5px; - margin-left: 5px; - } - } - - .ship-handle { - margin-top: 5px; - - span { - font-size: 14px; - color: #3A3A3A; - } - - .left { - margin-left: 24px; - } - - .middle { - margin-right: 5px; - margin-left: 5px; - } - } - - .discount { - margin-top: 5px; - - span { - font-size: 14px; font-size: 14px; - color: #3A3A3A; - } - - .left { - margin-left: 98px; - } - - .middle { - margin-right: 5px; - margin-left: 5px; - } - } - - .grand-total { - margin-top: 5px; - - span { - font-size: 14px; font-size: 14px; - color: #3A3A3A; - font-weight: bold; - } - - .left { - margin-left: 87px; - } - - .middle { - margin-right: 5px; - margin-left: 5px; - } - } - - .due { - margin-top: 5px; - - span { - font-size: 14px; font-size: 14px; - color: #3A3A3A; - font-weight: bold; - } - - .left { - margin-left: 101px; - } - - .middle { - margin-right: 5px; - margin-left: 5px; - } - } - } - } - - - // customer order information for admin css end here +} \ No newline at end of file diff --git a/packages/Webkul/Ui/src/Resources/assets/sass/icons.scss b/packages/Webkul/Ui/src/Resources/assets/sass/icons.scss index 4619c3f45..cd5f00ab3 100644 --- a/packages/Webkul/Ui/src/Resources/assets/sass/icons.scss +++ b/packages/Webkul/Ui/src/Resources/assets/sass/icons.scss @@ -14,6 +14,10 @@ @extend %menu-properties; background-image: url("../images/Icon-Dashboard.svg"); } +.sales-icon { + @extend %menu-properties; + background-image: url("../images/Icon-Sales.svg"); +} .catalog-icon { @extend %menu-properties; background-image: url("../images/Icon-Catalog.svg"); @@ -179,6 +183,10 @@ background-image: url("../images/Icon-Dashboard-Active.svg"); } + .sales-icon { + background-image: url("../images/Icon-Sales-Active.svg"); + } + .catalog-icon { background-image: url("../images/Icon-Catalog-Active.svg"); } @@ -205,6 +213,10 @@ background-image: url("../images/Icon-Dashboard-Active.svg"); } + &.sales-icon { + background-image: url("../images/Icon-Sales-Active.svg"); + } + &.settings-icon { background-image: url("../images/Icon-Settings-Active.svg"); } diff --git a/public/themes/default/assets/js/shop.js b/public/themes/default/assets/js/shop.js index 9f2f19dcb..a5b1fa629 100644 --- a/public/themes/default/assets/js/shop.js +++ b/public/themes/default/assets/js/shop.js @@ -31497,11 +31497,7 @@ if (false) { /* 50 */ /***/ (function(module, exports, __webpack_require__) { -<<<<<<< HEAD -!function(t,e){ true?module.exports=e():"function"==typeof define&&define.amd?define("vue-slider-component",[],e):"object"==typeof exports?exports["vue-slider-component"]=e():t["vue-slider-component"]=e()}(this,function(){return function(t){function e(s){if(i[s])return i[s].exports;var r=i[s]={i:s,l:!1,exports:{}};return t[s].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var i={};return e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,s){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:s})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=2)}([function(t,e,i){i(7);var s=i(5)(i(1),i(6),null,null);t.exports=s.exports},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=function(){var t="undefined"!=typeof window?window.devicePixelRatio||1:1;return function(e){return Math.round(e*t)/t}}();e.default={name:"VueSliderComponent",props:{width:{type:[Number,String],default:"auto"},height:{type:[Number,String],default:6},data:{type:Array,default:null},dotSize:{type:Number,default:16},dotWidth:{type:Number,required:!1},dotHeight:{type:Number,required:!1},min:{type:Number,default:0},max:{type:Number,default:100},interval:{type:Number,default:1},show:{type:Boolean,default:!0},disabled:{type:[Boolean,Array],default:!1},piecewise:{type:Boolean,default:!1},tooltip:{type:[String,Boolean],default:"always"},eventType:{type:String,default:"auto"},direction:{type:String,default:"horizontal"},reverse:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},clickable:{type:Boolean,default:!0},speed:{type:Number,default:.5},realTime:{type:Boolean,default:!1},stopPropagation:{type:Boolean,default:!1},value:{type:[String,Number,Array,Object],default:0},piecewiseLabel:{type:Boolean,default:!1},debug:{type:Boolean,default:!0},fixed:{type:Boolean,default:!1},processDragable:{type:Boolean,default:!1},useKeyboard:{type:Boolean,default:!1},actionsKeyboard:{type:Array,default:function(){return[function(t){return t-1},function(t){return t+1}]}},tooltipMerge:{type:Boolean,default:!0},startAnimation:{type:Boolean,default:!1},sliderStyle:[Array,Object,Function],focusStyle:[Array,Object,Function],tooltipDir:[Array,String],formatter:[String,Function],mergeFormatter:[String,Function],piecewiseStyle:Object,disabledStyle:Object,piecewiseActiveStyle:Object,processStyle:Object,bgStyle:Object,tooltipStyle:[Array,Object,Function],disabledDotStyle:[Array,Object,Function],labelStyle:Object,labelActiveStyle:Object},data:function(){return{flag:!1,keydownFlag:null,focusFlag:!1,processFlag:!1,processSign:null,size:0,fixedValue:0,focusSlider:0,currentValue:0,currentSlider:0,isComponentExists:!0,isMounted:!1}},computed:{dotWidthVal:function(){return"number"==typeof this.dotWidth?this.dotWidth:this.dotSize},dotHeightVal:function(){return"number"==typeof this.dotHeight?this.dotHeight:this.dotSize},flowDirection:function(){return"vue-slider-"+this.direction+(this.reverse?"-reverse":"")},tooltipMergedPosition:function(){if(!this.isMounted)return{};var t=this.tooltipDirection[0];if(this.$refs.dot0){if("vertical"===this.direction){var e={};return e[t]="-"+(this.dotHeightVal/2-this.width/2+9)+"px",e}var i={};return i[t]="-"+(this.dotWidthVal/2-this.height/2+9)+"px",i.left="50%",i}},tooltipDirection:function(){var t=this.tooltipDir||("vertical"===this.direction?"left":"top");return Array.isArray(t)?this.isRange?t:t[1]:this.isRange?[t,t]:t},tooltipStatus:function(){return"hover"===this.tooltip&&this.flag?"vue-slider-always":this.tooltip?"vue-slider-"+this.tooltip:""},tooltipClass:function(){return["vue-slider-tooltip-"+this.tooltipDirection,"vue-slider-tooltip"]},disabledArray:function(){return Array.isArray(this.disabled)?this.disabled:[this.disabled,this.disabled]},boolDisabled:function(){return this.disabledArray.every(function(t){return!0===t})},isDisabled:function(){return"none"===this.eventType||this.boolDisabled},disabledClass:function(){return this.boolDisabled?"vue-slider-disabled":""},stateClass:function(){return{"vue-slider-state-process-drag":this.processFlag,"vue-slider-state-drag":this.flag&&!this.processFlag&&!this.keydownFlag,"vue-slider-state-focus":this.focusFlag}},isRange:function(){return Array.isArray(this.value)},slider:function(){return this.isRange?[this.$refs.dot0,this.$refs.dot1]:this.$refs.dot},minimum:function(){return this.data?0:this.min},val:{get:function(){return this.data?this.isRange?[this.data[this.currentValue[0]],this.data[this.currentValue[1]]]:this.data[this.currentValue]:this.currentValue},set:function(t){if(this.data)if(this.isRange){var e=this.data.indexOf(t[0]),i=this.data.indexOf(t[1]);e>-1&&i>-1&&(this.currentValue=[e,i])}else{var s=this.data.indexOf(t);s>-1&&(this.currentValue=s)}else this.currentValue=t}},currentIndex:function(){return this.isRange?this.data?this.currentValue:[this.getIndexByValue(this.currentValue[0]),this.getIndexByValue(this.currentValue[1])]:this.getIndexByValue(this.currentValue)},indexRange:function(){return this.isRange?this.currentIndex:[0,this.currentIndex]},maximum:function(){return this.data?this.data.length-1:this.max},multiple:function(){var t=(""+this.interval).split(".")[1];return t?Math.pow(10,t.length):1},spacing:function(){return this.data?1:this.interval},total:function(){return this.data?this.data.length-1:(Math.floor((this.maximum-this.minimum)*this.multiple)%(this.interval*this.multiple)!=0&&this.printError("Prop[interval] is illegal, Please make sure that the interval can be divisible"),(this.maximum-this.minimum)/this.interval)},gap:function(){return this.size/this.total},position:function(){return this.isRange?[(this.currentValue[0]-this.minimum)/this.spacing*this.gap,(this.currentValue[1]-this.minimum)/this.spacing*this.gap]:(this.currentValue-this.minimum)/this.spacing*this.gap},limit:function(){return this.isRange?this.fixed?[[0,(this.total-this.fixedValue)*this.gap],[this.fixedValue*this.gap,this.size]]:[[0,this.position[1]],[this.position[0],this.size]]:[0,this.size]},valueLimit:function(){return this.isRange?this.fixed?[[this.minimum,this.maximum-this.fixedValue*(this.spacing*this.multiple)/this.multiple],[this.minimum+this.fixedValue*(this.spacing*this.multiple)/this.multiple,this.maximum]]:[[this.minimum,this.currentValue[1]],[this.currentValue[0],this.maximum]]:[this.minimum,this.maximum]},idleSlider:function(){return 0===this.currentSlider?1:0},wrapStyles:function(){return"vertical"===this.direction?{height:"number"==typeof this.height?this.height+"px":this.height,padding:this.dotHeightVal/2+"px "+this.dotWidthVal/2+"px"}:{width:"number"==typeof this.width?this.width+"px":this.width,padding:this.dotHeightVal/2+"px "+this.dotWidthVal/2+"px"}},sliderStyles:function(){return Array.isArray(this.sliderStyle)?this.isRange?this.sliderStyle:this.sliderStyle[1]:"function"==typeof this.sliderStyle?this.sliderStyle(this.val,this.currentIndex):this.isRange?[this.sliderStyle,this.sliderStyle]:this.sliderStyle},focusStyles:function(){return Array.isArray(this.focusStyle)?this.isRange?this.focusStyle:this.focusStyle[1]:"function"==typeof this.focusStyle?this.focusStyle(this.val,this.currentIndex):this.isRange?[this.focusStyle,this.focusStyle]:this.focusStyle},disabledDotStyles:function(){var t=this.disabledDotStyle;if(Array.isArray(t))return t;if("function"==typeof t){var e=t(this.val,this.currentIndex);return Array.isArray(e)?e:[e,e]}return t?[t,t]:[{backgroundColor:"#ccc"},{backgroundColor:"#ccc"}]},tooltipStyles:function(){return Array.isArray(this.tooltipStyle)?this.isRange?this.tooltipStyle:this.tooltipStyle[1]:"function"==typeof this.tooltipStyle?this.tooltipStyle(this.val,this.currentIndex):this.isRange?[this.tooltipStyle,this.tooltipStyle]:this.tooltipStyle},elemStyles:function(){return"vertical"===this.direction?{width:this.width+"px",height:"100%"}:{height:this.height+"px"}},dotStyles:function(){return"vertical"===this.direction?{width:this.dotWidthVal+"px",height:this.dotHeightVal+"px",left:-(this.dotWidthVal-this.width)/2+"px"}:{width:this.dotWidthVal+"px",height:this.dotHeightVal+"px",top:-(this.dotHeightVal-this.height)/2+"px"}},piecewiseDotStyle:function(){return"vertical"===this.direction?{width:this.width+"px",height:this.width+"px"}:{width:this.height+"px",height:this.height+"px"}},piecewiseDotWrap:function(){if(!this.piecewise&&!this.piecewiseLabel)return!1;for(var t=[],e=0;e<=this.total;e++){var i="vertical"===this.direction?{bottom:this.gap*e-this.width/2+"px",left:0}:{left:this.gap*e-this.height/2+"px",top:0},s=this.reverse?this.total-e:e,r=this.data?this.data[s]:this.spacing*s+this.min;t.push({style:i,label:this.formatter?this.formatting(r):r,inRange:s>=this.indexRange[0]&&s<=this.indexRange[1]})}return t}},watch:{value:function(t){this.flag||this.setValue(t,!0)},max:function(t){if(tthis.max)return this.printError("The minimum value can not be greater than the maximum value.");var e=this.limitValue(this.val);this.setValue(e),this.refresh()},show:function(t){var e=this;t&&!this.size&&this.$nextTick(function(){e.refresh()})},fixed:function(){this.computedFixedValue()}},methods:{bindEvents:function(){document.addEventListener("touchmove",this.moving,{passive:!1}),document.addEventListener("touchend",this.moveEnd,{passive:!1}),document.addEventListener("mousedown",this.blurSlider),document.addEventListener("mousemove",this.moving),document.addEventListener("mouseup",this.moveEnd),document.addEventListener("mouseleave",this.moveEnd),document.addEventListener("keydown",this.handleKeydown),document.addEventListener("keyup",this.handleKeyup),window.addEventListener("resize",this.refresh),this.isRange&&this.tooltipMerge&&(this.$refs.dot0.addEventListener("transitionend",this.handleOverlapTooltip),this.$refs.dot1.addEventListener("transitionend",this.handleOverlapTooltip))},unbindEvents:function(){document.removeEventListener("touchmove",this.moving),document.removeEventListener("touchend",this.moveEnd),document.removeEventListener("mousedown",this.blurSlider),document.removeEventListener("mousemove",this.moving),document.removeEventListener("mouseup",this.moveEnd),document.removeEventListener("mouseleave",this.moveEnd),document.removeEventListener("keydown",this.handleKeydown),document.removeEventListener("keyup",this.handleKeyup),window.removeEventListener("resize",this.refresh),this.isRange&&this.tooltipMerge&&(this.$refs.dot0.removeEventListener("transitionend",this.handleOverlapTooltip),this.$refs.dot1.removeEventListener("transitionend",this.handleOverlapTooltip))},handleKeydown:function(t){if(!this.useKeyboard||!this.focusFlag)return!1;switch(t.keyCode){case 37:case 40:t.preventDefault(),this.keydownFlag=!0,this.flag=!0,this.changeFocusSlider(this.actionsKeyboard[0]);break;case 38:case 39:t.preventDefault(),this.keydownFlag=!0,this.flag=!0,this.changeFocusSlider(this.actionsKeyboard[1])}},handleKeyup:function(){this.keydownFlag&&(this.keydownFlag=!1,this.flag=!1)},changeFocusSlider:function(t){var e=this;if(this.isRange){var i=this.currentIndex.map(function(i,s){if(s===e.focusSlider||e.fixed){var r=t(i),o=e.fixed?e.valueLimit[s]:[0,e.total];if(r<=o[1]&&r>=o[0])return r}return i});i[0]>i[1]&&(this.focusSlider=0===this.focusSlider?1:0,i=i.reverse()),this.setIndex(i)}else this.setIndex(t(this.currentIndex))},blurSlider:function(t){var e=this.isRange?this.$refs["dot"+this.focusSlider]:this.$refs.dot;if(!e||e===t.target)return!1;this.focusFlag=!1},formatting:function(t){return"string"==typeof this.formatter?this.formatter.replace(/\{value\}/,t):this.formatter(t)},mergeFormatting:function(t,e){return"string"==typeof this.mergeFormatter?this.mergeFormatter.replace(/\{(value1|value2)\}/g,function(i,s){return"value1"===s?t:e}):this.mergeFormatter(t,e)},getPos:function(t){return this.realTime&&this.getStaticData(),"vertical"===this.direction?this.reverse?t.pageY-this.offset:this.size-(t.pageY-this.offset):this.reverse?this.size-(t.clientX-this.offset):t.clientX-this.offset},processClick:function(t){this.fixed&&t.stopPropagation()},wrapClick:function(t){var e=this;if(this.isDisabled||!this.clickable||this.processFlag)return!1;var i=this.getPos(t);if(this.isRange)if(this.disabledArray.every(function(t){return!1===t}))this.currentSlider=i>(this.position[1]-this.position[0])/2+this.position[0]?1:0;else if(this.disabledArray[0]){if(ithis.position[1])return!1;this.currentSlider=0}if(this.disabledArray[this.currentSlider])return!1;if(this.setValueOnPos(i),this.isRange&&this.tooltipMerge){var s=setInterval(function(){return e.handleOverlapTooltip()},16.7);setTimeout(function(){return window.clearInterval(s)},1e3*this.speed)}},moveStart:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments[2];if(this.disabledArray[e])return!1;if(this.stopPropagation&&t.stopPropagation(),this.isRange&&(this.currentSlider=e,i)){if(!this.processDragable)return!1;this.processFlag=!0,this.processSign={pos:this.position,start:this.getPos(t.targetTouches&&t.targetTouches[0]?t.targetTouches[0]:t)}}!i&&this.useKeyboard&&(this.focusFlag=!0,this.focusSlider=e),this.flag=!0,this.$emit("drag-start",this)},moving:function(t){if(this.stopPropagation&&t.stopPropagation(),!this.flag)return!1;t.preventDefault(),t.targetTouches&&t.targetTouches[0]&&(t=t.targetTouches[0]),this.processFlag?(this.currentSlider=0,this.setValueOnPos(this.processSign.pos[0]+this.getPos(t)-this.processSign.start,!0),this.currentSlider=1,this.setValueOnPos(this.processSign.pos[1]+this.getPos(t)-this.processSign.start,!0)):this.setValueOnPos(this.getPos(t),!0),this.isRange&&this.tooltipMerge&&this.handleOverlapTooltip()},moveEnd:function(t){var e=this;if(this.stopPropagation&&t.stopPropagation(),!this.flag)return!1;this.$emit("drag-end",this),this.lazy&&this.isDiff(this.val,this.value)&&this.syncValue(),this.flag=!1,window.setTimeout(function(){e.processFlag=!1},0),this.setPosition()},setValueOnPos:function(t,e){var i=this.isRange?this.limit[this.currentSlider]:this.limit,s=this.isRange?this.valueLimit[this.currentSlider]:this.valueLimit;if(t>=i[0]&&t<=i[1]){this.setTransform(t);var r=this.getValueByIndex(Math.round(t/this.gap));this.setCurrentValue(r,e),this.isRange&&this.fixed&&(this.setTransform(t+this.fixedValue*this.gap*(0===this.currentSlider?1:-1),!0),this.setCurrentValue((r*this.multiple+this.fixedValue*this.spacing*this.multiple*(0===this.currentSlider?1:-1))/this.multiple,e,!0))}else tthis.maximum)return!1;this.isRange?this.isDiff(this.currentValue[s],t)&&(this.currentValue.splice(s,1,t),this.lazy&&this.flag||this.syncValue()):this.isDiff(this.currentValue,t)&&(this.currentValue=t,this.lazy&&this.flag||this.syncValue()),e||this.setPosition()},getValueByIndex:function(t){return(this.spacing*this.multiple*t+this.minimum*this.multiple)/this.multiple},getIndexByValue:function(t){return Math.round((t-this.minimum)*this.multiple)/(this.spacing*this.multiple)},setIndex:function(t){if(Array.isArray(t)&&this.isRange){var e=void 0;e=this.data?[this.data[t[0]],this.data[t[1]]]:[this.getValueByIndex(t[0]),this.getValueByIndex(t[1])],this.setValue(e)}else t=this.getValueByIndex(t),this.isRange&&(this.currentSlider=t>(this.currentValue[1]-this.currentValue[0])/2+this.currentValue[0]?1:0),this.setCurrentValue(t)},setValue:function(t,e,i){var s=this;if(this.isDiff(this.val,t)){var r=this.limitValue(t);this.val=this.isRange?r.concat():r,this.computedFixedValue(),this.syncValue(e)}this.$nextTick(function(){return s.setPosition(i)})},computedFixedValue:function(){if(!this.fixed)return this.fixedValue=0,!1;this.fixedValue=this.currentIndex[1]-this.currentIndex[0]},setPosition:function(t){this.flag||this.setTransitionTime(void 0===t?this.speed:t),this.isRange?(this.setTransform(this.position[0],1===this.currentSlider),this.setTransform(this.position[1],0===this.currentSlider)):this.setTransform(this.position),this.flag||this.setTransitionTime(0)},setTransform:function(t,e){var i=e?this.idleSlider:this.currentSlider,r=s(("vertical"===this.direction?this.dotHeightVal/2-t:t-this.dotWidthVal/2)*(this.reverse?-1:1)),o="vertical"===this.direction?"translateY("+r+"px)":"translateX("+r+"px)",n=this.fixed?this.fixedValue*this.gap+"px":(0===i?this.position[1]-t:t-this.position[0])+"px",l=this.fixed?(0===i?t:t-this.fixedValue*this.gap)+"px":(0===i?t:this.position[0])+"px";this.isRange?(this.slider[i].style.transform=o,this.slider[i].style.WebkitTransform=o,this.slider[i].style.msTransform=o,"vertical"===this.direction?(this.$refs.process.style.height=n,this.$refs.process.style[this.reverse?"top":"bottom"]=l):(this.$refs.process.style.width=n,this.$refs.process.style[this.reverse?"right":"left"]=l)):(this.slider.style.transform=o,this.slider.style.WebkitTransform=o,this.slider.style.msTransform=o,"vertical"===this.direction?(this.$refs.process.style.height=t+"px",this.$refs.process.style[this.reverse?"top":"bottom"]=0):(this.$refs.process.style.width=t+"px",this.$refs.process.style[this.reverse?"right":"left"]=0))},setTransitionTime:function(t){if(t||this.$refs.process.offsetWidth,this.isRange){for(var e=0;ee.max?(e.printError("The value of the slider is "+t+", the maximum value is "+e.max+", the value of this slider can not be greater than the maximum value"),e.max):i};return this.isRange?t.map(function(t){return i(t)}):i(t)},syncValue:function(t){var e=this.isRange?this.val.concat():this.val;this.$emit("input",e),t||this.$emit("callback",e)},getValue:function(){return this.val},getIndex:function(){return this.currentIndex},getStaticData:function(){this.$refs.elem&&(this.size="vertical"===this.direction?this.$refs.elem.offsetHeight:this.$refs.elem.offsetWidth,this.offset="vertical"===this.direction?this.$refs.elem.getBoundingClientRect().top+window.pageYOffset||document.documentElement.scrollTop:this.$refs.elem.getBoundingClientRect().left)},refresh:function(){this.$refs.elem&&(this.getStaticData(),this.computedFixedValue(),this.setPosition())},printError:function(t){this.debug&&console.error("[VueSlider error]: "+t)},handleOverlapTooltip:function(){var t=this.tooltipDirection[0]===this.tooltipDirection[1];if(this.isRange&&t){var e=this.reverse?this.$refs.tooltip1:this.$refs.tooltip0,i=this.reverse?this.$refs.tooltip0:this.$refs.tooltip1,s=e.getBoundingClientRect().right,r=i.getBoundingClientRect().left,o=e.getBoundingClientRect().y,n=i.getBoundingClientRect().y+i.getBoundingClientRect().height,l="horizontal"===this.direction&&s>r,a="vertical"===this.direction&&n>o;l||a?this.handleDisplayMergedTooltip(!0):this.handleDisplayMergedTooltip(!1)}},handleDisplayMergedTooltip:function(t){var e=this.$refs.tooltip0,i=this.$refs.tooltip1,s=this.$refs.process.getElementsByClassName("vue-merged-tooltip")[0];t?(e.style.visibility="hidden",i.style.visibility="hidden",s.style.visibility="visible"):(e.style.visibility="visible",i.style.visibility="visible",s.style.visibility="hidden")}},mounted:function(){var t=this;if(this.isComponentExists=!0,"undefined"==typeof window||"undefined"==typeof document)return this.printError("window or document is undefined, can not be initialization.");this.$nextTick(function(){t.isComponentExists&&(t.getStaticData(),t.setValue(t.limitValue(t.value),!0,t.startAnimation?t.speed:0),t.bindEvents())}),this.isMounted=!0},beforeDestroy:function(){this.isComponentExists=!1,this.unbindEvents()}}},function(t,e,i){"use strict";var s=i(0);t.exports=s},function(t,e,i){e=t.exports=i(4)(),e.push([t.i,'.vue-slider-component{position:relative;box-sizing:border-box;-ms-user-select:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-o-user-select:none}.vue-slider-component.vue-slider-disabled{opacity:.5;cursor:not-allowed}.vue-slider-component.vue-slider-has-label{margin-bottom:15px}.vue-slider-component.vue-slider-disabled .vue-slider-dot{cursor:not-allowed}.vue-slider-component .vue-slider{position:relative;display:block;border-radius:15px;background-color:#ccc}.vue-slider-component .vue-slider:after{content:"";position:absolute;left:0;top:0;width:100%;height:100%;z-index:2}.vue-slider-component .vue-slider-process{position:absolute;border-radius:15px;background-color:#3498db;transition:all 0s;z-index:1}.vue-slider-component .vue-slider-process.vue-slider-process-dragable{cursor:pointer;z-index:3}.vue-slider-component.vue-slider-horizontal .vue-slider-process{width:0;height:100%;top:0;left:0;will-change:width}.vue-slider-component.vue-slider-vertical .vue-slider-process{width:100%;height:0;bottom:0;left:0;will-change:height}.vue-slider-component.vue-slider-horizontal-reverse .vue-slider-process{width:0;height:100%;top:0;right:0}.vue-slider-component.vue-slider-vertical-reverse .vue-slider-process{width:100%;height:0;top:0;left:0}.vue-slider-component .vue-slider-dot{position:absolute;border-radius:50%;background-color:#fff;box-shadow:.5px .5px 2px 1px rgba(0,0,0,.32);transition:all 0s;will-change:transform;cursor:pointer;z-index:5}.vue-slider-component .vue-slider-dot.vue-slider-dot-focus{box-shadow:0 0 2px 1px #3498db}.vue-slider-component .vue-slider-dot.vue-slider-dot-dragging{z-index:5}.vue-slider-component .vue-slider-dot.vue-slider-dot-disabled{z-index:4}.vue-slider-component.vue-slider-horizontal .vue-slider-dot{left:0}.vue-slider-component.vue-slider-vertical .vue-slider-dot{bottom:0}.vue-slider-component.vue-slider-horizontal-reverse .vue-slider-dot{right:0}.vue-slider-component.vue-slider-vertical-reverse .vue-slider-dot{top:0}.vue-slider-component .vue-slider-tooltip-wrap{display:none;position:absolute;z-index:9}.vue-slider-component .vue-slider-tooltip{display:block;font-size:14px;white-space:nowrap;padding:2px 5px;min-width:20px;text-align:center;color:#fff;border-radius:5px;border:1px solid #3498db;background-color:#3498db}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-top{top:-9px;left:50%;transform:translate(-50%,-100%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-bottom{bottom:-9px;left:50%;transform:translate(-50%,100%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-left{top:50%;left:-9px;transform:translate(-100%,-50%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-right{top:50%;right:-9px;transform:translate(100%,-50%)}.vue-slider-component .vue-slider-tooltip-top .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-top .vue-slider-tooltip:before{content:"";position:absolute;bottom:-10px;left:50%;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-top-color:inherit;transform:translate(-50%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-merged-tooltip{display:block;visibility:hidden}.vue-slider-component .vue-slider-tooltip-bottom .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-bottom .vue-slider-tooltip:before{content:"";position:absolute;top:-10px;left:50%;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-bottom-color:inherit;transform:translate(-50%)}.vue-slider-component .vue-slider-tooltip-left .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-left .vue-slider-tooltip:before{content:"";position:absolute;top:50%;right:-10px;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-left-color:inherit;transform:translateY(-50%)}.vue-slider-component .vue-slider-tooltip-right .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-right .vue-slider-tooltip:before{content:"";position:absolute;top:50%;left:-10px;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-right-color:inherit;transform:translateY(-50%)}.vue-slider-component .vue-slider-dot.vue-slider-hover:hover .vue-slider-tooltip-wrap{display:block}.vue-slider-component .vue-slider-dot.vue-slider-always .vue-slider-tooltip-wrap{display:block!important}.vue-slider-component .vue-slider-piecewise{position:absolute;width:100%;padding:0;margin:0;left:0;top:0;height:100%;list-style:none}.vue-slider-component .vue-slider-piecewise-item{position:absolute;width:8px;height:8px}.vue-slider-component .vue-slider-piecewise-dot{position:absolute;left:50%;top:50%;width:100%;height:100%;display:inline-block;background-color:rgba(0,0,0,.16);border-radius:50%;transform:translate(-50%,-50%);z-index:2;transition:all .3s}.vue-slider-component .vue-slider-piecewise-item:first-child .vue-slider-piecewise-dot,.vue-slider-component .vue-slider-piecewise-item:last-child .vue-slider-piecewise-dot{visibility:hidden}.vue-slider-component.vue-slider-horizontal-reverse .vue-slider-piecewise-label,.vue-slider-component.vue-slider-horizontal .vue-slider-piecewise-label{position:absolute;display:inline-block;top:100%;left:50%;white-space:nowrap;font-size:12px;color:#333;transform:translate(-50%,8px);visibility:visible}.vue-slider-component.vue-slider-vertical-reverse .vue-slider-piecewise-label,.vue-slider-component.vue-slider-vertical .vue-slider-piecewise-label{position:absolute;display:inline-block;top:50%;left:100%;white-space:nowrap;font-size:12px;color:#333;transform:translate(8px,-50%);visibility:visible}.vue-slider-component .vue-slider-sr-only{clip:rect(1px,1px,1px,1px);height:1px;width:1px;overflow:hidden;position:absolute!important}',""])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;ei.parts.length&&(s.parts.length=i.parts.length)}else{for(var n=[],r=0;r-1&&i>-1&&(this.currentValue=[e,i])}else{var s=this.data.indexOf(t);s>-1&&(this.currentValue=s)}else this.currentValue=t}},currentIndex:function(){return this.isRange?this.data?this.currentValue:[this.getIndexByValue(this.currentValue[0]),this.getIndexByValue(this.currentValue[1])]:this.getIndexByValue(this.currentValue)},indexRange:function(){return this.isRange?this.currentIndex:[0,this.currentIndex]},maximum:function(){return this.data?this.data.length-1:this.max},multiple:function(){var t=(""+this.interval).split(".")[1];return t?Math.pow(10,t.length):1},spacing:function(){return this.data?1:this.interval},total:function(){return this.data?this.data.length-1:(Math.floor((this.maximum-this.minimum)*this.multiple)%(this.interval*this.multiple)!=0&&this.printError("Prop[interval] is illegal, Please make sure that the interval can be divisible"),(this.maximum-this.minimum)/this.interval)},gap:function(){return this.size/this.total},position:function(){return this.isRange?[(this.currentValue[0]-this.minimum)/this.spacing*this.gap,(this.currentValue[1]-this.minimum)/this.spacing*this.gap]:(this.currentValue-this.minimum)/this.spacing*this.gap},limit:function(){return this.isRange?this.fixed?[[0,(this.total-this.fixedValue)*this.gap],[this.fixedValue*this.gap,this.size]]:[[0,this.position[1]],[this.position[0],this.size]]:[0,this.size]},valueLimit:function(){return this.isRange?this.fixed?[[this.minimum,this.maximum-this.fixedValue*(this.spacing*this.multiple)/this.multiple],[this.minimum+this.fixedValue*(this.spacing*this.multiple)/this.multiple,this.maximum]]:[[this.minimum,this.currentValue[1]],[this.currentValue[0],this.maximum]]:[this.minimum,this.maximum]},idleSlider:function(){return 0===this.currentSlider?1:0},wrapStyles:function(){return"vertical"===this.direction?{height:"number"==typeof this.height?this.height+"px":this.height,padding:this.dotHeightVal/2+"px "+this.dotWidthVal/2+"px"}:{width:"number"==typeof this.width?this.width+"px":this.width,padding:this.dotHeightVal/2+"px "+this.dotWidthVal/2+"px"}},sliderStyles:function(){return Array.isArray(this.sliderStyle)?this.isRange?this.sliderStyle:this.sliderStyle[1]:"function"==typeof this.sliderStyle?this.sliderStyle(this.val,this.currentIndex):this.isRange?[this.sliderStyle,this.sliderStyle]:this.sliderStyle},focusStyles:function(){return Array.isArray(this.focusStyle)?this.isRange?this.focusStyle:this.focusStyle[1]:"function"==typeof this.focusStyle?this.focusStyle(this.val,this.currentIndex):this.isRange?[this.focusStyle,this.focusStyle]:this.focusStyle},disabledDotStyles:function(){var t=this.disabledDotStyle;if(Array.isArray(t))return t;if("function"==typeof t){var e=t(this.val,this.currentIndex);return Array.isArray(e)?e:[e,e]}return t?[t,t]:[{backgroundColor:"#ccc"},{backgroundColor:"#ccc"}]},tooltipStyles:function(){return Array.isArray(this.tooltipStyle)?this.isRange?this.tooltipStyle:this.tooltipStyle[1]:"function"==typeof this.tooltipStyle?this.tooltipStyle(this.val,this.currentIndex):this.isRange?[this.tooltipStyle,this.tooltipStyle]:this.tooltipStyle},elemStyles:function(){return"vertical"===this.direction?{width:this.width+"px",height:"100%"}:{height:this.height+"px"}},dotStyles:function(){return"vertical"===this.direction?{width:this.dotWidthVal+"px",height:this.dotHeightVal+"px",left:-(this.dotWidthVal-this.width)/2+"px"}:{width:this.dotWidthVal+"px",height:this.dotHeightVal+"px",top:-(this.dotHeightVal-this.height)/2+"px"}},piecewiseDotStyle:function(){return"vertical"===this.direction?{width:this.width+"px",height:this.width+"px"}:{width:this.height+"px",height:this.height+"px"}},piecewiseDotWrap:function(){if(!this.piecewise&&!this.piecewiseLabel)return!1;for(var t=[],e=0;e<=this.total;e++){var i="vertical"===this.direction?{bottom:this.gap*e-this.width/2+"px",left:0}:{left:this.gap*e-this.height/2+"px",top:0},s=this.reverse?this.total-e:e,r=this.data?this.data[s]:this.spacing*s+this.min;t.push({style:i,label:this.formatter?this.formatting(r):r,inRange:s>=this.indexRange[0]&&s<=this.indexRange[1]})}return t}},watch:{value:function(t){this.flag||this.setValue(t,!0)},max:function(t){if(tthis.max)return this.printError("The minimum value can not be greater than the maximum value.");var e=this.limitValue(this.val);this.setValue(e),this.refresh()},show:function(t){var e=this;t&&!this.size&&this.$nextTick(function(){e.refresh()})},fixed:function(){this.computedFixedValue()}},methods:{bindEvents:function(){document.addEventListener("touchmove",this.moving,{passive:!1}),document.addEventListener("touchend",this.moveEnd,{passive:!1}),document.addEventListener("mousedown",this.blurSlider),document.addEventListener("mousemove",this.moving),document.addEventListener("mouseup",this.moveEnd),document.addEventListener("mouseleave",this.moveEnd),document.addEventListener("keydown",this.handleKeydown),document.addEventListener("keyup",this.handleKeyup),window.addEventListener("resize",this.refresh),this.isRange&&this.tooltipMerge&&(this.$refs.dot0.addEventListener("transitionend",this.handleOverlapTooltip),this.$refs.dot1.addEventListener("transitionend",this.handleOverlapTooltip))},unbindEvents:function(){document.removeEventListener("touchmove",this.moving),document.removeEventListener("touchend",this.moveEnd),document.removeEventListener("mousedown",this.blurSlider),document.removeEventListener("mousemove",this.moving),document.removeEventListener("mouseup",this.moveEnd),document.removeEventListener("mouseleave",this.moveEnd),document.removeEventListener("keydown",this.handleKeydown),document.removeEventListener("keyup",this.handleKeyup),window.removeEventListener("resize",this.refresh),this.isRange&&this.tooltipMerge&&(this.$refs.dot0.removeEventListener("transitionend",this.handleOverlapTooltip),this.$refs.dot1.removeEventListener("transitionend",this.handleOverlapTooltip))},handleKeydown:function(t){if(!this.useKeyboard||!this.focusFlag)return!1;switch(t.keyCode){case 37:case 40:t.preventDefault(),this.keydownFlag=!0,this.flag=!0,this.changeFocusSlider(this.actionsKeyboard[0]);break;case 38:case 39:t.preventDefault(),this.keydownFlag=!0,this.flag=!0,this.changeFocusSlider(this.actionsKeyboard[1])}},handleKeyup:function(){this.keydownFlag&&(this.keydownFlag=!1,this.flag=!1)},changeFocusSlider:function(t){var e=this;if(this.isRange){var i=this.currentIndex.map(function(i,s){if(s===e.focusSlider||e.fixed){var r=t(i),o=e.fixed?e.valueLimit[s]:[0,e.total];if(r<=o[1]&&r>=o[0])return r}return i});i[0]>i[1]&&(this.focusSlider=0===this.focusSlider?1:0,i=i.reverse()),this.setIndex(i)}else this.setIndex(t(this.currentIndex))},blurSlider:function(t){var e=this.isRange?this.$refs["dot"+this.focusSlider]:this.$refs.dot;if(!e||e===t.target)return!1;this.focusFlag=!1},formatting:function(t){return"string"==typeof this.formatter?this.formatter.replace(/\{value\}/,t):this.formatter(t)},mergeFormatting:function(t,e){return"string"==typeof this.mergeFormatter?this.mergeFormatter.replace(/\{(value1|value2)\}/g,function(i,s){return"value1"===s?t:e}):this.mergeFormatter(t,e)},getPos:function(t){return this.realTime&&this.getStaticData(),"vertical"===this.direction?this.reverse?t.pageY-this.offset:this.size-(t.pageY-this.offset):this.reverse?this.size-(t.clientX-this.offset):t.clientX-this.offset},processClick:function(t){this.fixed&&t.stopPropagation()},wrapClick:function(t){var e=this;if(this.isDisabled||!this.clickable||this.processFlag)return!1;var i=this.getPos(t);if(this.isRange)if(this.disabledArray.every(function(t){return!1===t}))this.currentSlider=i>(this.position[1]-this.position[0])/2+this.position[0]?1:0;else if(this.disabledArray[0]){if(ithis.position[1])return!1;this.currentSlider=0}if(this.disabledArray[this.currentSlider])return!1;if(this.setValueOnPos(i),this.isRange&&this.tooltipMerge){var s=setInterval(function(){return e.handleOverlapTooltip()},16.7);setTimeout(function(){return window.clearInterval(s)},1e3*this.speed)}},moveStart:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments[2];if(this.disabledArray[e])return!1;if(this.stopPropagation&&t.stopPropagation(),this.isRange&&(this.currentSlider=e,i)){if(!this.processDragable)return!1;this.processFlag=!0,this.processSign={pos:this.position,start:this.getPos(t.targetTouches&&t.targetTouches[0]?t.targetTouches[0]:t)}}!i&&this.useKeyboard&&(this.focusFlag=!0,this.focusSlider=e),this.flag=!0,this.$emit("drag-start",this)},moving:function(t){if(this.stopPropagation&&t.stopPropagation(),!this.flag)return!1;t.preventDefault(),t.targetTouches&&t.targetTouches[0]&&(t=t.targetTouches[0]),this.processFlag?(this.currentSlider=0,this.setValueOnPos(this.processSign.pos[0]+this.getPos(t)-this.processSign.start,!0),this.currentSlider=1,this.setValueOnPos(this.processSign.pos[1]+this.getPos(t)-this.processSign.start,!0)):this.setValueOnPos(this.getPos(t),!0),this.isRange&&this.tooltipMerge&&this.handleOverlapTooltip()},moveEnd:function(t){var e=this;if(this.stopPropagation&&t.stopPropagation(),!this.flag)return!1;this.$emit("drag-end",this),this.lazy&&this.isDiff(this.val,this.value)&&this.syncValue(),this.flag=!1,window.setTimeout(function(){e.processFlag=!1},0),this.setPosition()},setValueOnPos:function(t,e){var i=this.isRange?this.limit[this.currentSlider]:this.limit,s=this.isRange?this.valueLimit[this.currentSlider]:this.valueLimit;if(t>=i[0]&&t<=i[1]){this.setTransform(t);var r=this.getValueByIndex(Math.round(t/this.gap));this.setCurrentValue(r,e),this.isRange&&this.fixed&&(this.setTransform(t+this.fixedValue*this.gap*(0===this.currentSlider?1:-1),!0),this.setCurrentValue((r*this.multiple+this.fixedValue*this.spacing*this.multiple*(0===this.currentSlider?1:-1))/this.multiple,e,!0))}else tthis.maximum)return!1;this.isRange?this.isDiff(this.currentValue[s],t)&&(this.currentValue.splice(s,1,t),this.lazy&&this.flag||this.syncValue()):this.isDiff(this.currentValue,t)&&(this.currentValue=t,this.lazy&&this.flag||this.syncValue()),e||this.setPosition()},getValueByIndex:function(t){return(this.spacing*this.multiple*t+this.minimum*this.multiple)/this.multiple},getIndexByValue:function(t){return Math.round((t-this.minimum)*this.multiple)/(this.spacing*this.multiple)},setIndex:function(t){if(Array.isArray(t)&&this.isRange){var e=void 0;e=this.data?[this.data[t[0]],this.data[t[1]]]:[this.getValueByIndex(t[0]),this.getValueByIndex(t[1])],this.setValue(e)}else t=this.getValueByIndex(t),this.isRange&&(this.currentSlider=t>(this.currentValue[1]-this.currentValue[0])/2+this.currentValue[0]?1:0),this.setCurrentValue(t)},setValue:function(t,e,i){var s=this;if(this.isDiff(this.val,t)){var r=this.limitValue(t);this.val=this.isRange?r.concat():r,this.computedFixedValue(),this.syncValue(e)}this.$nextTick(function(){return s.setPosition(i)})},computedFixedValue:function(){if(!this.fixed)return this.fixedValue=0,!1;this.fixedValue=this.currentIndex[1]-this.currentIndex[0]},setPosition:function(t){this.flag||this.setTransitionTime(void 0===t?this.speed:t),this.isRange?(this.setTransform(this.position[0],1===this.currentSlider),this.setTransform(this.position[1],0===this.currentSlider)):this.setTransform(this.position),this.flag||this.setTransitionTime(0)},setTransform:function(t,e){var i=e?this.idleSlider:this.currentSlider,r=s(("vertical"===this.direction?this.dotHeightVal/2-t:t-this.dotWidthVal/2)*(this.reverse?-1:1)),o="vertical"===this.direction?"translateY("+r+"px)":"translateX("+r+"px)",n=this.fixed?this.fixedValue*this.gap+"px":(0===i?this.position[1]-t:t-this.position[0])+"px",l=this.fixed?(0===i?t:t-this.fixedValue*this.gap)+"px":(0===i?t:this.position[0])+"px";this.isRange?(this.slider[i].style.transform=o,this.slider[i].style.WebkitTransform=o,this.slider[i].style.msTransform=o,"vertical"===this.direction?(this.$refs.process.style.height=n,this.$refs.process.style[this.reverse?"top":"bottom"]=l):(this.$refs.process.style.width=n,this.$refs.process.style[this.reverse?"right":"left"]=l)):(this.slider.style.transform=o,this.slider.style.WebkitTransform=o,this.slider.style.msTransform=o,"vertical"===this.direction?(this.$refs.process.style.height=t+"px",this.$refs.process.style[this.reverse?"top":"bottom"]=0):(this.$refs.process.style.width=t+"px",this.$refs.process.style[this.reverse?"right":"left"]=0))},setTransitionTime:function(t){if(t||this.$refs.process.offsetWidth,this.isRange){for(var e=0;ee.max?(e.printError("The value of the slider is "+t+", the maximum value is "+e.max+", the value of this slider can not be greater than the maximum value"),e.max):i};return this.isRange?t.map(function(t){return i(t)}):i(t)},syncValue:function(t){var e=this.isRange?this.val.concat():this.val;this.$emit("input",e),t||this.$emit("callback",e)},getValue:function(){return this.val},getIndex:function(){return this.currentIndex},getStaticData:function(){this.$refs.elem&&(this.size="vertical"===this.direction?this.$refs.elem.offsetHeight:this.$refs.elem.offsetWidth,this.offset="vertical"===this.direction?this.$refs.elem.getBoundingClientRect().top+window.pageYOffset||document.documentElement.scrollTop:this.$refs.elem.getBoundingClientRect().left)},refresh:function(){this.$refs.elem&&(this.getStaticData(),this.computedFixedValue(),this.setPosition())},printError:function(t){this.debug&&console.error("[VueSlider error]: "+t)},handleOverlapTooltip:function(){var t=this.tooltipDirection[0]===this.tooltipDirection[1];if(this.isRange&&t){var e=this.reverse?this.$refs.tooltip1:this.$refs.tooltip0,i=this.reverse?this.$refs.tooltip0:this.$refs.tooltip1,s=e.getBoundingClientRect().right,r=i.getBoundingClientRect().left,o=e.getBoundingClientRect().y,n=i.getBoundingClientRect().y+i.getBoundingClientRect().height,l="horizontal"===this.direction&&s>r,a="vertical"===this.direction&&n>o;l||a?this.handleDisplayMergedTooltip(!0):this.handleDisplayMergedTooltip(!1)}},handleDisplayMergedTooltip:function(t){var e=this.$refs.tooltip0,i=this.$refs.tooltip1,s=this.$refs.process.getElementsByClassName("vue-merged-tooltip")[0];t?(e.style.visibility="hidden",i.style.visibility="hidden",s.style.visibility="visible"):(e.style.visibility="visible",i.style.visibility="visible",s.style.visibility="hidden")}},mounted:function(){var t=this;if(this.isComponentExists=!0,"undefined"==typeof window||"undefined"==typeof document)return this.printError("window or document is undefined, can not be initialization.");this.$nextTick(function(){t.isComponentExists&&(t.getStaticData(),t.setValue(t.limitValue(t.value),!0,0),t.bindEvents())}),this.isMounted=!0},beforeDestroy:function(){this.isComponentExists=!1,this.unbindEvents()}}},function(t,e,i){"use strict";var s=i(0);t.exports=s},function(t,e,i){e=t.exports=i(4)(),e.push([t.i,'.vue-slider-component{position:relative;box-sizing:border-box;-ms-user-select:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-o-user-select:none}.vue-slider-component.vue-slider-disabled{opacity:.5;cursor:not-allowed}.vue-slider-component.vue-slider-has-label{margin-bottom:15px}.vue-slider-component.vue-slider-disabled .vue-slider-dot{cursor:not-allowed}.vue-slider-component .vue-slider{position:relative;display:block;border-radius:15px;background-color:#ccc}.vue-slider-component .vue-slider:after{content:"";position:absolute;left:0;top:0;width:100%;height:100%;z-index:2}.vue-slider-component .vue-slider-process{position:absolute;border-radius:15px;background-color:#3498db;transition:all 0s;z-index:1}.vue-slider-component .vue-slider-process.vue-slider-process-dragable{cursor:pointer;z-index:3}.vue-slider-component.vue-slider-horizontal .vue-slider-process{width:0;height:100%;top:0;left:0;will-change:width}.vue-slider-component.vue-slider-vertical .vue-slider-process{width:100%;height:0;bottom:0;left:0;will-change:height}.vue-slider-component.vue-slider-horizontal-reverse .vue-slider-process{width:0;height:100%;top:0;right:0}.vue-slider-component.vue-slider-vertical-reverse .vue-slider-process{width:100%;height:0;top:0;left:0}.vue-slider-component .vue-slider-dot{position:absolute;border-radius:50%;background-color:#fff;box-shadow:.5px .5px 2px 1px rgba(0,0,0,.32);transition:all 0s;will-change:transform;cursor:pointer;z-index:5}.vue-slider-component .vue-slider-dot.vue-slider-dot-focus{box-shadow:0 0 2px 1px #3498db}.vue-slider-component .vue-slider-dot.vue-slider-dot-dragging{z-index:5}.vue-slider-component .vue-slider-dot.vue-slider-dot-disabled{z-index:4}.vue-slider-component.vue-slider-horizontal .vue-slider-dot{left:0}.vue-slider-component.vue-slider-vertical .vue-slider-dot{bottom:0}.vue-slider-component.vue-slider-horizontal-reverse .vue-slider-dot{right:0}.vue-slider-component.vue-slider-vertical-reverse .vue-slider-dot{top:0}.vue-slider-component .vue-slider-tooltip-wrap{display:none;position:absolute;z-index:9}.vue-slider-component .vue-slider-tooltip{display:block;font-size:14px;white-space:nowrap;padding:2px 5px;min-width:20px;text-align:center;color:#fff;border-radius:5px;border:1px solid #3498db;background-color:#3498db}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-top{top:-9px;left:50%;-webkit-transform:translate(-50%,-100%);transform:translate(-50%,-100%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-bottom{bottom:-9px;left:50%;-webkit-transform:translate(-50%,100%);transform:translate(-50%,100%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-left{top:50%;left:-9px;-webkit-transform:translate(-100%,-50%);transform:translate(-100%,-50%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-right{top:50%;right:-9px;-webkit-transform:translate(100%,-50%);transform:translate(100%,-50%)}.vue-slider-component .vue-slider-tooltip-top .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-top .vue-slider-tooltip:before{content:"";position:absolute;bottom:-10px;left:50%;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-top-color:inherit;-webkit-transform:translate(-50%);transform:translate(-50%)}.vue-slider-component .vue-slider-tooltip-wrap.vue-merged-tooltip{display:block;visibility:hidden}.vue-slider-component .vue-slider-tooltip-bottom .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-bottom .vue-slider-tooltip:before{content:"";position:absolute;top:-10px;left:50%;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-bottom-color:inherit;-webkit-transform:translate(-50%);transform:translate(-50%)}.vue-slider-component .vue-slider-tooltip-left .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-left .vue-slider-tooltip:before{content:"";position:absolute;top:50%;right:-10px;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-left-color:inherit;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.vue-slider-component .vue-slider-tooltip-right .vue-merged-tooltip .vue-slider-tooltip:before,.vue-slider-component .vue-slider-tooltip-wrap.vue-slider-tooltip-right .vue-slider-tooltip:before{content:"";position:absolute;top:50%;left:-10px;width:0;height:0;border:5px solid transparent;border:6px solid transparent\\0;border-right-color:inherit;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.vue-slider-component .vue-slider-dot.vue-slider-hover:hover .vue-slider-tooltip-wrap{display:block}.vue-slider-component .vue-slider-dot.vue-slider-always .vue-slider-tooltip-wrap{display:block!important}.vue-slider-component .vue-slider-piecewise{position:absolute;width:100%;padding:0;margin:0;left:0;top:0;height:100%;list-style:none}.vue-slider-component .vue-slider-piecewise-item{position:absolute;width:8px;height:8px}.vue-slider-component .vue-slider-piecewise-dot{position:absolute;left:50%;top:50%;width:100%;height:100%;display:inline-block;background-color:rgba(0,0,0,.16);border-radius:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:2;transition:all .3s}.vue-slider-component .vue-slider-piecewise-item:first-child .vue-slider-piecewise-dot,.vue-slider-component .vue-slider-piecewise-item:last-child .vue-slider-piecewise-dot{visibility:hidden}.vue-slider-component.vue-slider-horizontal-reverse .vue-slider-piecewise-label,.vue-slider-component.vue-slider-horizontal .vue-slider-piecewise-label{position:absolute;display:inline-block;top:100%;left:50%;white-space:nowrap;font-size:12px;color:#333;-webkit-transform:translate(-50%,8px);transform:translate(-50%,8px);visibility:visible}.vue-slider-component.vue-slider-vertical-reverse .vue-slider-piecewise-label,.vue-slider-component.vue-slider-vertical .vue-slider-piecewise-label{position:absolute;display:inline-block;top:50%;left:100%;white-space:nowrap;font-size:12px;color:#333;-webkit-transform:translate(8px,-50%);transform:translate(8px,-50%);visibility:visible}.vue-slider-component .vue-slider-sr-only{clip:rect(1px,1px,1px,1px);height:1px;width:1px;overflow:hidden;position:absolute!important}',""])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;ei.parts.length&&(s.parts.length=i.parts.length)}else{for(var n=[],r=0;r>>>>>> 0daee318b33d18aeb665824f03da773fc818c647 /***/ }), /* 51 */