Browse Source

[UPDT] Ageing report issue

pull/175/head
Ajmal Cybro 4 years ago
parent
commit
4bbd5ecc98
  1. 2
      dynamic_accounts_report/__manifest__.py
  2. 5
      dynamic_accounts_report/doc/RELEASE_NOTES.md
  3. 10
      dynamic_accounts_report/report/ageing.xml
  4. 20
      dynamic_accounts_report/static/src/js/ageing.js
  5. 172
      dynamic_accounts_report/static/src/xml/ageing.xml
  6. 22
      dynamic_accounts_report/wizard/ageing.py

2
dynamic_accounts_report/__manifest__.py

@ -22,7 +22,7 @@
{ {
'name': 'Dynamic Financial Reports', 'name': 'Dynamic Financial Reports',
'version': '14.0.1.1.1', 'version': '14.0.1.2.1',
'category': 'Accounting', 'category': 'Accounting',
'summary': """Dynamic Financial Reports with drill 'summary': """Dynamic Financial Reports with drill
down and filters Community Edition""", down and filters Community Edition""",

5
dynamic_accounts_report/doc/RELEASE_NOTES.md

@ -10,5 +10,10 @@
#### UPDT #### UPDT
- Updated Style and Currency Format - Updated Style and Currency Format
#### 27.05.2021
#### Version 14.0.1.2.1
#### UPDT
- Ageing Report.

10
dynamic_accounts_report/report/ageing.xml

@ -53,11 +53,11 @@
<th>JRNL</th> <th>JRNL</th>
<th>Account</th> <th>Account</th>
<th>Not Due</th> <th>Not Due</th>
<th>0 - 20</th> <th>0 - 30</th>
<th>20 - 40</th> <th>30 - 60</th>
<th>40 - 60</th> <th>60 - 90</th>
<th>60 - 80</th> <th>90 - 120</th>
<th>80 +</th> <th>120 +</th>
<th> Total</th> <th> Total</th>
<th groups="base.group_multi_currency">Currency</th> <th groups="base.group_multi_currency">Currency</th>
</tr> </tr>

20
dynamic_accounts_report/static/src/js/ageing.js

@ -72,6 +72,12 @@ odoo.define('dynamic_accounts_report.ageing', function (require) {
self.$el.find('.category').select2({ self.$el.find('.category').select2({
placeholder: ' Partner Category...', placeholder: ' Partner Category...',
}); });
self.$el.find('.target_move').select2({
placeholder: ' Target Move...',
});
self.$el.find('.result_selection').select2({
placeholder: ' Account Type...',
});
} }
var child=[]; var child=[];
@ -337,10 +343,12 @@ odoo.define('dynamic_accounts_report.ageing', function (require) {
if ($(".target_move").length) { if ($(".target_move").length) {
var post_res = document.getElementById("post_res") var post_res = document.getElementById("post_res")
filter_data_selected.target_move = $(".target_move")[0].value filter_data_selected.target_move = $(".target_move")[1].value
post_res.value = $(".target_move")[0].value console.log($(".target_move"))
post_res.value = $(".target_move")[1].value
post_res.innerHTML=post_res.value; post_res.innerHTML=post_res.value;
if ($(".target_move")[0].value == "") { if ($(".target_move")[1].value == "") {
post_res.innerHTML="posted"; post_res.innerHTML="posted";
} }
@ -348,10 +356,10 @@ odoo.define('dynamic_accounts_report.ageing', function (require) {
if ($(".result_selection").length) { if ($(".result_selection").length) {
var account_res = document.getElementById("account_res") var account_res = document.getElementById("account_res")
filter_data_selected.result_selection = $(".result_selection")[0].value filter_data_selected.result_selection = $(".result_selection")[1].value
account_res.value = $(".result_selection")[0].value account_res.value = $(".result_selection")[1].value
account_res.innerHTML=account_res.value; account_res.innerHTML=account_res.value;
if ($(".result_selection")[0].value == "") { if ($(".result_selection")[1].value == "") {
account_res.innerHTML="customer"; account_res.innerHTML="customer";
} }

172
dynamic_accounts_report/static/src/xml/ageing.xml

@ -1,4 +1,3 @@
<templates> <templates>
<t t-name="AgeingTemp"> <t t-name="AgeingTemp">
<div class=""> <div class="">
@ -26,23 +25,20 @@
<tr> <tr>
<th colspan="6">Partner</th> <th colspan="6">Partner</th>
<th class="mon_fld">Not Due</th> <th class="mon_fld">Not Due</th>
<th class="mon_fld">0-20</th> <th class="mon_fld">0-30</th>
<th class="mon_fld">20-40</th> <th class="mon_fld">30-60</th>
<th class="mon_fld">40-60</th> <th class="mon_fld">60-90</th>
<th class="mon_fld">60-80</th> <th class="mon_fld">90-120</th>
<th class="mon_fld">80+</th> <th class="mon_fld">120+</th>
<th class="mon_fld">Total</th> <th class="mon_fld">Total</th>
</tr> </tr>
</thead> </thead>
<tbody style="width:100%;">
</tbody>
<tbody> <tbody>
<t t-set="none_value" t-value="_"/> <t t-set="none_value" t-value="_"/>
<t t-foreach="report_lines[0]" t-as="account"> <t t-foreach="report_lines[0]" t-as="account">
<t t-set="common_id" t-value="0"/> <t t-set="common_id" t-value="0"/>
<tr style="border: 1.5px solid black;" class="gl-line" <tr style="border: 1.5px solid black;" class="gl-line"
@ -58,61 +54,136 @@
</span> </span>
<t t-if="currency[1] == 'before'"> <t t-if="currency[1] == 'before'">
<td style="text-align:right;"> <td style="text-align:right;">
<t t-if="account['direction'] == 0">
<span>-</span>
</t>
<t t-else="">
<t t-esc="currency[0]"/> <t t-esc="currency[0]"/>
<t t-raw="account['direction']"/> <t t-esc="Math.round(account['direction'] * Math.pow(10, 2)) / Math.pow(10, 2)"/>
</t>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<t t-if="account['4'] == 0">
<span>-</span>
</t>
<t t-else="">
<t t-esc="currency[0]"/> <t t-esc="currency[0]"/>
<t t-raw="account['4']"/> <t t-esc="Math.round(account['4'] * Math.pow(10, 2)) / Math.pow(10, 2)"/>
</t>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<t t-if="account['3'] == 0">
<span>-</span>
</t>
<t t-else="">
<t t-esc="currency[0]"/> <t t-esc="currency[0]"/>
<t t-raw="account['3']"/> <t t-esc="Math.round(account['3'] * Math.pow(10, 2)) / Math.pow(10, 2)"/>
</t>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<t t-if="account['2'] == 0">
<span>-</span>
</t>
<t t-else="">
<t t-esc="currency[0]"/> <t t-esc="currency[0]"/>
<t t-raw="account['2']"/> <t t-esc="Math.round(account['2'] * Math.pow(10, 2)) / Math.pow(10, 2)"/>
</t>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<t t-if="account['1'] == 0">
<span>-</span>
</t>
<t t-else="">
<t t-esc="currency[0]"/> <t t-esc="currency[0]"/>
<t t-raw="account['1']"/> <t t-esc="Math.round(account['1'] * Math.pow(10, 2)) / Math.pow(10, 2)"/>
</t>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<t t-if="account['0'] == 0">
<span>-</span>
</t>
<t t-else="">
<t t-esc="currency[0]"/> <t t-esc="currency[0]"/>
<t t-raw="account['0']"/> <t t-esc="Math.round(account['0'] * Math.pow(10, 2)) / Math.pow(10, 2)"/>
</t>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<t t-if="account['total'] == 0">
<span>-</span>
</t>
<t t-else="">
<t t-esc="currency[0]"/> <t t-esc="currency[0]"/>
<t t-raw="account['total']"/> <t t-esc="Math.round(account['total'] * Math.pow(10, 2)) / Math.pow(10, 2)"/>
</t>
</td> </td>
</t> </t>
<t t-else=""> <t t-else="">
<td style="text-align:right;"> <td style="text-align:right;">
<t t-raw="account['direction']"/><t t-esc="currency[0]"/> <t t-if="account['direction'] == 0">
<span>-</span>
</t>
<t t-else="">
<t t-esc="Math.round(account['direction'] * Math.pow(10, 2)) / Math.pow(10, 2)"/>
<t t-esc="currency[0]"/>
</t>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<t t-raw="account['4']"/><t t-esc="currency[0]"/> <t t-if="account['4'] == 0">
<span>-</span>
</t>
<t t-else="">
<t t-esc="Math.round(account['4'] * Math.pow(10, 2)) / Math.pow(10, 2)"/>
<t t-esc="currency[0]"/>
</t>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<t t-raw="account['3']"/><t t-esc="currency[0]"/> <t t-if="account['3'] == 0">
<span>-</span>
</t>
<t t-else="">
<t t-esc="Math.round(account['3'] * Math.pow(10, 2)) / Math.pow(10, 2)"/>
<t t-esc="currency[0]"/>
</t>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<t t-raw="account['2']"/><t t-esc="currency[0]"/> <t t-if="account['2'] == 0">
<span>-</span>
</t>
<t t-else="">
<t t-esc="Math.round(account['2'] * Math.pow(10, 2)) / Math.pow(10, 2)"/>
<t t-esc="currency[0]"/>
</t>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<t t-raw="account['1']"/><t t-esc="currency[0]"/> <t t-if="account['1'] == 0">
<span>-</span>
</t>
<t t-else="">
<t t-esc="Math.round(account['1'] * Math.pow(10, 2)) / Math.pow(10, 2)"/>
<t t-esc="currency[0]"/>
</t>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<t t-raw="account['0']"/><t t-esc="currency[0]"/> <t t-if="account['0'] == 0">
<span>-</span>
</t>
<t t-else="">
<t t-esc="Math.round(account['0'] * Math.pow(10, 2)) / Math.pow(10, 2)"/>
<t t-esc="currency[0]"/>
</t>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<t t-raw="account['total']"/><t t-esc="currency[0]"/> <t t-if="account['total'] == 0">
<span>-</span>
</t>
<t t-else="">
<t t-esc="Math.round(account['total'] * Math.pow(10, 2)) / Math.pow(10, 2)"/>
<t t-esc="currency[0]"/>
</t>
</td> </td>
</t> </t>
<!--
< </div>-->
</td> </td>
<tr t-attf-class="collapse a{{account['partner_id']}}"> <tr t-attf-class="collapse a{{account['partner_id']}}">
<td colspan="14"> <td colspan="14">
@ -132,14 +203,18 @@
</t> </t>
<t t-name="AgeingFilterView"> <t t-name="AgeingFilterView">
<div class="" style="position: relative;"> <div class="" style="position: relative;">
<div class="sub_container_left"> <div class="sub_container_left">
<div class="report_print"> <div class="report_print">
<button type="button" class="btn btn-primary" id="pdf" style="left:10px; height:30px;position: relative;color:white;background-color: #00A0AD;border-color: #00A0AD; padding:3px;">Print (PDF)</button> <button type="button" class="btn btn-primary" id="pdf"
<button type="button" class="btn btn-primary" id="xlsx" style="left:10px; height:30px;position: relative;color:white;background-color: #00A0AD;border-color: #00A0AD; padding:3px;">Export (XLSX)</button> style="left:10px; height:30px;position: relative;color:white;background-color: #00A0AD;border-color: #00A0AD; padding:3px;">
Print (PDF)
</button>
<button type="button" class="btn btn-primary" id="xlsx"
style="left:10px; height:30px;position: relative;color:white;background-color: #00A0AD;border-color: #00A0AD; padding:3px;">
Export (XLSX)
</button>
</div> </div>
</div> </div>
<br></br> <br></br>
@ -147,17 +222,17 @@
<div class="" style="right:80x;"> <div class="" style="right:80x;">
<br></br> <br></br>
<div class="row" style="right:80px;top:0px;position: absolute;width:50;"> <div class="row" style="right:100px;top:0px;position: absolute;width:50;">
<div class="time_range" style=""> <div class="time_range" style="">
<a type="button" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> <a type="button" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="fa fa-calendar" title="Dates" role="img" aria-label="Dates"></span> <span class="fa fa-calendar" title="Dates" role="img" aria-label="Dates"></span>
As On Date As On Date
</a> </a>
<div class="dropdown-menu" role="menu"> <div class="dropdown-menu" role="menu">
<div class="" > <div class="">
<label class="" for="date_from">As On Date :</label> <label class="" for="date_from">As On Date :</label>
<div class=""> <div class="">
<div class="" aria-atomic="true" id="" > <div class="" aria-atomic="true" id="">
<input type="date" id="date_from"></input> <input type="date" id="date_from"></input>
</div> </div>
</div> </div>
@ -167,11 +242,11 @@ As On Date
<div class="search-Result-Selection" style=""> <div class="search-Result-Selection" style="">
<a type="button" class="dropdown-toggle" data-toggle="dropdown"> <a type="button" class="dropdown-toggle" data-toggle="dropdown">
<span class="fa fa-book"></span> <span class="fa fa-book"></span>
Account Type: Account Type:
</a> </a>
<select id="selection" class="dropdown-menu result_selection" name="states[]" > <select id="selection" class="dropdown-menu result_selection" name="states[]">
<div role="separator" class="dropdown-divider"></div> <div role="separator" class="dropdown-divider"></div>
<option value="customer">Receivable Accounts </option> <option value="customer">Receivable Accounts</option>
<option value="supplier">Payable Accounts</option> <option value="supplier">Payable Accounts</option>
<option value="customer_supplier">Receivable and Payable Accounts</option> <option value="customer_supplier">Receivable and Payable Accounts</option>
</select> </select>
@ -214,12 +289,12 @@ Account Type:
<div class="search-Target-move" style=""> <div class="search-Target-move" style="">
<a type="button" class="dropdown-toggle" data-toggle="dropdown"> <a type="button" class="dropdown-toggle" data-toggle="dropdown">
<span class="fa fa-filter"></span> <span class="fa fa-filter"></span>
Target Move: Target Move:
</a> </a>
<select id="entries" class="dropdown-menu target_move" name="states[]" > <select id="entries" class="dropdown-menu target_move" name="states[]">
<div role="separator" class="dropdown-divider"></div> <div role="separator" class="dropdown-divider"></div>
<option value="Posted">Posted Entries</option> <option value="Posted">Posted Entries</option>
<option value="All">All Entries </option> <option value="All">All Entries</option>
</select> </select>
<span id="post_res"></span> <span id="post_res"></span>
@ -228,7 +303,10 @@ Target Move:
</div> </div>
<div style=""> <div style="">
<button type="button" id="apply_filter" class="btn btn-primary" style="top:0px;height:30px;right:20px;position: absolute;color:white;background-color: #00A0AD;border-color: #00A0AD;">Apply</button> <button type="button" id="apply_filter" class="btn btn-primary"
style="top:0px;height:30px;right:20px;position: absolute;color:white;background-color: #00A0AD;border-color: #00A0AD;">
Apply
</button>
</div> </div>
</div> </div>
@ -245,12 +323,12 @@ Target Move:
<th>DueDate</th> <th>DueDate</th>
<th>JRNL</th> <th>JRNL</th>
<th>Account</th> <th>Account</th>
<th >Not Due</th> <th>Not Due</th>
<th >0-20</th> <th>0-30</th>
<th >21-40</th> <th>30-60</th>
<th >41-60</th> <th>60-90</th>
<th >61-80</th> <th>90-120</th>
<th >80+</th> <th>120+</th>
</tr> </tr>
</thead> </thead>

22
dynamic_accounts_report/wizard/ageing.py

@ -19,7 +19,7 @@ class AgeingView(models.TransientModel):
_name = 'account.partner.ageing' _name = 'account.partner.ageing'
period_length = fields.Integer(string='Period Length (days)', period_length = fields.Integer(string='Period Length (days)',
required=True, default=20) required=True, default=30)
date_from = fields.Date(default=lambda *a: time.strftime('%Y-%m-%d')) date_from = fields.Date(default=lambda *a: time.strftime('%Y-%m-%d'))
result_selection = fields.Selection([('customer', 'Receivable Accounts'), result_selection = fields.Selection([('customer', 'Receivable Accounts'),
('supplier', 'Payable Accounts'), ('supplier', 'Payable Accounts'),
@ -599,11 +599,11 @@ class AgeingView(models.TransientModel):
sheet.merge_range('A7:C7', 'Partner', heading) sheet.merge_range('A7:C7', 'Partner', heading)
sheet.write('D7', 'Total', heading) sheet.write('D7', 'Total', heading)
sheet.write('E7', 'Not Due', heading) sheet.write('E7', 'Not Due', heading)
sheet.write('F7', '0-20', heading) sheet.write('F7', '0-30', heading)
sheet.write('G7', '20-40', heading) sheet.write('G7', '30-60', heading)
sheet.write('H7', '40-60', heading) sheet.write('H7', '60-90', heading)
sheet.write('I7', '60-80', heading) sheet.write('I7', '90-120', heading)
sheet.write('J7', '80+', heading) sheet.write('J7', '120+', heading)
lst = [] lst = []
for rec in report_data_main[0]: for rec in report_data_main[0]:
@ -637,11 +637,11 @@ class AgeingView(models.TransientModel):
sheet.write(row, col + 2, 'Journal', sub_heading) sheet.write(row, col + 2, 'Journal', sub_heading)
sheet.write(row, col + 3, 'Account', sub_heading) sheet.write(row, col + 3, 'Account', sub_heading)
sheet.write(row, col + 4, 'Not Due', sub_heading) sheet.write(row, col + 4, 'Not Due', sub_heading)
sheet.write(row, col + 5, '0 - 20', sub_heading) sheet.write(row, col + 5, '0 - 30', sub_heading)
sheet.write(row, col + 6, '21 - 40', sub_heading) sheet.write(row, col + 6, '30 - 60', sub_heading)
sheet.write(row, col + 7, '41 - 60', sub_heading) sheet.write(row, col + 7, '60 - 90', sub_heading)
sheet.write(row, col + 8, '61 - 80', sub_heading) sheet.write(row, col + 8, '90 - 120', sub_heading)
sheet.write(row, col + 9, '81 - 100', sub_heading) sheet.write(row, col + 9, '120 +', sub_heading)
for line_data in rec_data['child_lines']: for line_data in rec_data['child_lines']:
row += 1 row += 1

Loading…
Cancel
Save