akaunting.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. {% extends "layout.html" %}
  2. {% block title %}Akaunting Settings{% endblock %}
  3. {% block description %}Integrate and manage your Akaunting platform{% endblock %}
  4. {% block head %}
  5. <style>
  6. </style>
  7. {% endblock %}
  8. {% block content %}
  9. <script>
  10. function set_company_id(val) {
  11. document.getElementById('akaunting_company_id').value = val
  12. }
  13. function import_item_id(id) { document.getElementById('akaunting_company_id').value = val }
  14. function import_customer_id(id) { document.getElementById('akaunting_company_id').value = val }
  15. </script>
  16. <div class="container">
  17. <div class="section">
  18. <div class="heading_div">
  19. <h1>Keep your books in order. Run reports and projections. Organization you accounting. Build plugins. Host
  20. it yourself</h1>
  21. <h3>Don't Already Have Your Own Akaunting login?</h3>
  22. <h4>The simplest way to register an account at <a target="_blank"
  23. href="https://akaunting.com">Akaunting.com</a>, a managed service.
  24. </h4>
  25. <h5>Once you have a valid username and password for your akaunting you can enter it in below to link your
  26. kinbrio platform and synchronize your data!</h5>
  27. <p>You can <a href="/documentation#setup-akaunting">host a private instance of akaunting</a></p>
  28. </div>
  29. <div class="row justified">
  30. <div class="backed content">
  31. <img decoding="async" loading="lazy" width="128px" height="128px"alt="Akaunting logo" src="/fs/images/akaunting-logo-horizontal.svg">
  32. <hr />
  33. <p><b>Link Akaunting into kinbrio</b></p>
  34. <p></p>
  35. <div class="row justified">
  36. <div class="col-sm-12 col-md-12 col-lg-6">
  37. <form id="akaunting_form" style="text-align:left;">
  38. <label for="user_name">User Name</label><br>
  39. <input type="text" id="user_name" name="user_name" value="{{akaunting_options.user_name}}">
  40. <label for="user_pass">User Pass</label><br>
  41. <input type="password" id="user_pass" name="user_pass"
  42. value="{{akaunting_options.user_pass}}">
  43. <label for="akaunting_domain">Akaunting Domain</label><br>
  44. <input type="text" id="akaunting_domain" name="akaunting_domain"
  45. value="{{akaunting_options.akaunting_domain}}">
  46. <label for="akaunting_company_id">Akaunting Company ID</label><br>
  47. <input type="text" id="akaunting_company_id" name="akaunting_company_id"
  48. value="{{akaunting_options.akaunting_company_id}}">
  49. <input type="checkbox" id="organization_data" name="organization_data"
  50. value="{{akaunting_options.organization_data}}" {% if
  51. akaunting_options.organization_data %} checked{% endif %}>
  52. <label for="organization_data">Company Data</label><br>
  53. <input type="checkbox" id="employee_data" name="employee_data"
  54. value="{{akaunting_options.employee_data}}" {% if akaunting_options.employee_data %}
  55. checked{% endif %}>
  56. <label for="employee_data">Users/Employees</label><br>
  57. <input type="checkbox" id="client_data" name="client_data"
  58. value="{{akaunting_options.client_data}}" {% if akaunting_options.client_data %}
  59. checked{% endif %}>
  60. <label for="client_data">Clients</label><br>
  61. <input type="checkbox" id="vendor_data" name="vendor_data"
  62. value="{{akaunting_options.vendor_data}}" {% if akaunting_options.vendor_data %}
  63. checked{% endif %}>
  64. <label for="vendor_data">Vendors</label><br>
  65. <input type="checkbox" id="item_data" name="item_data"
  66. value="{{akaunting_options.item_data}}" {% if akaunting_options.item_data %} checked{%
  67. endif %}>
  68. <label for="item_data">Services & Items</label><br>
  69. <input type="checkbox" id="invoice_data" name="invoice_data"
  70. value="{{akaunting_options.invoice_data}}" {% if akaunting_options.invoice_data %}
  71. checked{% endif %}>
  72. <label for="invoice_data">Invoices & Payments</label><br>
  73. <input type="checkbox" id="allow_post" name="allow_post"
  74. value="{{akaunting_options.allow_post}}" {% if akaunting_options.allow_post %} checked{%
  75. endif %}>
  76. <label for="allow_post">Creation of Invoices & Payments</label><br>
  77. <div>
  78. <input class="add_button" type="submit" value="Save" />
  79. </div>
  80. </form>
  81. </div>
  82. <div class="col-sm-12 col-md-12 col-lg-6">
  83. <div class="content">
  84. <div class="backed col-sm-12 col-md-12 col-lg-12">
  85. <p><b>Companys</b></p>
  86. {% for company in companys %}
  87. <div class="white-backed bump">
  88. {{ company.name }} ({{ company.id }})
  89. {% if company.id.to_string() == akaunting_options.akaunting_company_id %}<p><b>Selected Company</b></p>{%else%}<button onclick="set_company_id('{{ company.id }}')" class="add_button"
  90. type="button">Select</button>{%endif%}
  91. </div>
  92. {% endfor %}
  93. </div>
  94. <div class="backed col-sm-12 col-md-12 col-lg-12">
  95. <p><b>Items</b></p>
  96. {% for item in items %}
  97. <div class="white-backed bump">
  98. {{ Self::get_str(self, item.name) }}
  99. <form class="list_form" id="akaunting_form" action="/akaunting/import_item" method="post" enctype="multipart/form-data">
  100. <input style="display:none" type="text" id="import_id" name="import_id"
  101. value="{{item.id}}">
  102. <input class="add_button" type="submit" value="{% if item.kinbrio_id.is_some() %}Reimport{%else%}Import{%endif%}" />
  103. </form>
  104. </div>
  105. {% endfor %}
  106. </div>
  107. <div class="backed col-sm-12 col-md-12 col-lg-12">
  108. <p><b>Users</b></p>
  109. {% for user in users %}
  110. <div class="white-backed bump">
  111. {{ user.name }}
  112. </div>
  113. {% endfor %}
  114. </div>
  115. <div class="backed col-sm-12 col-md-12 col-lg-12">
  116. <p><b>Customers</b></p>
  117. {% for customer in customers %}
  118. <div class="white-backed bump">
  119. {{ customer.name }}
  120. <form class="list_form" id="akaunting_form" action="/akaunting/import_customer" method="post" enctype="multipart/form-data">
  121. <input style="display:none" type="text" id="import_id" name="import_id"
  122. value="{{customer.id}}">
  123. <input class="add_button" type="submit" value="{% if customer.kinbrio_id.is_some() %}Reimport{%else%}Import{%endif%}" />
  124. </form>
  125. </div>
  126. {% endfor %}
  127. </div>
  128. <div class="backed col-sm-12 col-md-12 col-lg-12">
  129. <p><b>Invoices</b></p>
  130. {% for invoice in invoices %}
  131. <div class="white-backed bump">
  132. {{ Self::get_str(self, invoice.document_number) }} | {{ Self::get_str(self, invoice.status) }}
  133. </div>
  134. {% endfor %}
  135. </div>
  136. </div>
  137. <div class="backed col-sm-12 col-md-12 col-lg-12">
  138. <p>What the hell is <a target="_blank" href="https://akaunting.com/"><u>Akaunting</u></a>
  139. and <a target="_blank" href="/open-source-book-keeping">why do I care</a>?</p>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. <script>
  146. window.addEventListener('load', function () {
  147. post_form("akaunting_form", "/akaunting", data => {
  148. const key = "{{akaunting_options.key}}"
  149. data.key = key == "" ? "00000000-0000-0000-0000-000000000000" : key
  150. data.owner_key = "{{organization.owner_key}}"
  151. data.organization_key = "{{organization.key}}";
  152. data.last_sync = parseInt("{{akaunting_options.last_sync}}") || 0;
  153. data.created = parseInt("{{akaunting_options.created}}") || 0;
  154. data.updated = parseInt("{{akaunting_options.updated}}") || 0;
  155. return data
  156. }, (response_text) => {
  157. window.location.reload()
  158. });
  159. })
  160. </script>
  161. {% endblock %}