mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-15 12:55:10 +00:00
fix(payment entry): round unallocated amount
(cherry picked from commit b0d6751777)
This commit is contained in:
@@ -1082,20 +1082,32 @@ class PaymentEntry(AccountsController):
|
|||||||
self.base_paid_amount + deductions_to_consider
|
self.base_paid_amount + deductions_to_consider
|
||||||
):
|
):
|
||||||
self.unallocated_amount = (
|
self.unallocated_amount = (
|
||||||
self.base_paid_amount
|
flt(
|
||||||
+ deductions_to_consider
|
(
|
||||||
- self.base_total_allocated_amount
|
self.base_paid_amount
|
||||||
- included_taxes
|
+ deductions_to_consider
|
||||||
) / self.source_exchange_rate
|
- self.base_total_allocated_amount
|
||||||
|
- included_taxes
|
||||||
|
),
|
||||||
|
self.precision("unallocated_amount"),
|
||||||
|
)
|
||||||
|
/ self.source_exchange_rate
|
||||||
|
)
|
||||||
elif self.payment_type == "Pay" and self.base_total_allocated_amount < (
|
elif self.payment_type == "Pay" and self.base_total_allocated_amount < (
|
||||||
self.base_received_amount - deductions_to_consider
|
self.base_received_amount - deductions_to_consider
|
||||||
):
|
):
|
||||||
self.unallocated_amount = (
|
self.unallocated_amount = (
|
||||||
self.base_received_amount
|
flt(
|
||||||
- deductions_to_consider
|
(
|
||||||
- self.base_total_allocated_amount
|
self.base_received_amount
|
||||||
- included_taxes
|
- deductions_to_consider
|
||||||
) / self.target_exchange_rate
|
- self.base_total_allocated_amount
|
||||||
|
- included_taxes
|
||||||
|
),
|
||||||
|
self.precision("unallocated_amount"),
|
||||||
|
)
|
||||||
|
/ self.target_exchange_rate
|
||||||
|
)
|
||||||
|
|
||||||
def set_exchange_gain_loss(self):
|
def set_exchange_gain_loss(self):
|
||||||
exchange_gain_loss = flt(
|
exchange_gain_loss = flt(
|
||||||
|
|||||||
Reference in New Issue
Block a user