PageRenderTime 43ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/receipts/client/views/form-receipt.client.view.html

https://gitlab.com/pentacode/poweraire-erp
HTML | 201 lines | 184 code | 13 blank | 4 comment | 0 complexity | 85f40f57cc2adbbcc2147ec2f8d18601 MD5 | raw file
  1. <section>
  2. <div ng-class="!vm.receipt._id ? 'page-header': 'top-spacing'">
  3. <h1 data-ng-if="!vm.receipt._id">New Receipt</h1>
  4. </div>
  5. <div class="form-detials-important dtl-border-top" data-ng-if="vm.receipt.number">
  6. <div class="dtl-left">
  7. <span class="dtl-label">RECEIPT NO:</span> {{vm.receipt.number}} <br />
  8. <span class="small-font"><span class="dtl-label">PURCHASE ORDER NO:</span> {{vm.purchaseOrder.number}}</span>
  9. </div>
  10. <div class="dtl-right small-font">
  11. {{vm.receipt.created | date: 'EEEE M/d/yy h:mm:ss a'}}
  12. </div>
  13. <div class="clear-block"></div>
  14. </div>
  15. <div class="col-md-12">
  16. <form name="vm.form.receiptForm" class="form-horizontal" ng-submit="vm.save(vm.form.receiptForm.$valid)" novalidate>
  17. <fieldset>
  18. <div class="form-group" show-errors data-ng-if="!vm.receipt._id && !vm.fromPurchaseUI">
  19. <label class="control-label reqd" for="supplier">Purchase Order No: </label>
  20. <!--<input name="supplier" type="text" ng-model="vm.ponumber" class="form-control" placeholder="Purchase Order Number" ng-change="vm.searchPONumber()" typeahead="c as c.number for c in vm.po" typeahead-wait-ms="50" ng-blur="vm.selectPONumber()" required>-->
  21. <select name="supplier" type="text" ng-model="vm.ponumber" id="supplier" class="form-control" placeholder="Purchase Order Number" ng-options="c as c.number for c in vm.purchaseOrder | orderBy: 'c.date'" ng-change="vm.selectPONumber()" required></select>
  22. <div ng-messages="vm.form.receiptForm.supplier.$error" role="alert">
  23. <p class="help-block error-text" ng-message="required">Purchase Order is required.</p>
  24. </div>
  25. </div>
  26. <div class="form-group" show-errors>
  27. <label class="control-label" for="supplier">Supplier Name: </label>
  28. <input name="supplier" type="text" ng-value="vm.receipt.purchaseOrder.supplier.name" id="supplier" class="form-control" disabled>
  29. </div>
  30. <div class="form-group" show-errors>
  31. <label class="control-label" for="date">Date: </label>
  32. <div class="input-group">
  33. <input type="text" class="form-control" datepicker-popup="dd-MMMM-yyyy" ng-model="vm.receipt.date" is-open="vm.date.opened" datepicker-options="dateOptions" ng-required="true" close-text="Close" placeholder="Date" name="date" ng-disabled="vm.receipt._id" />
  34. <span class="input-group-btn">
  35. <button type="button" class="btn btn-default" ng-click="vm.openDate($event)" ng-disabled="vm.receipt._id"><i class="glyphicon glyphicon-calendar"></i></button>
  36. </span>
  37. <div ng-messages="vm.form.receiptForm.date.$error" role="alert">
  38. </div>
  39. </div>
  40. </div>
  41. <div class="form-group" show-errors>
  42. <label class="control-label" for="description">Comments: </label>
  43. <textarea name="comments" type="text" ng-model="vm.receipt.comments" id="comments" class="form-control" placeholder="Comments" ng-disabled="vm.receipt._id"></textarea>
  44. <div ng-messages="vm.form.receiptForm.comments.$error" role="alert">
  45. </div>
  46. </div>
  47. <br/>
  48. <!--<div class="button-cnt button-group" ng-show="!vm.receipt._id">
  49. <div class="btn btn-primary" ng-click="vm.addLine(vm.receipt.lines)"><i class="glyphicon glyphicon-plus"></i> Add Lines</div>
  50. </div>-->
  51. <table class="table table-bordered table-condensed table-striped table-hover table-responsive">
  52. <tr>
  53. <th width="24%">Item</th>
  54. <th width="13%" class="reqd">Quantity</th>
  55. <th width="7%">Amount (Php) </th>
  56. <th width="10%">Status</th>
  57. <th width="40%" class="reqd">Charge Account</th>
  58. <th width="7%" class="reqd">Serial</th>
  59. <th width="10px">Action</th>
  60. </tr>
  61. <tr data-ng-if="!vm.receipt.lines.length">
  62. <td colspan="7" align="center">No records found</td>
  63. </tr>
  64. <tr data-ng-repeat="list in vm.receipt.lines">
  65. <td class="cell-readonly">
  66. {{vm.getPoLine(list.number)}}
  67. {{ vm.currentPoLine.item.code }} - {{ vm.currentPoLine.item.description }}
  68. </td>
  69. <td>
  70. <input name="quantity" type="number" ng-model="list.quantity" id="quantity" class="form-control" ng-disabled="vm.receipt._id || vm.statusChecking(vm.currentPoLine.status) " oninput="validity.valid || (value='')" min="0">
  71. </td>
  72. <td class="cell-readonly">
  73. {{ vm.getAmountPerLine(list, vm.currentPoLine) | currency:'' }}
  74. </td>
  75. <td class="cell-readonly" data-ng-bind="vm.currentPoLine.status"></td>
  76. <td >
  77. <div class="input-group" popover="{{vm.getPopOverDescription(list.chargeAccount)}}" popover-trigger="mouseenter" popover-popup-delay="500" popover-placement="left" >
  78. <select name="chargeAccount" type="text" ng-model="list.chargeAccount" id="chargeAccount" class="form-control" ng-options="account._id as account.accountDescription for account in vm.chargeAccount" ng-disabled="vm.receipt._id || vm.statusChecking(vm.currentPoLine.status) "></select>
  79. <span class="input-group-btn">
  80. <button type="button" class="btn btn-primary" ng-click="vm.openActionCodeLookup($index)" ng-hide="vm.receipt._id || vm.statusChecking(vm.currentPoLine.status)"><i class="glyphicon glyphicon-search" ></i></button>
  81. </span>
  82. </div>
  83. </td>
  84. <td>
  85. <div class="btn btn-primary" data-toggle="modal" data-target="#myModal" ng-click="vm.showSerials(list, $index)"><i class="glyphicon glyphicon-search"></i></div>
  86. </td>
  87. <td>
  88. <div class="btn btn-danger" ng-click="vm.deleteLine($index, vm.receipt._id, vm.currentPoLine)" ng-disabled="vm.receipt._id || vm.statusChecking(vm.currentPoLine.status) "><i class="glyphicon glyphicon-trash"></i></div>
  89. </td>
  90. </tr>
  91. </table>
  92. <div class="lineTotal"><b>Total: </b>{{ vm.computeTotal(vm.receipt.lines, vm.currentPoLine) | currency:'' }}</div>
  93. <div ng-show="vm.poLine.length">
  94. <div class="page-subheader">
  95. <h4>Completed / Cancelled Items</h4>
  96. </div>
  97. <table class="table table-bordered table-condensed table-striped table-hover table-responsive">
  98. <tr>
  99. <th width="30%">Item</th>
  100. <th width="10%">Ordered</th>
  101. <th width="10%">Received</th>
  102. <th width="10%">Cancelled</th>
  103. <th width="15%%">Purchased Price (Php)</th>
  104. <th width="15%">Status</th>
  105. </tr>
  106. <tr data-ng-if="!vm.poLine.length">
  107. <td colspan="5" align="center">No records found</td>
  108. </tr>
  109. <tr data-ng-repeat="list in vm.poLine">
  110. <td class="cell-readonly">
  111. {{ list.item.code }} - {{ list.item.description }}
  112. </td>
  113. <td class="cell-readonly" data-ng-bind="list.ordered"></td>
  114. <td class="cell-readonly" data-ng-bind="list.received"></td>
  115. <td class="cell-readonly" data-ng-bind="list.cancelled"></td>
  116. <td class="cell-readonly">
  117. {{ list.purchasedPrice | currency:'' }}
  118. </td>
  119. <td class="cell-readonly" data-ng-bind="list.status"></td>
  120. </tr>
  121. </table>
  122. </div>
  123. <div class="form-group">
  124. <button type="submit" class="btn btn-success" ng-show="!vm.receipt._id">Save</button>
  125. <button type="button" class="btn btn-default" ng-show="!vm.receipt._id" ng-click="vm.resetReceipt()">Reset</button>
  126. <button type="button" class="btn btn-primary" data-ui-sref="receipts.purchaseOrder({ purchaseOrderId: vm.purchaseOrder._id })" data-ng-if="vm.fromPurchaseUI">View Purchase Order</button>
  127. <button type="button" class="btn btn-default" data-ui-sref="receipts.list">Back</button>
  128. </div>
  129. </fieldset>
  130. </form>
  131. <div class="form-detials dtl-border" data-ng-if="vm.receipt.created">
  132. <div class="dtl-left">
  133. <span class="dtl-label" data-ng-if="vm.receipt.updatedBy">Updated By:</span> {{vm.receipt.updatedBy.username}} <br/>
  134. <span class="dtl-label" data-ng-if="vm.receipt.updated">Date Updated:</span> {{vm.receipt.updated | date: 'medium'}}
  135. </div>
  136. <div class="dtl-right">
  137. <span class="dtl-label" data-ng-if="vm.receipt.createdBy">Created By:</span> {{vm.receipt.createdBy.username}} <br/>
  138. <span class="dtl-label" data-ng-if="vm.receipt.created">Date Created:</span> {{vm.receipt.created | date: 'medium'}}
  139. </div>
  140. <div class="clear-block"></div>
  141. </div>
  142. </div>
  143. </section>
  144. <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  145. <div class="modal-dialog modal-lg" role="document">
  146. <div class="modal-content">
  147. <div class="modal-header bg-primary text-white">
  148. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  149. <span aria-hidden="true">&times;</span>
  150. </button>
  151. <h3 class="modal-title" id="myModalLabel">Serials</h3>
  152. </div>
  153. <div class="modal-body">
  154. <div class="button-cnt button-group" ng-show="!vm.receipt._id">
  155. <div class="btn btn-primary" ng-click="vm.addSerial(vm.receipt.lines[vm.currentIndex].serials)"><i class="glyphicon glyphicon-plus"></i> Add Serials</div>
  156. </div>
  157. <table class="table table-bordered table-condensed table-striped table-hover table-responsive">
  158. <tr>
  159. <th width="25%" class="reqd">Serial #</th>
  160. <th width="60%" class="reqd">Sub Inventory</th>
  161. <th width="15%" class="reqd">Quantity</th>
  162. <th width="10px">Action</th>
  163. </tr>
  164. <tr data-ng-if="vm.receipt.lines[vm.currentIndex].serials.length === 0">
  165. <td colspan="7" align="center">No records found</td>
  166. </tr>
  167. <tr data-ng-repeat="se in vm.receipt.lines[vm.currentIndex].serials">
  168. <td>
  169. <input name="serialNumber" type="text" ng-model="se.serial" id="serialNumber" required ng-disabled="vm.receipt._id" typeahead="serial._id as serial.displaySerial for serial in vm.existingSerials | filter:$viewValue:$emptyOrMatch" typeahead-on-select='onSerialSelect(se,$item,$label)' class="form-control" typeahead-click-open >
  170. </td>
  171. <td>
  172. <select name="subInventory" type="text" ng-model="se.subInventory" id="subInventory" class="form-control" ng-options="si._id as si.value for si in vm.subInventories" ng-disabled="vm.receipt._id"></select>
  173. </td>
  174. <td>
  175. <input name="serialQty" type="number" ng-model="se.quantity" id="serialQty" class="form-control" required ng-disabled="vm.receipt._id" oninput="validity.valid || (value='')" min="0">
  176. </td>
  177. <td>
  178. <div class="btn btn-danger" ng-click="vm.deleteSerial($index, vm.receipt._id)" ng-disabled="vm.receipt._id"><i class="glyphicon glyphicon-trash"></i> </div>
  179. </td>
  180. </tr>
  181. </table>
  182. </div>
  183. <div class="modal-footer">
  184. <button type="button" class="btn btn-primary" ng-click="saveSerial(vm.currentIndex)" data-dismiss="modal">Okay</button>
  185. </div>
  186. </div>
  187. </div>
  188. </div>