@extends('layouts.bootstrap') @section('title', $tender->name) @section('header')

{{ $tender->name }}

@if(auth()->user()->canManage()) Edit @endif Back to Tenders
@endsection @section('content')
@if(session('success')) @endif

{{ $tender->name }}

{{ $tender->reference_number }} {{ $tender->getStatusLabel() }} @if($tender->isExpired()) Expired @endif
@if($tender->description)

{{ $tender->description }}

@endif
Budget

@if($tender->budget) ৳{{ number_format($tender->budget, 2) }} @else Not specified @endif

Deadline

@if($tender->deadline) {{ $tender->deadline->format('M d, Y') }} @if(!$tender->isExpired())
{{ $tender->getDaysUntilDeadline() }} days left @endif @else Not specified @endif

Total Products

{{ $tender->getTotalProductsCount() }}

Estimated Cost

৳{{ number_format($tender->getTotalBudgetBdt(), 2) }}

@if($tender->tender_buying_time || $tender->submission_time || $tender->security_money_time)
Timeline Information
@if($tender->tender_buying_time)
Tender Buying Time

{{ $tender->tender_buying_time->format('M d, Y h:i A') }}

@endif @if($tender->submission_time)
Submission Time

{{ $tender->submission_time->format('M d, Y h:i A') }}

@endif @if($tender->security_money_time)
Security Money Time

{{ $tender->security_money_time->format('M d, Y h:i A') }}

@endif
@endif @if($tender->bidding_companies && count($tender->bidding_companies) > 0)
Expected Bidding Companies
@foreach($tender->bidding_companies as $company) {{ $company }} @endforeach
@endif @if($tender->status === 'active' && ($tender->documentRequirements->count() > 0 || $tender->qualification_requirements || $tender->other_required_files))
Document Requirements @if($tender->documentRequirements->count() > 0) {{ $tender->document_completion_percentage }}% Complete @endif
@if($tender->documentRequirements->count() > 0)
{{ $tender->documentSubmissions->whereIn('status', ['submitted', 'approved'])->count() }} of {{ $tender->documentRequirements->count() }} documents completed
Required Documents:
@foreach($tender->documentRequirements as $requirement) @php $submission = $tender->documentSubmissions->where('document_type_id', $requirement->document_type_id)->first(); $isCompleted = $submission && in_array($submission->status, ['submitted', 'approved']); $statusClass = $isCompleted ? 'list-group-item-success' : 'list-group-item-light'; $iconClass = $isCompleted ? 'bi-check-circle-fill text-success' : 'bi-circle text-muted'; @endphp
{{ $requirement->documentType->name }}
@if($requirement->documentType->description)

{{ $requirement->documentType->description }}

@endif @if($submission) Status: {{ ucfirst($submission->status) }} @if($submission->submitted_at) | Submitted: {{ $submission->submitted_at->format('M d, Y') }} @endif @endif
@endforeach
@endif @if($tender->qualification_requirements)
Qualification Requirements:

{!! nl2br(e($tender->qualification_requirements)) !!}

@endif @if($tender->other_required_files)
Other Required Files:

{!! nl2br(e($tender->other_required_files)) !!}

@endif @endif @if(auth()->user()->canManage())
Pricing Configuration
%
%
Inc VAT/Tax = Market + (Market × VAT%)
Bidding = Inc VAT/Tax + (Inc VAT/Tax × Bidding%)
@endif @if($tender->contact_person || $tender->contact_email || $tender->contact_phone)
Contact Information
@if($tender->contact_person)
{{ $tender->contact_person }}
@endif @if($tender->contact_email) @endif @if($tender->contact_phone) @endif
@endif
Tender Products @if(request('category') && $categories->where('id', request('category'))->first()) {{ $categories->where('id', request('category'))->first()->name }} @endif {{ $products->total() }}
@can('update', $tender) @endcan
@if($products->count() > 0)
@foreach($products as $product) @endforeach
Product Name Market Price Inc VAT/Tax Price Bidding Price Qty Market Total Inc VAT/Tax Total Bidding Total Priority Status Actions
{{ $product->name }} @if($product->description)
{{ Str::limit($product->description, 50) }} @endif @if($product->country_of_origin)
{{ $product->country_of_origin }} @endif
{{ $product->getFormattedMarketPriceBdt() }} @if($product->measurement_unit)
per {{ $product->measurement_unit }} @endif
{{ $product->getFormattedIncVatTaxPriceBdt() }} @if($product->measurement_unit)
per {{ $product->measurement_unit }} @endif
@if(auth()->user()->canManage())
@else {{ $product->getFormattedBiddingPriceBdt() }} @if($product->measurement_unit)
per {{ $product->measurement_unit }} @endif @endif
{{ number_format($product->quantity_required ?? 1) }} {{ $product->getFormattedTotalMarketPriceBdt() }} {{ $product->getFormattedTotalIncVatTaxPriceBdt() }} {{ $product->getFormattedTotalBiddingPriceBdt() }} {{ $product->getPriorityLabel() }} @if($product->is_mandatory)
Mandatory @else
Optional @endif
{{ $product->getImportStatusLabel() }} @if($product->hasSimilarProducts())
{{ $product->getSimilarProductsCount() }} similar @endif
@can('update', $tender)
@csrf @method('DELETE')
@endcan
TOTALS: ৳{{ number_format($tender->getTotalMarketPriceBdt(), 2) }} ৳{{ number_format($tender->getTotalIncVatTaxPriceBdt(), 2) }} ৳{{ number_format($tender->getTotalBiddingPriceBdt(), 2) }} {{ $tender->getTotalProductsCount() }} ৳{{ number_format($tender->getTotalMarketPriceBdt(), 2) }} ৳{{ number_format($tender->getTotalIncVatTaxPriceBdt(), 2) }} ৳{{ number_format($tender->getTotalBiddingPriceBdt(), 2) }}
@if($products->hasPages()) @endif @else
No Products Found

@if(request()->hasAny(['product_search', 'priority', 'mandatory'])) No products match your current filters. @else This tender doesn't have any products yet. @endif

@can('update', $tender) Import Products @endcan
@endif
@foreach($products as $product) @endforeach @push('scripts') @endpush @endsection