PageRenderTime 79ms CodeModel.GetById 31ms RepoModel.GetById 1ms app.codeStats 0ms

/magehelp/application/views/procurement/quote/request/quote_request_grid.php

https://bitbucket.org/jit_bec/shopifine
PHP | 908 lines | 748 code | 112 blank | 48 comment | 34 complexity | 96b9db68d8ccf4f9f3e4d84272a9cd03 MD5 | raw file
Possible License(s): LGPL-3.0
  1. <html>
  2. <head>
  3. <?php $this->load->view("common/header"); ?>
  4. <link rel="stylesheet" rev="stylesheet" href="<?php echo base_url();?>css/chosen.css" />
  5. <script src="<?php echo base_url();?>js/chosen.jquery.min.js" type="text/javascript" language="javascript" charset="UTF-8"></script>
  6. <!-- <script type="text/javascript" src="http://jzaefferer.github.com/jquery-validation/jquery.validate.js"></script>-->
  7. <style>
  8. .column {
  9. float: left;
  10. padding: 1em 1em 3em;
  11. width: 100%;
  12. }
  13. .base-column{
  14. padding: 1em 1em 1em;
  15. }
  16. .field{
  17. width:100%;
  18. }
  19. .ui-widget-header {height:12px;}
  20. .quote-column {
  21. float: left;
  22. padding-bottom: 0.5em;
  23. width: 45em;
  24. }
  25. .ui-combobox-input{
  26. width:23em;
  27. }
  28. #supplierOp-input{
  29. width:10em;
  30. }
  31. #warehouseOp-input{
  32. width:10em;
  33. }
  34. .shopifine-ui-dialog{
  35. height:auto;
  36. }
  37. .ui-tabs {
  38. height: 20em;
  39. margin: 0 auto;
  40. width: 45%;
  41. left:0;
  42. }
  43. .calculated {
  44. color: green;
  45. font-size: 90%;
  46. }
  47. .ui-tabs-nav{
  48. height:22px;
  49. }
  50. .chzn-container{
  51. font-size:inherit;
  52. }
  53. /* .labeldiv {
  54. color: #2E6E9E;
  55. float: left;
  56. font-size: 110%;
  57. font-weight: bold;
  58. margin-right: .5em;
  59. width: 18%;
  60. word-wrap: break-word;
  61. }*/
  62. </style>
  63. <script type="text/javascript">
  64. $(function() {
  65. $.validator.addMethod('minStrict', function (value, el, param) {
  66. return value > param;
  67. },"Price must be more than 0");
  68. $.validator.addMethod('hasItems', function (value, el, param) {
  69. if($("#quoteId").val()!=""){
  70. var noOfRows = $("#lineItems").getGridParam("records");
  71. //alert(noOfRows);
  72. if (noOfRows<1){
  73. return false;
  74. }
  75. }
  76. return true;
  77. },"Items must be added for RFQ");
  78. //form validation
  79. $("#quoteForm").validate({
  80. rules:{
  81. quoteId:{
  82. hasItems:true
  83. }
  84. },
  85. errorPlacement :function (error,element){
  86. // console.log( error );
  87. // console.log( element );
  88. // console.log(element.parent() );
  89. if (element[0].id=="quoteId"){
  90. error.appendTo("#status-message-li");
  91. }
  92. else { //defailt
  93. error.appendTo(element.parent()) ;
  94. }
  95. }
  96. }
  97. );
  98. $("#bulkItemForm").validate({rules:{
  99. quantity_bulk:{
  100. required:true,
  101. digits:true,
  102. min:1
  103. },
  104. productoptions_bulk:{
  105. required:true
  106. }
  107. }}
  108. );
  109. $("#edit-quote-form").validate();
  110. $("#itemForm").validate({rules:{
  111. quantity:{
  112. required:true,
  113. digits:true,
  114. min:1
  115. },
  116. exPrice:{
  117. number:true
  118. }
  119. }}
  120. );
  121. // datepicker for Add Form
  122. $( "#reqdate" ).datepicker({
  123. showOn: "button",
  124. buttonImage: "images/calendar.gif",
  125. buttonImageOnly: true,
  126. dateFormat:"dd/mm/yy",
  127. minDate:0
  128. });
  129. $( "#reqdate-edit-quote" ).datepicker({
  130. showOn: "button",
  131. buttonImage: "images/calendar.gif",
  132. buttonImageOnly: true,
  133. dateFormat:"dd/mm/yy"
  134. });
  135. $( "#neededdate" ).datepicker({
  136. showOn: "button",
  137. buttonImage: "images/calendar.gif",
  138. buttonImageOnly: true,
  139. dateFormat:"dd/mm/yy",
  140. minDate:0
  141. });
  142. function quotegriddates(id){
  143. jQuery("#"+id+"_needed_by_date","#rfqs").datepicker({dateFormat:"yy-mm-dd",minDate:0});
  144. }
  145. function quoteitemgriddates(id){
  146. jQuery("#"+id+"_needed_by_date","#lineItems").datepicker({dateFormat:"yy-mm-dd",minDate:0});
  147. }
  148. //end datepicker
  149. //com bo boxes
  150. // $("#warehouseOp").combobox();
  151. // $("#supplierOp").combobox();
  152. $("#productOp").combobox({customChange:function(){
  153. console.log("product id = " + $("#productOp").val());
  154. $.ajax({
  155. type:"GET",
  156. url:'index.php/procurement/getCostPrice',
  157. data:{productid:$("#productOp").val()},
  158. success:function (response){
  159. $("#curPrice").text(" The Current Average Cost Price Is " +response );
  160. }
  161. })
  162. }}
  163. );
  164. //end combox
  165. $( "#dialog-form" ).dialog({
  166. autoOpen: false,
  167. height: 'auto',
  168. width: '60%',
  169. modal: true,
  170. buttons: {
  171. "DoneButton": {
  172. id:"doneBtn",
  173. text:"Create RFQ",
  174. click:function() {
  175. var isValid = $("#quoteForm").valid();
  176. if (isValid){
  177. $.ajax({url:"index.php/procurement/createRFQ",
  178. type:"POST",
  179. data:{ quoteId:$("#quoteId").val(),
  180. supplierId:$("#supplierOp").val(),
  181. warehouseId:$("#warehouseOp").val(),
  182. reqdate:$("#reqdate").val(),
  183. notes:$("#desc").val()
  184. },
  185. success:function(response)
  186. {
  187. console.log($("#quoteId").val());
  188. if ($("#quoteId").val()==""){
  189. if (response !='error'){
  190. $("#quoteId").val(response);
  191. $("#pkdheader").show();
  192. $("#doneBtn > span").text("Done");
  193. var lineSettingObj ={grid_id:'lineItems',pager:'pagerPk',owner_id:user_id,status:'draft'};
  194. prepareRFQItemsGrid(lineSettingObj,{quoteId:$("#quoteId").val()}, {}, {});
  195. $("#lineItems").navGrid("#pagerPk",{edit:false,add:false,del:true,search:false},{},{},{},{},{});
  196. var buttons = {add:true,edit:true,bulk:true,data:{quote_id:$("#quoteId").val(),bulk_grid_id:'lineItemsbulk'}};
  197. addCustomButtonsInRFQItemGrid(lineSettingObj, buttons);
  198. $("#lineItems").jqGrid('filterToolbar', {stringResult: true, searchOnEnter: true, defaultSearch : "cn"});
  199. $("#edit_lineItems").insertAfter("#add_lineItems");
  200. }
  201. }
  202. } //end success of Ajax
  203. }) //end ajax
  204. if ($("#quoteId").val()!=""){
  205. $( this ).dialog( "close" );
  206. }
  207. } //end ifvalid
  208. }}, //end of Create button
  209. Cancel: function() {
  210. $.ajax({
  211. method:"POST",
  212. data:{id:$("#quoteId").val(),oper:'del'},
  213. url:'index.php/procurement/modifyRFQ'
  214. })
  215. $( this ).dialog( "close" );
  216. }
  217. },//end buttons
  218. open:function(event,ui){
  219. //reseting line item grids once again to be doubly sure
  220. $("#pkdheader").hide();
  221. $("#lineItems").jqGrid("GridUnload");
  222. $("#tabs").tabs({
  223. load: function(event,ui){
  224. //console.log( ui);
  225. $( "#reqdate" ).datepicker({
  226. showOn: "button",
  227. buttonImage: "images/calendar.gif",
  228. buttonImageOnly: true,
  229. dateFormat:"dd/mm/yy",
  230. minDate:0
  231. });
  232. if (ui.tab.id=="base"){
  233. $("#supplierOp").val($("#supval").val());
  234. $("#warehouseOp").val($("#warehouseval").val());
  235. $("#reqdate").val($("#reqdateval").val());
  236. // reset
  237. $("#reqdateval").val("");
  238. $("#warehouseval").val("");
  239. $("#supval").val("");
  240. }
  241. else if (ui.tab.id=="notes"){
  242. $("#approveNotes").val($("#notesval").val());
  243. // reset
  244. $("#notesval").val("");
  245. }
  246. },
  247. beforeActivate: function (event,ui){
  248. if (ui.newTab[0].id=="notesLink"){
  249. $("#reqdateval").val($("#reqdate").val());
  250. $("#warehouseval").val($("#warehouseOp").val());
  251. $("#supval").val($("#supplierOp").val());
  252. }
  253. else if (ui.newTab[0].id=="baseLink"){
  254. $("#notesval").val($("#approveNotes").val());
  255. }
  256. }
  257. });
  258. },
  259. close: function(event,ui) {
  260. //validate so that close button is not pressed while there is no line item
  261. var noOfRec =$("#lineItems").getGridParam("records");
  262. //if (noOfRec<1){
  263. $.ajax({
  264. method:"POST",
  265. data:{id:$("#quoteId").val(),entity:'rfq',items_count:noOfRec},
  266. url:'index.php/procurement/closeValidate'
  267. })
  268. //}
  269. //reset line item grids
  270. $("#pkdheader").hide();
  271. $("#lineItems").jqGrid("GridUnload");
  272. //reload main grid
  273. $("#rfqs").trigger("reloadGrid");
  274. //destrying the tab to bring it to the initial state while opening it next
  275. $("#tabs").tabs("destroy");
  276. //change Button Text To original
  277. $("#doneBtn > span").text("Create RFQ");
  278. $("#status-message-li").empty();
  279. }
  280. });
  281. //Line Item Dialog
  282. $( "#dialog-form-item" ).dialog({
  283. autoOpen: false,
  284. height: 'auto',
  285. width: '40%',
  286. position:[350,25],
  287. modal: true,
  288. buttons: {
  289. "Add Item": function() {
  290. var isvalid = $("#itemForm").valid();
  291. var grid = $(this).data('grid_data').grid_id;
  292. var rfq_id = $(this).data('grid_data').quote_id;
  293. var line_id = $(this).data('grid_data').line_id;
  294. var action = $(this).data('grid_data').action;
  295. var url = "index.php/procurement/addRFQItem";
  296. if (action =='edit'){
  297. url = "index.php/procurement/modifyRFQItem";
  298. }
  299. console.log ("data " + grid + " " + rfq_id);
  300. if (action=='edit' && $("#ischangeditem").val()==0){
  301. //dont submit. Nothing has changed
  302. $( this ).dialog( "close" );
  303. }
  304. else {
  305. if (isvalid){
  306. $.ajax({
  307. url:url,
  308. type:"POST",
  309. data:{
  310. rfq:rfq_id,
  311. productid:$("#productOp").val(),
  312. needeedByDate:$("#neededdate").val(),
  313. quantity:$("#quantity").val(),
  314. exprice:$("#exPrice").val(),
  315. descItem:$("#descItem").val(),
  316. oper:action,
  317. line_id:line_id
  318. },
  319. success:function (response){
  320. $("#rfqs").trigger("reloadGrid");
  321. }
  322. })
  323. $( this ).dialog( "close" );
  324. }
  325. }
  326. },
  327. Cancel: function() {
  328. $( this ).dialog( "close" );
  329. }
  330. },
  331. open: function(event,ui){
  332. var action = $(this).data('grid_data').action;
  333. var grid_id = $(this).data('grid_data').grid_id;
  334. var line_id = $(this).data('grid_data').line_id;
  335. var quote_id = $(this).data('grid_data').quote_id;
  336. console.log("line_id = "+ line_id);
  337. console.log("quote_id = "+ quote_id + " name " + $("#"+grid_id).getCell(line_id,'name'));
  338. if (action=='edit'){
  339. $("#productOp-input").parent().hide();
  340. $("#product_name_edit").show();
  341. $("#product_name_edit").text($("#"+grid_id).getCell(line_id,'name'));
  342. $("#quantity").val($("#"+grid_id).getCell(line_id,'quoted_quantity'));
  343. $("#exPrice").val($("#"+grid_id).getCell(line_id,'expected_price'));
  344. $("#estValue").text($("#"+grid_id).getCell(line_id,'estimated_value'));
  345. var needDate = $("#"+grid_id).getCell(line_id,'needed_by_date');
  346. if (needDate!=null && needDate!=""){
  347. var d1 = Date.parse(needDate);
  348. $("#neededdate").val(d1.toString('dd/MM/yyyy'));
  349. }
  350. }
  351. },
  352. close: function(event,ui) {
  353. $("#itemForm").data('validator').resetForm();
  354. $("#productOp-input").parent().show();
  355. $(".inithide").hide();
  356. $('#itemForm')[0].reset();
  357. $("#estValue").text("");
  358. $("#curPrice").text("");
  359. }
  360. });
  361. $( "#dialog-form-bulk" ).dialog({
  362. autoOpen: false,
  363. height: 'auto',
  364. width: '50%',
  365. position:[350,25],
  366. modal: true,
  367. buttons: {
  368. "Add Bulk": function() {
  369. var isvalid = $("#bulkItemForm").valid();
  370. var grid = $(this).data('grid_data').grid_id;
  371. var rfq_id = $(this).data('grid_data').quote_id;
  372. console.log ("data " + grid + " " + rfq_id);
  373. if (isvalid){
  374. $.ajax({
  375. url:"index.php/procurement/addRFQItemBulk",
  376. type:"POST",
  377. data:{
  378. rfq:rfq_id,
  379. data:$("#"+grid).getGridParam('data')
  380. },
  381. success:function (response){
  382. //console.log("grid " + grid);
  383. $("#lineItems").trigger("reloadGrid");
  384. $("#status-message-li").empty();
  385. //reload Main Grid
  386. }
  387. })
  388. $( this ).dialog( "close" );
  389. }
  390. },
  391. Cancel: function() {
  392. $( this ).dialog( "close" );
  393. }
  394. },
  395. open: function(event,ui){
  396. $("#lineItemsbulk").jqGrid({
  397. datatype: 'local',
  398. colNames:['Product','Quantity'],
  399. colModel :[
  400. {name:'name', index:'name',editable:false, width:200, align:'right'},
  401. {name:'quantity', index:'quantity', editable:true,width:80, align:'right'}
  402. ],
  403. pager: '#pagerPk_bulk',
  404. rowNum:10,
  405. rowList:[5,10,20],
  406. sortname: 'id',
  407. sortorder: 'desc',
  408. viewrecords: true,
  409. gridview: true,
  410. ignoreCase:true,
  411. rownumbers:true,
  412. height:'auto',
  413. width:400,
  414. caption: 'Products & Quantities'
  415. }).navGrid("#pagerPk_bulk",{edit:true,add:false,del:true,search:false},{},{},{},{},{});
  416. },
  417. close: function(event,ui) {
  418. $("#bulkItemForm").data('validator').resetForm();
  419. $('#bulkItemForm')[0].reset();
  420. $(".chzn-select").val('').trigger("liszt:updated");
  421. $("#lineItemsbulk").jqGrid("GridUnload");
  422. }
  423. });
  424. $( "#edit-quote-dialog" ).dialog({
  425. autoOpen: false,
  426. height: 'auto',
  427. width: '400',
  428. position:[350,25],
  429. modal: true,
  430. buttons: {
  431. "Edit Quote Details": function() {
  432. var isvalid = $("#edit-quote-form").valid();
  433. if (isvalid){
  434. $.ajax({
  435. url:'index.php/procurement/modifyRFQ',
  436. type:"POST",
  437. data:{
  438. oper:'edit',
  439. id:myGrid.getGridParam("selrow"),
  440. supplier_name:$("#supplierOp-edit-quote").val(),
  441. warehouse_id:$("#warehouseOp-edit-quote").val(),
  442. needed_date:$("#reqdate-edit-quote").val(),
  443. notes:$("#notes-edit-quote").val()
  444. },
  445. success:function (response){
  446. //console.log("grid " + grid);
  447. $("#rfqs").trigger("reloadGrid");
  448. //reload Main Grid
  449. }
  450. })
  451. $( this ).dialog( "close" );
  452. }
  453. },
  454. Cancel: function() {
  455. $( this ).dialog( "close" );
  456. }
  457. },
  458. open: function(event,ui){
  459. var quote_id = myGrid.getGridParam("selrow");
  460. var needDate = myGrid.getCell(quote_id,'needed_by_date');
  461. $("#supplierOp-edit-quote").val(myGrid.getCell(quote_id,'supplier_id')) ;
  462. $("#warehouseOp-edit-quote").val(myGrid.getCell(quote_id,'warehouse_id')) ;
  463. if (needDate!=null && needDate!=""){
  464. var d1 = Date.parse(needDate);
  465. $("#reqdate-edit-quote").val(d1.toString('dd/MM/yyyy'));
  466. }
  467. },
  468. close: function(event,ui) {
  469. $("#edit-quote-form").data('validator').resetForm();
  470. $('#edit-quote-form')[0].reset();
  471. }
  472. });
  473. $( "#delete-quote-dialog" ).dialog({
  474. autoOpen: false,
  475. height: '20',
  476. width: '300',
  477. position:[350,25],
  478. modal: true,
  479. buttons: {
  480. "Cancel Selected RFQ?": function() {
  481. $.ajax({
  482. url:'index.php/procurement/modifyRFQ',
  483. type:"POST",
  484. data:{
  485. oper:'del',
  486. id:myGrid.getGridParam("selarrrow")
  487. },
  488. success:function (response){
  489. //console.log("grid " + grid);
  490. $("#rfqs").trigger("reloadGrid");
  491. }
  492. })
  493. $( this ).dialog( "close" );
  494. }
  495. }
  496. });
  497. // Main Request For Quotation Grid
  498. var myGrid = $("#rfqs");
  499. myGrid.jqGrid({
  500. url:'index.php/procurement/populateRFQ',
  501. datatype: 'json',
  502. mtype: 'POST',
  503. postData:{_status:['open','draft','waitingforapproval','rejected']},
  504. colNames:['Reference','Supplier','Estimated Value','Owner Id','Status','Raised By','Owner','Needed By Date','Approver','Supplier Id','Warehouse Id'],
  505. colModel :[
  506. {name:'reference', index:'reference', width:80, align:'right',editable:false},
  507. {name:'supplier_name', index:'supplier_name', width:140, align:'right'},
  508. {name:'estimated_value', index:'estimated_value', width:100, align:'right',editable:false,editoptions:{size:"20",maxlength:"30"}},
  509. {name:'owner_id', index:'owner_id', width:140, align:'right',editable:true,editoptions:{size:"20",maxlength:"30"},hidden:true},
  510. {name:'status', index:'status', width:60, align:'right',editable:false,editoptions:{size:"20",maxlength:"30"}},
  511. {name:'raised_by_name', index:'raised_by_name',editable:false, width:80, align:'right'},
  512. {name:'owner_name', index:'owner_name',editable:false, width:80, align:'right'},
  513. {name:'needed_by_date', index:'needed_by_date',editable:true, width:120, sorttype:'date',editrules:{date:true}},
  514. {name:'approved_by_name', index:'approved_by_name',editable:false, width:80, align:'right'},
  515. {name:'supplier_id', index:'supplier_id',editable:false, hidden:'true'},
  516. {name:'warehouse_id', index:'warehouse_id',editable:false, hidden:'true'}
  517. ],
  518. pager: '#pager',
  519. rowNum:10,
  520. rowList:[5,10,20],
  521. sortname: 'id',
  522. sortorder: 'desc',
  523. viewrecords: true,
  524. gridview: true,
  525. multiselect:true,
  526. ignoreCase:true,
  527. rownumbers:true,
  528. height:'auto',
  529. width:680,
  530. caption: 'Requests For Quotation',
  531. jsonReader : {
  532. root:"quotedata",
  533. page: "page",
  534. total: "total",
  535. records: "records",
  536. cell: "dprow",
  537. id: "id"
  538. },
  539. editurl:'index.php/procurement/modifyRFQ',
  540. subGrid:true,
  541. subGridRowExpanded: function(subgrid_id, row_id) {
  542. var subgrid_table_id, pager_id;
  543. subgrid_table_id = subgrid_id+"_t";
  544. pager_id = "p_"+subgrid_table_id;
  545. // we need to set #quoteId as we are reusing dialog-form-item
  546. $("#quoteSubgridId").val(row_id);
  547. $("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table><div id='"+pager_id+"' class='scroll'></div>");
  548. var owner_id = myGrid.getCell(row_id,'owner_id');
  549. var rfq_status = myGrid.getCell(row_id,'status');
  550. var lineSettingObj = {grid_id:subgrid_table_id,pager:pager_id,owner_id:owner_id,status:rfq_status};
  551. prepareRFQItemsGrid(lineSettingObj,{quoteId:row_id}, {}, {});
  552. var del = false;
  553. var buttons ={};
  554. // if status is open or draft then only add modify buttons
  555. if (rfq_status=='open' || rfq_status=='draft'){
  556. if (user_id==owner_id){
  557. del = true;
  558. }
  559. buttons = {add:true,edit:true,bulk:true,data:{quote_id:$("#quoteSubgridId").val(),bulk_grid_id:'lineItemsbulk'}};
  560. }
  561. $("#"+subgrid_table_id).jqGrid('navGrid',"#"+pager_id,{edit:false,add:false,del:del,search:false,view:true});
  562. addCustomButtonsInRFQItemGrid(lineSettingObj, buttons);
  563. },
  564. subGridRowColapsed: function(subgrid_id, row_id) {
  565. // this function is called before removing the data
  566. //var subgrid_table_id;
  567. //subgrid_table_id = subgrid_id+"_t";
  568. //jQuery("#"+subgrid_table_id).remove();
  569. $("#quoteSubgridId").val("");
  570. }
  571. }).navGrid("#pager",{edit:false,add:false,del:false,search:false,view:true},{},{},{},{});
  572. var buttons = {add:true,edit:true,del:true,reopen:true,submit_approval:true,gen_quote:true,comments:true,load_owner_all:true};
  573. addCustomButtonsInRFQGrid('rfqs', 'pager', null, buttons, null);
  574. myGrid.jqGrid('filterToolbar', {stringResult: true, searchOnEnter: true, defaultSearch : "cn"});
  575. //reArrange The Icons
  576. $("#edit_rfqs").insertAfter("#add_rfqs");
  577. $("#del_rfqs").insertAfter("#edit_rfqs");
  578. $("#comments_rfqs").insertAfter("#del_rfqs");
  579. $("#gen_quote_rfqs").insertAfter("#submit_approve_rfqs");
  580. $(".bulk-input").change (function(){
  581. var isvalid = $("#bulkItemForm").valid();
  582. if (isvalid){
  583. var products = $("#productOptions_bulk").val();
  584. $.each(products, function(){
  585. console.log(" id "+ this);
  586. console.log($("#productOptions_bulk option:eq("+this+")").text())
  587. var qty = parseFloat($("#quantity_bulk").val());
  588. var edit = false;
  589. var existingQ = parseFloat($("#lineItemsbulk").getCell(this,'quantity'));
  590. if (!isNaN(existingQ) && existingQ!=false){
  591. qty +=existingQ;
  592. edit = true;
  593. }
  594. var myrow = {name:$("#productOptions_bulk option:eq("+this+")").text(), quantity:qty};
  595. if (edit){
  596. $("#lineItemsbulk").setRowData(this, myrow);
  597. }
  598. else{
  599. $("#lineItemsbulk").addRowData(this, myrow);
  600. }
  601. })
  602. }
  603. });
  604. $(".chzn-select").chosen();
  605. $("#itemForm input,#itemForm select").change(function (){
  606. $("#ischangeditem").val("1");
  607. });
  608. });
  609. $(window).load(function(){
  610. var warningDialogs={one:true,none:true,morethanone:true,exactlyone:true};
  611. initDialogs(warningDialogs);
  612. initCommentsForQuote();
  613. });
  614. </script>
  615. </head>
  616. <body>
  617. <?php $this->load->view("common/menubar"); ?>
  618. <?php $this->load->view("common/dialogs"); ?>
  619. <div id ="dialog-form" class="inithide">
  620. <h1 id="formHeader">RFQ # <span id="quoteRef"></span> Details</h1>
  621. <form id="quoteForm">
  622. <fieldset>
  623. <div id="tabs">
  624. <ul>
  625. <li id="baseLink"><a id="base" href="<?php echo site_url('procurement/loadRFQFormFragment') ?>">Basic Details</a></li>
  626. <li id="notesLink"><a id ="notes" href="<?php echo site_url('procurement/loadRFQNotesFragment') ?>">Notes</a></li>
  627. </ul>
  628. </div>
  629. <div id ="status-message-li" class="ui-corner-all" style="margin-top: 10px; width:15em;">
  630. </div>
  631. <div class="table-grid" style="padding-top:2em;">
  632. <h1 id="pkdheader">Add Line Items</h1>
  633. <table id="lineItems"><tr><td/></tr></table>
  634. <div id="pagerPk"></div>
  635. </div>
  636. </fieldset>
  637. </form>
  638. </div>
  639. <input id="quoteSubgridId" name ="quoteSubgridId" type="hidden" value=""/>
  640. <div id ="dialog-form-item" class="inithide">
  641. <h1 id="formHeader">Add New Line Item</h1>
  642. <form id="itemForm">
  643. <fieldset>
  644. <div class="row single-column-row">
  645. <div class="column quote-column single-column">
  646. <div class="field">
  647. <label for="productOp" class="labeldiv">Products:</label>
  648. <select name="productOp" id ="productOp" class="required initshow">
  649. <option value="">Choose
  650. <?= $productOptions ?>
  651. </select>
  652. <div class="valuediv valuediv-edit inithide" id="product_name_edit" name ="product_name_edit" style="display:none"></div>
  653. </div>
  654. </div>
  655. </div>
  656. <div class="row single-column-row">
  657. <div class="column quote-column single-column">
  658. <div class="field">
  659. <label for="neededdate" class="labeldiv">Needed By Date:</label>
  660. <input id="neededdate" name ="neededdate" type="text"/>
  661. </div>
  662. </div>
  663. </div>
  664. <div class="row single-column-row">
  665. <div class="column quote-column single-column">
  666. <div class="field">
  667. <label for="quantity" class="labeldiv">Quantity:</label>
  668. <input id="quantity" name="quantity" class="calinput"/>
  669. </div>
  670. </div>
  671. </div>
  672. <div class="row single-column-row">
  673. <div class="column quote-column single-column">
  674. <div class="field">
  675. <label for="exPrice" class="labeldiv">Expected Price:</label>
  676. <input id="exPrice" name="exPrice" class="calinput"/>
  677. </div>
  678. <div class="field">
  679. <label style="width:100%;" id="curPrice" name="curPrice" class="calculated"/>
  680. </div>
  681. </div>
  682. </div>
  683. <div class="row single-column-row">
  684. <div class="column quote-column single-column">
  685. <div class="field">
  686. <label for="estValue" class="labeldiv">Estimated Value:</label>
  687. <label id="estValue" name="estValue" class="calculated"/>
  688. </div>
  689. </div>
  690. </div>
  691. <div class="row single-column-row">
  692. <div class="column quote-column single-column">
  693. <div class="field">
  694. <label for="descItem" class="labeldiv">Notes:</label>
  695. <input id="descItem" name="descItem" size="40" maxlength="60"/>
  696. </div>
  697. </div>
  698. <input id="ischangeditem" name="ischangeditem" type="hidden" value="0"/>
  699. </div>
  700. </fieldset>
  701. </form>
  702. </div>
  703. <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">
  704. <?php $this->load->view("common/message"); ?>
  705. <div class="table-grid">
  706. <h1 id="table header">Request For Quotations</h1>
  707. <table id="rfqs"><tr><td/></tr></table>
  708. <div id="pager"></div>
  709. </div>
  710. </div>
  711. <div id ="dialog-form-bulk" style="overflow:hidden;" class="inithide">
  712. <h1 id="formHeader">Add Bulk Quotations </h1>
  713. <form id="bulkItemForm" class="single-column-form" style="width:100%; margin-left: 0;">
  714. <fieldset>
  715. <div class="row single-column-row">
  716. <div class="column single-column">
  717. <div class="field">
  718. <label for="productOptions_bulk" class="labeldiv">Products:</label>
  719. <select name="productOptions_bulk[]" id ="productOptions_bulk" class="chzn-select bulk-input" multiple="multiple" style="width:200px;height:20px;">
  720. <?=$productOptions?>
  721. </select>
  722. </div>
  723. </div>
  724. </div>
  725. <div class="row single-column-row">
  726. <div class="column quote-column single-column">
  727. <div class="field">
  728. <label for="quantity_bulk" class="labeldiv">Quantity:</label>
  729. <input id="quantity_bulk" name="quantity_bulk" class="bulk-input"/>
  730. </div>
  731. </div>
  732. </div>
  733. <div class="table-grid" style="padding-top:2em;">
  734. <h1 id="pkdheader">Items For RFQ</h1>
  735. <table id="lineItemsbulk"><tr><td/></tr></table>
  736. <div id="pagerPk_bulk"></div>
  737. </div>
  738. </fieldset>
  739. </form>
  740. </div>
  741. <div id ="edit-quote-dialog" style="overflow:hidden;" class="inithide">
  742. <h1 id="formHeader-edit-quote">Edit Quotation </h1>
  743. <form id="edit-quote-form" class="single-column-form" style="width:100%; margin-left: 0;">
  744. <fieldset>
  745. <div class="row single-column-row">
  746. <div class="column base-column">
  747. <div class="field">
  748. <label for="supplierOp-edit-quote" class="labeldiv-edit">Supplier:</label>
  749. <select name="supplierOp-edit-quote" id ="supplierOp-edit-quote" class="required">
  750. <option value="">Choose
  751. <?= $supplierOptions ?>
  752. </select>
  753. </div>
  754. </div>
  755. </div>
  756. <div class="row single-column-row">
  757. <div class="column base-column">
  758. <div class="field">
  759. <label for="warehouseOp-edit-quote" class="labeldiv-edit">Warehouse:</label>
  760. <select name="warehouseOp-edit-quote" id ="warehouseOp-edit-quote">
  761. <option value="">Choose
  762. <?= $warehouseOptions ?>
  763. </select>
  764. </div>
  765. </div>
  766. </div>
  767. <div class="row single-column-row">
  768. <div class="column base-column" style="width:35em;">
  769. <div class="field">
  770. <label for="reqdate-edit-quote"class="labeldiv-edit" >Request By Date:</label>
  771. <input id="reqdate-edit-quote" name ="reqdate-edit-quote" type="text" class="dateValidate" style="width:12em;"/>
  772. </div>
  773. </div>
  774. </div>
  775. <div class="row single-column-row">
  776. <div class="column" style="width:80%">
  777. <div class="field">
  778. <label for="notes-edit-quote" class="labeldiv">Notes:</label>
  779. <textarea id="notes-edit-quote" name ="notes-edit-quote" rows="7" cols="45"></textarea>
  780. </div>
  781. </div>
  782. </div>
  783. </fieldset>
  784. </form>
  785. </div>
  786. <div id ="delete-quote-dialog" style="overflow:hidden;" class="inithide" title="Cancel RFQs">
  787. </div>
  788. <?php $this->load->view("partial/footer"); ?>
  789. </body>
  790. </html>
  791. <script>
  792. $(".calinput").change(function(){
  793. var exprice =$("#quantity").val()*$("#exPrice").val();
  794. $("#estValue").text(exprice);
  795. });
  796. </script>