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.

534 lines
30 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="foreign_currency" t-value="o.foreign_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-set="type" t-value='"account_type"'/>
  33. <t t-call="account_financial_report.report_general_ledger_lines">
  34. <t t-set="account_or_partner_object" t-value="account"/>
  35. </t>
  36. </t>
  37. <t t-if="account.partner_ids">
  38. <!-- Display account partners -->
  39. <t t-foreach="account.partner_ids" t-as="partner">
  40. <t t-set="type" t-value='"partner_type"'/>
  41. <div class="page_break">
  42. <!-- Display partner header -->
  43. <div class="act_as_caption account_title">
  44. <span t-field="partner.name"/>
  45. </div>
  46. <!-- Display partner move lines -->
  47. <t t-call="account_financial_report.report_general_ledger_lines">
  48. <t t-set="account_or_partner_object" t-value="partner"/>
  49. </t>
  50. <!-- Display partner footer -->
  51. <t t-call="account_financial_report.report_general_ledger_ending_cumul">
  52. <t t-set="account_or_partner_object" t-value="partner"/>
  53. <t t-set="type" t-value='"partner_type"'/>
  54. </t>
  55. </div>
  56. </t>
  57. </t>
  58. <!-- Display account footer -->
  59. <t t-call="account_financial_report.report_general_ledger_ending_cumul">
  60. <t t-set="account_or_partner_object" t-value="account"/>
  61. <t t-set="type" t-value='"account_type"'/>
  62. </t>
  63. </div>
  64. </t>
  65. </div>
  66. </template>
  67. <template id="account_financial_report.report_general_ledger_filters">
  68. <div class="act_as_table data_table" style="width: 100%;">
  69. <div class="act_as_row labels">
  70. <div class="act_as_cell">Date range filter</div>
  71. <div class="act_as_cell">Target moves filter</div>
  72. <div class="act_as_cell">Account balance at 0 filter</div>
  73. <div class="act_as_cell">Centralize filter</div>
  74. </div>
  75. <div class="act_as_row">
  76. <div class="act_as_cell">
  77. From: <span t-field="o.date_from"/> To: <span t-field="o.date_to"/>
  78. </div>
  79. <div class="act_as_cell">
  80. <t t-if="o.only_posted_moves">All posted entries</t>
  81. <t t-if="not o.only_posted_moves">All entries</t>
  82. </div>
  83. <div class="act_as_cell">
  84. <t t-if="o.hide_account_balance_at_0">Hide</t>
  85. <t t-if="not o.hide_account_balance_at_0">Show</t>
  86. </div>
  87. <div class="act_as_cell">
  88. <t t-if="o.centralize">Yes</t>
  89. <t t-if="not o.centralize">No</t>
  90. </div>
  91. </div>
  92. </div>
  93. </template>
  94. <template id="account_financial_report.report_general_ledger_lines">
  95. <div class="act_as_table data_table" style="width: 100%;">
  96. <!-- Display table headers for lines -->
  97. <div class="act_as_thead">
  98. <div class="act_as_row labels">
  99. <!--## date-->
  100. <div class="act_as_cell first_column" style="width: 3.51%;">
  101. Date</div>
  102. <!--## move-->
  103. <div class="act_as_cell" style="width: 8.03%">Entry</div>
  104. <!--## journal-->
  105. <div class="act_as_cell" style="width: 4.13%;">Journal</div>
  106. <!--## account code-->
  107. <div class="act_as_cell" style="width: 4.75%;">Account</div>
  108. <!--## account code-->
  109. <div class="act_as_cell" style="width: 8.89%;">Taxes</div>
  110. <!--## partner-->
  111. <div class="act_as_cell" style="width: 12.01%;">Partner
  112. </div>
  113. <!--## ref - label-->
  114. <div class="act_as_cell" style="width: 22.9%;">Ref -
  115. Label</div>
  116. <t t-if="show_cost_center">
  117. <!--## cost_center-->
  118. <div class="act_as_cell" style="width: 8.03%;">Cost
  119. center</div>
  120. </t>
  121. <!--## matching_number-->
  122. <div class="act_as_cell" style="width: 2.41%;">Rec.</div>
  123. <!--## debit-->
  124. <div class="act_as_cell amount" style="width: 6.02%;">Debit</div>
  125. <!--## credit-->
  126. <div class="act_as_cell amount" style="width: 6.02%;">Credit</div>
  127. <!--## balance cumulated-->
  128. <div class="act_as_cell amount" style="width: 6.02%;">Cumul. Bal.</div>
  129. <t t-if="foreign_currency">
  130. <!--## currency_name-->
  131. <div class="act_as_cell" style="width: 2.08%;">Cur.</div>
  132. <!--## amount_currency-->
  133. <div class="act_as_cell amount" style="width: 5.19%;">Amount cur.</div>
  134. </t>
  135. </div>
  136. </div>
  137. <!-- Display first line with initial balance -->
  138. <div class="act_as_row lines">
  139. <!--## date-->
  140. <div class="act_as_cell"/>
  141. <!--## move-->
  142. <div class="act_as_cell"/>
  143. <!--## journal-->
  144. <div class="act_as_cell"/>
  145. <!--## account code-->
  146. <div class="act_as_cell"/>
  147. <!--## taxes-->
  148. <div class="act_as_cell"/>
  149. <!--## partner-->
  150. <div class="act_as_cell"/>
  151. <!--## ref - label-->
  152. <div class="act_as_cell amount">Initial balance</div>
  153. <t t-if="show_cost_center">
  154. <!--## cost_center-->
  155. <div class="act_as_cell"/>
  156. </t>
  157. <!--## matching_number-->
  158. <div class="act_as_cell"/>
  159. <!--## debit-->
  160. <div class="act_as_cell amount">
  161. <t t-if="type == 'account_type'">
  162. <t t-set="domain"
  163. t-value="[('account_id', '=', account_or_partner_object.account_id.id),
  164. ('date', '&lt;', o.date_from),
  165. ('debit', '&lt;&gt;', 0)]"/>
  166. <span>
  167. <a t-att-data-domain="domain"
  168. t-att-data-res-model="'account.move.line'"
  169. class="o_account_financial_reports_web_action_monetary_multi"
  170. style="color: black;">
  171. <t t-raw="account_or_partner_object.initial_debit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
  172. </span>
  173. </t>
  174. <t t-if="type == 'partner_type'">
  175. <t t-set="domain"
  176. t-value="[('account_id', '=', account_or_partner_object.report_account_id.account_id.id),
  177. ('partner_id', '=', account_or_partner_object.partner_id.id),
  178. ('date', '&lt;', o.date_from),
  179. ('debit', '&lt;&gt;', 0)]"/>
  180. <span>
  181. <a t-att-data-domain="domain"
  182. t-att-data-res-model="'account.move.line'"
  183. class="o_account_financial_reports_web_action_monetary_multi"
  184. style="color: black;">
  185. <t t-raw="account_or_partner_object.initial_debit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
  186. </span>
  187. </t>
  188. </div>
  189. <!--## credit-->
  190. <div class="act_as_cell amount">
  191. <t t-if="type == 'account_type'">
  192. <t t-set="domain"
  193. t-value="[('account_id', '=', account_or_partner_object.account_id.id),
  194. ('date', '&lt;', o.date_from),
  195. ('credit', '&lt;&gt;', 0)]"/>
  196. <span>
  197. <a t-att-data-domain="domain"
  198. t-att-data-res-model="'account.move.line'"
  199. class="o_account_financial_reports_web_action_monetary_multi"
  200. style="color: black;">
  201. <t t-raw="account_or_partner_object.initial_credit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
  202. </span>
  203. </t>
  204. <t t-if="type == 'partner_type'">
  205. <t t-set="domain"
  206. t-value="[('account_id', '=', account_or_partner_object.report_account_id.account_id.id),
  207. ('partner_id', '=', account_or_partner_object.partner_id.id),
  208. ('date', '&lt;', o.date_from),
  209. ('credit', '&lt;&gt;', 0)]"/>
  210. <span>
  211. <a t-att-data-domain="domain"
  212. t-att-data-res-model="'account.move.line'"
  213. class="o_account_financial_reports_web_action_monetary_multi"
  214. style="color: black;">
  215. <t t-raw="account_or_partner_object.initial_credit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
  216. </span>
  217. </t>
  218. </div>
  219. <!--## balance cumulated-->
  220. <div class="act_as_cell amount">
  221. <t t-if="type == 'account_type'">
  222. <t t-set="domain"
  223. t-value="[('account_id', '=', account_or_partner_object.account_id.id),
  224. ('date', '&lt;', o.date_from)]"/>
  225. <span>
  226. <a t-att-data-domain="domain"
  227. t-att-data-res-model="'account.move.line'"
  228. class="o_account_financial_reports_web_action_monetary_multi"
  229. style="color: black;">
  230. <t t-raw="account_or_partner_object.initial_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
  231. </span>
  232. </t>
  233. <t t-if="type == 'partner_type'">
  234. <t t-set="domain"
  235. t-value="[('account_id', '=', account_or_partner_object.report_account_id.account_id.id),
  236. ('partner_id', '=', account_or_partner_object.partner_id.id),
  237. ('date', '&lt;', o.date_from)]"/>
  238. <span>
  239. <a t-att-data-domain="domain"
  240. t-att-data-res-model="'account.move.line'"
  241. class="o_account_financial_reports_web_action_monetary_multi"
  242. style="color: black;">
  243. <t t-raw="account_or_partner_object.initial_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
  244. </span>
  245. </t>
  246. </div>
  247. <t t-if="foreign_currency">
  248. <t t-if="account.account_id.currency_id.id">
  249. <div class="act_as_cell amount" style="width: 2.08%;">
  250. <span t-field="account.account_id.currency_id.display_name"/>
  251. </div>
  252. <div class="act_as_cell amount" style="width: 5.19%;">
  253. <t t-if="type == 'account_type'">
  254. <t t-set="domain"
  255. t-value="[('account_id', '=', account_or_partner_object.account_id.id),
  256. ('date', '&lt;', o.date_from)]"/>
  257. <span>
  258. <a t-att-data-domain="domain"
  259. t-att-data-res-model="'account.move.line'"
  260. class="o_account_financial_reports_web_action_monetary_multi"
  261. style="color: black;">
  262. <t t-raw="account_or_partner_object.initial_balance_foreign_currency" t-options="{'widget': 'monetary', 'display_currency': account.account_id.currency_id}"/></a>
  263. </span>
  264. </t>
  265. <t t-if="type == 'partner_type'">
  266. <t t-set="domain"
  267. t-value="[('account_id', '=', account_or_partner_object.report_account_id.account_id.id),
  268. ('partner_id', '=', account_or_partner_object.partner_id.id),
  269. ('date', '&lt;', o.date_from)]"/>
  270. <span>
  271. <a t-att-data-domain="domain"
  272. t-att-data-res-model="'account.move.line'"
  273. class="o_account_financial_reports_web_action_monetary_multi"
  274. style="color: black;">
  275. <t t-raw="account_or_partner_object.initial_balance_foreign_currency" t-options="{'widget': 'monetary', 'display_currency': account.account_id.currency_id}"/></a>
  276. </span>
  277. </t>
  278. </div>
  279. </t>
  280. <t t-if="not account.account_id.currency_id.id">
  281. <div class="act_as_cell" style="width: 2.08%;"/>
  282. <div class="act_as_cell" style="width: 5.19%;"/>
  283. </t>
  284. </t>
  285. </div>
  286. <!-- Display each lines -->
  287. <t t-foreach="account_or_partner_object.move_line_ids" t-as="line">
  288. <!-- # lines or centralized lines -->
  289. <div class="act_as_row lines">
  290. <!--## date-->
  291. <div class="act_as_cell left">
  292. <t t-set="res_model" t-value="'account.move.line'"/>
  293. <span>
  294. <a t-att-data-active-id="line.move_line_id.id"
  295. t-att-data-res-model="res_model"
  296. class="o_account_financial_reports_web_action"
  297. style="color: black;">
  298. <t t-raw="line.date"/></a>
  299. </span>
  300. </div>
  301. <!--## move-->
  302. <div class="act_as_cell left">
  303. <t t-set="res_model" t-value="'account.move'"/>
  304. <span>
  305. <a t-att-data-active-id="line.move_line_id.move_id.id"
  306. t-att-data-res-model="res_model"
  307. class="o_account_financial_reports_web_action"
  308. style="color: black;">
  309. <t t-raw="line.entry"/></a>
  310. </span>
  311. </div>
  312. <!--## journal-->
  313. <div class="act_as_cell left">
  314. <t t-set="res_model" t-value="'account.journal'"/>
  315. <span>
  316. <a t-att-data-active-id="line.move_line_id.move_id.journal_id.id"
  317. t-att-data-res-model="res_model"
  318. class="o_account_financial_reports_web_action"
  319. style="color: black;">
  320. <t t-raw="line.journal"/></a>
  321. </span>
  322. </div>
  323. <!--## account code-->
  324. <div class="act_as_cell left">
  325. <t t-set="res_model" t-value="'account.account'"/>
  326. <span>
  327. <a t-att-data-active-id="line.move_line_id.account_id.id"
  328. t-att-data-res-model="res_model"
  329. class="o_account_financial_reports_web_action"
  330. style="color: black;">
  331. <t t-raw="line.account"/></a>
  332. </span>
  333. </div>
  334. <!--## taxes-->
  335. <div class="act_as_cell left"><span t-field="line.taxes_description"/></div>
  336. <!--## partner-->
  337. <div class="act_as_cell left">
  338. <t t-set="res_model" t-value="'res.partner'"/>
  339. <span t-if="line.partner">
  340. <a t-att-data-active-id="line.move_line_id.partner_id.id"
  341. t-att-data-res-model="res_model"
  342. class="o_account_financial_reports_web_action"
  343. style="color: black;"><t t-raw="line.partner"/></a>
  344. </span>
  345. </div>
  346. <!--## ref - label-->
  347. <div class="act_as_cell left">
  348. <t t-set="res_model" t-value="'account.move.line'"/>
  349. <span>
  350. <a t-att-data-active-id="line.move_line_id.id"
  351. t-att-data-res-model="res_model"
  352. class="o_account_financial_reports_web_action"
  353. style="color: black;">
  354. <t t-raw="line.label"/></a>
  355. </span>
  356. </div>
  357. <!--## cost_center-->
  358. <t t-if="show_cost_center">
  359. <div class="act_as_cell left">
  360. <t t-set="res_model" t-value="'account.analytic.account'"/>
  361. <span t-if="line.cost_center">
  362. <a t-att-data-active-id="line.move_line_id.analytic_account_id.id"
  363. t-att-data-res-model="res_model"
  364. class="o_account_financial_reports_web_action"
  365. style="color: black;"><t t-raw="line.cost_center"/></a>
  366. </span>
  367. </div>
  368. </t>
  369. <!--## matching_number-->
  370. <div class="act_as_cell">
  371. <t t-set="res_model" t-value="'account.full.reconcile'"/>
  372. <span t-if="line.matching_number">
  373. <a t-att-data-active-id="line.move_line_id.full_reconcile_id.id"
  374. t-att-data-res-model="res_model"
  375. class="o_account_financial_reports_web_action"
  376. style="color: black;"><t t-raw="line.matching_number"/></a>
  377. </span>
  378. </div>
  379. <!--## debit-->
  380. <div class="act_as_cell amount">
  381. <t t-set="res_model" t-value="'account.move.line'"/>
  382. <span>
  383. <a t-att-data-active-id="line.move_line_id.id"
  384. t-att-data-res-model="res_model"
  385. class="o_account_financial_reports_web_action_monetary"
  386. style="color: black;">
  387. <t t-raw="line.debit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
  388. </span>
  389. </div>
  390. <!--## credit-->
  391. <div class="act_as_cell amount">
  392. <t t-set="res_model" t-value="'account.move.line'"/>
  393. <span>
  394. <a t-att-data-active-id="line.move_line_id.id"
  395. t-att-data-res-model="res_model"
  396. class="o_account_financial_reports_web_action_monetary"
  397. style="color: black;">
  398. <t t-raw="line.credit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
  399. </span>
  400. </div>
  401. <!--## balance cumulated-->
  402. <div class="act_as_cell amount">
  403. <t t-set="res_model" t-value="'account.move.line'"/>
  404. <span>
  405. <a t-att-data-active-id="line.move_line_id.id"
  406. t-att-data-res-model="res_model"
  407. class="o_account_financial_reports_web_action_monetary"
  408. style="color: black;">
  409. <t t-raw="line.cumul_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
  410. </span>
  411. </div>
  412. <t t-if="foreign_currency">
  413. <t t-if="line.currency_id.id">
  414. <!--## currency_name-->
  415. <div class="act_as_cell amount" style="width: 2.08%;">
  416. <span t-field="line.currency_id.display_name"/>
  417. </div>
  418. <!--## amount_currency-->
  419. <div class="act_as_cell amount" style="width: 5.19%;">
  420. <t t-set="res_model" t-value="'account.move.line'"/>
  421. <span>
  422. <a t-att-data-active-id="line.move_line_id.id"
  423. t-att-data-res-model="res_model"
  424. class="o_account_financial_reports_web_action"
  425. style="color: black;">
  426. <t t-raw="line.amount_currency" t-options="{'widget': 'monetary', 'display_currency': line.currency_id}"/></a>
  427. </span>
  428. </div>
  429. </t>
  430. <t t-if="not line.currency_id.id">
  431. <!--## currency_name-->
  432. <div class="act_as_cell amount" style="width: 2.08%;"/>
  433. <!--## amount_currency-->
  434. <div class="act_as_cell amount" style="width: 5.19%;"/>
  435. </t>
  436. </t>
  437. </div>
  438. </t>
  439. </div>
  440. </template>
  441. <template id="account_financial_report.report_general_ledger_ending_cumul">
  442. <!-- Display ending balance line for account or partner -->
  443. <div class="act_as_table list_table" style="width: 100%;">
  444. <div class="act_as_row labels" style="font-weight: bold;">
  445. <!--## date-->
  446. <t t-if='type == "account_type"'>
  447. <div class="act_as_cell first_column"
  448. style="width: 41.32%;"><span
  449. t-field="account_or_partner_object.code"/> - <span t-field="account_or_partner_object.name"/></div>
  450. <div class="act_as_cell right"
  451. style="width: 22.9%;">Ending balance</div>
  452. </t>
  453. <t t-if='type == "partner_type"'>
  454. <div class="act_as_cell first_column" style="width: 41.32%;"/>
  455. <div class="act_as_cell right" style="width: 22.9%;">Partner ending balance</div>
  456. </t>
  457. <t t-if="show_cost_center">
  458. <!--## cost_center-->
  459. <div class="act_as_cell" style="width: 8.03%"/>
  460. </t>
  461. <!--## matching_number-->
  462. <div class="act_as_cell" style="width: 2.41%;"/>
  463. <!--## debit-->
  464. <div class="act_as_cell amount" style="width: 6.02%;">
  465. <span t-field="account_or_partner_object.final_debit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
  466. </div>
  467. <!--## credit-->
  468. <div class="act_as_cell amount" style="width: 6.02%;">
  469. <span t-field="account_or_partner_object.final_credit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
  470. </div>
  471. <!--## balance cumulated-->
  472. <div class="act_as_cell amount" style="width: 6.02%;">
  473. <span t-field="account_or_partner_object.final_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
  474. </div>
  475. <!--## currency_name + amount_currency-->
  476. <t t-if="foreign_currency">
  477. <t t-if="account.account_id.currency_id.id">
  478. <div class="act_as_cell amount" style="width: 2.08%;">
  479. <span t-field="account.account_id.currency_id.display_name"/>
  480. </div>
  481. <div class="act_as_cell amount" style="width: 5.19%;">
  482. <t t-if="type == 'account_type'">
  483. <t t-set="domain"
  484. t-value="[('account_id', '=', account_or_partner_object.account_id.id),
  485. ('date', '&lt;', o.date_from)]"/>
  486. <span>
  487. <a t-att-data-domain="domain"
  488. t-att-data-res-model="'account.move.line'"
  489. class="o_account_financial_reports_web_action_monetary_multi"
  490. style="color: black;">
  491. <t t-raw="account_or_partner_object.final_balance_foreign_currency" t-options="{'widget': 'monetary', 'display_currency': account_or_partner_object.account_id.currency_id}"/></a>
  492. </span>
  493. </t>
  494. <t t-if="type == 'partner_type'">
  495. <t t-set="domain"
  496. t-value="[('account_id', '=', account_or_partner_object.report_account_id.account_id.id),
  497. ('partner_id', '=', account_or_partner_object.partner_id.id),
  498. ('date', '&lt;', o.date_from)]"/>
  499. <span>
  500. <a t-att-data-domain="domain"
  501. t-att-data-res-model="'account.move.line'"
  502. class="o_account_financial_reports_web_action_monetary_multi"
  503. style="color: black;">
  504. <t t-raw="account_or_partner_object.final_balance_foreign_currency" t-options="{'widget': 'monetary', 'display_currency': account_or_partner_object.report_account_id.currency_id}"/></a>
  505. </span>
  506. </t>
  507. </div>
  508. </t>
  509. <t t-if="not account.account_id.currency_id ">
  510. <div class="act_as_cell amount" style="width: 2.08%;"/>
  511. <div class="act_as_cell amount" style="width: 5.19%;"/>
  512. </t>
  513. </t>
  514. </div>
  515. </div>
  516. </template>
  517. </odoo>