Skip to content

Commit

Permalink
chore: minor cleanups and depr message
Browse files Browse the repository at this point in the history
  • Loading branch information
rtdany10 committed Nov 21, 2023
1 parent 4516e15 commit aa735fe
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@
},
{
"default": "1",
"description": "For tax inclusive rate, due to precision loss while calculating the net total and the taxes, sometimes it doesn't add up to match with the total. If you would like to force it to match, enable this setting.",
"description": "Adjust grand total in cases where rounding issue occurs due to inclusive tax rates.",
"fieldname": "adjust_grand_total_for_inclusive_tax",
"fieldtype": "Check",
"label": "Adjust Grand Total for Inclusive Tax"
Expand All @@ -470,7 +470,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2023-11-20 23:43:45.597943",
"modified": "2023-11-21 04:56:23.580607",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",
Expand Down
3 changes: 2 additions & 1 deletion erpnext/controllers/taxes_and_totals.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from frappe import _, scrub
from frappe.model.document import Document
from frappe.utils import cint, flt, round_based_on_smallest_currency_fraction
from frappe.utils.deprecations import deprecated

import erpnext
from erpnext.accounts.doctype.journal_entry.journal_entry import get_exchange_rate
Expand Down Expand Up @@ -516,6 +517,7 @@ def round_off_base_values(self, tax):
tax.base_tax_amount = round(tax.base_tax_amount, 0)
tax.base_tax_amount_after_discount_amount = round(tax.base_tax_amount_after_discount_amount, 0)

@deprecated
def manipulate_grand_total_for_inclusive_tax(self):
# for backward compatablility - if in case used by an external application
return self.adjust_grand_total_for_inclusive_tax()
Expand Down Expand Up @@ -844,7 +846,6 @@ def calculate_outstanding_amount(self):
self.calculate_paid_amount()

def calculate_paid_amount(self):

paid_amount = base_paid_amount = 0.0

if self.doc.is_pos:
Expand Down
2 changes: 1 addition & 1 deletion erpnext/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ erpnext.patches.v15_0.rename_daily_depreciation_to_depreciation_amount_based_on_
erpnext.patches.v15_0.rename_depreciation_amount_based_on_num_days_in_month_to_daily_prorata_based
erpnext.patches.v15_0.set_reserved_stock_in_bin
erpnext.patches.v14_0.create_accounting_dimensions_in_supplier_quotation
erpnext.patches.v13_0.set_default_for_grand_total_manipulation
erpnext.patches.v13_0.set_default_for_grand_total_adjustment
erpnext.patches.v14_0.update_zero_asset_quantity_field
# below migration patch should always run last
erpnext.patches.v14_0.migrate_gl_to_payment_ledger
3 changes: 3 additions & 0 deletions erpnext/public/js/controllers/taxes_and_totals.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,9 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
}
}

/**
* @deprecated Use adjust_grand_total_for_inclusive_tax instead.
*/
manipulate_grand_total_for_inclusive_tax() {
// for backward compatablility - if in case used by an external application
this.adjust_grand_total_for_inclusive_tax()
Expand Down

0 comments on commit aa735fe

Please sign in to comment.