@forelse($locations as $key => $value)

@lang('sale.location'): {{$value}}

@if($enable_expiry == 1 && $product->enable_stock == 1) @endif @if($enable_lot == 1) @endif @php $subtotal = 0; @endphp @foreach($product->variations as $variation) @if(empty($purchases[$key][$variation->id])) @php $purchases[$key][$variation->id][] = ['quantity' => 0, 'purchase_price' => $variation->default_purchase_price, 'purchase_line_id' => null, 'lot_number' => null ] @endphp @endif @foreach($purchases[$key][$variation->id] as $sub_key => $var) @php $purchase_line_id = $var['purchase_line_id']; $qty = $var['quantity']; $purcahse_price = $var['purchase_price']; $row_total = $qty * $purcahse_price; $subtotal += $row_total; $lot_number = $var['lot_number']; @endphp @if($enable_expiry == 1 && $product->enable_stock == 1) @endif @if($enable_lot == 1) @endif @endforeach @endforeach
@lang( 'product.product_name' ) @lang( 'lang_v1.quantity_left' ) @lang( 'purchase.unit_cost_before_tax' )Exp. Date@lang( 'lang_v1.lot_number' )@lang( 'purchase.subtotal_before_tax' )  
{{ $product->name }} @if( $product->type == 'variable' ) ({{ $variation->product_variation->name }} : {{ $variation->name }}) @endif @if(!empty($purchase_line_id)) {!! Form::hidden('stocks[' . $key . '][' . $variation->id . '][' . $sub_key . '][purchase_line_id]', $purchase_line_id); !!} @endif
{!! Form::text('stocks[' . $key . '][' . $variation->id . '][' . $sub_key . '][quantity]', @format_quantity($qty) , ['class' => 'form-control input-sm input_number purchase_quantity input_quantity', 'required']); !!} {{ $product->unit->short_name }}
{!! Form::text('stocks[' . $key . '][' . $variation->id . '][' . $sub_key . '][purchase_price]', @num_format($purcahse_price) , ['class' => 'form-control input-sm input_number unit_price', 'required']); !!} {!! Form::text('stocks[' . $key . '][' . $variation->id . '][' . $sub_key . '][exp_date]', !empty($var['exp_date']) ? @format_date($var['exp_date']) : null , ['class' => 'form-control input-sm os_exp_date', 'readonly']); !!} {!! Form::text('stocks[' . $key . '][' . $variation->id . '][' . $sub_key . '][lot_number]', $lot_number , ['class' => 'form-control input-sm']); !!} {{@num_format($row_total)}} @if($loop->index == 0) @else   @endif
@lang( 'lang_v1.total_amount_exc_tax' ): {{@num_format($subtotal)}}
@empty

@lang( 'lang_v1.product_not_assigned_to_any_location' )

@endforelse