create.blade.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. @extends('layouts.master')
  2. @section('content')
  3. <link rel="stylesheet" href="{{ asset('/assets/') }}/css/dataTables.bootstrap.min.css">
  4. <link rel="stylesheet" href="{{ asset('/assets/') }}/css/buttons.dataTables.min.css">
  5. <div class="content">
  6. <div class="row" style="min-height: 500px">
  7. <form action="{{ url('admin/payroll/bill_create') }}" enctype="multipart/form-data" method="POST" role="form">
  8. <div class="col-md-10 col-md-offset-1">
  9. <header class="panel-heading" style="height:50px;">
  10. <div class="pull-left">
  11. {{$title}}
  12. </div>
  13. <div>
  14. @if(\Auth::user()->utype==1)
  15. <a style="margin-left: 3px" href="{{ url('admin/payroll') }}" class="btn btn-sm btn-info pull-right"><i class="fa fa-arrow-left"></i> Back </a>
  16. @endif
  17. </div>
  18. </header>
  19. </div>
  20. <div class="col-md-10 col-md-offset-1">
  21. <div class="panel panel-default">
  22. <div class="panel-body">
  23. @if ($errors->any())
  24. <div class="alert alert-danger">
  25. <ol>
  26. @foreach ($errors->all() as $error)
  27. <li>{{ $error }}</li>
  28. @endforeach
  29. </ol>
  30. </div>
  31. @endif
  32. {{ csrf_field() }}
  33. <div class="col-md-12">
  34. <table class="table table-bordered " id="example">
  35. <thead>
  36. <tr>
  37. <th>#</th>
  38. <th>Employee Name</th>
  39. <th>Designation</th>
  40. <th>Grade</th>
  41. <th class="text-right">Salary</th>
  42. <th class="text-right">Due</th>
  43. <th class="text-right">Payable Amount</th>
  44. <th class="text-center">Status</th>
  45. </tr>
  46. </thead>
  47. <tbody>
  48. @if($all)
  49. <?php $i=1; $total=0; $total_payable=0;?>
  50. @foreach($all as $row)
  51. <tr>
  52. <input type="hidden" name="emp_id[]" value="{{$row->employee->id}}" class="hidden">
  53. <td>{{ $i++ }}</td>
  54. <td>{{ $row->employee->name }}</td>
  55. <td>{{ $row->designationName->designation['name'] }}</td>
  56. <td>{{ $row->grade->name }}</td>
  57. <td class="text-right">
  58. <?php $salary=0; ?>
  59. @foreach($row->psHead as $data)
  60. @php $salary = $salary + $data->amount @endphp
  61. @endforeach
  62. <span>{{ number_format($salary,2) }} </span>
  63. <input type="hidden" name="salary[]" value="{{$salary}}" class="hidden">
  64. </td>
  65. <td class="text-right">
  66. <?php $gross=0; $paid=0; ?>
  67. @foreach($row->due as $due)
  68. @php
  69. $gross = $gross + $due->gross_amount;
  70. $paid = $paid + $due->paid_amount
  71. @endphp
  72. @endforeach
  73. @php
  74. $total_due = $gross - $paid
  75. @endphp
  76. {{ number_format($total_due,2) }}
  77. </td>
  78. <td class="text-right">{{ number_format($total_payable = $salary + $total_due,2) }}</td>
  79. <td class="text-center">
  80. @if($total_due <= 0)
  81. <label class="label label-success">Paid</label>
  82. @else
  83. <label class="label label-info">Due</label>
  84. @endif
  85. </td>
  86. @php $total = $total + $total_payable @endphp
  87. </tr>
  88. @endforeach
  89. @endif
  90. </tbody>
  91. </table>
  92. <h5 class="text-right"><b>Total Salary : {{ number_format($total,2) }} TK. </b></h5>
  93. </div>
  94. <div class="col-md-12" style="margin-top: 15px">
  95. <a href="{{ url('admin/payroll') }}" class="btn btn-default pull-left">
  96. <span class="btn-icon">
  97. <i class="fa fa-times"></i>
  98. </span>
  99. Cancel
  100. </a>
  101. <button type="submit" class="btn btn-inline btn-success pull-right">
  102. <span class="btn-icon">
  103. <i class="fa fa-plus"></i>
  104. </span>
  105. Bill Create
  106. </button>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </form>
  112. </div>
  113. </div>
  114. @stop
  115. @section('script')
  116. <script src="{{ asset('/assets/') }}/js/jquery.dataTables.min.js"></script>
  117. <script src="{{ asset('/assets/') }}/js/dataTables.bootstrap.min.js"></script>
  118. <script src="{{ asset('/assets/') }}/js/dataTables.buttons.min.js"></script>
  119. <script src="{{ asset('/assets/') }}/js/buttons.print.min.js"></script>
  120. <script type="text/javascript">
  121. var table=$("#example").DataTable({
  122. "searching": true,
  123. "lengthChange": false,
  124. "ordering": false,
  125. "bPaginate": false,
  126. "bInfo" : false,
  127. dom: 'Bfrtip',
  128. buttons: [
  129. 'print'
  130. ]
  131. });
  132. </script>
  133. @if(Session::has('msg'))
  134. <div class="alert alert-success center-block msg_alt" >
  135. <a class="close" data-dismiss="alert" href="#">&times;</a>
  136. <strong><i class="fa fa-check"></i></strong>&nbsp;
  137. {{Session::get('msg')}}
  138. </div>
  139. @endif
  140. @stop