* use 12 places precision for sums * use high float precision, fix decimal place late * Update accounts_controller.py
This commit is contained in:
		
							parent
							
								
									f592f2c9a9
								
							
						
					
					
						commit
						5825dedf7c
					
				| @ -693,8 +693,9 @@ class AccountsController(TransactionBase): | |||||||
| 			total = 0 | 			total = 0 | ||||||
| 			for d in self.get("payment_schedule"): | 			for d in self.get("payment_schedule"): | ||||||
| 				total += flt(d.payment_amount) | 				total += flt(d.payment_amount) | ||||||
|  | 			total = flt(total, self.precision("grand_total")) | ||||||
| 
 | 
 | ||||||
| 			grand_total = self.get("rounded_total") or self.grand_total | 			grand_total = flt(self.get("rounded_total") or self.grand_total, self.precision('grand_total')) | ||||||
| 			if total != grand_total: | 			if total != grand_total: | ||||||
| 				frappe.throw(_("Total Payment Amount in Payment Schedule must be equal to Grand / Rounded Total")) | 				frappe.throw(_("Total Payment Amount in Payment Schedule must be equal to Grand / Rounded Total")) | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user