			



				<div class="row"  style="font-size: 18px; direction: rtl;
font-weight: bolder;
padding: 10px;">



					<div class="col text-right"> 
						<select name="speical" id="special" class="form-control" style="font-size: 18px;
font-weight: bolder;
text-align: center;">
							<option value="0">فاتورة  مبيعات </option>
							<option value="1">فاتورة  خاصه  </option>
						</select>
					</div>

				</div>



				<div class="card" style="max-height: 350px;
overflow: scroll; overflow-x: hidden;">
						<table class="table table-striped">
							<thead>

								@if(Config::get('app.locale') == "ar")
								<tr>
									<th>المنتج</th>
									<th>الكميـــــــة</th>
									<th style="text-align: center;"> <i class="fa fa-trash"></i> </th>
									<th class="text-right">السعر</th>
								</tr>
								@else
								<tr>
									<th>Product</th>
									<th>Quantity</th>
									<th style="text-align: center;"> <i class="fa fa-trash"></i> </th>
									<th class="text-right">Price</th>
								</tr>
								@endif
							</thead>
							<tbody>

								<?php 
								$total = 0;
								$total_buy_price = 0;
								?>

								@foreach($cart_data as $r)

								<tr>
									<td style="width: 100%;"> {{$r->product->name}} </td>
									<td style="width: 100%;">
										<input type="text" onmouseout="new_to_cart('<?php echo $r->product->id; ?>" onchange="new_to_cart('<?php echo $r->product->id; ?>',
										this.value);"
											id="the_quantity<?php echo $r->product->id; ?>"
										 style="width: 100%;" class="form-control form-control-sm qty" 
										 value="{{number_format($r->quantity,3)}}">
									</td>
									<td>
										<a onclick="delete_from_cart('<?php echo $r->product->id; ?>');">
										<button class="btn btn-danger btn-sm"
										 onclick="delete_from_cart('<?php echo $r->product->id; ?>');"><i class="fas fa-trash"></i>
										</a>
									</td>
									<td class="text-right"> 
										<?php $total = $total + ($r->product->price * $r->quantity); ?>



										<?php $total_buy_price = $total_buy_price + ($r->product->buy_price * $r->quantity); ?>



										<input type="text" onchange="change_price(<?php echo $r->product->id; ?>,this.value)" style="width:100px;" id="price<?php echo $r->product->id; ?>" 
										value="{{number_format($r->product->price * $r->quantity,0)}}">
										
									</td>
								</tr>

								@endforeach


								<?php 

								$net_profit = $total - $total_buy_price;

								?>
	
							</tbody>
						</table>
					</div>

								@if(Config::get('app.locale') == "ar")

					<div class="row" style="font-size: 18px; direction: rtl;
font-weight: bolder;
padding: 10px;">
					<div class="col"> المجموع  </div>
					<div class="col text-right" id="total_amount2"> {{number_format($total,0)}}</div>

					<input type="hidden" id="total_amount" value="{{$total}}">

				</div>

				<div class="row" style="font-size: 18px; direction: rtl;
font-weight: bolder;
padding: 10px;">

					<div class="col"> الخصم </div>

					<div class="col text-right">
						
					 <input type="number" style="width: 150px;" id="discount" placeholder="0" value="0" onkeyup="get_discount(this.value)" placeholder="0">

					 <br>
					</div>


				</div>
			
				<div class="row" style="font-size: 18px; direction: rtl;
font-weight: bolder;
padding: 10px;">
					<input type="hidden" id="net_profit2" value="{{$net_profit}}">
					<div class="col" > الربـح  </div>
					<div class="col text-right">

					<input type="text" style="width: 70px; background: none; border: 0; cursor: default; " id="net_profit" readonly 
					value="{{$net_profit}}" 
					 placeholder="0">

					</div>
				</div>

				</div>


				<div class="row"  style="font-size: 18px; direction: rtl;
font-weight: bolder;
padding: 10px;">

					<div class="col" style="cursor: pointer; text-align: center; background: black; color: white;" onclick="pay_bankak();"> بنكـك   </div>


					<div class="col text-right"> 
						<input type="number" id="bankak" name="bankak" onmousemove="
						if(document.getElementById('bankak').value == '') { document.getElementById('bankak').value = 0; } "  value="0">
					</div>

				</div>












				<div class="row"  style="font-size: 18px; direction: rtl;
font-weight: bolder;
padding: 10px;">
					<div class="col"  style="cursor: pointer; text-align: center; background: black; color: white;" onclick="pay_cash();"> Cash  </div>
					<div class="col text-right" > 
						<input type="number" id="cash" name="cash" onmousemove="
						if(document.getElementById('cash').value == '') { document.getElementById('cash').value = 0; } " 

						 value="0">

					</div>

				</div>


					







				<div class="row"  style="font-size: 18px; direction: rtl;
font-weight: bolder;
padding: 10px;">
					<div class="col" style="cursor: pointer; text-align: center; background: black; color: white;" onclick="pay_shake();"> شيك   </div>
					<div class="col text-right" > 
						<input type="number" id="shake" name="shake" onmousemove="
						if(document.getElementById('shake').value == '') { document.getElementById('shake').value = 0; } " 

						 value="0">

					</div>

				</div>












@else
					<div class="row" style="font-size: 18px;
font-weight: bolder;
padding: 10px;">
					<div class="col">Total  </div>
					<div class="col text-right" id="total_amount2"> {{number_format($total,0)}}</div>

					<input type="hidden" id="total_amount" value="{{$total}}">

					<div class="col">Discount </div>

					<div class="col text-right">
						
					 <input type="number" style="width: 70px;" id="discount" placeholder="0" value="0" onkeyup="get_discount(this.value)" placeholder="0">
					</div>


					<p> &nbsp; </p>

					<input type="hidden" id="net_profit2" value="{{$net_profit}}">
					<div class="col" >Net Profit  </div>
					<div class="col text-right">

					<input type="text" style="width: 70px; background: none; border: 0; cursor: default; " id="net_profit" readonly 
					value="{{$net_profit}}" 
					 placeholder="0">

					</div>


				</div>
				@endif



								@if(Config::get('app.locale') == "ar")

				<div class="row">
					<div class="col">
						<button type="button" class="btn btn-danger btn-block" onclick="delete_all_cart();">
							الغاء
						 </button>
					</div>
					<div class="col">
					
							@csrf
								<input type="hidden" name="amount" id="amount" value="<?php echo $total; ?>">
								<input type="hidden" name="user_id" value="{{auth()->user()->id}}">
						<button type="button" id="submit_btn" onclick="confirm_order(<?php echo $total; ?>);" class="btn btn-primary btn-block" >اعتماد الفاتورة</button>
					
					</div>
				</div>


								@else
				<div class="row">
					<div class="col">
						<button type="button" class="btn btn-danger btn-block" onclick="delete_all_cart();">{{__('Cancel')}} </button>
					</div>
					<div class="col">
					
							@csrf
								<input type="hidden" name="amount" id="amount" value="<?php echo $total; ?>">
								<input type="hidden" name="user_id" value="{{auth()->user()->id}}">
						<button type="button" id="submit_btn" onclick="confirm_order(<?php echo $total; ?>);" class="btn btn-primary btn-block" >{{__('Submit')}}</button>
					
					</div>
				</div>

						@endif