ODOO - Bug - Refund of discounted invoice does not consider the discount

Environment - Bahmni 0.92 - https://erp-product-qa04.mybahmni.org/web

ODOO ->Login->Create Quotation->Apply Fixed Discount->Confirm Sale->Create Invoice->Validate->Register Payment. Now refund the same invoice. When refund is processed for such an invoice having discount, the refund invoice does not account for the discounted amount, instead only the pre-discount amount gets refunded. Following are the screen shots from QA04. Invoice with Discount -

Refund of the invoice showing the pre-discount amount

@angshuonline @anandpatel Has anyone noticed this? Should I raise JIRA Ticket for this?

Has any one tried to debug this?

I have solved this issue. It is a bug.

When the functionality of Discount with an amount (Fixed Discount under Discount Method) was being implemented, the column “discount_percentage”, “disc_acc_id”, “discount” and “discount_type” of the table “account_invoice” were not considered for the process flow of refund of the sales order. Because of while refunding a sales order, the system could not identify if there was any discount (Fixed Discount under Discount Method) applied to the invoice.

@angshuonline I have raised a PR for this against ticket BAH-965

1 Like

Super. Thanks @sushantpatil1214. @ramashish can you test it out please?