PageRenderTime 54ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/resources/views/invoice/single.blade.php

https://bitbucket.org/inets_company/erb_payment
PHP | 240 lines | 212 code | 26 blank | 2 comment | 10 complexity | 768eee9c16735e5de55264a0a68f447c MD5 | raw file
Possible License(s): Apache-2.0
  1. @extends('layouts.app')
  2. @section('content')
  3. <style>
  4. @media print {
  5. a[href]:after {
  6. content: none !important;
  7. }
  8. #myTab {display: block !important; opacity: 1 !important;}
  9. table,thead,tbody,tr,td,th {border: 1px solid black !important;}
  10. #invoice_name{font-size: 15px !important; font-weight: bolder}
  11. }
  12. </style>
  13. <div class="row">
  14. <div class="col-sm-12">
  15. <section class="panel">
  16. <header class="panel-heading">
  17. Invoice
  18. <span class=" pull-right">
  19. <div class="tab-pane">
  20. <div style="">
  21. <?php if ($invoice->status <> 1) { ?> <a href="<?= url('payment/add?id=' . $invoice->id) ?>" class="btn btn-danger btn-sm"><i class="fa fa-money"></i> Add Payment </a>
  22. <?php } ?>
  23. <a href="#" onmousedown="print_page()" class="btn btn-primary btn-sm"><i class="fa fa-print"></i> Print </a>
  24. </div>
  25. </div>
  26. </span>
  27. </header>
  28. <div class="panel-body">
  29. <div class="col-md-12">
  30. <section class="panel">
  31. <div class="panel-body invoice">
  32. <div class="invoice-header">
  33. <div class="invoice-title col-md-3 col-xs-2">
  34. <h1 id="invoice_name">invoice</h1>
  35. </div>
  36. <div class="invoice-info col-md-9 col-xs-10">
  37. <div class="pull-right">
  38. <div class="col-md-6 col-sm-6 pull-left">
  39. <p>Engineers Registration Board <br>
  40. Tetex Building (2nd and 4th Floor),<br>
  41. P.o Box 14942, Dar es salaam</p>
  42. </div>
  43. <div class="col-md-6 col-sm-6 pull-right">
  44. <p>Tel: +255 22 2122836<br>
  45. Email : registrar@erb.go.tz</p>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="row invoice-to">
  51. <div class="col-md-4 col-sm-4 pull-left">
  52. <h4>Invoice To:</h4>
  53. <h2><?= $invoice->user->name ?></h2>
  54. <p>
  55. <br>
  56. Phone: <?= $invoice->user->phone ?><br>
  57. Email : <?= $invoice->user->email ?>
  58. </p>
  59. </div>
  60. <div class="col-md-4 col-sm-5 pull-right">
  61. <div class="row">
  62. <div class="col-md-4 col-sm-5 inv-label">Control #</div>
  63. <div class="col-md-8 col-sm-6"><b style="font-size: 17px"><?= $invoice->number ?></b></div>
  64. </div>
  65. <br>
  66. <div class="row">
  67. <div class="col-md-4 col-sm-5 inv-label">Date #</div>
  68. <div class="col-md-8 col-sm-7"><?= date('d M Y', strtotime($invoice->date)) ?></div>
  69. </div>
  70. <br>
  71. <div class="row">
  72. <div class="col-md-12 inv-label">
  73. <h3>TOTAL DUE</h3>
  74. </div>
  75. <div class="col-md-12">
  76. <td data-title="">
  77. <?php
  78. $am = $invoice->invoiceFee()->sum('amount');
  79. $paid = $invoice->invoiceFeesPayment()->sum('paid_amount');
  80. $unpaid = $am - $paid;
  81. ?>
  82. <h1 class="amnt-value">Tsh <?= number_format($unpaid) ?></h1>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <?php
  88. $invoice_fee = $invoice->invoiceFee()->get();
  89. if ($invoice->user->is_employer == 1) {
  90. ?>
  91. <table class="table table-invoice">
  92. <thead>
  93. <tr>
  94. <th>#</th>
  95. <th class="text-center">Name</th>
  96. <th class="text-center">Email</th>
  97. <th class="text-center">Phone</th>
  98. <th class="text-center">Total</th>
  99. </tr>
  100. </thead>
  101. <tbody>
  102. <?php
  103. $x = 1;
  104. foreach ($invoice_fee as $fees) {
  105. ?>
  106. <tr>
  107. <td><?= $x ?></td>
  108. <td class="text-center">
  109. <h4> <?php
  110. echo $fees->user->name
  111. ?>
  112. </h4>
  113. </td>
  114. <td class="text-center">
  115. <h4> <?php
  116. echo $fees->user->email
  117. ?>
  118. </h4>
  119. </td>
  120. <td class="text-center">
  121. <h4> <?php
  122. echo $fees->user->phone
  123. ?>
  124. </h4>
  125. </td>
  126. <td class="text-center"><?= isset($fees) && count($fees) == 1 ? number_format($fees->amount) : 0 ?></td>
  127. </tr>
  128. <?php $x++;
  129. }
  130. ?>
  131. </tbody>
  132. </table>
  133. <?php } else {
  134. ?>
  135. <table class="table table-invoice">
  136. <thead>
  137. <tr>
  138. <th>#</th>
  139. <th>Description</th>
  140. <th class="text-center">Quantity</th>
  141. <th class="text-center">Total</th>
  142. </tr>
  143. </thead>
  144. <tbody>
  145. <?php
  146. $i = 1;
  147. ?>
  148. <tr>
  149. <td><?= $i ?></td>
  150. <td>
  151. <h4>
  152. <?php
  153. $names = '';
  154. foreach ($invoice_fee as $fees) {
  155. ?>
  156. <?php $names .= $fees->item_name . ',' ?>
  157. <?php
  158. $i++;
  159. }
  160. echo rtrim($names, ',');
  161. ?>
  162. </h4><br/>
  163. <p>Summary: <?= isset($fees) && count($fees) == 1 ? $fees->note : '' ?></p>
  164. </td>
  165. <td class="text-center"><?= $invoice->invoiceFee()->count() ?></td>
  166. <td class="text-center"><?= isset($fees) && count($fees) == 1 ? number_format($fees->amount * $invoice->invoiceFee()->count()) : 0 ?></td>
  167. </tr>
  168. </tbody>
  169. </table>
  170. <?php } ?>
  171. <div class="row">
  172. <div class="col-md-8 col-xs-7 payment-method">
  173. <p><b style="color:#0066cc">FOR BANKS</b>
  174. <br/>
  175. Use the INVOICE NUMBER to make payments in the Bank selected, thereafter a confirmation SMS & email will be sent to the mobile number and email you used during the Booking.
  176. <br/>
  177. <b>(You are advised to print this invoice and submit it to the bank along with the appreciate amount)</b>
  178. </p>
  179. <p>
  180. <br/><b style="color:#0066cc">FOR MOBILE</b><br/>
  181. Use <b>{{$setting->mno_number}}</b> as the Business number and use the CONTROL NUMBER from the system as the reference number to make payments in the selected Mobile Company.</p>
  182. <br/><p><b style="color:#0066cc">NB;</b><br/>
  183. in case you face any challenge, please call +255 222780228 (INETS CO LTD) OR +255 22 2122836 -(ERB)</p>
  184. <br>
  185. </div>
  186. <div class="col-md-4 col-xs-5 invoice-block pull-right">
  187. <ul class="unstyled amounts">
  188. <li>Sub - Total amount : <?= number_format($invoice->getAmount()) ?></li>
  189. <li>Paid Amount : <?= $paid > 0 ? $paid : 0 ?> </li>
  190. <li>Discount :___ </li>
  191. <li class="grand-total">Grand Total : Tsh <?= number_format($unpaid) ?></li>
  192. </ul>
  193. </div>
  194. </div>
  195. </div>
  196. </section>
  197. </div>
  198. </div>
  199. </section>
  200. </div>
  201. </div>
  202. <script type="text/javascript">
  203. print_page = function () {
  204. $('#head_one,#tab_panel_heading').hide();
  205. $('.widget-header, .btn, .breadcrumb, .clearfix').hide();
  206. $('#myTab').removeClass('nav-tabs');
  207. $('#myTab').removeClass('bar_tabs');
  208. window.print();
  209. $('#head_one,#tab_panel_heading').show();
  210. $('.widget-header, .btn, .breadcrumb, .clearfix').show();
  211. $('#myTab').addClass('nav-tabs');
  212. $('#myTab').addClass('bar_tabs');
  213. }</script>
  214. @endsection