mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 03:39:11 +00:00
fix: Test Cases
This commit is contained in:
@@ -482,7 +482,7 @@ class PaymentEntry(AccountsController):
|
|||||||
|
|
||||||
self.received_amount_after_tax = flt(flt(self.received_amount) + flt(applicable_tax),
|
self.received_amount_after_tax = flt(flt(self.received_amount) + flt(applicable_tax),
|
||||||
self.precision("paid_amount_after_tax"))
|
self.precision("paid_amount_after_tax"))
|
||||||
self.base_received_amount_after_tax = flt(flt(self.received_amount_after_tax) * flt(self.source_exchange_rate),
|
self.base_received_amount_after_tax = flt(flt(self.received_amount_after_tax) * flt(self.target_exchange_rate),
|
||||||
self.precision("base_paid_amount_after_tax"))
|
self.precision("base_paid_amount_after_tax"))
|
||||||
|
|
||||||
def set_amounts_in_company_currency(self):
|
def set_amounts_in_company_currency(self):
|
||||||
@@ -804,7 +804,7 @@ class PaymentEntry(AccountsController):
|
|||||||
self.total_taxes_and_charges = 0.0
|
self.total_taxes_and_charges = 0.0
|
||||||
self.base_total_taxes_and_charges = 0.0
|
self.base_total_taxes_and_charges = 0.0
|
||||||
|
|
||||||
for i, tax in enumerate(self.taxes):
|
for i, tax in enumerate(self.get('taxes')):
|
||||||
tax_rate = tax.rate
|
tax_rate = tax.rate
|
||||||
|
|
||||||
# To set row_id by default as previous row.
|
# To set row_id by default as previous row.
|
||||||
@@ -821,11 +821,11 @@ class PaymentEntry(AccountsController):
|
|||||||
current_tax_amount = (tax_rate / 100.0) * self.paid_amount
|
current_tax_amount = (tax_rate / 100.0) * self.paid_amount
|
||||||
elif tax.charge_type == "On Previous Row Amount":
|
elif tax.charge_type == "On Previous Row Amount":
|
||||||
current_tax_amount = (tax_rate / 100.0) * \
|
current_tax_amount = (tax_rate / 100.0) * \
|
||||||
self.taxes[cint(tax.row_id) - 1].tax_amount
|
self.get('taxes')[cint(tax.row_id) - 1].tax_amount
|
||||||
|
|
||||||
elif tax.charge_type == "On Previous Row Total":
|
elif tax.charge_type == "On Previous Row Total":
|
||||||
current_tax_amount = (tax_rate / 100.0) * \
|
current_tax_amount = (tax_rate / 100.0) * \
|
||||||
self.taxes[cint(tax.row_id) - 1].total
|
self.get('taxes')[cint(tax.row_id) - 1].total
|
||||||
|
|
||||||
tax.tax_amount = current_tax_amount
|
tax.tax_amount = current_tax_amount
|
||||||
tax.base_tax_amount = tax.tax_amount * self.source_exchange_rate
|
tax.base_tax_amount = tax.tax_amount * self.source_exchange_rate
|
||||||
@@ -839,7 +839,7 @@ class PaymentEntry(AccountsController):
|
|||||||
if i == 0:
|
if i == 0:
|
||||||
tax.total = flt(self.paid_amount + current_tax_amount, self.precision("total", tax))
|
tax.total = flt(self.paid_amount + current_tax_amount, self.precision("total", tax))
|
||||||
else:
|
else:
|
||||||
tax.total = flt(self.taxes[i-1].total + current_tax_amount, self.precision("total", tax))
|
tax.total = flt(self.get('taxes')[i-1].total + current_tax_amount, self.precision("total", tax))
|
||||||
|
|
||||||
tax.base_total = tax.total * self.source_exchange_rate
|
tax.base_total = tax.total * self.source_exchange_rate
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user