Skip to content

Commit

Permalink
Update code, still tested to add.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fekete Mihai committed Feb 23, 2018
1 parent a9994c6 commit 22c2793
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion l10n_ro_report_D300/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'depends': [
'l10n_ro',
'date_range',
'report_xlsx',],
'report_xlsx'],
'data': [
"views/layouts.xml",
"views/l10n_ro_report_d300.xml",
Expand Down
16 changes: 7 additions & 9 deletions l10n_ro_report_D300/report/l10n_ro_report_D300.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,11 @@ def _inject_taxtags_values(self):
query_inject_taxtags = """
WITH
taxtags AS
(SELECT coalesce(replace(
tag.name, 'Romania - D300: randul ', ''),0)::integer
AS code,
(SELECT coalesce(regexp_replace(replace(tag.name, 'D300', ''),
'[^0-9\.]+', '', 'g')::numeric * 10, 0)::integer AS code,
tag.name, tag.id,
abs(coalesce(sum(movetax.tax_base_amount), 0.00)) AS net,
abs(coalesce(sum(movetax.balance), 0.00)) AS tax
coalesce(sum(movetax.tax_base_amount), 0.00) AS net,
coalesce(sum(movetax.balance), 0.00) AS tax
FROM
account_account_tag AS tag
INNER JOIN account_tax_account_tag AS taxtag
Expand All @@ -202,8 +201,7 @@ def _inject_taxtags_values(self):
AND move.company_id = %s AND move.date >= %s
AND move.date <= %s AND move.state = 'posted'
GROUP BY tag.id
ORDER BY replace(tag.name, 'Romania - D300: randul ',
'')::integer, tag.name
ORDER BY code, tag.name
)
INSERT INTO
l10n_ro_report_d300_taxtag
Expand Down Expand Up @@ -242,8 +240,8 @@ def _inject_tax_values(self):
SELECT
tag.id AS report_tax_id, '' AS code,
tax.name, tax.id,
abs(coalesce(sum(movetax.tax_base_amount), 0.00)) AS net,
abs(coalesce(sum(movetax.balance), 0.00)) AS tax
coalesce(sum(movetax.tax_base_amount), 0.00) AS net,
coalesce(sum(movetax.balance), 0.00) AS tax
FROM
l10n_ro_report_d300_taxtag AS tag
INNER JOIN account_tax_account_tag AS taxtag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ odoo.define('l10n_ro_report_D300.l10n_ro_report_d300_widget', function
var core = require('web.core');
var Widget = require('web.Widget');

var QWeb = core.qweb;

var _t = core._t;

var accountFinancialReportWidget = Widget.extend({
var D300ReportWidget = Widget.extend({
events: {
'click .o_l10n_ro_report_d300_web_action': 'boundLink',
'click .o_l10n_ro_report_d300_web_action_multi': 'boundLinkmulti',
Expand Down Expand Up @@ -44,6 +40,6 @@ var accountFinancialReportWidget = Widget.extend({
},
});

return accountFinancialReportWidget;
return D300ReportWidget;

});

0 comments on commit 22c2793

Please sign in to comment.