<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
</head>
<style>
#rcorners1 {
  border-radius: 25px;
  border: 1px solid;
  
}
.style5 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; }
.style21 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 18px;
	font-weight: bold;
}
.style22 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
}
.style23 {font-family: Arial, Helvetica, sans-serif}
.style24 {font-size: 12px}
.style27 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; }
@media print{ 
  @page {
    margin-top: 30px;
    margin-bottom: 30px;
  }
}
</style>
<script type="text/javascript">
  window.print();
</script>
<body>
@php $number = $data->NetAmount;@endphp
<?php
$no = floor($number);
   $point = round($number - $no, 2) * 100;
   $hundred = null;
   $digits_1 = strlen($no);
   $i = 0;
   $str = array();
   $words = array('0' => '', '1' => 'one', '2' => 'two',
    '3' => 'three', '4' => 'four', '5' => 'five', '6' => 'six',
    '7' => 'seven', '8' => 'eight', '9' => 'nine',
    '10' => 'ten', '11' => 'eleven', '12' => 'twelve',
    '13' => 'thirteen', '14' => 'fourteen',
    '15' => 'fifteen', '16' => 'sixteen', '17' => 'seventeen',
    '18' => 'eighteen', '19' =>'nineteen', '20' => 'twenty',
    '30' => 'thirty', '40' => 'forty', '50' => 'fifty',
    '60' => 'sixty', '70' => 'seventy',
    '80' => 'eighty', '90' => 'ninety');
   $digits = array('', 'hundred', 'thousand', 'lakh', 'crore');
   while ($i < $digits_1) {
     $divider = ($i == 2) ? 10 : 100;
     $number = floor($no % $divider);
     $no = floor($no / $divider);
     $i += ($divider == 10) ? 1 : 2;
     if ($number) {
        $plural = (($counter = count($str)) && $number > 9) ? 's' : null;
        $hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
        $str [] = ($number < 21) ? $words[$number] .
            " " . $digits[$counter] . $plural . " " . $hundred
            :
            $words[floor($number / 10) * 10]
            . " " . $words[$number % 10] . " "
            . $digits[$counter] . $plural . " " . $hundred;
     } else $str[] = null;
  }
  $str = array_reverse($str);
  $result2 = implode('', $str);
  $points = ($point) ?
    "." . $words[$point / 10] . " " . 
          $words[$point = $point % 10] : '';
  ?>
<table width="700" border="1" cellspacing="0" cellpadding="0" style="border:1 px solid">
  <tr>
    <td align="left" valign="top"><table width="100%" border="0" cellspacing="1" cellpadding="3" style="rcorners1">
      <tr>
        <td><table width="100%" border="0" cellspacing="3" cellpadding="3">
          <tr>
            <td align="center" valign="top"><span class="style21">MANASI OPTICAL </span></td>
          </tr>
          <tr>
            <td><div align="center" class="style22">Rathi Nagar, Amravati.</div></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
        </table></td>
      </tr>
      
    </table>
      <hr />
      <table width="100%" border="0" cellspacing="3" cellpadding="5">
        <tr>
          <td width="15%" align="left" valign="top"><span class="style5">Name : </span></td>
          <td width="52%" align="left" valign="top">&nbsp;{{$data->PatientName}}</td>
          <td width="14%"><span class="style5">Date : </span></td>
          <td width="19%" align="left" valign="top">&nbsp;{{date("d/m/Y", strtotime(str_replace('-', '/',$data->SaleDate)))}}</td>
        </tr>
        <tr>
          <td align="left" valign="top"><span class="style5">Mob : </span></td>
          <td align="left" valign="top">&nbsp;{{$data->MobileNo}}</td>
          <td><span class="style5">Bill No : </span></td>
          <td align="left" valign="top">&nbsp;{{$data->BillNo}}</td>
        </tr>
        <tr>
          <td><span class="style5">Age / Gender </span></td>
          <td align="left" valign="top">&nbsp;{{$data->AgeGender}}</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
      </table>
      <br />
      <table width="100%" border="1" cellspacing="0" cellpadding="5">
        <tr>
          <td width="15%" align="left" valign="top"><span class="style5">Sr.No</span></td>
          <td width="45%"><span class="style5">Particulars</span></td>
          <td width="15%" align="center" valign="top"><span class="style5">Qty</span></td>
          <td width="25%" align="right" valign="top"><span class="style5">Amount</span></td>
        </tr>
        @php $i=1;@endphp
        @foreach($data2 as $result)
            <tr>
          <td height="82" align="left" valign="top">&nbsp;{{$i}}</td>
          <td align="left" valign="top">&nbsp;{{$result->FrameName}}<br />
          <br />
          <br />
          <br />
          <br /></td>
          <td align="center" valign="top">&nbsp;{{$result->Qty}}</td>
          <td align="right" valign="top">&nbsp;{{$result->Qty * $result->Rate}}</td>
        </tr>
        @if($result->GlassName != '')
        <tr>
          <td height="82" align="left" valign="top">&nbsp;{{$i}}</td>
          <td align="left" valign="top">&nbsp;{{$result->GlassName}}<br />
          <br />
          <br />
          <br />
          <br /></td>
          <td align="center" valign="top">&nbsp;1</td>
          <td align="right" valign="top">&nbsp;{{$result->GlassRate}}</td>
        </tr>
        @endif
        @php $i++;@endphp
        @endforeach
                <tr>
          <td colspan="2" rowspan="3" align="left" valign="top">
          <strong> <em>In Words : </em></strong><?php echo $result2 . "Rupees  " . $points . "";?><br>
              <strong>Payment Mode : </strong>{{$data->PayMode}}
          </td>
          <td height="29" align="left" valign="top"><span class="style5">Total : </span></td>
          <td align="right" valign="top">&nbsp;{{$data->SubTotal}}</td>
        </tr>
        <tr>
          <td height="29" align="left" valign="top"><span class="style5">Advance : </span></td>
          <td align="right" valign="top">&nbsp;{{$data->Advance}}</td>
        </tr>
        <tr>
          <td height="29" align="left" valign="top"><span class="style5">Balance</span></td>
          <td align="right" valign="top">&nbsp;{{$data->NetAmount}}</td>
        </tr>
        <tr>
          <td height="29" colspan="2" align="left" valign="top"><span class="style5">Date of Delivery : {{date("d/m/Y", strtotime(str_replace('-', '/',$data->DeliveryDate)))}}</span></td>
          <td align="left" valign="top">&nbsp;
            </td>
          <td align="right" valign="top">&nbsp;</td>
        </tr>
      </table>      
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="64%" align="left" valign="top"><table width="100%" border="0" cellspacing="3" cellpadding="2">
            <tbody>
              <tr>
                <td style="font-size: 12px;">&#2327;&#2381;&#2352;&#2366;&#2361;&#2325;&#2366;&#2306;&#2330;&#2381;&#2351;&#2366; &#2332;&#2369;&#2344;&#2381;&#2351;&#2366; &#2347;&#2381;&#2352;&#2375;&#2350; &#2325;&#2367;&#2306;&#2357;&#2366; &#2325;&#2366;&#2330;&#2366;&#2306;&#2330;&#2381;&#2351;&#2366; &#2344;&#2369;&#2325;&#2360;&#2366;&#2344;&#2366;&#2330;&#2368; &#2332;&#2348;&#2366;&#2348;&#2342;&#2366;&#2352;&#2368; &#2360;&#2381;&#2357;&#2368;&#2325;&#2366;&#2352;&#2354;&#2368; &#2332;&#2366;&#2339;&#2366;&#2352; &#2344;&#2366;&#2361;&#2368;.</td>
              </tr>
              <tr>
                <td style="font-size: 12px;">&#2325;&#2366;&#2361;&#2368; &#2340;&#2366;&#2306;&#2340;&#2381;&#2352;&#2367;&#2325; &#2325;&#2366;&#2352;&#2339;&#2366;&#2360;&#2381;&#2340;&#2357; &#2330;&#2359;&#2381;&#2350;&#2366; &#2342;&#2375;&#2339;&#2381;&#2351;&#2366;&#2360; &#2357;&#2367;&#2354;&#2306;&#2348; &#2361;&#2379;&#2314; &#2358;&#2325;&#2340;&#2379; .</td>
              </tr>
              <tr>
                <td style="font-size: 12px;">&#2319;&#2325; &#2350;&#2361;&#2367;&#2344;&#2381;&#2351;&#2366;&#2340; &#2330;&#2359;&#2381;&#2350;&#2366; &#2344; &#2344;&#2375;&#2354;&#2381;&#2351;&#2366;&#2360; &#2310;&#2350;&#2381;&#2361;&#2368; &#2332;&#2348;&#2366;&#2348;&#2342;&#2366;&#2352; &#2352;&#2366;&#2361;&#2339;&#2366;&#2352; &#2344;&#2366;&#2361;&#2368;</td>
              </tr>
              <tr>
                <td style="font-size: 12px;">&#2319;&#2325;&#2342;&#2366; &#2342;&#2367;&#2354;&#2375;&#2354;&#2368; &#2321;&#2352;&#2381;&#2337;&#2352; &#2352;&#2342;&#2381;&#2342; &#2361;&#2379;&#2339;&#2366;&#2352; &#2344;&#2366;&#2361;&#2368;</td>
              </tr>
            </tbody>
          </table>          </td>
          <td width="36%">&nbsp;</td>
        </tr>
        <tr>
          <td align="left" valign="top">&nbsp;</td>
          <td align="center" valign="top"><span class="style22">FOR MANASI OPTICAL </span></td>
        </tr>
        <tr>
          <td align="left" valign="top"><span class="style5">Shop Timing : 10:30 AM to 6:00 PM</span> </td>
          <td>&nbsp;</td>
        </tr>
      </table>      
      </td>
  </tr>
</table>
<br />
<br />
<br />
<table width="700" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="2" cellpadding="3">
      <tr>
        <td width="14%" align="left" valign="top" class="style62"><span class="style24 style23 style80"><strong>Name : </strong></span></td>
        <td width="46%" align="left" valign="top" class="style62"><span class="style81">{{$data->PatientName}}</span></td>
        <td width="15%" align="left" valign="top" class="style62"><span class="style24 style23 style80"><strong>Date : </strong></span></td>
        <td width="25%" align="left" valign="top" class="style62"><span class="style81"><span class="commontxtfont">{{date("d/m/Y", strtotime(str_replace('-', '/',$data->SaleDate)))}}</span></span></td>
      </tr>
      <tr>
        <td align="left" valign="top" class="style62"><span class="style24 style23 style80"><strong>Mob : </strong></span></td>
        <td align="left" valign="top" class="style62"><span class="style81">{{$data->MobileNo}}</span></td>
        <td align="left" valign="top" class="style62"><span class="style24 style23 style80"><strong>Bill No: </strong></span></td>
        <td align="left" valign="top" class="style62"><span class="style81"><span class="commontxtfont">{{$data->BillNo}}</span></span></td>
      </tr>
      <tr>
        <td align="left" valign="top" class="style62 style23"><span class="style24 style80"><strong>Frame : </strong></span></td>
        <td align="left" valign="top" class="style62"><span class="style81"></span><span class="style81">{{$result->FrameName}}</span></td>
        <td align="left" valign="top" class="style62"><span class="style24 style23 style80"><strong>          Glasses : </strong> </span></td>
        <td align="left" valign="top" class="style62">&nbsp;{{$result->GlassName}}</td>
      </tr>
      
    </table>
    <br />
    <table width="700" border="0" cellspacing="2" cellpadding="2">
      <tr>
        <td align="center" valign="top"><table width="100%" border="1" cellspacing="0" cellpadding="5">
          <tr>
            <td colspan="4" align="center" valign="top"><span class="style5">RE</span></td>
            </tr>
          <tr>
            <td width="25%" align="center" valign="top"><span class="style5">SPH</span></td>
            <td width="25%" align="center" valign="top"><span class="style5">CYL</span></td>
            <td width="25%" align="center" valign="top"><span class="style5">AXIS</span></td>
            <!-- <td width="25%" align="center" valign="top"><span class="style5">VISION</span></td> -->
          </tr>
          <tr>
            <td align="center" valign="top">&nbsp;{{$data->SrSphRe}}</td>
            <td align="center" valign="top">&nbsp;{{$data->SrCylRe}}</td>
            <td align="center" valign="top">&nbsp;{{$data->SrAxisRe}}</td>
            <!-- <td align="center" valign="top">&nbsp;{{$data->MobileNo}}</td> -->
          </tr>
          <tr>
            <td colspan="2">&nbsp;</td>
            <td colspan="2">&nbsp;{{$data->SrNearAddRe}}</td>
            </tr>
        </table></td>
        <td width="50%" align="center" valign="top"><table width="100%" border="1" cellspacing="0" cellpadding="5">
          <tr>
            <td colspan="4" align="center" valign="top"><span class="style5">LE</span></td>
            </tr>
          <tr>
            <td width="25%" align="center" valign="top"><span class="style5">SPH</span></td>
            <td width="25%" align="center" valign="top"><span class="style5">CYL</span></td>
            <td width="25%" align="center" valign="top"><span class="style5">AXIS</span></td>
            <!-- <td width="25%" align="center" valign="top"><span class="style5">VISION</span></td> -->
          </tr>
          <tr>
            <td align="center" valign="top">&nbsp;{{$data->SrSphLe}}</td>
            <td align="center" valign="top">&nbsp;{{$data->SrCylLe}}</td>
            <td align="center" valign="top">&nbsp;{{$data->SrAxisLe}}</td>
            <!-- <td align="center" valign="top">&nbsp;{{$data->MobileNo}}</td> -->
          </tr>
          <tr>
            <td colspan="2">&nbsp;</td>
            <td colspan="2">&nbsp;{{$data->SrNearAddLe}}</td>
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
