erpnext
erpnext copied to clipboard
why the system validate paid_amount = invoice_total in sales invoice and POS invoice which make trouple when to try to return partly paid invoice.
Information about bug
Problem Overview
System checks when make a return for partly paid invoice If Total Invoice = Paid Amount
Scenario
Example
| Item | Rate | Quantity |
|---|---|---|
| Item 1 | 500 | 1 |
- Total Invoice: 500
- Paid Amount: 250
If i tried to make a return i got this message
"Paid amount + Write Off Amount can not be greater than Grand Total"
so to make a return, I have to change rate from 500 to 250 for making Total Invoice = Paid Amount
| Item | Rate | Quantity |
|---|---|---|
| Item 1 | 250 | 1 |
- Total Invoice : 500
- Paid Amount : 250 Which does not make any sense and will be more difficult to manage with multiple items
code
def validate_pos(self):
if self.is_return:
invoice_total = self.rounded_total or self.grand_total
if flt(self.paid_amount) + flt(self.write_off_amount) - flt(invoice_total) > 1.0 / (
10.0 ** (self.precision("grand_total") + 1.0)
):
frappe.throw(_("Paid amount + Write Off Amount can not be greater than Grand Total"))
what the point of validate that paid_amount = invoice_total If anyone can help why this validation exist
Module
accounts, selling
Version
Frappe 15 ERPnext 15
Installation method
None
Relevant log output / Stack trace / Full Error Message.
"Paid amount + Write Off Amount can not be greater than Grand Total"