fix: Rename get_gl_entries_on_asset_movement to get_gl_entries_on_asset_disposal_and_regain

This commit is contained in:
GangaManoj 2021-07-06 23:43:08 +05:30
parent f8ee8058e7
commit ca87745be1
2 changed files with 5 additions and 5 deletions

View File

@ -13,7 +13,7 @@ from erpnext.accounts.utils import get_account_currency
from erpnext.stock.doctype.delivery_note.delivery_note import update_billed_amount_based_on_so
from erpnext.projects.doctype.timesheet.timesheet import get_projectwise_timesheet_data
from erpnext.assets.doctype.asset.depreciation \
import get_disposal_account_and_cost_center, get_gl_entries_on_asset_movement
import get_disposal_account_and_cost_center, get_gl_entries_on_asset_disposal_and_regain
from erpnext.stock.doctype.batch.batch import set_batch_nos
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos, get_delivery_note_serial_no
from erpnext.setup.doctype.company.company import update_company_current_month_sales
@ -930,11 +930,11 @@ class SalesInvoice(SellingController):
.format(item.item_code, item.idx))
if self.is_return:
fixed_asset_gl_entries = get_gl_entries_on_asset_movement(asset,
fixed_asset_gl_entries = get_gl_entries_on_asset_disposal_and_regain(asset,
item.base_net_amount, item.finance_book, True)
asset.db_set("disposal_date", None)
else:
fixed_asset_gl_entries = get_gl_entries_on_asset_movement(asset,
fixed_asset_gl_entries = get_gl_entries_on_asset_disposal_and_regain(asset,
item.base_net_amount, item.finance_book)
asset.db_set("disposal_date", self.posting_date)

View File

@ -147,7 +147,7 @@ def scrap_asset(asset_name):
je.company = asset.company
je.remark = "Scrap Entry for asset {0}".format(asset_name)
for entry in get_gl_entries_on_asset_movement(asset):
for entry in get_gl_entries_on_asset_disposal_and_regain(asset):
entry.update({
"reference_type": "Asset",
"reference_name": asset_name
@ -177,7 +177,7 @@ def restore_asset(asset_name):
asset.set_status()
@frappe.whitelist()
def get_gl_entries_on_asset_movement(asset, selling_amount=0, finance_book=None, is_return = False):
def get_gl_entries_on_asset_disposal_and_regain(asset, selling_amount=0, finance_book=None, is_return = False):
fixed_asset_account, accumulated_depr_account, depr_expense_account = get_depreciation_accounts(asset)
disposal_account, depreciation_cost_center = get_disposal_account_and_cost_center(asset.company)
depreciation_cost_center = asset.cost_center or depreciation_cost_center