[FIX] account: A negative amount with sale taxes on bank statement line must be considered as a refund. Courtesy of Adrien Peiffer (ACSONE). PR #11877
This commit is contained in:
parent
e588d85315
commit
e664d3074c
|
@ -1378,7 +1378,8 @@ class account_move_line(osv.osv):
|
||||||
account_id = 'account_collected_id'
|
account_id = 'account_collected_id'
|
||||||
base_sign = 'base_sign'
|
base_sign = 'base_sign'
|
||||||
tax_sign = 'tax_sign'
|
tax_sign = 'tax_sign'
|
||||||
if journal.type in ('purchase_refund', 'sale_refund') or (journal.type in ('cash', 'bank') and total < 0 and tax_id.type_tax_use != 'sale'):
|
is_refund = ((total > 0 and tax_id.type_tax_use == 'sale') or (total < 0 and tax_id.type_tax_use != 'sale'))
|
||||||
|
if journal.type in ('purchase_refund', 'sale_refund') or (journal.type in ('cash', 'bank') and is_refund):
|
||||||
base_code = 'ref_base_code_id'
|
base_code = 'ref_base_code_id'
|
||||||
tax_code = 'ref_tax_code_id'
|
tax_code = 'ref_tax_code_id'
|
||||||
account_id = 'account_paid_id'
|
account_id = 'account_paid_id'
|
||||||
|
|
Loading…
Reference in New Issue