# Point Of Sale Fiscal don`t working #9815

Closed
opened this Issue Nov 30, 2015 · 2 comments

Projects
None yet
3 participants

### ilyasProgrammer commented Nov 30, 2015

 Problem: Point of sale ignoring fiscal. Steps to reproduce problem: Create two tax (e.g. 10% and 15%) including in price. Create the product and set up tax for it that included in price. Create new fiscal and do tax mapping 10% replacing 15%. Create new Point Of Sale Sale and add created taxes. Open POS and ad that product in order. Than apply fiscal on it. Payment. Cash. Validate. Close POS. Push Validate and Close. You will got ISSUE "Cannot create unbalanced journal entry." Reason of ISSUE as i presume (look up method "_create_account_move_line" in point_of_sale.py): In point_of_sale.py line: ``````for tax in account_tax_obj.browse(cr, uid, taxes, context=context).compute_all(line.price_unit * (100.0-line.discount) / 100.0, cur, line.qty)['taxes']: `````` as result ignoring fiscal. Fix way as i suppose: ``````#Add this before call compute_all +taxes = account_tax_obj.browse(cr, uid, taxes, context=context) +m_price = line.price_unit * (100.0-line.discount) / 100.0 +m_fiscal = order.fiscal_position_id + if m_fiscal: + taxes = m_fiscal.map_tax(taxes) #And replace like this -for tax in account_tax_obj.browse(cr, uid, taxes, context=context).compute_all(line.price_unit * (100.0-line.discount) / 100.0, cur, line.qty)['taxes']: +for tax in taxes.compute_all(m_price, cur, line.qty, product=line.product_id, partner=line.order_id.partner_id or False)['taxes']: `````` Its analogy of _amount_line_tax in pos_order class. Than you got it to work properly. But i have tested it superficially so its has to be done deeply.

Contributor

### jorenvo commented Dec 1, 2015

 Thanks for the report, it's fixed. You were right btw, we did not use the mapped taxes when creating the account moves, because of this the pos would attempt to create unbalanced lines (where paid != amount of order), which caused the problem.

### jorenvo added a commit to odoo-dev/odoo that referenced this issue Dec 1, 2015

``` [FIX] point_of_sale: use mapped taxes when creating account moves ```
```We have a tax_ids_after_fiscal_position field on pos.order.line that
contains the mapped taxes. We should use that to create the account
moves. Otherwise the Point of Sale will create unbalanced journal
entries.

Fixes odoo#9815```
``` 879d8b2 ```
Contributor

### flotho commented Jan 28, 2016

 I think it probably coming from a bad way taxes are handled : #10648