{% extends 'template.html.twig' %}

{% block title %}Details Tour Claim - {{ parent() }} {% endblock %}

{% block body %}

<!-- Title Start  -->
        <div class="app-page-title">
            <div class="page-title-wrapper">
                <div class="page-title-heading">
                    <div class="page-title-icon">
                        <i class="pe-7s-menu icon-gradient bg-ripe-malin text-success">
                        </i>
                    </div>
                    <div><h3>Tour Claim</h3>
                        
                    </div>
                </div>
                
                <div class="page-title-actions">
                    <div class="d-inline-block dropdown">
                        <nav class="" aria-label="breadcrumb">
                                    <ol class="breadcrumb">
                                        <li class="breadcrumb-item"><a href="#">Home</a></li>
                                        <li class="breadcrumb-item"><a href="{{ path('tour_claim_index') }}">Tour Claim List</a></li>
                                        <li class="active breadcrumb-item" aria-current="page">Details</li>
                                    </ol>
                                </nav>
                    </div>
                </div>   
                
            </div>
        </div>    
        {% for message in app.flashes('notice') %}
                            
            <div class="alert alert-info alert-dismissible">
                <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                <strong>{{ message }}</strong> 
            </div>
        {% endfor %}  	    
        <ul class="body-tabs body-tabs-layout tabs-animated body-tabs-animated nav">
            
            <li class="nav-item">
                <a role="tab" class="nav-link active"  href="{{ path('tour_claim_edit', {'id': tour_claim.id}) }}">
                    <span><i class="fa fa-edit"> Edit</i></span>
                </a>
            </li>
            <li class="nav-item">
                <a role="tab" class="nav-link active"  href="{{ path('tour_claim_index') }}">
                    <span><i class="fa fa-list"> Tour Claim List</i></span>
                </a>
            </li>
                <li class="nav-item">
                   {# {{ include('leave_application/_delete_form.html.twig') }} #}
               
            </li>
        </ul> <!-- Title End  --> 
        
        <!-- Tab Start  --> 
        <div class="tab-content">
        
            <!-- Table Tab Start  --> 
            <div class="tab-pane tabs-animation fade show active" id="tab-content-0" role="tabpanel">
                <div class="main-card mb-3 card">
                    <div class="card-body"> <h5 class="card-title"> Details</h5>
                    
                    
                        <div class="table table-striped table-hover">
                        
                            <table class="mb-0 table">
                                
                                <tbody>
                    
                                <tr>
                                    <th width="25%">Submition Date</th>
                                    <th width="3%">: </th>
                                    <td>{{ tour_claim.submitionDate ? tour_claim.submitionDate|date('d-m-Y') : '' }}</td>
                                </tr>
                                <tr>
                                    <th>Actual tour starting date & time</th>
                                    <th>: </th>
                                    <td>{{ tour_claim.startingDate ? tour_claim.startingDate|date('d-m-Y H:i:s') : '' }}</td>
                                </tr>
                                <tr>
                                    <th>Actual tour ending date & time</th>
                                     <th>: </th>
                                    <td>{{ tour_claim.endingDate ? tour_claim.endingDate|date('d-m-Y H:i:s') : '' }}</td>
                                </tr>
                                <tr>
                                    <th>Tour Details</th>
                                     <th>: </th>
                                    <td>{{ tour_claim.tourDetails }}</td>
                                </tr>
                               
                                </tbody>
                            </table>
                        </div>

                        <h5 class="card-title">Expenses Details</h5>
                            <div class="table table-bordered table-responsive table-striped table-hover" >
                        
                            <table class="mb-0 table">
                                <thead>
                                <tr>
                                    <th>#</th>                                                  
                                    <th>Category</th>                                                  
                                    <th>From / Place of Stay</th>
                                    <th>From Date & Time</>
                                    <th>To / Place of Stay</th>
                                    <th>To Date & Time</th>
                                    <th>Mode of Transportation </th>
                                    <th>Amount Currency </th>
                                    <th>Amount </th>
                                    <th>Remarks </th>
                                    
                                </tr>
                                </thead>
                                <tbody>

                                    {% set totalAmount = 0 %}
                                    {% for tourClaimDetail in tour_claim.tourClaimDetails %}
                                    {% set counter = ( counter | default(0) ) + 1 %}   
                                    {% set totalAmount = ( totalAmount | default(0) ) + tourClaimDetail.amount %}                                                                                
                                    <tr>
                                        <td>{{ counter }}</td>                                                    
                                        <td>{{ tourClaimDetail.category }} </td>                                                     
                                        <td>{{ tourClaimDetail.fromPlace }} </td>
                                        <td>{{ tourClaimDetail.startingDate ? tourClaimDetail.startingDate|date('d-m-Y H:i:s') : '' }} </td>
                                        <td>{{ tourClaimDetail.toPlace }} </td>
                                        <td>{{ tourClaimDetail.endingDate ? tourClaimDetail.endingDate|date('d-m-Y H:i:s') : '' }} </td>
                                        <td>{{ tourClaimDetail.travelMode }} </td>
                                        <td>{{ tourClaimDetail.amountCurrency }} </td>
                                        <td>{{ tourClaimDetail.amount|number_format(2, '.', ',') }} </td>
                                        <td>{{ tourClaimDetail.remarks }} </td>
                                    </tr>
                                    {% else %}
                                    <tr>
                                    <td colspan="15">No records found</td>                                                    
                                    </tr>
                                    {% endfor %}
                                   <tr>
                                        <td colspan="8" style="text-align:right;"> <strong>Total Amount: </strong></td>
                                        <td><strong>{{ totalAmount|number_format(2, '.', ',') }}</strong> </td>
                                        <td> </td>
                                    </tr>    
                                </tbody>
                            </table>
        

                        </div>        

            
                    </div>
                </div>
                
                
            </div> <!-- Table Tab End  --> 
                                        
        </div> <!-- Tab End  --> 


{% endblock %}



{# {% extends 'base.html.twig' %}

{% block title %}TourClaim{% endblock %}

{% block body %}
    <h1>TourClaim</h1>

    <table class="table">
        <tbody>
            <tr>
                <th>Id</th>
                <td>{{ tour_claim.id }}</td>
            </tr>
            <tr>
                <th>SubmitionDate</th>
                <td>{{ tour_claim.submitionDate ? tour_claim.submitionDate|date('Y-m-d') : '' }}</td>
            </tr>
            <tr>
                <th>StartingDate</th>
                <td>{{ tour_claim.startingDate ? tour_claim.startingDate|date('Y-m-d H:i:s') : '' }}</td>
            </tr>
            <tr>
                <th>EndingDate</th>
                <td>{{ tour_claim.endingDate ? tour_claim.endingDate|date('Y-m-d H:i:s') : '' }}</td>
            </tr>
            <tr>
                <th>TourDetails</th>
                <td>{{ tour_claim.tourDetails }}</td>
            </tr>
        </tbody>
    </table>

    <a href="{{ path('tour_claim_index') }}">back to list</a>

    <a href="{{ path('tour_claim_edit', {'id': tour_claim.id}) }}">edit</a>

    {{ include('tour_claim/_delete_form.html.twig') }}
{% endblock %} #}
