Browse Source

Dec 17: [FIX] Bug Fixed 'dynamic_accounts_report'

pull/361/head
Cybrosys Technologies 4 months ago
parent
commit
d7a0bc3702
  1. 5
      dynamic_accounts_report/__manifest__.py
  2. 12
      dynamic_accounts_report/doc/RELEASE_NOTES.md
  3. 4
      dynamic_accounts_report/static/src/js/aged_payable_report.js
  4. 4
      dynamic_accounts_report/static/src/js/aged_receivable_report.js
  5. 4
      dynamic_accounts_report/static/src/js/balance_sheet.js
  6. 8
      dynamic_accounts_report/static/src/js/bank_flow.js
  7. 8
      dynamic_accounts_report/static/src/js/cash_flow.js
  8. 13
      dynamic_accounts_report/static/src/js/general_ledger.js
  9. 13
      dynamic_accounts_report/static/src/js/partner_ledger.js
  10. 4
      dynamic_accounts_report/static/src/js/profit_and_loss.js
  11. 49
      dynamic_accounts_report/static/src/js/tax_report.js
  12. 14
      dynamic_accounts_report/static/src/js/trial_balance.js
  13. 1
      dynamic_accounts_report/static/src/xml/partner_ledger_view.xml

5
dynamic_accounts_report/__manifest__.py

@ -21,7 +21,7 @@
################################################################################
{
'name': 'Odoo18 Dynamic Accounting Reports',
'version': '18.0.1.0.2',
'version': '18.0.1.1.1',
'category': 'Accounting',
'summary': "Odoo 18 Accounting Financial Reports,Dynamic Accounting Reports, Dynamic Financial Reports,Dynamic Report Odoo18, Odoo18,Financial Reports, Odoo18 Accounting,Accounting, Odoo Apps",
'description': "This module creates dynamic Accounting General Ledger, Trial"
@ -32,7 +32,7 @@
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': "https://www.cybrosys.com",
'depends': ['web', 'base_accounting_kit'],
'depends': ['base_accounting_kit'],
'data': [
'security/ir.model.access.csv',
'views/accounting_report_views.xml',
@ -49,7 +49,6 @@
],
'assets': {
'web.assets_backend': [
'web/static/lib/jquery/jquery.js', #No conflict with web jquery
'dynamic_accounts_report/static/src/xml/general_ledger_view.xml',
'dynamic_accounts_report/static/src/xml/trial_balance_view.xml',
'dynamic_accounts_report/static/src/xml/cash_flow_templates.xml',

12
dynamic_accounts_report/doc/RELEASE_NOTES.md

@ -1,11 +1,11 @@
## Module <dynamic_accounts_report>
#### 18.10.2024
#### Version 18.0.1.0.0
#### 21.11.2024
#### Version 18.0.1.0.1
#### ADD
- Initial commit for Dynamic Accounts Reports
-
#### 04.12.2024
#### Version 18.0.1.0.2
#### 13.12.2024
#### Version 18.0.1.1.1
#### UPDT
- Updated the Jquery version issue
- Fixed the errors in the filters.

4
dynamic_accounts_report/static/src/js/aged_payable_report.js

@ -142,12 +142,12 @@ class AgedPayable extends owl.Component {
*/
if (!ev.target.classList.contains("selected-filter")) {
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.add('show')
this.tbody.el.children[length].classList.add('show')
}
ev.target.classList.add("selected-filter");
} else {
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.remove('show')
this.tbody.el.children[length].classList.remove('show')
}
ev.target.classList.remove("selected-filter");
}

4
dynamic_accounts_report/static/src/js/aged_receivable_report.js

@ -141,12 +141,12 @@ class AgedReceivable extends owl.Component {
*/
if (!ev.target.classList.contains("selected-filter")) {
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.add('show')
this.tbody.el.children[length].classList.add('show');
}
ev.target.classList.add("selected-filter");
} else {
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.remove('show')
this.tbody.el.children[length].classList.remove('show')
}
ev.target.classList.remove("selected-filter");
}

4
dynamic_accounts_report/static/src/js/balance_sheet.js

@ -202,12 +202,12 @@ class BalanceSheet extends owl.Component {
*/
if (!ev.target.classList.contains("selected-filter")) {
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.add('show')
this.tbody.el.children[length].classList.add('show')
}
ev.target.classList.add("selected-filter");
} else {
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.remove('show')
this.tbody.el.children[length].classList.remove('show')
}
ev.target.classList.remove("selected-filter");
}

8
dynamic_accounts_report/static/src/js/bank_flow.js

@ -318,8 +318,8 @@ class BankBook extends owl.Component {
this.state.total = move_line_totals
this.state.total_debit = totalDebitSum.toFixed(2)
this.state.total_credit = totalCreditSum.toFixed(2)
if ($(this.unfoldButton.el.classList).find("selected-filter")) {
this.unfoldButton.el.classList.remove("selected-filter")
if (this.unfoldButton.el.classList.contains("selected-filter")) {
this.unfoldButton.el.classList.remove("selected-filter");
}
}
async unfoldAll(ev) {
@ -331,12 +331,12 @@ class BankBook extends owl.Component {
*/
if (!ev.target.classList.contains("selected-filter")) {
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.add('show')
this.tbody.el.children[length].classList.add('show')
}
ev.target.classList.add("selected-filter");
} else {
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.remove('show')
this.tbody.el.children[length].classList.remove('show')
}
ev.target.classList.remove("selected-filter");
}

8
dynamic_accounts_report/static/src/js/cash_flow.js

@ -308,8 +308,8 @@ class CashBook extends owl.Component {
this.state.total = move_line_totals
this.state.total_debit = totalDebitSum.toFixed(2)
this.state.total_credit = totalCreditSum.toFixed(2)
if ($(this.unfoldButton.el.classList).find("selected-filter")) {
this.unfoldButton.el.classList.remove("selected-filter")
if (this.unfoldButton.el.classList.contains("selected-filter")) {
this.unfoldButton.el.classList.remove("selected-filter");
}
}
async unfoldAll(ev) {
@ -321,12 +321,12 @@ class CashBook extends owl.Component {
*/
if (!ev.target.classList.contains("selected-filter")) {
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.add('show')
this.tbody.el.children[length].classList.add('show')
}
ev.target.classList.add("selected-filter");
} else {
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.remove('show')
this.tbody.el.children[length].classList.remove('show')
}
ev.target.classList.remove("selected-filter");
}

13
dynamic_accounts_report/static/src/js/general_ledger.js

@ -281,7 +281,8 @@ class GeneralLedger extends owl.Component {
}
}
let filtered_data = await this.orm.call("account.general.ledger", "get_filter_values", [this.state.selected_journal_list, this.state.date_range, this.state.options, this.state.selected_analytic_list,this.state.method]);
$.each(filtered_data, function (index, value) {
for (let index in filtered_data) {
const value = filtered_data[index];
if (index !== 'account_totals' && index !== 'journal_ids' && index !== 'analytic_ids') {
account_list.push(index)
}
@ -292,25 +293,25 @@ class GeneralLedger extends owl.Component {
totalCreditSum += account_list.total_credit || 0;
});
}
})
}
this.state.account = account_list
this.state.account_data = filtered_data
this.state.account_total = account_totals
this.state.total_debit = totalDebitSum.toFixed(2)
this.state.total_credit = totalCreditSum.toFixed(2)
if ($(this.unfoldButton.el.classList).find("selected-filter")) {
this.unfoldButton.el.classList.remove("selected-filter")
if (this.unfoldButton.el.classList.contains("selected-filter")) {
this.unfoldButton.el.classList.remove("selected-filter");
}
}
async unfoldAll(ev) {
if (!ev.target.classList.contains("selected-filter")) {
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.add('show')
this.tbody.el.children[length].classList.add('show')
}
ev.target.classList.add("selected-filter");
} else {
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.remove('show')
this.tbody.el.children[length].classList.remove('show')
}
ev.target.classList.remove("selected-filter");
}

13
dynamic_accounts_report/static/src/js/partner_ledger.js

@ -351,7 +351,8 @@ class PartnerLedger extends owl.Component {
}
}
let filtered_data = await this.orm.call("account.partner.ledger", "get_filter_values", [this.state.selected_partner, this.state.date_range, this.state.account, this.state.options,]);
$.each(filtered_data, function (index, value) {
for (let index in filtered_data) {
const value = filtered_data[index];
if (index !== 'partner_totals') {
partner_list.push(index)
}
@ -362,14 +363,14 @@ class PartnerLedger extends owl.Component {
totalCreditSum += partner_list.total_credit || 0;
});
}
})
}
this.state.partners = partner_list
this.state.data = filtered_data
this.state.total = partner_totals
this.state.total_debit = totalDebitSum
this.state.total_credit = totalCreditSum
if ($(this.unfoldButton.el.classList).find("selected-filter")) {
this.unfoldButton.el.classList.remove("selected-filter")
if (this.unfoldButton.el.classList.contains("selected-filter")) {
this.unfoldButton.el.classList.remove("selected-filter");
}
}
getDomain() {
@ -384,12 +385,12 @@ class PartnerLedger extends owl.Component {
*/
if (!ev.target.classList.contains("selected-filter")) {
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.add('show')
this.tbody.el.children[length].classList.add('show')
}
ev.target.classList.add("selected-filter");
} else {
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.remove('show')
this.tbody.el.children[length].classList.remove('show')
}
ev.target.classList.remove("selected-filter");
}

4
dynamic_accounts_report/static/src/js/profit_and_loss.js

@ -221,13 +221,13 @@ class ProfitAndLoss extends owl.Component {
if (!ev.target.classList.contains("selected-filter")) {
// Unfold all elements
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.add('show')
this.tbody.el.children[length].classList.add('show')
}
ev.target.classList.add("selected-filter");
} else {
// Collapse all elements
for (var length = 0; length < this.tbody.el.children.length; length++) {
$(this.tbody.el.children[length])[0].classList.remove('show')
this.tbody.el.children[length].classList.remove('show')
}
ev.target.classList.remove("selected-filter");
}

49
dynamic_accounts_report/static/src/js/tax_report.js

@ -66,12 +66,12 @@ class TaxReport extends owl.Component {
self.start_date.el.value = startOfMonth.getFullYear() + '-' + String(startOfMonth.getMonth() + 1).padStart(2, '0') + '-' + String(startOfMonth.getDate()).padStart(2, '0');
self.end_date.el.value = endOfMonth.getFullYear() + '-' + String(endOfMonth.getMonth() + 1).padStart(2, '0') + '-' + String(endOfMonth.getDate()).padStart(2, '0');
self.state.date_viewed.push(monthNamesShort[today.getMonth()] + ' ' + today.getFullYear())
$.each(self.state.data.sale, function (index, value) {
self.state.sale_total += value.tax
})
$.each(self.state.data.purchase, function (index, value) {
self.state.purchase_total += value.tax
})
self.state.data.sale.forEach((value) => {
self.state.sale_total += value.tax;
});
self.state.data.purchase.forEach((value) => {
self.state.purchase_total += value.tax
});
}
catch (el) {
window.location.href;
@ -184,10 +184,10 @@ class TaxReport extends owl.Component {
'account': true
};
val.target.classList.add("selected-filter");
if($(this.tax.el.classList.contains("selected-filter"))) {
if(this.tax.el.classList.contains("selected-filter")) {
this.tax.el.classList.remove("selected-filter");
}
if($(this.global.el.classList.contains("selected-filter"))) {
if(this.global.el.classList.contains("selected-filter")) {
this.global.el.classList.remove("selected-filter");
}
}
@ -201,10 +201,10 @@ class TaxReport extends owl.Component {
'tax': true
};
val.target.classList.add("selected-filter");
if($(this.account.el.classList.contains("selected-filter"))) {
if(this.account.el.classList.contains("selected-filter")) {
this.account.el.classList.remove("selected-filter");
}
if($(this.global.el.classList.contains("selected-filter"))) {
if(this.global.el.classList.contains("selected-filter")) {
this.global.el.classList.remove("selected-filter");
}
}
@ -216,10 +216,10 @@ class TaxReport extends owl.Component {
} else {
this.state.report_type = null
val.target.classList.add("selected-filter");
if($(this.account.el.classList.contains("selected-filter"))) {
if(this.account.el.classList.contains("selected-filter")) {
this.account.el.classList.remove("selected-filter");
}
if($(this.tax.el.classList.contains("selected-filter"))) {
if(this.tax.el.classList.contains("selected-filter")) {
this.tax.el.classList.remove("selected-filter");
}
}
@ -251,18 +251,21 @@ class TaxReport extends owl.Component {
var date_viewed = []
var sale_total = 0.0
var purchase_total = 0.0
$.each(this.state.data.sale, function (index, value) {
sale_total += value.tax
})
$.each(this.state.data.purchase, function (index, value) {
purchase_total += value.tax
})
this.state.data.sale.forEach((value) => {
sale_total += value.tax;
});
this.state.data.purchase.forEach((value) => {
purchase_total += value.tax;
});
var date_viewed = []
$.each(this.state.data.dynamic_date_num, function (index, value) {
if (!date_viewed.includes(value)) {
date_viewed.push(value)
}
})
let iterable = Array.isArray(this.state.data.dynamic_date_num)
? this.state.data.dynamic_date_num
: Object.values(this.state.data.dynamic_date_num);
for (const date_num of iterable) {
if (!date_viewed.includes(date_num)) {
date_viewed.push(date_num);
}
}
if (date_viewed.length !== 0) {
this.state.date_viewed = date_viewed.reverse()
}

14
dynamic_accounts_report/static/src/js/trial_balance.js

@ -241,16 +241,18 @@ class TrialBalance extends owl.Component {
}
this.state.data = await this.orm.call("account.trial.balance", "get_filter_values", [this.start_date.el.value, this.end_date.el.value, this.state.comparison_number, this.state.comparison_type, this.state.selected_journal_list, this.state.selected_analytic, this.state.options,this.state.method,]);
var date_viewed = []
$.each(this.state.data, function (index, value) {
this.state.data.forEach((value, index) => {
if (index == 'journal_ids') {
this.state.journals = value
}
if (value.dynamic_date_num) {
$.each(value.dynamic_date_num, function (index, value) {
if (!date_viewed.includes(value)) {
date_viewed.push(value)
}
})
let iterable = Array.isArray(value.dynamic_date_num) ? value.dynamic_date_num
: Object.values(value.dynamic_date_num);
for (const date_num of iterable) {
if (!date_viewed.includes(date_num)) {
date_viewed.push(date_num);
}
}
}
})
if (date_viewed.length !== 0) {

1
dynamic_accounts_report/static/src/xml/partner_ledger_view.xml

@ -350,7 +350,6 @@
<t t-foreach="state.data[partner]"
t-as="valuelist"
t-key="valuelist_index">
<t t-log="valuelist"/>
<tr class="border-bottom border-gainsboro collapse"
t-attf-id="partner-{{i}}"
t-att-data-id="valuelist[0]['move_id'][0]">

Loading…
Cancel
Save