You are here: Home OpenERP Problems and solutions Round the VAT to 5 cents in Swiss
Search
Advanced Search…
E-Mail

Webmail: webmail.wyden.com

E-Mail Preferences: postfix.wyden.com/users

E-Mail Administration: postfix.wyden.com

Statistics
Total: 463
Total Pages: 284
Total Folders: 87
Total Files: 18
Total Links: 26
Last modification: 03.02.2012 16:00
 

Round the VAT to 5 cents in Swiss

by Wyden Silvan last modified 20.12.2010 17:26

SALE ORDER:

Change the file sale/sale.py:

def _amount_all(self, cr, uid, ids, field_name, arg, context=None):

   res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val)

   ....

   #hack by wysi1 to round prices
   if order.pricelist_id.currency_id.name == 'CHF':
                    res[order.id]['amount_tax'] = round(res[order.id]['amount_tax']/0.05)*0.05

   res[order.id]['amount_untaxed'] = cur_obj.round(cr, uid, cur, val1)
   ....

  

 

INVOICE:

Install the module "account_include_tax"

Change the file invoice_tax_incl.py:

def compute(self, cr, uid, invoice_id, context=None):

...

        for t in tax_grouped.values():
            t['amount'] = cur_obj.round(cr, uid, cur, t['amount'])
            t['base_amount'] = cur_obj.round(cr, uid, cur, t['base_amount'])
            t['tax_amount'] = cur_obj.round(cr, uid, cur, t['tax_amount'])

            #hack by wysi1 to round the tax for swiss standard
            if t['amount'] == t['tax_amount'] and inv.price_type == "tax_excluded":
                t['amount'] = round(t['amount']/0.05)*0.05
                t['tax_amount'] = round(t['tax_amount']/0.05)*0.05
...
        return tax_grouped
account_invoice_tax()