@extends('layouts.app') @section('title', 'Package Update') @section('content')

Package Update

@csrf
{!! Form::label('customer_id', __('contact.customer') . ':') !!}
{!! Form::select('customer_id', $customers,$package->customer_id, ['class' => 'form-control select2','placeholder' => 'select customer', 'required']); !!}
{!! Form::label('sale_product','Sale Product') !!} {!! Form::select('sale_product', $package_products,$package->sale_product, ['class' => 'form-control select2', 'required','Placeholder' => 'Select Product']); !!}
@component('components.widget', ['class' => 'box-solid'])
{!! Form::text('search_product', null, ['class' => 'form-control mousetrap', 'id' => 'search_product', 'placeholder' => __('lang_v1.search_product_placeholder'), 'autofocus' => true, ]); !!}
@php $total = 0 @endphp @foreach($products as $product) @endforeach
@lang('sale.product') @lang('sale.qty') Price
@php $business_id = request()->session()->get('user.business_id'); $pr = \App\Product::where('id',$product->product_id)->first(); $product_name = $pr->name; $query = \App\Variation::join('products AS p', 'variations.product_id', '=', 'p.id') ->join('product_variations AS pv', 'variations.product_variation_id', '=', 'pv.id') ->leftjoin('variation_location_details AS vld', 'variations.id', '=', 'vld.variation_id') ->leftjoin('units', 'p.unit_id', '=', 'units.id') ->leftjoin('units as u', 'p.secondary_unit_id', '=', 'u.id') ->leftjoin('brands', function ($join) { $join->on('p.brand_id', '=', 'brands.id') ->whereNull('brands.deleted_at'); }) ->where('p.business_id', $business_id) ->where('variations.id', $product->variation_id); $price = $query->select( 'variations.sell_price_inc_tax' ) ->firstOrFail(); $total += $price->sell_price_inc_tax * $product->quantity; @endphp {{$product_name}} {{$price->sell_price_inc_tax}}
Total : {{number_format($total,2)}}
@endcomponent
@endsection @section('javascript') @endsection