



<div class="row text-left">
       <div class="col-lg-12 text-center form-group">
         <span class="border-left fs-12">
           <span>{{$stock->produit->fullName}}</span><br>
            <span>{{__('Lot')}} : {{$stock->id_lot}} , </span>
            <span>{{__('Expire Le')}} : {{$stock->date_peremtion}}</span><br>
            <span class="text-success fs-13">{{__('Qty Actuelle')}} : {{format_amount($stock->qty)}}</span>
        </span>
       </div>

       @can('st-stock-adjustments-list')
           <div class="col-lg-12 ajustements-list">
               <span class="fs-15">{{__("Total")}} : {{format_amount(count($stock->ajustements))}}</span><br>
               <div style="max-height: 300px; overflow-y: scroll">
                   @forelse($stock->ajustements()->orderBy("created_at",'desc')->get() as $ajustement)
                       <div class="media chat-item border-top">
                           <img  alt="image {{$ajustement->createdBy->nom_complet ?? ""}}"
                                 src="{{$ajustement->createdBy->image ?? ""}}"
                                 class="rounded-circle user-avatar-lg">
                           <div class="media-body">
                               <div class="chat-item-title">
                               <span class="chat-item-author">
                                   <strong>{{$ajustement->createdBy->nom_complet}}</strong>
                               </span>
                                   <span class="fs-12 text-muted">{{$ajustement->created_at->format(__('d-m-Y à H:i:s'))}}</span>
                               </div>
                               <div class="chat-item-body">
                                   <p class="fs-12">{{$ajustement->commentaire->message ?? ""}}</p>
                               </div>
                               <div class="media media-attachment">
                                   <div class="avatar bg-{{$ajustement->operation->color}}">
                                       <i class="{{$ajustement->operation->icon}}"></i>
                                   </div>
                                   <div class="media-body">
                                       <ul class="list-unstyled">
                                           <li class="fs-13">
                                               <span>{{format_amount($ajustement->qty_before)}}</span>
                                               <strong><span class="fas fs-12 fa-long-arrow-alt-right text-{{$ajustement->operation->color}}"></span></strong>
                                               <span>{{format_amount($ajustement->modified_qty)}}</span>
                                           </li>
                                           <li class="fs-10 badge badge-{{$ajustement->type->color ?? ""}}">{{$ajustement->type->libelle ?? ""}}</li>
                                       </ul>
                                   </div>
                               </div>
                           </div>
                       </div>
                   @empty
                       {!! custom_alert_html(['type' => 'danger','msg' => __("Aucun ajustement sur ce stock."),'closable' => false]) !!}
                   @endforelse
               </div>
           </div>
       @elsecan
           <h4 class="text-danger">{{__("Vous ne pouvez pas voir les ajustements sur stock")}}</h4>
       @endcan
   </div>

