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.

263 lines
13 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <template id="report_general_ledger_qweb">
  4. <t t-call="web.html_container">
  5. <t t-foreach="docs" t-as="o">
  6. <t t-call="account_financial_report.internal_layout">
  7. <t t-call="account_financial_report.report_general_ledger_base"/>
  8. </t>
  9. </t>
  10. </t>
  11. </template>
  12. <template id="report_general_ledger_base">
  13. <!-- Saved flag fields into variables, used to define columns display -->
  14. <t t-set="show_cost_center" t-value="o.show_cost_center"/>
  15. <t t-set="has_second_currency" t-value="o.has_second_currency"/>
  16. <!-- Defines global variables used by internal layout -->
  17. <t t-set="title">General Ledger</t>
  18. <t t-set="company_name" t-value="o.company_id.name"/>
  19. <div class="page">
  20. <!-- Display filters -->
  21. <t t-call="account_financial_report.report_general_ledger_filters"/>
  22. <t t-foreach="o.account_ids" t-as="account">
  23. <div class="page_break">
  24. <!-- Display account header -->
  25. <div class="act_as_table list_table" style="margin-top: 10px;"/>
  26. <div class="act_as_caption account_title" style="width: 1141px !important;">
  27. <span t-field="account.code"/> - <span t-field="account.name"/>
  28. </div>
  29. <t t-if="not account.partner_ids">
  30. <!-- Display account move lines without partner regroup -->
  31. <t t-call="account_financial_report.report_general_ledger_lines">
  32. <t t-set="account_or_partner_object" t-value="account"/>
  33. </t>
  34. </t>
  35. <t t-if="account.partner_ids">
  36. <!-- Display account partners -->
  37. <t t-foreach="account.partner_ids" t-as="partner">
  38. <div class="page_break">
  39. <!-- Display partner header -->
  40. <div class="act_as_caption account_title">
  41. <span t-field="partner.name"/>
  42. </div>
  43. <!-- Display partner move lines -->
  44. <t t-call="account_financial_report.report_general_ledger_lines">
  45. <t t-set="account_or_partner_object" t-value="partner"/>
  46. </t>
  47. <!-- Display partner footer -->
  48. <t t-call="account_financial_report.report_general_ledger_ending_cumul">
  49. <t t-set="account_or_partner_object" t-value="partner"/>
  50. <t t-set="type" t-value='"partner_type"'/>
  51. </t>
  52. </div>
  53. </t>
  54. </t>
  55. <!-- Display account footer -->
  56. <t t-call="account_financial_report.report_general_ledger_ending_cumul">
  57. <t t-set="account_or_partner_object" t-value="account"/>
  58. <t t-set="type" t-value='"account_type"'/>
  59. </t>
  60. </div>
  61. </t>
  62. </div>
  63. </template>
  64. <template id="account_financial_report.report_general_ledger_filters">
  65. <div class="act_as_table data_table" style="width: 1140px !important;">
  66. <div class="act_as_row labels">
  67. <div class="act_as_cell">Date range filter</div>
  68. <div class="act_as_cell">Target moves filter</div>
  69. <div class="act_as_cell">Account balance at 0 filter</div>
  70. <div class="act_as_cell">Centralize filter</div>
  71. </div>
  72. <div class="act_as_row">
  73. <div class="act_as_cell">
  74. From: <span t-field="o.date_from"/> To: <span t-field="o.date_to"/>
  75. </div>
  76. <div class="act_as_cell">
  77. <t t-if="o.only_posted_moves">All posted entries</t>
  78. <t t-if="not o.only_posted_moves">All entries</t>
  79. </div>
  80. <div class="act_as_cell">
  81. <t t-if="o.hide_account_balance_at_0">Hide</t>
  82. <t t-if="not o.hide_account_balance_at_0">Show</t>
  83. </div>
  84. <div class="act_as_cell">
  85. <t t-if="o.centralize">Yes</t>
  86. <t t-if="not o.centralize">No</t>
  87. </div>
  88. </div>
  89. </div>
  90. </template>
  91. <template id="account_financial_report.report_general_ledger_lines">
  92. <div class="act_as_table data_table" style="width: 1140px !important;">
  93. <!-- Display table headers for lines -->
  94. <div class="act_as_thead">
  95. <div class="act_as_row labels">
  96. <!--## date-->
  97. <div class="act_as_cell first_column" style="width: 60px;">Date</div>
  98. <!--## move-->
  99. <div class="act_as_cell" style="width: 100px;">Entry</div>
  100. <!--## journal-->
  101. <div class="act_as_cell" style="width: 40px;">Journal</div>
  102. <!--## account code-->
  103. <div class="act_as_cell" style="width: 50px;">Account</div>
  104. <!--## partner-->
  105. <div class="act_as_cell" style="width: 140px;">Partner</div>
  106. <!--## ref - label-->
  107. <div class="act_as_cell" style="width: 290px;">Ref - Label</div>
  108. <t t-if="show_cost_center">
  109. <!--## cost_center-->
  110. <div class="act_as_cell" style="width: 100px;">Cost center</div>
  111. </t>
  112. <!--## matching_number-->
  113. <div class="act_as_cell" style="width: 25px;">Rec.</div>
  114. <!--## debit-->
  115. <div class="act_as_cell amount" style="width: 75px;">Debit</div>
  116. <!--## credit-->
  117. <div class="act_as_cell amount" style="width: 75px;">Credit</div>
  118. <!--## balance cumulated-->
  119. <div class="act_as_cell amount" style="width: 75px;">Cumul. Bal.</div>
  120. <!--## currency_name-->
  121. <div class="act_as_cell" style="width: 35px;">Cur.</div>
  122. <!--## amount_currency-->
  123. <div class="act_as_cell amount" style="width: 75px;">Amount cur.</div>
  124. </div>
  125. </div>
  126. <!-- Display first line with initial balance -->
  127. <div class="act_as_row lines">
  128. <!--## date-->
  129. <div class="act_as_cell"/>
  130. <!--## move-->
  131. <div class="act_as_cell"/>
  132. <!--## journal-->
  133. <div class="act_as_cell"/>
  134. <!--## account code-->
  135. <div class="act_as_cell"/>
  136. <!--## partner-->
  137. <div class="act_as_cell"/>
  138. <!--## ref - label-->
  139. <div class="act_as_cell amount">Initial balance</div>
  140. <t t-if="show_cost_center">
  141. <!--## cost_center-->
  142. <div class="act_as_cell"/>
  143. </t>
  144. <!--## matching_number-->
  145. <div class="act_as_cell"/>
  146. <!--## debit-->
  147. <div class="act_as_cell amount"><span t-field="account_or_partner_object.initial_debit"/></div>
  148. <!--## credit-->
  149. <div class="act_as_cell amount"><span t-field="account_or_partner_object.initial_credit"/></div>
  150. <!--## balance cumulated-->
  151. <div class="act_as_cell amount"><span t-field="account_or_partner_object.initial_balance"/></div>
  152. <!--## currency_name-->
  153. <div class="act_as_cell"/>
  154. <!--## amount_currency-->
  155. <div class="act_as_cell"/>
  156. </div>
  157. <!-- Display each lines -->
  158. <t t-foreach="account_or_partner_object.move_line_ids" t-as="line">
  159. <!-- # lines or centralized lines -->
  160. <div class="act_as_row lines">
  161. <!--## date-->
  162. <div class="act_as_cell left"><span t-field="line.date"/></div>
  163. <!--## move-->
  164. <div class="act_as_cell left">
  165. <t t-set="res_model" t-value="'account.move'"/>
  166. <span>
  167. <a t-att-data-active-id="line.move_line_id.move_id.id"
  168. t-att-data-res-model="res_model"
  169. class="o_account_financial_reports_web_action"
  170. style="color: black;">
  171. <t t-raw="line.entry"/></a>
  172. </span>
  173. </div>
  174. <!--## journal-->
  175. <div class="act_as_cell left"><span t-field="line.journal"/></div>
  176. <!--## account code-->
  177. <div class="act_as_cell left"><span t-field="line.account"/></div>
  178. <!--## partner-->
  179. <div class="act_as_cell left">
  180. <t t-set="res_model" t-value="'res.partner'"/>
  181. <span t-if="line.partner">
  182. <a t-att-data-active-id="line.move_line_id.partner_id.id"
  183. t-att-data-res-model="res_model"
  184. class="o_account_financial_reports_web_action"
  185. style="color: black;"><t t-raw="line.partner"/></a>
  186. </span>
  187. </div>
  188. <!--## ref - label-->
  189. <div class="act_as_cell left"><span t-field="line.label"/></div>
  190. <t t-if="show_cost_center">
  191. <!--## cost_center-->
  192. <div class="act_as_cell left"><span t-field="line.cost_center"/></div>
  193. </t>
  194. <!--## matching_number-->
  195. <div class="act_as_cell"><span t-field="line.matching_number"/></div>
  196. <!--## debit-->
  197. <div class="act_as_cell amount"><span t-field="line.debit"/></div>
  198. <!--## credit-->
  199. <div class="act_as_cell amount"><span t-field="line.credit"/></div>
  200. <!--## balance cumulated-->
  201. <div class="act_as_cell amount"><span t-field="line.cumul_balance"/></div>
  202. <!--## currency_name-->
  203. <div class="act_as_cell"><span t-field="line.currency_name"/></div>
  204. <t t-if="line.currency_name">
  205. <!--## amount_currency-->
  206. <div class="act_as_cell amount"><span t-field="line.amount_currency"/></div>
  207. </t>
  208. <t t-if="not line.currency_name">
  209. <!--## amount_currency-->
  210. <div class="act_as_cell"/>
  211. </t>
  212. </div>
  213. </t>
  214. </div>
  215. </template>
  216. <template id="account_financial_report.report_general_ledger_ending_cumul">
  217. <!-- Display ending balance line for account or partner -->
  218. <div class="act_as_table list_table" style="width: 1141px !important;">
  219. <div class="act_as_row labels" style="font-weight: bold;">
  220. <!--## date-->
  221. <t t-if='type == "account_type"'>
  222. <div class="act_as_cell first_column" style="width: 380px;"><span t-field="account_or_partner_object.code"/> - <span t-field="account_or_partner_object.name"/></div>
  223. <div class="act_as_cell right" style="width: 290px;">Ending balance</div>
  224. </t>
  225. <t t-if='type == "partner_type"'>
  226. <div class="act_as_cell first_column" style="width: 380px;"/>
  227. <div class="act_as_cell right" style="width: 290px;">Partner ending balance</div>
  228. </t>
  229. <t t-if="show_cost_center">
  230. <!--## cost_center-->
  231. <div class="act_as_cell" style="width: 100px;"/>
  232. </t>
  233. <!--## matching_number-->
  234. <div class="act_as_cell" style="width: 25px;"/>
  235. <!--## debit-->
  236. <div class="act_as_cell amount" style="width: 75px;"><span t-field="account_or_partner_object.final_debit"/></div>
  237. <!--## credit-->
  238. <div class="act_as_cell amount" style="width: 75px;"><span t-field="account_or_partner_object.final_credit"/></div>
  239. <!--## balance cumulated-->
  240. <div class="act_as_cell amount" style="width: 75px; padding-right: 1px;"><span t-field="account_or_partner_object.final_balance"/></div>
  241. <!--## currency_name + amount_currency-->
  242. <div class="act_as_cell" style="width: 110px;"/>
  243. </div>
  244. </div>
  245. </template>
  246. </odoo>