fixed asset depreciation

This commit is contained in:
Nabin Hait
2016-03-09 12:40:56 +05:30
parent 3a15c92c5e
commit 4fdb05228d
22 changed files with 793 additions and 328 deletions

View File

@@ -458,7 +458,20 @@ class AccountsController(TransactionBase):
# Note: not validating with gle account because we don't have the account
# at quotation / sales order level and we shouldn't stop someone
# from creating a sales invoice if sales order is already created
def validate_asset(self, asset, item_row):
if asset.company != self.company:
frappe.throw(_("Row #{0}: Asset {1} does not belong to company {2}")
.format(item_row.idx, item_row.asset, self.company))
elif asset.item_code != item_row.item_code:
frappe.throw(_("Row #{0}: Asset {1} does not linked to Item {2}")
.format(item_row.idx, item_row.asset, item_row.item_code))
elif asset.docstatus != 1:
frappe.throw(_("Row #{0}: Asset {1} must be submitted").format(item_row.idx, item_row.asset))
elif item_row.qty > 1:
frappe.throw(_("Row #{0}: Qty must be 1, as item is linked to an asset").format(item_row.idx))
@frappe.whitelist()
def get_tax_rate(account_head):
return frappe.db.get_value("Account", account_head, "tax_rate")