<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>Amirdham Invoice</title>
		<style>
		    
		  table{
    border-spacing: 0;
}
table td, table th, p{
    font-size: 16px !important;
    line-height: 1.8;
}
img{
    border: 3px solid #F1F5F9;
    padding: 6px;
    background-color: #F1F5F9;
}
.table-no-border{
    width: 100%;
}
.table-no-border .width-50{
    width: 50%;
}
.table-no-border .width-70{
    width: 70%;
    text-align: left;
}
.table-no-border .width-30{
    width: 30%;
}
.margin-top{
    margin-top: 40px;
}
.product-table{
    margin-top: 20px;
    width: 100%;
    border-width: 0px;
}
.product-table thead th{
    background-color: #005748;
    color: white;
    padding: 5px;
    text-align: left;
    padding: 5px 15px;
}
.width-10{
    width: 10%;
}
.width-20{
    width: 20%;
}
.width-30{
    width: 30%;
}
.width-50{
    width: 50%;
}
.width-25{
    width: 25%;
}
.width-70{
    width: 70%;
    text-align: right;
}
.width-60{
    width: 60%;
    
}
.width-40{
    width: 40%;
    
}
.product-table tbody td{
    background-color: #ffd73187;
    color: black;
    padding: 5px 15px;
}
.product-table td:last-child, .product-table th:last-child{
    text-align: right;
}
.product-table tfoot td{
    color: black;
    padding: 5px 15px;
}
.footer-div{
    background-color: #F1F5F9;
    margin-top: 100px;
    padding: 3px 10px;
}
.new1 {
  border: 1px dashed #222;
  margin: 20px 0 0 0;

}
            .fnt-we-300{
                font-weight: 300 !important;
            }
            .fnt-we-400{
                font-weight: 400 !important;
            }
            .fnt-we-500{
                font-weight: 500 !important;
            }
            .fnt-we-600{
                font-weight: 600 !important;
            }
            .fnt-16{
                font-size: 16px !important;
            }
            .fnt-17{
                font-size: 17px !important;
            }
            .fnt-18{
                font-size: 18px !important;
            }
            .marg-both-10{
margin: 10px 0 !important;
            }
            .marg-both-20{
margin: 20px 0 !important;
            }
            .marg-both-30{
margin: 30px 0 !important;
            }
            .marg-both-40{
margin: 40px 0 !important;
            }
		</style>
	</head>

	<body>

    <table class="table-no-border">
        <tr>
            <?php
                $logo = logo_get_setting();
            ?>
            <td class="width-60">
                <img src="{{ $logo }}" alt="UserBookR Logo" width="100">
            </td>
            <td class="width-30">
                <h2 style="font-size: 20px;margin-top: 0px;margin-bottom: 0px;">Invoice Number: {{ $order_details->order_id }}</h2>
                <h2 style="font-size: 17px;margin-top: 0px;">Date of Issue: {{ date('d-m-Y', strtotime($order_details->created_at)) }}</h2>
            </td>
        </tr>
    </table>
  
<div class="margin-top">
    <table class="table-no-border">
        <tr>
            <td class="width-60">
                <div><strong style="font-size: 20px;">Invoice Details</strong></div>
               
                <div><strong>Name:</strong> {{ $order_details->name }}</div>
                <div><strong>Phone:</strong>{{ $order_details->phone }}</div>
                <div><strong>Mail:</strong> {{ $order_details->email }}</div>
                <div><strong>Address:</strong> {{ $order_details->address ?? '' }}, {{ $order_details->city ?? '' }}, {{ $order_details->state_details->name ?? '' }}, {{ $order_details->country ?? '' }}, {{ $order_details->pincode ?? '' }}</div>
                <div><strong>Landmark:</strong> {{ $order_details->landmark ?? '' }}</div>
                
            </td>
            <td class="width-10"></td>
            <td class="width-40">
                
                <div><strong style="font-size: 20px;">Company Details</strong></div>
                <div>Amirdham Foodrink</div>
                <div>237-N5, Pollachi Main Road, Sidco Post, Opp. Rajam Medical Centre, SIDCO Industrial Estate, Coimbatore, Tamil Nadu, 641021</div>
                 <div><strong>GST:</strong> 33BODPS8367G1ZL</div> 
                
            </td>
        </tr>
    </table>
</div>
  
<div>
    <table class="product-table">
        <thead>
            <tr>
                <th class="width-10" style="border: 1px solid #222;border-bottom: 1px solid #222;text-align: center;">
                    <strong>#</strong>
                </th>
                 <th class="width-20" style="border: 1px solid #222;border-bottom: 1px solid #222;text-align: center;">
                    <strong>Product Name</strong>
                </th>

                 <th class="width-30" style="border: 1px solid #222;border-bottom: 1px solid #222;text-align: center;">
                    <strong>Sub Total </strong>
                </th>
                
                <th class="width-20" style="border: 1px solid #222;border-bottom: 1px solid #222;text-align: center;">
                    <strong>Qty</strong>
                </th>
                <th class="width-20" style="border: 1px solid #222;border-bottom: 1px solid #222;text-align: center;">
                    <strong>Total</strong>
                </th>
            </tr>
        </thead>
        <tbody>
        <?php
            $OrderPageDetails = $order_details->orderitems;
        ?>
        @if($OrderPageDetails)
        @foreach($OrderPageDetails as $key => $details)
            <?php
                $sub_total_2 = $details->discount_amount * $details->quantity;
            ?>
            <tr>
                <td class="width-10" style="border: 1px solid #222;border-bottom: 1px solid #222;text-align: center;"> {{ $key + 1 }} </td>
                <td class="width-20" style="border: 1px solid #222;border-bottom: 1px solid #222;text-align: center;"> {{ $details->product_name }} </td> 
                <td class="width-30" style="border: 1px solid #222;border-bottom: 1px solid #222;text-align: center;"> {{ number_format($details->discount_amount, 2) }} </td>
                <td class="width-20" style="border: 1px solid #222;border-bottom: 1px solid #222;text-align: center;"> {{ $details->quantity }} </td> 
                <td class="width-20" style="border: 1px solid #222;border-bottom: 1px solid #222;text-align: center;"> {{ number_format($sub_total_2, 2) }} </td> 
            </tr>
            
        @endforeach
        @endif
        </tbody>
        <?php
            $total = $order_details->total_discount_amount - $order_details->discount_amount;
        ?>
        <tbody>
            
            <tr>
                
                <td class="width-70" colspan="4" style="border: 1px solid #222;border-bottom: 1px solid #222;">
                    Sub Total
                </td>
                <td class="width-20" style="border: 1px solid #222;border-bottom: 1px solid #222;text-align: center;">
                   {{ number_format($sub_total_2, 2) }}
                </td>
            </tr>

            @if($order_details->discount_amount != 0 || $order_details->discount_amount != "")
            <tr>
                <td class="width-70" colspan="4" style="border: 1px solid #222;border-bottom: 1px solid #222;">
                    Discount Amount (-)
                </td>
                <td class="width-20" style="border: 1px solid #222;border-bottom: 1px solid #222;text-align: center;">
                   {{ number_format($order_details->discount_amount, 2) }}
                </td>
            </tr>
            @endif
            
            <tr>  
                <td class="width-70" colspan="4" style="border: 1px solid #222;border-bottom: 1px solid #222;">
                   Total <span style="font-size: 10px;">(Inclusive GST)</span>
                </td>
                <td class="width-20" style="border: 1px solid #222;border-bottom: 1px solid #222;text-align: center;">
                   {{ number_format($total, 2) }}
                </td>
            </tr>
         
        </tbody>
       
    </table>
</div>

<!-- <div><strong style="margin-top: 40px;"></strong></div> -->

<div class="new1"></div>

<div class="marg-both-10">
    <table class="table-no-border">
        <tr>
           {{-- <td class="width-50">
                <div><strong style="font-size: 20px;line-height: 2.5;">Payment Reference</strong></div>
               
                <div style="font-size: 14px !important;"><strong style="font-size: 14px !important;">Transaction Id  :</strong> {{ $payment_details->transaction_id }} </div>
               <div style="font-size: 14px !important;"><strong style="font-size: 14px !important;">Amount of Payment :</strong> Rs.{{ $product->amount }}/-</div>
                <div style="font-size: 14px !important;"><strong style="font-size: 14px !important;">Date :</strong> Date : {{ date('D d M Y', strtotime($payment_details->transaction_date)) }}</div>
                <div style="font-size: 14px !important;"><strong style="font-size: 14px !important;">Mode of payment :</strong> {{ $payment_details->transaction_method }}</div>
            </td> --}}
            <td class="width-50">
                
                <div style="font-size: 14px !important;line-height: 2.2;">Ceritified that the particulars given above are true and correct.</div>
               
                  <img src="{{ $logo }}" alt="" width="80" />
                <div><strong style="font-size: 20px !important;">Authorised signature</strong></div>
            </td>
        </tr>
    </table>
</div>


	</body>
</html>