fix(Asset): Add depreciation schedule details in create_asset()
This commit is contained in:
parent
aa9bbe51bd
commit
b55649f2ec
@ -660,7 +660,7 @@ def create_asset(**args):
|
|||||||
"item_code": args.item_code or "Macbook Pro",
|
"item_code": args.item_code or "Macbook Pro",
|
||||||
"company": args.company or"_Test Company",
|
"company": args.company or"_Test Company",
|
||||||
"purchase_date": "2015-01-01",
|
"purchase_date": "2015-01-01",
|
||||||
"calculate_depreciation": 0,
|
"calculate_depreciation": args.calculate_depreciation or 0,
|
||||||
"gross_purchase_amount": 100000,
|
"gross_purchase_amount": 100000,
|
||||||
"purchase_receipt_amount": 100000,
|
"purchase_receipt_amount": 100000,
|
||||||
"expected_value_after_useful_life": 10000,
|
"expected_value_after_useful_life": 10000,
|
||||||
@ -671,6 +671,13 @@ def create_asset(**args):
|
|||||||
"is_existing_asset": args.is_existing_asset or 0
|
"is_existing_asset": args.is_existing_asset or 0
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if asset.calculate_depreciation:
|
||||||
|
asset.append("finance_books", {
|
||||||
|
"depreciation_method": "Straight Line",
|
||||||
|
"frequency_of_depreciation": 12,
|
||||||
|
"total_number_of_depreciations": 5
|
||||||
|
})
|
||||||
|
|
||||||
try:
|
try:
|
||||||
asset.save()
|
asset.save()
|
||||||
except frappe.DuplicateEntryError:
|
except frappe.DuplicateEntryError:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user