@extends('layouts.app') @section('link') @endsection @section('content') @include('shared.messages')

{{__('texte.stock_inputs_arr.edit.stock_input_edit')}}

{{ method_field('PATCH') }} {{ csrf_field() }}
@if ($errors->has('supplier')) {{ $errors->first('supplier') }} @endif
@if ($errors->has('date')) {{ $errors->first('date') }} @endif
@if ($errors->has('note')) {{ $errors->first('note') }} @endif
@if ($errors->has('storage')) {{ $errors->first('storage') }} @endif
@if ($errors->has('product')) {{ $errors->first('product') }} @endif
@foreach($stock_input->rows as $row) @endforeach
{{__('texte.stock_inputs_arr.edit.title')}} {{__('texte.stock_inputs_arr.edit.quantity')}} {{__('texte.stock_inputs_arr.edit.measure')}} {{__('texte.stock_inputs_arr.edit.package')}} {{__('texte.stock_inputs_arr.edit.place')}} {{__('texte.stock_inputs_arr.edit.pallet')}} {{__('texte.stock_inputs_arr.edit.batch')}} {{__('texte.stock_inputs_arr.edit.expiry_date')}} {{__('texte.stock_inputs_arr.edit.delete')}}
{{$row->product->name}} {{ $row->quantity / ($row->measure == 0 ? 1 : ($row->measure == 1 ? $row->product->package_count : $row->product->pallet_count )) }} {{ __('texte.short_units_arr')[$row->product->unit]}} {{$row->measure==0 ? __('texte.stock_inputs_arr.edit.count') : ($row->measure == 1 ? $row->product->package->name : __('texte.stock_inputs_arr.edit.pallet'))}} {{$row->place->address}} {{$row->pallet}} {{$row->batch}} {{ $row->expiring_date ? (new DateTime($row->expiring_date))->format('d.m.Y') : '' }}
@if ($errors) {{ $errors->first() }} @endif
@endsection