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.

274 lines
13 KiB

8 years ago
  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"
  27. style="width: 100%">
  28. <span t-field="account.code"/> - <span t-field="account.name"/>
  29. </div>
  30. <t t-if="not account.partner_ids">
  31. <!-- Display account move lines without partner regroup -->
  32. <t t-call="account_financial_report.report_general_ledger_lines">
  33. <t t-set="account_or_partner_object" t-value="account"/>
  34. </t>
  35. </t>
  36. <t t-if="account.partner_ids">
  37. <!-- Display account partners -->
  38. <t t-foreach="account.partner_ids" t-as="partner">
  39. <div class="page_break">
  40. <!-- Display partner header -->
  41. <div class="act_as_caption account_title">
  42. <span t-field="partner.name"/>
  43. </div>
  44. <!-- Display partner move lines -->
  45. <t t-call="account_financial_report.report_general_ledger_lines">
  46. <t t-set="account_or_partner_object" t-value="partner"/>
  47. </t>
  48. <!-- Display partner footer -->
  49. <t t-call="account_financial_report.report_general_ledger_ending_cumul">
  50. <t t-set="account_or_partner_object" t-value="partner"/>
  51. <t t-set="type" t-value='"partner_type"'/>
  52. </t>
  53. </div>
  54. </t>
  55. </t>
  56. <!-- Display account footer -->
  57. <t t-call="account_financial_report.report_general_ledger_ending_cumul">
  58. <t t-set="account_or_partner_object" t-value="account"/>
  59. <t t-set="type" t-value='"account_type"'/>
  60. </t>
  61. </div>
  62. </t>
  63. </div>
  64. </template>
  65. <template id="account_financial_report.report_general_ledger_filters">
  66. <div class="act_as_table data_table" style="width: 100%;">
  67. <div class="act_as_row labels">
  68. <div class="act_as_cell">Date range filter</div>
  69. <div class="act_as_cell">Target moves filter</div>
  70. <div class="act_as_cell">Account balance at 0 filter</div>
  71. <div class="act_as_cell">Centralize filter</div>
  72. </div>
  73. <div class="act_as_row">
  74. <div class="act_as_cell">
  75. From: <span t-field="o.date_from"/> To: <span t-field="o.date_to"/>
  76. </div>
  77. <div class="act_as_cell">
  78. <t t-if="o.only_posted_moves">All posted entries</t>
  79. <t t-if="not o.only_posted_moves">All entries</t>
  80. </div>
  81. <div class="act_as_cell">
  82. <t t-if="o.hide_account_balance_at_0">Hide</t>
  83. <t t-if="not o.hide_account_balance_at_0">Show</t>
  84. </div>
  85. <div class="act_as_cell">
  86. <t t-if="o.centralize">Yes</t>
  87. <t t-if="not o.centralize">No</t>
  88. </div>
  89. </div>
  90. </div>
  91. </template>
  92. <template id="account_financial_report.report_general_ledger_lines">
  93. <div class="act_as_table data_table" style="width: 100%;">
  94. <!-- Display table headers for lines -->
  95. <div class="act_as_thead">
  96. <div class="act_as_row labels">
  97. <!--## date-->
  98. <div class="act_as_cell first_column" style="width: 5.74%;">
  99. Date</div>
  100. <!--## move-->
  101. <div class="act_as_cell" style="width: 8.77%">Entry</div>
  102. <!--## journal-->
  103. <div class="act_as_cell" style="width: 4.51%;">Journal</div>
  104. <!--## account code-->
  105. <div class="act_as_cell" style="width: 5.19%;">Account</div>
  106. <!--## partner-->
  107. <div class="act_as_cell" style="width: 10%;">Partner
  108. </div>
  109. <!--## ref - label-->
  110. <div class="act_as_cell" style="width: 25%;">Ref -
  111. Label</div>
  112. <t t-if="show_cost_center">
  113. <!--## cost_center-->
  114. <div class="act_as_cell" style="width: 8.77%;">Cost
  115. center</div>
  116. </t>
  117. <!--## matching_number-->
  118. <div class="act_as_cell" style="width: 2.63%;">Rec.</div>
  119. <!--## debit-->
  120. <div class="act_as_cell amount" style="width: 6.57%;">Debit</div>
  121. <!--## credit-->
  122. <div class="act_as_cell amount" style="width: 6.57%;">Credit</div>
  123. <!--## balance cumulated-->
  124. <div class="act_as_cell amount" style="width: 6.57%;">Cumul. Bal.</div>
  125. <!--## currency_name-->
  126. <div class="act_as_cell" style="width: 3.11%;">Cur.</div>
  127. <!--## amount_currency-->
  128. <div class="act_as_cell amount" style="width: 6.57%;">Amount cur.</div>
  129. </div>
  130. </div>
  131. <!-- Display first line with initial balance -->
  132. <div class="act_as_row lines">
  133. <!--## date-->
  134. <div class="act_as_cell"/>
  135. <!--## move-->
  136. <div class="act_as_cell"/>
  137. <!--## journal-->
  138. <div class="act_as_cell"/>
  139. <!--## account code-->
  140. <div class="act_as_cell"/>
  141. <!--## partner-->
  142. <div class="act_as_cell"/>
  143. <!--## ref - label-->
  144. <div class="act_as_cell amount">Initial balance</div>
  145. <t t-if="show_cost_center">
  146. <!--## cost_center-->
  147. <div class="act_as_cell"/>
  148. </t>
  149. <!--## matching_number-->
  150. <div class="act_as_cell"/>
  151. <!--## debit-->
  152. <div class="act_as_cell amount"><span t-field="account_or_partner_object.initial_debit"/></div>
  153. <!--## credit-->
  154. <div class="act_as_cell amount"><span t-field="account_or_partner_object.initial_credit"/></div>
  155. <!--## balance cumulated-->
  156. <div class="act_as_cell amount"><span t-field="account_or_partner_object.initial_balance"/></div>
  157. <!--## currency_name-->
  158. <div class="act_as_cell"/>
  159. <!--## amount_currency-->
  160. <div class="act_as_cell"/>
  161. </div>
  162. <!-- Display each lines -->
  163. <t t-foreach="account_or_partner_object.move_line_ids" t-as="line">
  164. <!-- # lines or centralized lines -->
  165. <div class="act_as_row lines">
  166. <!--## date-->
  167. <div class="act_as_cell left"><span t-field="line.date"/></div>
  168. <!--## move-->
  169. <div class="act_as_cell left">
  170. <t t-set="res_model" t-value="'account.move'"/>
  171. <span>
  172. <a t-att-data-active-id="line.move_line_id.move_id.id"
  173. t-att-data-res-model="res_model"
  174. class="o_account_financial_reports_web_action"
  175. style="color: black;">
  176. <t t-raw="line.entry"/></a>
  177. </span>
  178. </div>
  179. <!--## journal-->
  180. <div class="act_as_cell left"><span t-field="line.journal"/></div>
  181. <!--## account code-->
  182. <div class="act_as_cell left"><span t-field="line.account"/></div>
  183. <!--## partner-->
  184. <div class="act_as_cell left">
  185. <t t-set="res_model" t-value="'res.partner'"/>
  186. <span t-if="line.partner">
  187. <a t-att-data-active-id="line.move_line_id.partner_id.id"
  188. t-att-data-res-model="res_model"
  189. class="o_account_financial_reports_web_action"
  190. style="color: black;"><t t-raw="line.partner"/></a>
  191. </span>
  192. </div>
  193. <!--## ref - label-->
  194. <div class="act_as_cell left"><span t-field="line.label"/></div>
  195. <t t-if="show_cost_center">
  196. <!--## cost_center-->
  197. <div class="act_as_cell left"><span t-field="line.cost_center"/></div>
  198. </t>
  199. <!--## matching_number-->
  200. <div class="act_as_cell"><span t-field="line.matching_number"/></div>
  201. <!--## debit-->
  202. <div class="act_as_cell amount"><span t-field="line.debit"/></div>
  203. <!--## credit-->
  204. <div class="act_as_cell amount"><span t-field="line.credit"/></div>
  205. <!--## balance cumulated-->
  206. <div class="act_as_cell amount"><span t-field="line.cumul_balance"/></div>
  207. <!--## currency_name-->
  208. <div class="act_as_cell"><span t-field="line.currency_name"/></div>
  209. <t t-if="line.currency_name">
  210. <!--## amount_currency-->
  211. <div class="act_as_cell amount"><span t-field="line.amount_currency"/></div>
  212. </t>
  213. <t t-if="not line.currency_name">
  214. <!--## amount_currency-->
  215. <div class="act_as_cell"/>
  216. </t>
  217. </div>
  218. </t>
  219. </div>
  220. </template>
  221. <template id="account_financial_report.report_general_ledger_ending_cumul">
  222. <!-- Display ending balance line for account or partner -->
  223. <div class="act_as_table list_table" style="width: 100%;">
  224. <div class="act_as_row labels" style="font-weight: bold;">
  225. <!--## date-->
  226. <t t-if='type == "account_type"'>
  227. <div class="act_as_cell first_column"
  228. style="width: 33.33%;"><span
  229. t-field="account_or_partner_object.code"/> - <span t-field="account_or_partner_object.name"/></div>
  230. <div class="act_as_cell right"
  231. style="width: 25.44%;">Ending balance</div>
  232. </t>
  233. <t t-if='type == "partner_type"'>
  234. <div class="act_as_cell first_column" style="width: 33.33%;"/>
  235. <div class="act_as_cell right" style="width: 25.44%;">Partner ending balance</div>
  236. </t>
  237. <t t-if="show_cost_center">
  238. <!--## cost_center-->
  239. <div class="act_as_cell" style="width: 8.77%"/>
  240. </t>
  241. <!--## matching_number-->
  242. <div class="act_as_cell" style="width: 3.11%;"/>
  243. <!--## debit-->
  244. <div class="act_as_cell amount" style="width: 6.57%;"><span
  245. t-field="account_or_partner_object.final_debit"/></div>
  246. <!--## credit-->
  247. <div class="act_as_cell amount" style="width: 6.57%;"><span
  248. t-field="account_or_partner_object.final_credit"/></div>
  249. <!--## balance cumulated-->
  250. <div class="act_as_cell amount" style="width: 6.57%;"><span
  251. t-field="account_or_partner_object.final_balance"/></div>
  252. <!--## currency_name + amount_currency-->
  253. <div class="act_as_cell" style="width: 9.64%;"/>
  254. </div>
  255. </div>
  256. </template>
  257. </odoo>