PageRenderTime 34ms CodeModel.GetById 7ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/Inventory/Resources/views/reports/kardex/index.blade_bk.php

https://gitlab.com/laher01/factu40
PHP | 229 lines | 196 code | 33 blank | 0 comment | 12 complexity | f2dba637b5d08a670e0755ffb39a74c7 MD5 | raw file
  1. @extends('tenant.layouts.app')
  2. @section('content')
  3. <div class="row">
  4. <div class="col-md-12">
  5. <div class="card card-primary">
  6. <div class="card-header">
  7. <div>
  8. <h4 class="card-title">Consulta kardex</h4>
  9. </div>
  10. </div>
  11. <div class="card-body">
  12. <div>
  13. <form action="{{route('reports.kardex.search')}}" class="el-form demo-form-inline el-form--inline" method="GET">
  14. <div class="box">
  15. <div class="box-body no-padding">
  16. <!-- {{Form::label('item_id', 'Producto')}}-->
  17. <!--{{Form::select('item_id', $items->pluck('description', 'id'), old('item_id', request()->item_id), ['class' => 'form-control col-md-6'])}} -->
  18. <tenant-product
  19. :data_d="{{json_encode(isset($_GET['d']) ? $_GET['d']:null)}}"
  20. :data_a="{{json_encode(isset($_GET['a']) ? $_GET['a']:null)}}"
  21. :data_products="{{json_encode($items)}}"
  22. :item_selected="{{json_encode(isset($_GET['item_selected']) ? $_GET['item_selected']:null)}}"
  23. ></tenant-product>
  24. </div>
  25. <div class="el-form-item col-xs-12">
  26. <div class="el-form-item__content">
  27. <button class="btn btn-custom" type="submit"><i class="fa fa-search"></i> Buscar</button>
  28. </div>
  29. </div>
  30. </div>
  31. </form>
  32. </div>
  33. @if(!empty($reports) && $reports->count())
  34. <div class="box">
  35. <div class="box-body no-padding">
  36. <div style="margin-bottom: 10px">
  37. @if(isset($reports))
  38. <form action="{{route('reports.kardex.pdf')}}" class="d-inline" method="POST">
  39. {{csrf_field()}}
  40. <input type="hidden" value="{{$d}}" name="d">
  41. <input type="hidden" value="{{$a}}" name="a">
  42. <input type="hidden" name="item_id" value="{{$_GET['item_selected']}}">
  43. <button class="btn btn-custom mt-2 mr-2" type="submit"><i class="fa fa-file-pdf"></i> Exportar PDF</button>
  44. </form>
  45. <form action="{{route('reports.kardex.report_excel')}}" class="d-inline" method="POST">
  46. {{csrf_field()}}
  47. <input type="hidden" value="{{$d}}" name="d">
  48. <input type="hidden" value="{{$a}}" name="a">
  49. <input type="hidden" name="item_id" value="{{$_GET['item_selected']}}">
  50. <button class="btn btn-custom mt-2 mr-2" type="submit"><i class="fa fa-file-excel"></i> Exportar Excel</button>
  51. </form>
  52. @endif
  53. </div>
  54. <table width="100%" class="table table-striped table-responsive-xl table-bordered table-hover">
  55. <thead class="">
  56. <tr>
  57. <th>#</th>
  58. <th>Fecha y hora transacción</th>
  59. <th>Tipo transacción</th>
  60. <th>Número</th>
  61. <th>Feha emisión</th>
  62. <th>Entrada</th>
  63. <th>Salida</th>
  64. <th>Saldo</th>
  65. </tr>
  66. </thead>
  67. <tbody>
  68. @foreach($reports as $key => $value)
  69. <tr>
  70. <td>{{$loop->iteration}}</td>
  71. <td>{{$value->created_at}}</td>
  72. <td>
  73. @switch($value->inventory_kardexable_type)
  74. @case($models[0])
  75. {{($value->quantity < 0) ? "Venta":"Anulación Venta"}}
  76. @break
  77. @case($models[1])
  78. {{($value->quantity < 0) ? "Anulación Compra":"Compra"}}
  79. @break
  80. @case($models[2])
  81. {{"Nota de venta"}}
  82. @break
  83. @case($models[3])
  84. {{$value->inventory_kardexable->description}}
  85. @break
  86. @endswitch
  87. </td>
  88. <td>
  89. @switch($value->inventory_kardexable_type)
  90. @case($models[0])
  91. {{ optional($value->inventory_kardexable)->series.'-'.optional($value->inventory_kardexable)->number }}
  92. @break
  93. @case($models[1])
  94. {{ optional($value->inventory_kardexable)->series.'-'.optional($value->inventory_kardexable)->number }}
  95. @break
  96. @case($models[2])
  97. {{ optional($value->inventory_kardexable)->prefix.'-'.optional($value->inventory_kardexable)->id }}
  98. @break
  99. @case($models[3])
  100. {{"-"}}
  101. @break
  102. @endswitch
  103. </td>
  104. <td>
  105. @switch($value->inventory_kardexable_type)
  106. @case($models[0])
  107. {{ isset($value->inventory_kardexable->date_of_issue) ? $value->inventory_kardexable->date_of_issue->format('Y-m-d') : '' }}
  108. @break
  109. @case($models[1])
  110. {{ isset($value->inventory_kardexable->date_of_issue) ? $value->inventory_kardexable->date_of_issue->format('Y-m-d') : '' }}
  111. @break
  112. @case($models[2])
  113. {{ isset($value->inventory_kardexable->date_of_issue) ? $value->inventory_kardexable->date_of_issue->format('Y-m-d') : '' }}
  114. @break
  115. @case($models[3])
  116. {{"-"}}
  117. @break
  118. @endswitch
  119. </td>
  120. @php
  121. if($value->inventory_kardexable_type == $models[3]){
  122. if(!$value->inventory_kardexable->type){
  123. $transaction = Modules\Inventory\Models\InventoryTransaction::findOrFail($value->inventory_kardexable->inventory_transaction_id);
  124. }
  125. }
  126. @endphp
  127. <td>
  128. @switch($value->inventory_kardexable_type)
  129. @case($models[0])
  130. {{ ($value->quantity > 0) ? $value->quantity:"-"}}
  131. @break
  132. @case($models[1])
  133. {{ ($value->quantity > 0) ? $value->quantity:"-"}}
  134. @break
  135. @case($models[3])
  136. @if($value->inventory_kardexable->type != null)
  137. {{ ($value->inventory_kardexable->type == 1) ? $value->quantity : "-" }}
  138. @else
  139. {{($transaction->type == 'input') ? $value->quantity : "-" }}
  140. @endif
  141. @break
  142. @default
  143. {{"-"}}
  144. @break
  145. @endswitch
  146. </td>
  147. <td>
  148. @switch($value->inventory_kardexable_type)
  149. @case($models[0])
  150. {{ ($value->quantity < 0) ? $value->quantity:"-" }}
  151. @break
  152. @case($models[1])
  153. {{ ($value->quantity < 0) ? $value->quantity:"-"}}
  154. @break
  155. @case($models[2])
  156. {{ $value->quantity }}
  157. @break
  158. @case($models[3])
  159. @if($value->inventory_kardexable->type != null)
  160. {{($value->inventory_kardexable->type == 2 || $value->inventory_kardexable->type == 3) ? $value->quantity : "-" }}
  161. @else
  162. {{($transaction->type == 'output') ? $value->quantity : "-" }}
  163. @endif
  164. @break
  165. @default
  166. {{"-"}}
  167. @break
  168. @endswitch
  169. </td>
  170. @php
  171. $balance += $value->quantity;
  172. @endphp
  173. <td>{{number_format($balance, 4)}}</td>
  174. </tr>
  175. @endforeach
  176. </tbody>
  177. </table>
  178. Total {{$reports->total()}}
  179. <label class="pagination-wrapper ml-2">
  180. {{$reports->appends($_GET)->render()}}
  181. </label>
  182. </div>
  183. </div>
  184. @else
  185. <div class="box box-body no-padding">
  186. <strong>No se encontraron registros</strong>
  187. </div>
  188. @endif
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. @endsection
  194. @push('scripts')
  195. <script></script>
  196. @endpush