diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 17:14:58 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 17:14:58 +0700 |
| commit | 1ca3b3df3421961caec3b747a364071c80f5c7da (patch) | |
| tree | 6778a1f0f3f9b4c6e26d6d87ccde16e24da6c9d6 /dynamic_accounts_report/report | |
| parent | b57188be371d36d96caac4b8d65a40745c0e972c (diff) | |
initial commit
Diffstat (limited to 'dynamic_accounts_report/report')
| -rw-r--r-- | dynamic_accounts_report/report/__init__.py | 7 | ||||
| -rw-r--r-- | dynamic_accounts_report/report/ageing.py | 19 | ||||
| -rw-r--r-- | dynamic_accounts_report/report/ageing.xml | 168 | ||||
| -rw-r--r-- | dynamic_accounts_report/report/cash_flow_report.py | 16 | ||||
| -rw-r--r-- | dynamic_accounts_report/report/cash_flow_report.xml | 263 | ||||
| -rw-r--r-- | dynamic_accounts_report/report/daybook.py | 17 | ||||
| -rw-r--r-- | dynamic_accounts_report/report/daybook.xml | 121 | ||||
| -rw-r--r-- | dynamic_accounts_report/report/financial_report_template.xml | 165 | ||||
| -rw-r--r-- | dynamic_accounts_report/report/financial_reports.py | 20 | ||||
| -rw-r--r-- | dynamic_accounts_report/report/general_ledger.py | 20 | ||||
| -rw-r--r-- | dynamic_accounts_report/report/general_ledger.xml | 153 | ||||
| -rw-r--r-- | dynamic_accounts_report/report/partner_ledger.py | 16 | ||||
| -rw-r--r-- | dynamic_accounts_report/report/partner_ledger.xml | 155 | ||||
| -rw-r--r-- | dynamic_accounts_report/report/trial_balance.py | 18 | ||||
| -rw-r--r-- | dynamic_accounts_report/report/trial_balance.xml | 129 |
15 files changed, 1287 insertions, 0 deletions
diff --git a/dynamic_accounts_report/report/__init__.py b/dynamic_accounts_report/report/__init__.py new file mode 100644 index 0000000..5838e7a --- /dev/null +++ b/dynamic_accounts_report/report/__init__.py @@ -0,0 +1,7 @@ +from . import trial_balance +from . import general_ledger +from . import cash_flow_report +from . import financial_reports +from . import partner_ledger +from . import ageing +from . import daybook diff --git a/dynamic_accounts_report/report/ageing.py b/dynamic_accounts_report/report/ageing.py new file mode 100644 index 0000000..3764f7f --- /dev/null +++ b/dynamic_accounts_report/report/ageing.py @@ -0,0 +1,19 @@ +from odoo import api, models, _ + + +class PartnerAgeing(models.AbstractModel): + _name = 'report.dynamic_accounts_report.partner_ageing' + + @api.model + def _get_report_values(self, docids, data=None): + if self.env.context.get('ageing_pdf_report'): + + if data.get('report_data'): + data.update( + {'account_data': data.get('report_data')['report_lines'][0], + 'Filters': data.get('report_data')['filters'], + 'company': self.env.company, + + }) + + return data diff --git a/dynamic_accounts_report/report/ageing.xml b/dynamic_accounts_report/report/ageing.xml new file mode 100644 index 0000000..ae70846 --- /dev/null +++ b/dynamic_accounts_report/report/ageing.xml @@ -0,0 +1,168 @@ +<odoo> + <template id="dynamic_accounts_report.partner_ageing"> + <t t-call="web.html_container"> + <t t-set="data_report_margin_top" t-value="12"/> + <t t-set="data_report_header_spacing" t-value="9"/> + <t t-set="data_report_dpi" t-value="110"/> + <t t-call="web.internal_layout"> + <div class="page"> + <div class="oe_structure"/> + <h3 style="text-align:centre;left:50%;"><span t-esc="Filters.get('company_name')"/>: Partner Ageing + </h3> + <strong> As On Date:</strong> + <t t-esc="Filters['date_from']"/> + <div> + <div style="text-align:centre;left:50%;" class="row"> + <div class="col-3"> + <strong>Target move:</strong> + <li> + <t t-esc="Filters['target_move']"/> + </li> + </div> + <div class="col-3"> + <strong>Account Type:</strong> + <li> + <t t-esc="Filters['result_selection']"/> + </li> + </div> + <div class="col-3" style=""> + <strong>Partners :</strong> + <t t-foreach="Filters['partners']" t-as="pa"> + <li> + <t t-esc="pa"/> + </li> + </t> + </div> + <div class="col-3" style=""> + <strong>Partner Tag :</strong> + <t t-foreach="Filters['partner_tags']" t-as="pt"> + <li> + <t t-esc="pt"/> + </li> + </t> + </div> + </div> + + + <br></br> + <table class="table table-sm table-reports"> + <thead> + <tr class="text-center"> + <th>Entry Label</th> + <th>Due date</th> + <th>JRNL</th> + <th>Account</th> + <th>Not Due</th> + <th>0 - 30</th> + <th>30 - 60</th> + <th>60 - 90</th> + <th>90 - 120</th> + <th>120 +</th> + <th> Total</th> + <th groups="base.group_multi_currency">Currency</th> + </tr> + </thead> + <tbody> + <t t-foreach="account_data" t-as="account"> + <tr style="font-weight: bold;"> + <td colspan="4"> + <span style="color: white;" t-esc="'..'"/> + <span t-esc="account['name']"/> + </td> + <td class="text-right"> + <span t-esc="account['direction']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="account['4']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="account['3']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="account['2']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="account['1']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="account['0']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="account['total']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + + <td groups="base.group_multi_currency"/> + </tr> + <tr t-foreach="account['child_lines']" t-as="line"> + <td><span t-esc="line['move']"/></td> + <td><span t-esc="line['date']"/></td> + <td><span t-esc="line['jrnl']"/></td> + <td><span t-esc="line['acc_code']"/></td> + <td class="text-right"> + <span t-if="line.get('period6')" + t-esc="line['amount']" + t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + <span t-else=""> + <span>-</span> + </span> + </td> + <td class="text-right"> + <span t-if="line.get('period5')" + t-esc="line['amount']" + t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + <span t-else=""> + <span>-</span> + </span> + </td> + <td class="text-right"> + <span t-if="line.get('period4')" + t-esc="line['amount']" + t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + <span t-else=""> + <span>-</span> + </span> + </td> + <td class="text-right"> + <span t-if="line.get('period3')" + t-esc="line['amount']" + t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + <span t-else=""> + <span>-</span> + </span> + </td> + <td class="text-right"> + <span t-if="line.get('period2')" + t-esc="line['amount']" + t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + <span t-else=""> + <span>-</span> + </span> + </td> + <td class="text-right"> + <span t-if="line.get('period1')" + t-esc="line['amount']" + t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + <span t-else=""> + <span>-</span> + </span> + </td> + </tr> + </t> + </tbody> + </table> + </div> + <br></br> + </div> + </t> + </t> + </template> + + <record id="action_print_ageing_partner" model="ir.actions.report"> + <field name="name">Partner Ageing</field> + <field name="model">account.partner.ageing</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">dynamic_accounts_report.partner_ageing</field> + <field name="report_file">dynamic_accounts_report.partner_ageing</field> + </record> + +</odoo>
\ No newline at end of file diff --git a/dynamic_accounts_report/report/cash_flow_report.py b/dynamic_accounts_report/report/cash_flow_report.py new file mode 100644 index 0000000..b8077ec --- /dev/null +++ b/dynamic_accounts_report/report/cash_flow_report.py @@ -0,0 +1,16 @@ +from odoo import api, models, _ + + +class GeneralLedger(models.AbstractModel): + _name = 'report.dynamic_accounts_report.cash_flow' + + @api.model + def _get_report_values(self, docids, data=None): + + if self.env.context.get('trial_pdf_report'): + if data.get('report_data'): + data.update({'account_data': data.get('report_data')['report_lines'], + 'Filters': data.get('report_data')['filters'], + 'company': self.env.company, + }) + return data diff --git a/dynamic_accounts_report/report/cash_flow_report.xml b/dynamic_accounts_report/report/cash_flow_report.xml new file mode 100644 index 0000000..b9c6d36 --- /dev/null +++ b/dynamic_accounts_report/report/cash_flow_report.xml @@ -0,0 +1,263 @@ +<odoo> + + + + <template id="dynamic_accounts_report.cash_flow"> + <t t-call="web.html_container"> + <t t-call="web.internal_layout"> + <div style="font-size:12px" class="col-4"> + + <b>Report Date :</b> + <span t-esc="context_timestamp(datetime.datetime.now()).strftime('%Y-%m-%d %H:%M')"/> + <span t-esc='today'/> + <br/> + <span t-esc='logged_users'/> + </div> + + <div class="page"> + <h4 style="padding-left:10px !important">Cash Flow statements</h4> + <div style="width:90%;margin:1px auto;font-size:12px" class="row mt32 mb32"> + + + <div class="col-3"> + <strong>Target move:</strong> + <li> + <t t-esc="Filters['target_move']"/> + </li> + </div> + + <div class="col-3"> + <t t-if="Filters.get('levels')"> + <strong>Level :</strong> + <li> + <t t-esc="Filters['levels']"/> + </li> + </t> + + </div> + + <div class="col-4"> + + <p> + <t t-if="Filters.get('date_from')"> + <strong>Date from :</strong> + <span t-esc="Filters.get('date_from')"/> + </t> + <br/> + <t t-if="Filters.get('date_to')"> + <strong>Date to :</strong> + <span t-esc="Filters.get('date_to')"/> + </t> + </p> + + </div> + + </div> + <div> + + <br></br> + <table style="width:90%;margin:2px auto;" class="table table-condensed"> + <thead> + <tr style="font-size:13px; padding: 0.25rem !important;"> + <th>Name</th> + <th class="text-right">Cash In</th> + <th class="text-right">Cash Out</th> + <th class="text-right">Balance</th> + </tr> + </thead> + + <tbody style="font-size:12px" t-foreach="account_data['fetched_data']" t-as="fetch"> + <tr t-if="Filters['levels' ] == 'summary'"> + <td> + <span t-esc="fetch['month_part']"/> + + </td> + <td class="text-right"> + <span t-esc="fetch['total_debit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="fetch['total_credit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="fetch['total_balance']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </td> + </tr> + + <tr style="font-size:13px" t-if="Filters['levels' ] == 'consolidated'"> + <td> + <span t-esc="fetch['name']"/> + </td> + <td class="text-right"> + <span t-esc="fetch['total_debit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="fetch['total_credit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="fetch['total_balance']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </td> + </tr> + </tbody> + + <tbody style="font-size:12px" t-if="Filters['levels' ] == 'detailed' " t-foreach="account_data['journal_res']" t-as="res"> + <tr t-if="fet['name'] == res['account']" t-foreach="account_data['fetched_data']" t-as="fet"> + <td> + <strong> + <span t-esc="fet['code']"/> + <span t-esc="fet['name']"/> + </strong> + </td> + <td class="text-right"> + <strong> + <span t-esc="fet['total_debit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </strong> + </td> + <td class="text-right"> + <strong> + <span t-esc="fet['total_credit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </strong> + </td> + <td class="text-right"> + <strong> + <span t-esc="fet['total_debit'] - fet['total_credit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </strong> + </td> + <tr t-foreach="res['journal_lines']" t-as="mov"> + <td style="padding-left:50px !important" class="text-left"> + <span t-esc="mov['name']"/> + </td> + <td class="text-right"> + <span t-esc="mov['total_debit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="mov['total_credit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="mov['total_debit'] - mov['total_credit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </td> + </tr> + </tr> + </tbody> + <tbody style="font-size:12px" t-if="Filters['levels' ] == 'very' or Filters['levels' ] ==false " t-foreach="account_data['account_res']" t-as="res"> + <tr t-if="fet['name'] == res['account']" t-foreach="account_data['fetched_data']" t-as="fet"> + <td> + <strong> + <span t-esc="fet['code']"/> + <span t-esc="fet['name']"/> + </strong> + </td> + <td class="text-right"> + <strong> + <span t-esc="fet['total_debit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </strong> + </td> + <td class="text-right"> + <strong> + <span t-esc="fet['total_credit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </strong> + </td> + <td class="text-right"> + <strong> + <span t-esc="fet['total_debit'] - fet['total_credit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </strong> + </td> + + + <tr t-if="line['account_name'] == res['account']" + t-foreach="res['journal_lines']" t-as="line"> + <td style="padding-left:20px !important" class="text-left"> + <span t-esc="line['name']"/> + </td> + <td class="text-right"> + <span t-esc="line['total_debit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="line['total_credit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="line['total_debit'] - line['total_credit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </td> + <tr t-if="mov['name'] == line['name']" t-foreach="res['move_lines']" + t-as="mov"> + <td style="padding-left:50px !important" class="text-left"> + <span t-esc="mov['move_name']"/> + </td> + <td class="text-right"> + <span t-esc="mov['total_debit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="mov['total_credit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="mov['total_debit'] - mov['total_credit']" + t-options="{'widget': 'monetary', + 'display_currency': res_company.currency_id}"/> + </td> + </tr> + </tr> + </tr> + + </tbody> + + </table> + </div> + <br></br> + </div> + </t> + </t> + </template> + + + + + + + + <record id="action_print_cash_flow" model="ir.actions.report"> + <field name="name">cash_flow</field> + <field name="model">account.cash.flow</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">dynamic_accounts_report.cash_flow</field> + <field name="report_file">dynamic_accounts_report.cash_flow</field> + </record> +</odoo>
\ No newline at end of file diff --git a/dynamic_accounts_report/report/daybook.py b/dynamic_accounts_report/report/daybook.py new file mode 100644 index 0000000..4af37ce --- /dev/null +++ b/dynamic_accounts_report/report/daybook.py @@ -0,0 +1,17 @@ +from odoo import api, models, _ + + +class DayBook(models.AbstractModel): + _name = 'report.dynamic_accounts_report.day_book' + + @api.model + def _get_report_values(self, docids, data=None): + + if self.env.context.get('daybook_pdf_report'): + + if data.get('report_data'): + data.update({'account_data': data.get('report_data')['report_lines'], + 'Filters': data.get('report_data')['filters'], + 'company': self.env.company, + }) + return data
\ No newline at end of file diff --git a/dynamic_accounts_report/report/daybook.xml b/dynamic_accounts_report/report/daybook.xml new file mode 100644 index 0000000..c3593de --- /dev/null +++ b/dynamic_accounts_report/report/daybook.xml @@ -0,0 +1,121 @@ +<odoo> + <template id="dynamic_accounts_report.day_book"> + <t t-call="web.html_container"> + <t t-set="data_report_margin_top" t-value="12"/> + <t t-set="data_report_header_spacing" t-value="9"/> + <t t-set="data_report_dpi" t-value="110"/> + <t t-call="web.internal_layout"> + <div class="page"> + <div class="oe_structure"/> + <h3 style="text-align:centre;left:50%;"><span t-esc="Filters.get('company_name')"/>: Day Book + </h3> + + <span t-if="Filters.get('date_from')"> + <strong> From:</strong> + <t t-esc="Filters['date_from']"/> + </span> + <br></br> + <span t-if="Filters.get('date_to')"> + <strong> To:</strong> + <t t-esc="Filters['date_to']"/> + </span> + <div> + <div style="text-align:centre;left:50%;" class="row"> + <div class="col-3"> + <strong>Target move:</strong> + <li> + <t t-esc="Filters['target_move']"/> + </li> + </div> + <div class="col-3" style=""> + <strong>Journals:</strong> + <t t-foreach="Filters['journals']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + <div class="col-3" style=""> + <strong>Accounts :</strong> + <t t-foreach="Filters['accounts']" t-as="ac"> + <li> + <t t-esc="ac"/> + </li> + </t> + + </div> + + </div> + + + <br></br> + <table class="table table-sm table-reports"> + <thead> + <tr class="text-center"> + <th>Date</th> + <th>JRNL</th> + <th>Partner</th> + <th>Move</th> + <th>Entry Label</th> + <th>Debit</th> + <th>Credit</th> + <th>Balance</th> + <th groups="base.group_multi_currency">Currency</th> + </tr> + </thead> + <tbody> + <t t-foreach="account_data" t-as="account"> + <tr style="font-weight: bold;"> + <td colspan="5"> + <span style="color: white;" t-esc="'..'"/> + <span t-esc="account['date']"/> + </td> + <td class="text-right"> + <span t-esc="account['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="account['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="account['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + + + <td groups="base.group_multi_currency"/> + </tr> + <tr t-foreach="account['child_lines']" t-as="line"> + <td><span t-esc="line['ldate']"/></td> + <td><span t-esc="line['lcode']"/></td> + <td><span t-esc="line['partner_name']"/></td> + + <td><span t-esc="line['move_name']"/></td> + <td><span t-esc="line['lname']"/></td> + <td class="text-right"> + <span t-esc="line['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="line['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="line['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + </tr> + </t> + </tbody> + </table> + </div> + <br></br> + </div> + </t> + </t> + </template> + + <record id="action_print_day_book" model="ir.actions.report"> + <field name="name">Day Book</field> + <field name="model">account.day.book</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">dynamic_accounts_report.day_book</field> + <field name="report_file">dynamic_accounts_report.day_book</field> + </record> + +</odoo>
\ No newline at end of file diff --git a/dynamic_accounts_report/report/financial_report_template.xml b/dynamic_accounts_report/report/financial_report_template.xml new file mode 100644 index 0000000..6bd2608 --- /dev/null +++ b/dynamic_accounts_report/report/financial_report_template.xml @@ -0,0 +1,165 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <template id="dynamic_accounts_report.balance_sheet"> + <t t-call="web.html_container"> + <t t-call="web.internal_layout"> + <t t-set="data_report_margin_top" t-value="12"/> + <t t-set="data_report_header_spacing" t-value="9"/> + <t t-set="data_report_dpi" t-value="110"/> + <div class="page"> + <h3><span t-esc="Filters.get('company_name')"/>: <span t-esc="report_name"/> + </h3> + + <div> + <span t-if="Filters.get('date_from')"> + <strong> From:</strong> + <t t-esc="Filters['date_from']"/> + </span> + + <span t-if="Filters.get('date_to')"> + <strong>To:</strong> + <t t-esc="Filters['date_to']"/> + </span> + + <div style="width:100%;"> + <div style="text-align:centre;" class="row"> + + <div class="col-2"> + <strong>Journals:</strong> + <t t-foreach="Filters['journals']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + + <div class="col-2"> + <strong>Accounts:</strong> + <t t-foreach="Filters['accounts']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + + <div class="col-2"> + <strong>Account Tags:</strong> + <t t-foreach="Filters['account_tags']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + <div class="col-2"> + <strong>Analytic:</strong> + <t t-foreach="Filters['analytics']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + + <div class="col-2"> + <strong>Analytic Tag:</strong> + <t t-foreach="Filters['analytic_tags']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + + <div class="col-3"> + <strong>Target move:</strong> + <li> + <t t-esc="Filters['target_move']"/> + </li> + </div> + </div> + </div> + </div> + <br></br> + + <table class="table table-sm table-reports"> + <thead> + <tr> + <th></th> + <th class="text-right">Debit</th> + <th class="text-right">Credit</th> + <th class="text-right">Balance</th> + </tr> + </thead> + <tbody> + <tr t-foreach="report_lines" t-as="a"> + + <t t-if="a['level'] != 0"> + <t t-if="a.get('level') > 2"> + <t t-set="style" t-value="'font-weight: normal;'"/> + </t> + <t t-if="not a.get('level') > 2"> + <t t-set="style" t-value="'font-weight: bold;'"/> + </t> + <t t-if="a.get('code')"> + <t t-foreach="account_data" t-as="line"> + <t t-if="line['code'] == a.get('code')"> + <tr> + <td> + <span style="color: white;" t-esc="'..' * a.get('level', 0) * 3"/> + <span t-att-style="style" t-esc="line['name']"/> + </td> + <td class="text-right"> + <span t-esc="line['debit']" + t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="line['credit']" + t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="line['balance']" + t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + </tr> + </t> + </t> + </t> + + <t t-else=""> + + <td> + <span style="color: white;" t-esc="'..' * a.get('level', 0) * 3"/> + <span t-att-style="style" t-esc="a.get('name')"/> + </td> + <td class="text-right" style="white-space: text-nowrap;"> + <span t-att-style="style" t-esc="a.get('debit')" + t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right" style="white-space: text-nowrap;"> + <span t-att-style="style" t-esc="a.get('credit')" + t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right" style="white-space: text-nowrap;"> + <span t-att-style="style" t-esc="a.get('balance')" + t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + </t> + + </t> + </tr> + </tbody> + </table> + + + </div> + </t> + </t> + </template> + + <record id="action_print_balance_sheet" model="ir.actions.report"> + <field name="name">Financial Report</field> + <field name="model">dynamic.balance.sheet.report</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">dynamic_accounts_report.balance_sheet</field> + <field name="report_file">dynamic_accounts_report.balance_sheet</field> + </record> + +</odoo> diff --git a/dynamic_accounts_report/report/financial_reports.py b/dynamic_accounts_report/report/financial_reports.py new file mode 100644 index 0000000..76c6bdd --- /dev/null +++ b/dynamic_accounts_report/report/financial_reports.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from odoo import api, models, _ + + +class InsReportBalanceSheet(models.AbstractModel): + _name = 'report.dynamic_accounts_report.balance_sheet' + + @api.model + def _get_report_values(self, docids, data=None): + if self.env.context.get('bs_report'): + if data.get('report_data'): + data.update({ + 'Filters': data.get('report_data')['filters'], + 'account_data': data.get('report_data')['report_lines'], + 'report_lines': data.get('report_data')['bs_lines'], + 'report_name': data.get('report_name'), + 'title': data.get('report_data')['name'], + 'company': self.env.company, + }) + return data diff --git a/dynamic_accounts_report/report/general_ledger.py b/dynamic_accounts_report/report/general_ledger.py new file mode 100644 index 0000000..2572b6a --- /dev/null +++ b/dynamic_accounts_report/report/general_ledger.py @@ -0,0 +1,20 @@ +from odoo import api, models, _ + + +class GeneralLedger(models.AbstractModel): + _name = 'report.dynamic_accounts_report.general_ledger' + + @api.model + def _get_report_values(self, docids, data=None): + + if self.env.context.get('trial_pdf_report'): + + if data.get('report_data'): + data.update({'account_data': data.get('report_data')['report_lines'], + 'Filters': data.get('report_data')['filters'], + 'debit_total': data.get('report_data')['debit_total'], + 'credit_total': data.get('report_data')['credit_total'], + 'title': data.get('report_data')['name'], + 'company': self.env.company, + }) + return data diff --git a/dynamic_accounts_report/report/general_ledger.xml b/dynamic_accounts_report/report/general_ledger.xml new file mode 100644 index 0000000..63f8b95 --- /dev/null +++ b/dynamic_accounts_report/report/general_ledger.xml @@ -0,0 +1,153 @@ +<odoo> + + <template id="dynamic_accounts_report.general_ledger"> + <t t-call="web.html_container"> + <t t-set="data_report_margin_top" t-value="12"/> + <t t-set="data_report_header_spacing" t-value="9"/> + <t t-set="data_report_dpi" t-value="110"/> + <t t-call="web.internal_layout"> + <div class="page"> + <div class="oe_structure"/> + <h3 style="text-align:centre;left:50%;"><span t-esc="Filters.get('company_name')"/>: <t t-esc="title"/> + </h3> + + <span t-if="Filters.get('date_from')"> + <strong> From:</strong> + <t t-esc="Filters['date_from']"/> + </span> + + + + <span t-if="Filters.get('date_to')"> + <strong>To:</strong> + <t t-esc="Filters['date_to']"/> + </span> + + + <div> + <div style="width:100%;"> + <div style="text-align:centre;" class="row"> + + <div class="col-2"> + <strong>Journals:</strong> + <t t-foreach="Filters['journals']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + + <div class="col-2"> + <strong>Accounts:</strong> + <t t-foreach="Filters['accounts']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + + <div class="col-2"> + <strong>Analytic:</strong> + <t t-foreach="Filters['analytics']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + + <div class="col-2"> + <strong>Analytic Tag:</strong> + <t t-foreach="Filters['analytic_tags']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + + <div class="col-3"> + <strong>Target move:</strong> + <li> + <t t-esc="Filters['target_move']"/> + </li> + </div> + </div> + </div> + + + <br></br> + <table class="table table-sm table-reports"> + <thead> + <tr class="text-right"> + <th>Date</th> + <th>JRNL</th> + <th>Partner</th> + <th>Ref</th> + <th>Move</th> + <th>Entry Label</th> + <th>Debit</th> + <th>Credit</th> + <th>Balance</th> + <th groups="base.group_multi_currency">Currency</th> + </tr> + </thead> + <tbody> + <t t-foreach="account_data" t-as="account"> + <tr style="font-weight: bold;"> + <td colspan="6"> + <span style="color: white;" t-esc="'..'"/> + <span t-esc="account['code']"/> + <span t-esc="account['name']"/> + </td> + <td class="text-right"> + <span t-esc="account['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="account['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="account['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td groups="base.group_multi_currency"/> + </tr> + <tr t-foreach="account['move_lines']" t-as="line"> + <td><span t-esc="line['ldate']"/></td> + <td><span t-esc="line['lcode']"/></td> + <td><span t-esc="line['partner_name']"/></td> + <td><span t-if="line['lref']" t-esc="line['lref']"/></td> + <td><span t-esc="line['move_name']"/></td> + <td><span t-esc="line['lname']"/></td> + <td class="text-right"> + <span t-esc="line['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="line['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="line['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <t t-if="line['amount_currency']"> + <td class="text-right" groups="base.group_multi_currency"> + <span t-esc="line['amount_currency'] if line['amount_currency'] > 0.00 else ''"/> + <span t-esc="line['currency_code'] if line['amount_currency'] > 0.00 else ''"/> + </td> + </t> + </tr> + </t> + </tbody> + </table> + </div> + <br></br> + </div> + </t> + </t> + </template> + + <record id="action_print_General_ledger" model="ir.actions.report"> + <field name="name">Report</field> + <field name="model">account.general.ledger</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">dynamic_accounts_report.general_ledger</field> + <field name="report_file">dynamic_accounts_report.general_ledger</field> + </record> + +</odoo>
\ No newline at end of file diff --git a/dynamic_accounts_report/report/partner_ledger.py b/dynamic_accounts_report/report/partner_ledger.py new file mode 100644 index 0000000..fe97bca --- /dev/null +++ b/dynamic_accounts_report/report/partner_ledger.py @@ -0,0 +1,16 @@ +from odoo import api, models, _ + + +class PartnerLedgerReport(models.AbstractModel): + _name = 'report.dynamic_accounts_report.partner_ledger' + + @api.model + def _get_report_values(self, docids, data=None): + if self.env.context.get('partner_ledger_pdf_report'): + + if data.get('report_data'): + data.update({'account_data': data.get('report_data')['report_lines'], + 'Filters': data.get('report_data')['filters'], + 'company': self.env.company, + }) + return data diff --git a/dynamic_accounts_report/report/partner_ledger.xml b/dynamic_accounts_report/report/partner_ledger.xml new file mode 100644 index 0000000..fff1ba5 --- /dev/null +++ b/dynamic_accounts_report/report/partner_ledger.xml @@ -0,0 +1,155 @@ +<odoo> + + <template id="dynamic_accounts_report.partner_ledger"> + <t t-call="web.html_container"> + <t t-set="data_report_margin_top" t-value="12"/> + <t t-set="data_report_header_spacing" t-value="9"/> + <t t-set="data_report_dpi" t-value="110"/> + <t t-call="web.internal_layout"> + <div class="page"> + <div class="oe_structure"/> + <h3 style="text-align:centre;left:50%;"><span t-esc="Filters.get('company_name')"/>: Partner Ledger + </h3> + + <span t-if="Filters.get('date_from')"> + <strong> From:</strong> + <t t-esc="Filters['date_from']"/> + </span> + + <span t-if="Filters.get('date_to')"> + <strong>To:</strong> + <t t-esc="Filters['date_to']"/> + </span> + + + <div> + <div style="text-align:centre;left:50%;" class="row"> + + <div class="col-2" style=""> + <strong>Journals:</strong> + <t t-foreach="Filters['journals']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + <div class="col-2"> + <strong>Accounts:</strong> + <t t-foreach="Filters['accounts']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + <div class="col-2"> + <strong>Partners:</strong> + <t t-foreach="Filters['partners']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + <div class="col-2"> + <strong>Partner Tags:</strong> + <t t-foreach="Filters['partner_tags']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + <div class="col-2"> + <strong>Account Type:</strong> + <t t-foreach="Filters['account_type']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + <div class="col-2"> + <strong>Target move:</strong> + <li> + <t t-esc="Filters['target_move']"/> + </li> + </div> + + </div> + <div style="text-align:centre;left:50%;" class="row"> + + </div> + + + <br></br> + <table class="table table-sm table-reports" style="padding:5px;"> + <thead> + <tr class="text-center"> + <th style="text-align:left;">Date</th> + <th style="text-align:left;">Journal</th> + <th style="text-align:left;">Account</th> + <th style="text-align:left;">Move</th> + <th style="text-align:left;">Entry Label</th> + <th style="text-align:right;">Debit</th> + <th style="text-align:right;">Credit</th> + <th style="text-align:right;">Balance</th> + </tr> + </thead> + <tbody> + <t t-foreach="account_data" t-as="account"> + <tr style="font-weight: bold;"> + <td colspan="5"> + <span style="color: white;" t-esc="'..'"/> +<!-- <span t-esc="account['code']"/>--> + <span t-esc="account['name']"/> + </td> + <td class="text-right"> + <span t-esc="account['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="account['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="account['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td groups="base.group_multi_currency"/> + </tr> + <tr t-foreach="account['move_lines']" t-as="line"> + <td><span t-esc="line['ldate']"/></td> + <td><span t-esc="line['lcode']"/></td> + <td><span t-esc="line['account_name']"/></td> +<!-- <td><span t-if="line['lref']" t-esc="line['lref']"/></td>--> + <td><span t-esc="line['move_name']"/></td> + <td><span t-esc="line['lname']"/></td> + <td class="text-right"> + <span t-esc="line['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="line['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="line['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> + </td> + <t t-if="line['amount_currency']"> + <td class="text-right" groups="base.group_multi_currency"> + <span t-esc="line['amount_currency'] if line['amount_currency'] > 0.00 else ''"/> + <span t-esc="line['currency_code'] if line['amount_currency'] > 0.00 else ''"/> + </td> + </t> + </tr> + </t> + </tbody> + </table> + </div> + <br></br> + </div> + </t> + </t> + </template> + + <record id="action_print_partner_ledger" model="ir.actions.report"> + <field name="name">Partner ledger</field> + <field name="model">account.partner.ledger</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">dynamic_accounts_report.partner_ledger</field> + <field name="report_file">dynamic_accounts_report.partner_ledger</field> + </record> + +</odoo>
\ No newline at end of file diff --git a/dynamic_accounts_report/report/trial_balance.py b/dynamic_accounts_report/report/trial_balance.py new file mode 100644 index 0000000..bc33bbc --- /dev/null +++ b/dynamic_accounts_report/report/trial_balance.py @@ -0,0 +1,18 @@ +from odoo import api, models, _ + + +class TrialBalance(models.AbstractModel): + _name = 'report.dynamic_accounts_report.trial_balance' + + @api.model + def _get_report_values(self, docids, data=None): + if self.env.context.get('trial_pdf_report'): + + if data.get('report_data'): + data.update({'account_data': data.get('report_data')['report_lines'], + 'Filters': data.get('report_data')['filters'], + 'debit_total': data.get('report_data')['debit_total'], + 'credit_total': data.get('report_data')['credit_total'], + 'company': self.env.company, + }) + return data diff --git a/dynamic_accounts_report/report/trial_balance.xml b/dynamic_accounts_report/report/trial_balance.xml new file mode 100644 index 0000000..90d53fb --- /dev/null +++ b/dynamic_accounts_report/report/trial_balance.xml @@ -0,0 +1,129 @@ +<odoo> + + + + <template id="dynamic_accounts_report.trial_balance"> + <t t-call="web.html_container"> + <t t-call="web.internal_layout"> + <div class="page"> + <div class="oe_structure"/> + <h3 style="text-align:centre;left:50%;"><span t-esc="Filters.get('company_name')"/>: Trial Balance + </h3> + + <span t-if="Filters.get('date_from')"> + <strong> From:</strong> + <t t-esc="Filters['date_from']"/> + </span> + + + + <span t-if="Filters.get('date_to')"> + <strong>To:</strong> + <t t-esc="Filters['date_to']"/> + </span> + + + <div> + <div style="text-align:centre;left:50%;" class="row"> + + <div class="col-3" style=""> + <strong>Journals:</strong> + <t t-foreach="Filters['journals']" t-as="ps"> + <li> + <t t-esc="ps"/> + </li> + </t> + </div> + + <div class="col-3"> + <strong>Target move:</strong> + <li> + <t t-esc="Filters['target_move']"/> + </li> + </div> + </div> + + + <br></br> + <table class="table table-sm table-reports"> + <thead> + <tr> + <th style="text-align:left;">Code</th> + <th colspan="5">Account</th> + <t t-if="Filters.get('date_from')"> + <th class="mon_fld">Initial Debit</th> + <th class="mon_fld">Initial Credit</th> + + </t> + <th class="text-right">Debit</th> + <th class="text-right">Credit</th> + </tr> + </thead> + <t t-foreach="account_data" t-as="line"> + + <tr> + + <td style="text-align:left;"> + <span style="color: white;" t-esc="'..'"/> + <span t-esc="line['code']"/> + </td> + <td colspan="5"> + <span style="color: white;" t-esc="'..'"/> + <span t-esc="line['name']"/> + </td> + <t t-if="Filters.get('date_from')"> + <t t-if="line['Init_balance']"> + + <td class="mon_fld"> + <t t-raw="line['Init_balance']['debit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> + </td> + <td class="mon_fld"> + <t t-raw="line['Init_balance']['credit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> + </td> + </t> + <t t-else=""> + + <td class="mon_fld"> + </td> + <td class="mon_fld"> + </td> + </t> + + </t> + + <td class="text-right"> + <span t-esc="line['debit']" + t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> + </td> + <td class="text-right"> + <span t-esc="line['credit']" + t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> + </td> + </tr> + </t> + <td colspan="6" style="border-bottom: 1px solid ;" class="mon_fld"><strong>Total</strong></td> + <t t-if="Filters.get('date_from')"> + <td class="mon_fld" style="border-bottom: 1px solid ;"><strong></strong></td> + <td class="mon_fld" style="border-bottom: 1px solid ;"><strong></strong></td> + </t> + + <td class="text-right" style="border-bottom: 1px solid ;"><strong><t t-esc="debit_total" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></strong></td> + <td class="text-right" style="border-bottom: 1px solid;"><strong><t t-esc="debit_total" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></strong></td> + + </table> + </div> + <br></br> + </div> + </t> + </t> + </template> + + <record id="action_print_trial_balance" model="ir.actions.report"> + <field name="name">Trial Balance</field> + <field name="model">account.trial.balance</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">dynamic_accounts_report.trial_balance</field> + <field name="report_file">dynamic_accounts_report.trial_balance</field> + </record> + +</odoo>
\ No newline at end of file |
