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

/magehelp/application/views/procurement/purchaseorder/received/received_order_grid.php

https://bitbucket.org/jit_bec/shopifine
PHP | 327 lines | 134 code | 36 blank | 157 comment | 0 complexity | be885f03515cf2b785ccb4f8be6e8ad7 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. #content_area{
  12. width:1000px;
  13. }
  14. .extra-wide{
  15. width:95%;
  16. }
  17. .field{
  18. width:100%;
  19. }
  20. .ui-widget-header {height:12px;}
  21. .quote-column {
  22. float: left;
  23. padding-bottom: 0.5em;
  24. width: 95%;
  25. }
  26. .ui-combobox {
  27. width:14em;
  28. }
  29. .ui-combobox-input{
  30. width:12em;
  31. }
  32. #supplierOp-input{
  33. width:10em;
  34. }
  35. #warehouseOp-input{
  36. width:10em;
  37. }
  38. .calculated {
  39. color: green;
  40. font-size: 90%;
  41. }
  42. .row{
  43. width:95%;
  44. }
  45. .shopifine-ro-label {
  46. float: left;
  47. padding-right: 0.5em;
  48. width: 50%;
  49. word-wrap: break-word;
  50. color:#2E6E9E;
  51. }
  52. .shopifine-output {
  53. float: right;
  54. width: 45%;
  55. word-wrap: break-word;
  56. font-weight:bold;
  57. }
  58. .ui-tabs {
  59. height: 80%;
  60. margin: 0 auto;
  61. width: 70%;
  62. left:0;
  63. }
  64. #notetab {
  65. height:30em;
  66. }
  67. #details {
  68. height:12em;
  69. }
  70. .ui-tabs-nav{
  71. height:22px;
  72. }
  73. .labeldiv {
  74. color: #2E6E9E;
  75. float: left;
  76. font-size: 110%;
  77. font-weight: bold;
  78. margin-right: .5em;
  79. width: 35%;
  80. word-wrap: break-word;
  81. }
  82. .valuediv {
  83. float: left;
  84. font-weight: bold;
  85. width: 45%;
  86. word-wrap: break-word;
  87. }
  88. label.error {
  89. margin-right: .5em;
  90. }
  91. #status-message-li{
  92. color: red;
  93. font-size: 110%;
  94. font-style: italic;
  95. margin: 0 auto;
  96. width: 80%;
  97. }
  98. </style>
  99. <script type="text/javascript">
  100. $(function() {
  101. // Main Request For Quotation Grid
  102. var myGrid = $("#orders");
  103. // myGrid.jqGrid({
  104. // url:"index.php/procurement/populateReceipts?status=readytoinvoicememo",
  105. // datatype: 'json',
  106. // mtype: 'GET',
  107. // colNames:['Receipt Reference','Supplier Receipt','Supplier',/*'Estimated Value','Owner',*/'Status','Order Id','Order Ref','Quote Ref'/*,'Owner','Needed By Date'*/],
  108. // colModel :[
  109. // {name:'reference', index:'reference', width:100, align:'right',editable:false},
  110. // {name:'supplier_receipt_number',width:140, index:'supplier_receipt_number',editable:false,align:'right'},
  111. // {name:'supplier_name', index:'supplier_name', width:140, align:'right',editable:false},
  112. //// {name:'estimated_value', index:'estimated_value', width:100, align:'right',editable:false,editoptions:{size:"20",maxlength:"30"}},
  113. //// {name:'owner', index:'owner', width:140, align:'right',editable:true,editoptions:{size:"20",maxlength:"30"}},
  114. // {name:'status', index:'status', width:100, align:'right',editable:false,editoptions:{size:"20",maxlength:"30"}},
  115. // {name:'order_id', index:'order_id',hidden:true},
  116. // {name:'order_reference', index:'order_reference',editable:false, width:100, align:'right'},
  117. // {name:'quote_reference', index:'quote_reference',editable:false, width:100, align:'right'},
  118. //// {name:'owner_name', index:'owner_name',editable:false, width:80, align:'right'},
  119. //// {name:'needed_by_date', index:'needed_by_date',editable:false, width:120, sorttype:'date'}
  120. // ],
  121. // pager: '#pager',
  122. // rowNum:10,
  123. // rowList:[5,10,20],
  124. // sortname: 'id',
  125. // sortorder: 'desc',
  126. // viewrecords: true,
  127. // gridview: true,
  128. // multiselect:true,
  129. //
  130. // ignoreCase:true,
  131. // rownumbers:true,
  132. // height:'auto',
  133. // width:'90%',
  134. // caption: 'Receipts',
  135. //
  136. // jsonReader : {
  137. // root:"quotedata",
  138. // page: "page",
  139. // total: "total",
  140. // records: "records",
  141. // cell: "dprow",
  142. // id: "id"
  143. // },
  144. //
  145. // subGrid:true,
  146. // subGridRowExpanded: function(subgrid_id, row_id) {
  147. // // we pass two parameters
  148. // // subgrid_id is a id of the div tag created whitin a table data
  149. // // the id of this elemenet is a combination of the "sg_" + id of the row
  150. // // the row_id is the id of the row
  151. // // If we wan to pass additinal parameters to the url we can use
  152. // // a method getRowData(row_id) - which returns associative array in type name-value
  153. // // here we can easy construct the flowing
  154. // var subgrid_table_id, pager_id;
  155. // subgrid_table_id = subgrid_id+"_t";
  156. //
  157. // pager_id = "p_"+subgrid_table_id;
  158. //
  159. // $("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table><div id='"+pager_id+"' class='scroll'></div>");
  160. ////
  161. // var settingObj = {grid_id:subgrid_table_id,pager:pager_id,multiselect:false};
  162. // var hiddenObj = {line_reference:true,pp_quantity:true,pp_value:true,receiving_notes:true,returned_notes:true};
  163. // prepareReceiptItemsGrid(settingObj,{oper:'receipt',receiptId:row_id},false,{},hiddenObj)
  164. //
  165. // }
  166. // })
  167. var settingsObj ={grid_id:'orders',pager:'pager',multiselect:true};
  168. var subgridSettingsObj = {customButtons:{resubmit:true},multiselect:false,hiddenObj:{owner_name:true,approved_by_name:true}};
  169. prepareReceiptsGrid(settingsObj,{_status: ['readytoinvoicememo','waitingforapproval','rejected']},true,{},{approved_by_name:true},subgridSettingsObj)
  170. myGrid.navGrid("#pager",{edit:false,add:false,view:false,del:false,search:false},{},{},{},{},{});
  171. var buttons = {submit:true,process:true,load_owner_all:true,resubmit:true};
  172. addCustomButtonsInReceiptGrid('orders','pager',null,buttons);
  173. // myGrid.jqGrid('navButtonAdd','#pager',{
  174. // caption:"",
  175. // title:"Create Invoice And Memo" ,
  176. // buttonicon:"ui-icon-note",
  177. // id:"add_orders",
  178. // onClickButton : function () {
  179. // var selectRows = myGrid.getGridParam('selarrrow');
  180. // var noOfRows = selectRows.length;
  181. // var orderId = 0;
  182. // var mismatch = 0;
  183. //
  184. // if (noOfRows ==0){
  185. // $( "#modal-warning" ).dialog("open");
  186. // }
  187. // else if (noOfRows > 0){
  188. // for (i=0;i<noOfRows;i++){
  189. // //console.log(selectRows[i]);
  190. // var newOrderId = myGrid.getCell(selectRows[i],'order_id');
  191. // //console.log(newOrderId);
  192. // if (orderId==0){
  193. // orderId = newOrderId;
  194. // }
  195. // else if (newOrderId!=orderId){
  196. // $( "#modal-warning-order" ).dialog("open");
  197. // mismatch = 1;
  198. // break;
  199. // }
  200. // }
  201. // if (mismatch==0){
  202. // $.ajax({
  203. // type:"POST",
  204. // url:"index.php/procurement/createInvoiceMemoUpdateOrderReceipt",
  205. // data:{receipt_ids:selectRows,
  206. // order_id:orderId},
  207. // success:function (jqXHR){
  208. // emptyMessages();
  209. // var jsonRes = JSON.parse(jqXHR);
  210. // if (jsonRes.invoice_id!=null){
  211. // showSuccessMessage("Invoice No Inv-" + jsonRes.invoice_id + " Is Created Successfully");
  212. // }
  213. // if (jsonRes.memo_id!=null){
  214. // showSuccessMessage("CreditMemo No CM-" + jsonRes.memo_id + " Is Created Successfully");
  215. // }
  216. // myGrid.trigger("reloadGrid");
  217. // }
  218. // })
  219. // }
  220. // }
  221. //
  222. //
  223. // }
  224. // });
  225. // myGrid.jqGrid('navButtonAdd','#pager',{
  226. // caption:"",
  227. // title:"Submit For Approval",
  228. // buttonicon:"ui-icon-flag",
  229. // id:"approved_orders",
  230. // onClickButton : function () {
  231. // var selectRows = myGrid.getGridParam('selarrrow');
  232. // var noOfRows = selectRows.length;
  233. //
  234. // if (noOfRows ==0){
  235. // $( "#modal-warning" ).dialog("open");
  236. // }
  237. // else
  238. // $.ajax({
  239. // type:"POST",
  240. // url:"index.php/procurement/submitForApprovalBeforeInvoice",
  241. // data:{receipt_ids:selectRows
  242. // },
  243. // success:function (jqXHR){
  244. // emptyMessages();
  245. // showSuccessMessage(" Selected Records Have Been Submitted For Approval");
  246. // myGrid.trigger("reloadGrid");
  247. // },
  248. // error:function (jqXHR){
  249. // emptyMessages();
  250. // showErrorMessage(" Selected Records Could Not Be Submitted For Approval Due To Internal Error");
  251. // }
  252. // })
  253. //
  254. // }
  255. // });
  256. myGrid.jqGrid('filterToolbar', {stringResult: true, searchOnEnter: true, defaultSearch : "cn"});
  257. //$("#del_orders").insertAfter("#add_orders");
  258. $( "#modal-warning-order" ).dialog({
  259. autoOpen:false,
  260. height: 80,
  261. modal: true
  262. });
  263. });
  264. $(window).load(function(){
  265. var warningDialogs={one:true,none:true,status:true,exactlyone:true,morethanone:true};
  266. initDialogs(warningDialogs);
  267. initPaymentDialog();
  268. initCommentsForQuote();
  269. initAssignmentCommon();
  270. //initErrorDialogs({total:true,advance:true});
  271. //this is from payment dialog.The Select Inout is in dialogs.php
  272. });
  273. </script>
  274. </head>
  275. <body>
  276. <?php $this->load->view("common/menubar"); ?>
  277. <?php $this->load->view("common/dialogs"); ?>
  278. <div id="modal-warning-order" title="Warning">
  279. <p>Please Select Receipt with The Same Order Reference</p>
  280. </div>
  281. <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">
  282. <?php $this->load->view("common/message"); ?>
  283. <div class="table-grid">
  284. <h1 id="table header">Create Invoice</h1>
  285. <table id="orders"><tr><td/></tr></table>
  286. <div id="pager"></div>
  287. </div>
  288. </div>
  289. <?php $this->load->view("partial/footer"); ?>
  290. </body>
  291. </html>