Advertisement
hrz_

Untitled

Jan 21st, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. //JavScript
  2. $.getJSON('data.json', function (data) {
  3. console.log("DATA", data);
  4. $.each(data, function (i, f) {
  5.  
  6. $(".container").append("<div style='margin-left:" + f.level * 15 + "px'>" + (f.name) + " = " + (f.balance) + "<span id ='collapse" + i + "'></span></div>")
  7.  
  8. //Json
  9. [
  10. {
  11. "name": "Balance Sheet",
  12. "level": 0,
  13. "account_type": "sum",
  14. "balance": -27150010963.0,
  15. "type": "report"
  16. },
  17. {
  18. "name": "Assets",
  19. "level": 1,
  20. "account_type": "account_type",
  21. "balance": 19636000.0,
  22. "type": "report"
  23. },
  24. {
  25. "name": "12301 Piutang Dagang",
  26. "level": 4,
  27. "account_type": "receivable",
  28. "balance": 19636000.0,
  29. "type": "account"
  30. },
  31. {
  32. "name": "Liability",
  33. "level": 1,
  34. "account_type": "sum",
  35. "balance": -27169646963.0,
  36. "type": "report"
  37. },
  38. {
  39. "name": "Liability",
  40. "level": 2,
  41. "account_type": "account_type",
  42. "balance": -27169646963.0,
  43. "type": "report"
  44. },
  45. {
  46. "name": "21101 Hutang Usaha - Pemasok",
  47. "level": 4,
  48. "account_type": "payable",
  49. "balance": -5432435.0,
  50. "type": "account"
  51. },
  52. {
  53. "name": "21102 Hutang Usaha - bukan Pemasok",
  54. "level": 4,
  55. "account_type": "payable",
  56. "balance": -27164214528.0,
  57. "type": "account"
  58. },
  59. {
  60. "name": "Profit (Loss) to report",
  61. "level": 2,
  62. "account_type": "account_report",
  63. "balance": 0.0,
  64. "type": "report"
  65. }
  66. ]
  67.  
  68. //HTML
  69. <div class="container"> </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement