show.blade.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <div class="modal-content" style='width:60%;margin:0 auto !important'>
  2. <div class="modal-header">
  3. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  4. <h4 class="modal-title">Invoice &nbsp;&nbsp;&nbsp;
  5. <a href=""><i class="fa fa-print"></i></a> &nbsp;&nbsp;&nbsp;
  6. <a href="" data-inv_id='{{ $invoice->id }}' id='btn_email'><i class="fa fa-envelope-o"></i></a>&nbsp;&nbsp;&nbsp;
  7. @if($invoice->status==0)
  8. <span class='label label-danger'>Due</span>
  9. @elseif($invoice->status==1)
  10. <span class='label label-success'>Paid</span>
  11. @endif
  12. </h4>
  13. </div>
  14. <div class="modal-body">
  15. <style>
  16. .invoice-box{
  17. max-width:100%;
  18. margin:auto;
  19. padding:30px;
  20. border:1px solid #eee;
  21. font-size:16px;
  22. line-height:24px;
  23. font-family:'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
  24. color:#555;
  25. }
  26. .invoice-box table{
  27. width:100%;
  28. line-height:inherit;
  29. text-align:left;
  30. }
  31. .invoice-box table td{
  32. padding:5px;
  33. vertical-align:top;
  34. }
  35. .invoice-box table tr td:nth-child(2){
  36. text-align:left;
  37. }
  38. .invoice-box table tr.top table td{
  39. padding-bottom:20px;
  40. }
  41. .invoice-box table tr.top table td.title{
  42. font-size:18px;
  43. line-height:18px;
  44. color:#333;
  45. }
  46. .invoice-box table tr.information table td{
  47. padding-bottom:40px;
  48. }
  49. .invoice-box table tr.heading td{
  50. background:#eee;
  51. border-bottom:1px solid #ddd;
  52. font-weight:bold;
  53. }
  54. .invoice-box table tr.details td{
  55. padding-bottom:20px;
  56. }
  57. .invoice-box table tr.item td{
  58. border-bottom:1px solid #eee;
  59. }
  60. .invoice-box table tr.item.last td{
  61. border-bottom:none;
  62. }
  63. .invoice-box table tr.total td:nth-child(2){
  64. border-top:2px solid #eee;
  65. font-weight:bold;
  66. }
  67. @media only screen and (max-width: 600px) {
  68. .invoice-box table tr.top table td{
  69. width:100%;
  70. display:block;
  71. text-align:center;
  72. }
  73. .invoice-box table tr.information table td{
  74. width:100%;
  75. display:block;
  76. text-align:center;
  77. }
  78. }
  79. </style>
  80. <div class="invoice-box">
  81. <table cellpadding="0" cellspacing="0">
  82. <tr class="top">
  83. <td colspan="4">
  84. <table width="100%">
  85. <tr>
  86. <td class="">
  87. Invoice No#: {{ $invoice->invoice_code }}<br>
  88. Created: {{ date('d F, Y',strtotime($invoice->invoice_date)) }}<br>
  89. Due: {{ date('d F, Y',strtotime($invoice->due_date)) }} <br>
  90. PO No : {{ $invoice->po_no }}
  91. </td>
  92. <td>
  93. </td>
  94. </tr>
  95. </table>
  96. </td>
  97. </tr>
  98. <tr class="information">
  99. <td colspan="4">
  100. <table width="100%">
  101. <tr>
  102. <td width="50">
  103. <h4>From</h4>
  104. <!-- <img src="http://revinr.com/logo.png" style=""> -->
  105. UpArrow Digital<br>
  106. House 37, Road 03<br>
  107. Sector 09, Dhaka 1230
  108. </td>
  109. <td width="50">
  110. <h4>To</h4>
  111. {{ $invoice->client?$invoice->client->name:'' }}<br>
  112. {{ $invoice->client?$invoice->client->address:'' }}
  113. </td>
  114. </tr>
  115. </table>
  116. </td>
  117. </tr>
  118. <tr class="heading">
  119. <td style='width:20px;'>Sl.</td>
  120. <td class='text-left'>
  121. Service
  122. </td>
  123. <td>Particulars</td>
  124. <td class='text-right'>
  125. Price ({{ $invoice->currency }})
  126. </td>
  127. </tr>
  128. @if($invoice->items)
  129. <?php $indx=1; ?>
  130. @foreach($invoice->items as $row)
  131. <tr class="item">
  132. <td style='width: 20px;'>{{ $indx }}</td>
  133. <td class='text-left'>
  134. {{ $row->service?$row->service->name:'' }}
  135. </td>
  136. <td>{{ $row->particular }}</td>
  137. <td class="text-right">
  138. {{ $row->payable_amount }}
  139. </td>
  140. </tr>
  141. <?php $indx++; ?>
  142. @endforeach
  143. @endif
  144. <tr class="total">
  145. <?php
  146. $total=$invoice->items?$invoice->items->sum('payable_amount'):0;;
  147. $total1=$invoice->items?$invoice->items->sum('payable_amount'):0;
  148. $total2=$invoice->items?$invoice->items->sum('payable_amount'):0;
  149. $total_vat=($total1*$invoice->vat)/100;
  150. $total_tax=($total2*$invoice->tax)/100;
  151. ?>
  152. <td colspan="2">Vat ({{ $invoice->vat }}%)</td>
  153. <td colspan="2" style='text-align: right;'>
  154. {{ $total_vat }}
  155. </td>
  156. </tr>
  157. <tr class="total">
  158. <td colspan="2">Tax ({{ $invoice->tax }}%)</td>
  159. <td colspan="2" style='text-align: right;'>
  160. {{ $total_tax }}
  161. </td>
  162. </tr>
  163. <tr class="total">
  164. <td colspan="2"></td>
  165. <td colspan="2" style='text-align: right;'>
  166. <?php
  167. $total=$total+$total_vat+$total_tax;
  168. ?>
  169. Total: {{ $total }}
  170. </td>
  171. </tr>
  172. @if(!empty($invoice->notes))
  173. <tr>
  174. <td colspan="4">
  175. <br><br>
  176. Notes: {{ $invoice->notes }}
  177. </td>
  178. </tr>
  179. @endif
  180. </table>
  181. </div>
  182. </div>
  183. </div>
  184. <script type="text/javascript">
  185. $(document).ready(function() {
  186. $('#btn_email').click(function(e){
  187. e.preventDefault();
  188. var inv_id=$(this).data('inv_id');
  189. $.ajax({
  190. url: '{{ url('invoice/invoice_created_email') }}/'+inv_id,
  191. type: 'GET'
  192. })
  193. .done(function(res) {
  194. alert('Email sent successfully !')
  195. });
  196. });
  197. });
  198. </script>