@extends('user::layouts.master') @section('content')

Manage Quotations

@include('layouts.flash.alert')

Request for Quotation

Delivery Date: {{ $quotation->delivery_date }} Delivery Time: {{ $quotation->delivery_time }} Delivery Address: {{ $quotation->delivery_address }}
Area: {{ $quotation->mainActivity->area }} Level: {{ $quotation->mainActivity->level }} Sub Code: {{ $quotation->subActivity->sub_code }}
@if($quotation->materials->isNotEmpty()) @foreach($quotation->materials as $material) @endforeach @endif
Activity Code Activity Image Unit Rate Quantity
{{ $material->activityOfMaterial->item_code }} {{ $material->activity }} @if(\Storage::disk('public')->has('quotations/'.$material->photo)) @else @endif {{ $material->unit }} {{ $material->rate }} {{ $material->quantity }}
Note: {{ $quotation->notes }}
@if($quotation->replyMaterials->isNotEmpty())

Quotation received

@php $tabs = ""; $panes = ""; $i = 1; $allSupplierMaterials = $quotation->replyMaterials->unique('supplier_id'); foreach($allSupplierMaterials as $supplierMaterial){ if($i == 1){ $tabs .= ''; $panes .= '
'; }else{ $tabs .= ''; $panes .= '
'; } $quotations = \Modules\PurchaseManager\Entities\QuotationReply::where('quotation_id', $supplierMaterial->quotation_id)->where('supplier_id', $supplierMaterial->supplier_id)->get(); $materials = \Modules\PurchaseManager\Entities\QuotationReplyMaterial::where('quotation_id', $supplierMaterial->quotation_id)->where('supplier_id', $supplierMaterial->supplier_id)->get(); $finalQuotation = $quotations->last(); $route = route('quotations.admin.quotation.reply', $quotation->id); $panes .= '
'; $panes .= ''; if($materials->isNotEmpty()){ foreach($materials as $material){ $panes .= ''; } } $panes .= '
Activity Code Activity Image Unit Quantity Rate Total
'.$material->activityOfMaterial->item_code.' '.$material->activity.' '.$material->unit.' '.$material->quantity.' £'.$material->rate.' £'.$material->total.'
  Carriage costs £'.($finalQuotation->carriage_costs ?? 0).'
  C of C £'.($finalQuotation->c_of_c ?? 0).'
  Other costs £'.($finalQuotation->other_costs ?? 0).'
  Total Value £'.($materials->sum('total') + $finalQuotation->carriage_costs + $finalQuotation->c_of_c + $finalQuotation->other_costs).'
'; $panes .= '

Conversation

'; if($quotations->isNotEmpty()){ $panes .= '
'; foreach($quotations as $reply){ if($reply->sender_id == auth()->id()){ $panes .= '
'; }else{ $panes .= '
'; } $panes .= '
'.$reply->sender->full_name.' '.$reply->created_at->format('d M Y g:i A').'
'; if(\Storage::disk('public')->has($reply->sender->avatar)){ $panes .= ''; }else{ $panes .= ''; } $panes .= '
'.$reply->notes.'
'; $panes .= '
'; } $panes .= '
'; } $panes .= '
'; $i++; } @endphp
{!! $panes !!}
@endif
@stop