digvijay singh (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-bug-995471-dsi into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #995471 in OpenERP Addons: "[6.1]/[trunk] POS report pos_detail list
taxes issue"
https://bugs.launchpad.net/openobject-addons/+bug/995471
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-995471-dsi/+merge/112049
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
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-995471-dsi/+merge/112049
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-bug-995471-dsi.
=== modified file 'point_of_sale/report/pos_details.py'
--- point_of_sale/report/pos_details.py 2011-12-29 16:58:23 +0000
+++ point_of_sale/report/pos_details.py 2012-06-26 10:04:45 +0000
@@ -32,7 +32,6 @@
return res[0] or 'Draft'
else:
return ''
-
def _get_all_users(self):
user_obj = self.pool.get('res.users')
return user_obj.search(self.cr, self.uid, [])
@@ -154,6 +153,11 @@
temp = {}
list_ids = []
temp2 = 0.0
+ amount =[]
+ sum15 = 0
+ sumO = 0
+ sumX = 0
+ sumR = 0
user_ids = form['user_ids'] or self._get_all_users()
pos_order_obj = self.pool.get('pos.order')
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)])
@@ -162,13 +166,32 @@
temp2 += order.amount_tax
for line in order.lines:
if len(line.product_id.taxes_id):
- tax = line.product_id.taxes_id[0]
- 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)
- list_ids.append(tax.id)
- temp.update({'name': tax.name})
- temp.update({'amount': temp2})
+ for line_tax in range(len(line.product_id.taxes_id)):
+ tax = line.product_id.taxes_id[line_tax]
+ 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)
+ list_ids.append(tax.name)
+ if tax.name == 'Tax 15.00%':
+ sum15 = sum15 + tax.amount
+
+ elif tax.name == 'ITAX O':
+ sumO = sumO + tax.amount
+
+ elif tax.name == 'ITAX X':
+ sumX = sumX + tax.amount
+
+ elif tax.name == 'ITAX R':
+ sumR = sumR + tax.amount
+
+ temp.update({'name15':'Tax 15.00%'})
+ temp.update({'amount15': sum15})
+ temp.update({'nameO': 'ITAX O'})
+ temp.update({'amountO': sumO})
+ temp.update({'nameX': 'ITAX X'})
+ temp.update({'amountX': sumX})
+ temp.update({'nameR': 'ITAX R'})
+ temp.update({'amountR': sumR})
+
return [temp] or False
-
def _get_user_names(self, user_ids):
user_obj = self.pool.get('res.users')
return ', '.join(map(lambda x: x.name, user_obj.browse(self.cr, self.uid, user_ids)))
=== modified file 'point_of_sale/report/pos_details.rml'
--- point_of_sale/report/pos_details.rml 2011-12-29 16:58:23 +0000
+++ point_of_sale/report/pos_details.rml 2012-06-26 10:04:45 +0000
@@ -286,12 +286,40 @@
<blockTable colWidths="256.0,256.0" style="Table5">
<tr>
<td>
- <para style="terp_default_9">[[ p['name'] or removeParentNode('para') ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9_Bold">[[ formatLang(p['amount']) or removeParentNode('tr') ]] [[ company.currency_id.symbol ]]</para>
- </td>
- </tr>
+ <para style="terp_default_9">[[ p.get('name15') or removeParentNode('para') ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9_Bold">[[ p.get('amount15') or removeParentNode('tr') ]] [[ company.currency_id.symbol ]]</para>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <para style="terp_default_9">[[ (p['nameO']) or removeParentNode('para') ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9_Bold">[[ formatLang(p['amountO']) or removeParentNode('tr') ]] [[ company.currency_id.symbol ]]</para>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <para style="terp_default_9">[[ (p['nameX']) or removeParentNode('para') ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9_Bold">[[ formatLang(p['amountX']) or removeParentNode('tr') ]] [[ company.currency_id.symbol ]]</para>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <para style="terp_default_9">[[ (p['nameR']) or removeParentNode('para') ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9_Bold">[[ formatLang(p['amountR']) or removeParentNode('tr') ]] [[ company.currency_id.symbol ]]</para>
+ </td>
+ </tr>
+
</blockTable>
<para style="terp_default_1">
<font color="white"> </font>
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp