Merge lp:~openerp-dev/openobject-addons/trunk-bug-995471-dsi into lp:openobject-addons

Proposed by Digvijay Singh
Status: Rejected
Rejected by: Harry (OpenERP)
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-995471-dsi
Merge into: lp:openobject-addons
Diff against target: 113 lines (+64/-13)
2 files modified
point_of_sale/report/pos_details.py (+30/-7)
point_of_sale/report/pos_details.rml (+34/-6)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-995471-dsi
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+112049@code.launchpad.net

Description of the change

Hello,

    I have done all the required changes according to the user need under the tax category.
  Now user can see all the details of taxes with the total amount.

Thanks,
Digvijay Singh

To post a comment you must log in.

Unmerged revisions

6898. By Amit Rasmiya (OpenERP)

[FIX]pos: add the details of taxes with respective amount in py and rml

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'point_of_sale/report/pos_details.py'
2--- point_of_sale/report/pos_details.py 2011-12-29 16:58:23 +0000
3+++ point_of_sale/report/pos_details.py 2012-06-26 10:04:45 +0000
4@@ -32,7 +32,6 @@
5 return res[0] or 'Draft'
6 else:
7 return ''
8-
9 def _get_all_users(self):
10 user_obj = self.pool.get('res.users')
11 return user_obj.search(self.cr, self.uid, [])
12@@ -154,6 +153,11 @@
13 temp = {}
14 list_ids = []
15 temp2 = 0.0
16+ amount =[]
17+ sum15 = 0
18+ sumO = 0
19+ sumX = 0
20+ sumR = 0
21 user_ids = form['user_ids'] or self._get_all_users()
22 pos_order_obj = self.pool.get('pos.order')
23 pos_ids = pos_order_obj.search(self.cr, self.uid, [('date_order','>=',form['date_start'] + ' 00:00:00'),('date_order','<=',form['date_end'] + ' 23:59:59'),('state','in',['paid','invoiced','done']),('user_id','in',user_ids)])
24@@ -162,13 +166,32 @@
25 temp2 += order.amount_tax
26 for line in order.lines:
27 if len(line.product_id.taxes_id):
28- tax = line.product_id.taxes_id[0]
29- res[tax.name] = (line.price_unit * line.qty * (1-(line.discount or 0.0) / 100.0)) + (tax.id in list_ids and res[tax.name] or 0)
30- list_ids.append(tax.id)
31- temp.update({'name': tax.name})
32- temp.update({'amount': temp2})
33+ for line_tax in range(len(line.product_id.taxes_id)):
34+ tax = line.product_id.taxes_id[line_tax]
35+ res[tax.name] = (line.price_unit * line.qty * (1-(line.discount or 0.0) / 100.0)) + (tax.id in list_ids and res[tax.name] or 0)
36+ list_ids.append(tax.name)
37+ if tax.name == 'Tax 15.00%':
38+ sum15 = sum15 + tax.amount
39+
40+ elif tax.name == 'ITAX O':
41+ sumO = sumO + tax.amount
42+
43+ elif tax.name == 'ITAX X':
44+ sumX = sumX + tax.amount
45+
46+ elif tax.name == 'ITAX R':
47+ sumR = sumR + tax.amount
48+
49+ temp.update({'name15':'Tax 15.00%'})
50+ temp.update({'amount15': sum15})
51+ temp.update({'nameO': 'ITAX O'})
52+ temp.update({'amountO': sumO})
53+ temp.update({'nameX': 'ITAX X'})
54+ temp.update({'amountX': sumX})
55+ temp.update({'nameR': 'ITAX R'})
56+ temp.update({'amountR': sumR})
57+
58 return [temp] or False
59-
60 def _get_user_names(self, user_ids):
61 user_obj = self.pool.get('res.users')
62 return ', '.join(map(lambda x: x.name, user_obj.browse(self.cr, self.uid, user_ids)))
63
64=== modified file 'point_of_sale/report/pos_details.rml'
65--- point_of_sale/report/pos_details.rml 2011-12-29 16:58:23 +0000
66+++ point_of_sale/report/pos_details.rml 2012-06-26 10:04:45 +0000
67@@ -286,12 +286,40 @@
68 <blockTable colWidths="256.0,256.0" style="Table5">
69 <tr>
70 <td>
71- <para style="terp_default_9">[[ p['name'] or removeParentNode('para') ]]</para>
72- </td>
73- <td>
74- <para style="terp_default_Right_9_Bold">[[ formatLang(p['amount']) or removeParentNode('tr') ]] [[ company.currency_id.symbol ]]</para>
75- </td>
76- </tr>
77+ <para style="terp_default_9">[[ p.get('name15') or removeParentNode('para') ]]</para>
78+ </td>
79+ <td>
80+ <para style="terp_default_Right_9_Bold">[[ p.get('amount15') or removeParentNode('tr') ]] [[ company.currency_id.symbol ]]</para>
81+ </td>
82+ </tr>
83+
84+ <tr>
85+ <td>
86+ <para style="terp_default_9">[[ (p['nameO']) or removeParentNode('para') ]]</para>
87+ </td>
88+ <td>
89+ <para style="terp_default_Right_9_Bold">[[ formatLang(p['amountO']) or removeParentNode('tr') ]] [[ company.currency_id.symbol ]]</para>
90+ </td>
91+ </tr>
92+
93+ <tr>
94+ <td>
95+ <para style="terp_default_9">[[ (p['nameX']) or removeParentNode('para') ]]</para>
96+ </td>
97+ <td>
98+ <para style="terp_default_Right_9_Bold">[[ formatLang(p['amountX']) or removeParentNode('tr') ]] [[ company.currency_id.symbol ]]</para>
99+ </td>
100+ </tr>
101+
102+ <tr>
103+ <td>
104+ <para style="terp_default_9">[[ (p['nameR']) or removeParentNode('para') ]]</para>
105+ </td>
106+ <td>
107+ <para style="terp_default_Right_9_Bold">[[ formatLang(p['amountR']) or removeParentNode('tr') ]] [[ company.currency_id.symbol ]]</para>
108+ </td>
109+ </tr>
110+
111 </blockTable>
112 <para style="terp_default_1">
113 <font color="white"> </font>

Subscribers

People subscribed via source and target branches

to all changes: