<table style="width:100%;" style="border: 1px solid black;">
	

	
		<tr><center>
			<br>
			<td class="text-center" style="line-height: 15px !important; padding-bottom: 10px !important">
				@if(!empty($receipt_details->header_text))
					{!! $receipt_details->header_text !!}
				@endif

				@php
					$sub_headings = implode('<br/>', array_filter([$receipt_details->sub_heading_line1, $receipt_details->sub_heading_line2, $receipt_details->sub_heading_line3, $receipt_details->sub_heading_line4, $receipt_details->sub_heading_line5]));
				@endphp

				@if(!empty($sub_headings))
					<span>{!! $sub_headings !!}</span>
				@endif

				@if(!empty($receipt_details->invoice_heading))
						<span style="font-size: 20px;font-weight: bold;">{!! $receipt_details->invoice_heading !!}</span>
				@endif
			</td>
		</center></tr>

		</table>



<div style="width:100%;height:121px; margin:0 -1px; float:left;">
<div style="border:1px solid black; width:50%;height:120px; margin:0 1px; float:left;">		<!-- Logo -->
		@if(!empty($receipt_details->display_name))
			 
				<font color="red"><span style="font-size: 22px;font-weight:bold;">&nbsp;&nbsp; {{$receipt_details->display_name}}</span></font>
			
			<br>
				@if(!empty($receipt_details->address))
					{!! $receipt_details->address !!}
				@endif

				

				@if(!empty($receipt_details->website))
					<br/>&nbsp;&nbsp;{{ $receipt_details->website }}
				@endif
				<br>
				@if(!empty($receipt_details->contact))
					
					{!! $receipt_details->contact !!}@endif
					<br>
					@if(!empty($receipt_details->tax_info1))
					&nbsp;&nbsp;{{ $receipt_details->tax_label1 }} {{ $receipt_details->tax_info1 }}
				@endif

				

				@if(!empty($receipt_details->location_custom_fields))
					<br/>&nbsp;&nbsp;{{ $receipt_details->location_custom_fields }}
				@endif
			</p>
		@endif
		</div>



		<div style="border:0px; width:50%;height:100%; margin:0 -1px; float:right;">
		<!-- Shop & Location Name  -->
		<table style="border:1px solid black;width: 100%;">
	
			@if(!empty($receipt_details->invoice_no_prefix))
				<tr style="border:1px solid black;"><td style="border:1px solid black;">{!! $receipt_details->invoice_no_prefix !!}@endif
			

			<br>{{$receipt_details->invoice_no}}</td>
		
	

			
		<td style="border:1px solid black;">@if(!empty($receipt_details->date_label))
			
				
					{{$receipt_details->date_label}}<br>
				

				{{$receipt_details->invoice_date}}</td></tr>
			
		@endif
		
				@if(!empty($receipt_details->shipping_custom_field_1_label))
				<tr style="border:1px solid black;"><td style="border:1px solid black;">{!!$receipt_details->shipping_custom_field_1_label!!}
			
<br>
			<br> {!!$receipt_details->shipping_custom_field_1_value ?? ''!!}</td>
		

@endif
		
		<td style="border:1px solid black;">
			@if(!empty($receipt_details->shipping_custom_field_2_label))
				
					{!!$receipt_details->shipping_custom_field_2_label!!}<br>
				
<br>
			{!!$receipt_details->shipping_custom_field_2_value ?? ''!!}</td></tr>
			
		@endif
		
				<tr style="border:1px solid black;"><td style="border:1px solid black;">
					@if(!empty($receipt_details->shipping_custom_field_3_label))
					{!!$receipt_details->shipping_custom_field_3_label!!}
			<br>

			<br>{!!$receipt_details->shipping_custom_field_3_value ?? ''!!}</td>
		
	
	@endif

			@if(!empty($receipt_details->shipping_custom_field_4_label))
		<td style="border:1px solid black;">
			
				
					{!!$receipt_details->shipping_custom_field_4_label!!}<br>
				
<br>
				{!!$receipt_details->shipping_custom_field_4_value ?? ''!!}</td></tr>
			
		@endif

</table>
</div>


		
	</div>
<div style="width:100%;height:161px; margin:0 -1px; float:left;">
<div style="border:1px solid black; width:50%;height:161px; margin:0 1px; float:left;">		<!-- Logo -->
		@if(!empty($receipt_details->customer_label))
				<b>&nbsp;{{ $receipt_details->customer_label }}</b><br/>
			@endif

			<!-- customer info -->
			@if(!empty($receipt_details->customer_info))
				&nbsp;{!! $receipt_details->customer_info !!}
			@endif
			@if(!empty($receipt_details->client_id_label))
				<br/>
				<strong>&nbsp;{{ $receipt_details->client_id_label }}</strong> {{ $receipt_details->client_id }}
			@endif
		
			
				<strong>{{$receipt_details->customer_tax_label}}</strong> {{$receipt_details->customer_tax_number}}
			
			@if(!empty($receipt_details->customer_custom_fields))
				<br/>&nbsp;{!! $receipt_details->customer_custom_fields !!}
			@endif
			@if(!empty($receipt_details->sales_person_label))
				<br/>
				<strong>&nbsp;{{ $receipt_details->sales_person_label }}</strong> {{ $receipt_details->sales_person }}
			@endif
			@if(!empty($receipt_details->commission_agent_label))
				<br/>
				<strong>&nbsp;{{ $receipt_details->commission_agent_label }}</strong> {{ $receipt_details->commission_agent }}
			@endif

			@if(!empty($receipt_details->customer_rp_label))
				<br/>
				<strong>{{ $receipt_details->customer_rp_label }}</strong> {{ $receipt_details->customer_total_rp }}
			@endif
			<br>

			@foreach($receipt_details->lines as $line)@if(!empty($line['brand'])), 
			Brand:{{$line['brand']}} @endif
			@endforeach
		</div>



		<div style="border:0px double #56B5E5; width:50%;height:100%; margin:0 -1px; float:right;">
		<!-- Shop & Location Name  -->
		
<table style="border:1px solid black;width: 100%;">
	
	<div class="col-xs-6"  style="border:1px solid black;width: 100%;height: 75%;margin-top: 41px;">
		

	
			
				<span class="pull-left">Terms Of Delivery</span>
			
		
	
</div>		
	
</table>


</div>
	
</div>


		
	</div>
<!-----costmedetials------------->




<div class="row color-555">
	<div class="col-xs-12">
		
		<table class="table table-bordered table-no-top-cell-border table-slim">
			<thead>
				<tr style="background-color: #357ca5 !important; color: white !important;border: 1px solid black; font-size: 15px !important" class="table-no-side-cell-border table-no-top-cell-border text-center">
					<td style="background-color: #357ca5 !important; color: black !important;border: 1px solid black;width: 5% !important">S.No</td>
					
					@php
						$p_width = 37;
					@endphp
					@if($receipt_details->show_cat_code != 1)
						@php
							$p_width = 35;
						@endphp
					@endif
					<td style="background-color:  !important; color: black !important;border: 1px solid black; width: {{$p_width}}% !important">
						{{$receipt_details->table_product_label}}
					</td>

					
						<td style="background-color: #357ca5 !important; color: black !important;border: 1px solid black; width: 10% !important;">{{$receipt_details->cat_code_label}}</td>
					
					
					<td style="background-color: #357ca5 !important; color: black !important;border: 1px solid black;width: 10% !important;">
						{{$receipt_details->table_qty_label}}
					</td>
					<td style="background-color: #357ca5 !important; color: black !important;border: 1px solid black;width: 10% !important;">
						{{$receipt_details->table_unit_price_label}}
					</td>
					
					<td style="background-color: #357ca5 !important; color: black !important;border: 1px solid black;width: 10% !important;">
						{{$receipt_details->line_tax_label}}
					</td>
					
					<td style="background-color: #357ca5 !important; color: black !important;border: 1px solid black;width: 16% !important;">
						{{$receipt_details->table_subtotal_label}}
					</td>
				</tr>
			</thead>
			<tbody>
				@foreach($receipt_details->lines as $line)
					<tr>
						<td class="text-center">
							{{$loop->iteration}}
						</td>
						<td>
							@if(!empty($line['image']))
								<img src="{{$line['image']}}" alt="Image" width="50" style="float: left; margin-right: 8px;">
							@endif
                            {{$line['name']}} {{$line['product_variation']}} {{$line['variation']}} 
                             @if(!empty($line['sub_sku'])), {{$line['sub_sku']}} @endif <!--@if(!empty($line['brand'])), {{$line['brand']}} @endif
                            @if(!empty($line['product_custom_fields'])), {{$line['product_custom_fields']}} @endif
 -->                           
                            @if(!empty($line['lot_number']))<br> {{$line['lot_number_label']}}:  {{$line['lot_number']}} @endif 
                            @if(!empty($line['product_expiry'])), {{$line['product_expiry_label']}}:  {{$line['product_expiry']}} @endif 

                            @if(!empty($line['warranty_name'])) <br><small>{{$line['warranty_name']}} </small>@endif @if(!empty($line['warranty_exp_date'])) <small>- {{@format_date($line['warranty_exp_date'])}} </small>@endif
                            @if(!empty($line['warranty_description'])) <small> {{$line['warranty_description'] ?? ''}}</small>@endif
                        </td>

						@if($receipt_details->show_cat_code == 1)
	                        <td>
	                        	@if(!empty($line['cat_code']))
	                        		{{$line['cat_code']}}
	                        	@endif
	                        </td>
	                    @endif
	                   
						<td class="text-right">
							{{$line['quantity']}} {{$line['units']}}
						</td>
						<td class="text-right">
							{{$line['unit_price_before_discount']}}
						</td>
													
						
						<td class="text-right">
							{{$line['tax']}} {{$line['tax_name']}}
						</td>
						
						<td class="text-right">
							{{$line['line_total']}}
						</td>
					</tr>
					@if(!empty($line['modifiers']))
						
					@endif
				@endforeach

				@php
					$lines = count($receipt_details->lines);
				@endphp

				@for ($i = $lines; $i < 8; $i++)
    				<tr>
    					<td  style="color: solid black;">&nbsp;</td>
    					<td style="color: solid black;">&nbsp;</td>
    					<td style="color: solid black;">&nbsp;</td>
    					<td style="color: solid black;">&nbsp;</td>
    					<td>&nbsp;</td>
    					<td>&nbsp;</td>
    					<td>&nbsp;</td>
    					
    					
    				</tr>
				@endfor
@if(!empty($receipt_details->group_tax_details))
					@foreach($receipt_details->group_tax_details as $key => $value)
						<tr class="color-555">
							<td colspan="6" class="text-right" style="border: 1px solid black;">
								{!! $key !!}
							</td>
							<td class="text-right"  style="border: 1px solid black;">
								(+) {{$value}}
							</td>
						</tr>
					@endforeach
				@else
					@if( !empty($receipt_details->tax) )
						<tr class="color-555">
							<td colspan="1" style="border: 1px solid black;">
								{!! $receipt_details->tax_label !!}
							</td  style="border: 1px solid black;">
							<td class="text-right">
								(+) {{$receipt_details->tax}}
							</td>
						</tr>
					@endif
				@endif
			</tbody>
		</table>
	</div>
</div>

<div class="row invoice-info color-555" style="margin-top: -20px;">
	

	<div class="col-md-7 invoice-col width-100" style="margin-top: -20px;">
		<table class="table-slim" width="99.7%" style="border: 1px solid black;">
			<tbody>
				
				
				
				
				
				
				

				

				
				
				<!-- Total -->
				<tr>
					@if(!empty($receipt_details->total_quantity_label))
					<tr class="color-555" style="border: 1px solid black;">
					<td colspan="4" class="text-right" style="border: 1px solid black;">
						
						{!! $receipt_details->total_label !!}
					</td>
						
					<td colspan="8" class="text-right" style="border: 1px solid black;">
							{{$receipt_details->total_quantity}}
						</td>
					
				@endif
						
					<td colspan="2" class="text-right" style="border: 1px solid black;">
						{{$receipt_details->total}}
					</td>
				</tr>
				<tr>
				
						<td class="text-left" colspan="14" style="border: 1px solid black;">
							
							@if(!empty($receipt_details->total_in_words))
								
								<b>Amount Chargeable (In Words):({{$receipt_details->total_in_words}})</b>
							@endif
						</td>
					</tr>
					<tr><th colspan="10" style="border: 1px solid black;">HSN/SAC</th><th style="border: 1px solid black;">Taxable value</th><th style="border: 1px solid black;">Tax</th ><th style="border: 1px solid black;">Value</th><th style="border: 1px solid black;">Total Tax</th></tr>
					@if(!empty($receipt_details->group_tax_details))
					@foreach($receipt_details->group_tax_details as $key => $value)
				
						<tr class="color-555">
							<td colspan="10" style="border: 1px solid black;">@if(!empty($line['cat_code']))
	                        		{{$line['cat_code']}}
	                        	@endif</td>
							<td style="border: 1px solid black;">{{$receipt_details->subtotal}}</td>
							<td  class="text-right" style="border: 1px solid black;">
									{{$key}}
							</td>
						
							<td class="text-right"  style="border: 1px solid black;">
								(+) {{$value}}
							</td>
							<td class="text-right" style="border: 1px solid black;">
								(+) {{$receipt_details->tax}}
							</td>
						</tr>
						
					@endforeach
				@else
					@if( !empty($receipt_details->tax) )
						<tr class="color-555">
							<td colspan="1" style="border: 1px solid black;">
								{!! $receipt_details->tax_label !!}
							</td  style="border: 1px solid black;">
							<td class="text-right">
								(+) {{$receipt_details->tax}}
							</td>
						</tr>

					@endif
				@endif
			</tbody>
        </table>
       
	</div>

</div>

<div style="border:1px solid black; width:100%;height:15%; margin:-30 px; float:right;">
<div style="width:50%;height:15%; margin:0 -1px; float:left;border:1px solid black;">	
	<!-- Logo -->
	@if(!empty($receipt_details->footer_text))
		
			{!! $receipt_details->footer_text !!}
		
		@endif
		<p><hr></p>
	Declaration<br>
	We declare that this invoice shows the actual price of <br>the goods
	described and that all particulars are ture and correct<br>
	Goods once sold cannot be taken back or exchanged
		</div>



		<div style="width:50%;height:15%; margin:0 -1px; float:left;">
		<!-- Shop & Location Name  -->
		 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for PM Doors

		 <br>
	<br>
	<br>
	<br>
	
	
		 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Authorised Singature
</div>
</div>


<div class="row color-555">
	
		@if($receipt_details->show_barcode || $receipt_details->show_qr_code)
			<div class="@if(!empty($receipt_details->footer_text)) col-xs-4 @else col-xs-12 @endif text-center">
				{{-- Barcode --}}
				@if($receipt_details->show_barcode)
					<img class="center-block" src="data:image/png;base64,{{DNS1D::getBarcodePNG($receipt_details->invoice_no, 'C128', 2,30,array(39, 48, 54), true)}}">
				@endif
				
				@if($receipt_details->show_qr_code && !empty($receipt_details->qr_code_details))
					@php
						$qr_code_text = implode(',    ', $receipt_details->qr_code_details);
					@endphp
					<img class="center-block mt-5" src="data:image/png;base64,{{DNS2D::getBarcodePNG($qr_code_text, 'QRCODE', 3, 3, [39, 48, 54])}}">
				@endif
			</div>
		@endif
	</div>

			</td>
		</tr>
	</tbody>
</table>