@extends('layouts.base') @section('title', 'Créer un template') @section('content') @if(request('date') == null) salut @else
{{-- --}} @csrf @php($date = Carbon\Carbon::parse(request('date'))->startOfWeek()->format('Y-m-d')) @foreach($products as $key => $product) @php($stock = $product->stock()->where('site_id',$site)->value('value')) @php($qty =$product->commands()->where('site_id',$site)->with('commandProducts')->where('status', 'VALIDATED')->sum('command_product.quantity')) @php($rap = $qty - $stock) @php($style = $qty - $stock < 0 ? 'danger': 'warning' ) {{-- --}} @endforeach
Retour
Code Designation Quantité Stock RAP IndicationAction
{{$product->code}} {{$product->name}} {{$qty}} {{$stock != 0 ? $stock : 0}} {{ $rap }} {{ $rap < 0 ? 'Arrêter':'Produire' }} --}} {{--
--}} {{-- --}} {{--
--}} {{--
@endif @endsection @section('javascripts') @endsection