VM暫存
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 line
3.2KB

  1. <!-- ----- 電子發票清帳作業 ----- -->
  2. <div data-items="invoice_close" class="row" style="display:none;">
  3. <div class="col-lg-12">
  4. <div class="panel panel-default">
  5. <div class="panel-heading">電子發票清帳作業</div><!-- 資料顯示區灰色小表頭 -->
  6. <div class="panel-body">
  7. <div data-rows class="row">
  8. <div class="col-lg-6">
  9. <div>
  10. <label>統編&nbsp;&nbsp;</label>
  11. <label class="radio-inline"><input type="radio" name="invoice_close_company_no" value="<?=$company_no?>" checked />本場站</label>
  12. <label class="radio-inline"><input type="radio" name="invoice_close_company_no" value="<?=$hq_company_no?>" />總公司</label>
  13. </div>
  14. <div class="form-group">
  15. <label>清帳日期</label>
  16. <input id="invoice_close_date" type="datetime" class="form-control" />
  17. </div>
  18. <div class="checkbox">
  19. <label><input id="invoice_print_summary" type="checkbox" />列印清帳條</label>
  20. </div>
  21. <div class="checkbox">
  22. <label><input id="invoice_resend" type="checkbox" />發票重傳</label>
  23. </div>
  24. <div class="form-group">
  25. <button type="button" class="btn btn-large btn-success pull-left" onclick="invoice_close();">清帳</button>
  26. </div>
  27. </div><!-- end of col-lg-6 (nested) -->
  28. </div><!-- end of row (nested) -->
  29. </div><!-- end of panel-body -->
  30. </div><!-- end of panel -->
  31. </div><!-- end of col-lg-12 -->
  32. </div><!-- data-items -->
  33. <!-- ----- 電子發票清帳作業(結束) ----- -->
  34. <script>
  35. $("#invoice_close_date").datetimepicker({language:"zh-TW",autoclose:true,minView:2,format:"yyyymmdd"});
  36. // 列印電子發票清帳
  37. function invoice_close()
  38. {
  39. var invoice_close_date = $("#invoice_close_date").val();
  40. if (invoice_close_date == "")
  41. {
  42. alert("日期欄必填 !");
  43. return false;
  44. }
  45. if (!confirm("確認清帳日期:"+invoice_close_date+" ?")) return false;
  46. $.ajax
  47. ({
  48. url:"http://localhost:60134/",
  49. async:false,
  50. timeout:1500,
  51. type:"post",
  52. dataType:"json",
  53. data:
  54. {
  55. "cmd":"setShift_Close",
  56. "company_no":$("input:radio:checked[name='invoice_close_company_no']").val(),
  57. "vTRN_DATE":invoice_close_date,
  58. "vPRINT_SUMMARY":$("#invoice_print_summary").prop("checked") ? "N" : "Y",
  59. "vRESEND_FLG":$("#invoice_resend").prop("checked") ? "N" : "Y"
  60. },
  61. error:function(xhr, ajaxOptions, thrownError)
  62. {
  63. console.log("error:"+xhr.responseText+"|"+ajaxOptions+"|"+thrownError);
  64. },
  65. success:function(jdata)
  66. {
  67. if (jdata["Result"] == "000")
  68. {
  69. alert("清帳完成, 日期: "+jdata["W_TODAY"]);
  70. }
  71. else
  72. {
  73. alert("清帳失敗:["+jdata["Result"]+"]"+jdata["W_TODAY"]+jdata["Message"]);
  74. }
  75. $("#invoice_close_date").val("");
  76. $("#invoice_print_summary").prop("checked", false);
  77. $("#invoice_resend").prop("checked", false);
  78. }
  79. });
  80. }
  81. </script>