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

/magehelp/application/views/procurement/purchaseorder/approval/receipt_approval_grid.php

https://bitbucket.org/jit_bec/shopifine
PHP | 275 lines | 226 code | 38 blank | 11 comment | 1 complexity | 2b3b8f72314fac7848630352f1b18123 MD5 | raw file
Possible License(s): LGPL-3.0
  1. <html>
  2. <head>
  3. <?php $this->load->view("common/header"); ?>
  4. <!-- <script type="text/javascript" src="http://jzaefferer.github.com/jquery-validation/jquery.validate.js"></script>-->
  5. <style>
  6. .column {
  7. float: left;
  8. padding: 1em;
  9. width:45%;
  10. }
  11. .base-column{
  12. width:100%;
  13. }
  14. #content_area{
  15. width:1000px;
  16. }
  17. .extra-wide{
  18. width:95%;
  19. }
  20. .field{
  21. width:100%;
  22. }
  23. .ui-widget-header {height:12px;}
  24. .quote-column {
  25. float: left;
  26. padding-bottom: 0.5em;
  27. width: 95%;
  28. }
  29. .ui-combobox {
  30. width:14em;
  31. }
  32. .ui-combobox-input{
  33. width:12em;
  34. }
  35. #supplierOp-input{
  36. width:10em;
  37. }
  38. #warehouseOp-input{
  39. width:10em;
  40. }
  41. .calculated {
  42. color: green;
  43. font-size: 90%;
  44. }
  45. .row{
  46. width:95%;
  47. }
  48. .shopifine-ro-label {
  49. float: left;
  50. padding-right: 0.5em;
  51. width: 50%;
  52. word-wrap: break-word;
  53. color:#2E6E9E;
  54. }
  55. .shopifine-output {
  56. float: right;
  57. width: 45%;
  58. word-wrap: break-word;
  59. font-weight:bold;
  60. }
  61. .ui-tabs {
  62. height: 80%;
  63. margin: 0 auto;
  64. width: 70%;
  65. left:0;
  66. }
  67. #notetab {
  68. height:30em;
  69. }
  70. #details {
  71. height:12em;
  72. }
  73. .ui-tabs-nav{
  74. height:22px;
  75. }
  76. .labeldiv {
  77. color: #2E6E9E;
  78. float: left;
  79. font-size: 110%;
  80. font-weight: bold;
  81. margin-right: .5em;
  82. width: 35%;
  83. word-wrap: break-word;
  84. }
  85. .valuediv {
  86. float: left;
  87. font-weight: bold;
  88. width: 45%;
  89. word-wrap: break-word;
  90. }
  91. label.error {
  92. margin-right: .5em;
  93. }
  94. #status-message-li{
  95. color: red;
  96. font-size: 110%;
  97. font-style: italic;
  98. margin: 0 auto;
  99. width: 80%;
  100. }
  101. body{
  102. height:700px;
  103. }
  104. </style>
  105. <script type="text/javascript">
  106. $(function() {
  107. $("#notesForm").validate();
  108. // Main Request For Quotation Grid
  109. var myGrid = $("#receipts");
  110. var settingsObj ={grid_id:'receipts',pager:'pager',multiselect:true};
  111. var subgridSettingsObj = {customButtons:{reject:true},multiselect:true};
  112. prepareReceiptsGrid(settingsObj,{_status: 'waitingforapproval',mode:'admin'},true,{},{},subgridSettingsObj)
  113. myGrid.navGrid("#pager",{edit:false,add:false,view:false,del:false,search:false},{},{},{},{},{});
  114. var buttons = {approve:true,reject:true,mark_approver:true,assign:true,load_approver_all:true};
  115. addCustomButtonsInReceiptGrid('receipts','pager',null,buttons);
  116. myGrid.jqGrid('filterToolbar', {stringResult: true, searchOnEnter: true, defaultSearch : "cn"});
  117. var myGridRI = $("#receiptitems");
  118. var settingObj = {grid_id:'receiptitems',pager:'pagerRI',multiselect:true};
  119. var hiddenObj = {line_reference:true,returned_quantity:true,returned_value:true,receiving_notes:true,returned_notes:true};
  120. var subgridSettingsObj = {multiselect:true,customButtons:{reject:true,approve:true},status:['waitingforapproval'],filter:true};
  121. prepareReceiptItemsGrid(settingObj,{oper:'pp_approve',mode:'admin'},true,{},hiddenObj,subgridSettingsObj);
  122. myGridRI.navGrid('#pagerRI',{edit:false,add:false,view:true,del:false,search:false},{},{},{},{},{});
  123. var buttons = {mark_approver:true,assign:true,load_approver_all:true};
  124. addCustomButtonsInReceiptItemGrid('receiptitems','pagerRI',null,buttons);
  125. myGridRI.jqGrid('filterToolbar', {stringResult: true, searchOnEnter: true, defaultSearch : "cn"});
  126. $( "#modal-warning-order" ).dialog({
  127. autoOpen:false,
  128. height: 80,
  129. modal: true
  130. });
  131. $( "#dialog-rejection-notes" ).dialog({
  132. autoOpen: false,
  133. height: 'auto',
  134. width: '35%',
  135. position:[450,25],
  136. modal: true,
  137. buttons: {
  138. "DoneButton": {
  139. id:"doneBtn",
  140. text:"Reject",
  141. click:function() {
  142. var isvalid = $("#notesForm").valid();
  143. var grid_id = $(this).data('grid_data').grid_id;
  144. var url = $(this).data('grid_data').url;
  145. // "index.php/procurement/rejectReceipt"
  146. var multiple = $(this).data('grid_data').multiple;
  147. var receiptLineIds = $(this).data('grid_data').receiptLineIds;
  148. var receiptLineId = $(this).data('grid_data').receiptLineId;
  149. var receiptId = $(this).data('grid_data').receiptId;
  150. var ppIds = $(this).data('grid_data').ppIds;
  151. var ppId = $(this).data('grid_data').ppId;
  152. if (isvalid){
  153. $.ajax({
  154. url:url,
  155. type:"POST",
  156. data:{
  157. receiptId:receiptId,//ignore this for receipt line item reject in the back end
  158. rejection_notes:$("#rejected_notes").val(),
  159. multiple:multiple,
  160. receiptLineIds:receiptLineIds,//ignore for single item reject and total receipt reject in the back end
  161. receiptLineId:receiptLineId, //ignore for multiple item reject and total receipt reject in the back end
  162. /* only for Part Payment */
  163. ppIds:ppIds,//ignore for single item reject and total receipt reject in the back end(
  164. ppId:ppId
  165. },
  166. success:function (response){
  167. //console.log("grid " + grid);
  168. emptyMessages();
  169. showSuccessMessage("Selected Receipt Has Been Rejected ")
  170. myGrid.trigger("reloadGrid");
  171. },
  172. error:function (response){
  173. //console.log("grid " + grid);
  174. emptyMessages();
  175. showSuccessMessage("Selected Receipt Could Not Be Processed For Internal Error ")
  176. }
  177. })
  178. $( this ).dialog( "close" );
  179. }
  180. }
  181. },
  182. Cancel: function() {
  183. $( this ).dialog( "close" );
  184. }
  185. },
  186. close: function() {
  187. $("#notesForm").data('validator').resetForm();
  188. $('#notesForm')[0].reset();
  189. }
  190. });
  191. });
  192. $(window).load(function(){
  193. var warningDialogs={one:true,none:true,status:true,exactlyone:true,morethanone:true};
  194. initDialogs(warningDialogs);
  195. initCommentsForQuote();
  196. initAssignmentCommon();
  197. });
  198. </script>
  199. </head>
  200. <body>
  201. <?php $this->load->view("common/menubar"); ?>
  202. <?php $this->load->view("common/dialogs"); ?>
  203. <div id="modal-warning-order" title="Warning" class="inithide">
  204. <p>Please Select Receipt with The Same Order Reference</p>
  205. </div>
  206. <div style="display: block;height: 100%;" class="shopifine-ui-dialog ui-widget ui-widget-content ui-corner-all" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-dialog-form">
  207. <?php $this->load->view("common/message"); ?>
  208. <div class="table-grid" style="height:40%">
  209. <h1 id="table_header_receipt">Approve Receipts</h1>
  210. <table id="receipts"><tr><td/></tr></table>
  211. <div id="pager"></div>
  212. </div>
  213. <div class="table-grid" style="height:40%">
  214. <h1 id="table_header_receipt_item">Approve Part Payments</h1>
  215. <table id="receiptitems"><tr><td/></tr></table>
  216. <div id="pagerRI"></div>
  217. </div>
  218. </div>
  219. <div id="dialog-rejection-notes">
  220. <h3 id="formHeaderItem">Provide Reason For Rejection</h3>
  221. <div id ="status-message-li" class="ui-corner-all"></div>
  222. <form id="notesForm">
  223. <fieldset>
  224. <div id="rejected_notes_cntnr" class="row single-column-row">
  225. <div class="column quote-column single-column">
  226. <div class="field">
  227. <label for="rejected_notes" class="labeldiv" style="width:25%">Returned Notes:</label>
  228. <textarea id="rejected_notes" name="rejected_notes" row="7" col="100" class="required" style="width:50%"></textarea>
  229. </div>
  230. </div>
  231. </div>
  232. </fieldset>
  233. </form>
  234. </div>
  235. <?php $this->load->view("partial/footer"); ?>
  236. </body>
  237. </html>