mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
Merge pull request #43528 from frappe/extend_voucher_types
chore: Allow apps to extend voucher subtypes
This commit is contained in:
@@ -1068,6 +1068,13 @@ class AccountsController(TransactionBase):
|
|||||||
"Stock Entry": "stock_entry_type",
|
"Stock Entry": "stock_entry_type",
|
||||||
"Asset Capitalization": "entry_type",
|
"Asset Capitalization": "entry_type",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for method_name in frappe.get_hooks("voucher_subtypes"):
|
||||||
|
voucher_subtype = frappe.get_attr(method_name)(self)
|
||||||
|
|
||||||
|
if voucher_subtype:
|
||||||
|
return voucher_subtype
|
||||||
|
|
||||||
if self.doctype in voucher_subtypes:
|
if self.doctype in voucher_subtypes:
|
||||||
return self.get(voucher_subtypes[self.doctype])
|
return self.get(voucher_subtypes[self.doctype])
|
||||||
elif self.doctype == "Purchase Receipt" and self.is_return:
|
elif self.doctype == "Purchase Receipt" and self.is_return:
|
||||||
@@ -1078,6 +1085,7 @@ class AccountsController(TransactionBase):
|
|||||||
return "Credit Note"
|
return "Credit Note"
|
||||||
elif (self.doctype == "Purchase Invoice" and self.is_return) or self.doctype == "Sales Invoice":
|
elif (self.doctype == "Purchase Invoice" and self.is_return) or self.doctype == "Sales Invoice":
|
||||||
return "Debit Note"
|
return "Debit Note"
|
||||||
|
|
||||||
return self.doctype
|
return self.doctype
|
||||||
|
|
||||||
def get_value_in_transaction_currency(self, account_currency, gl_dict, field):
|
def get_value_in_transaction_currency(self, account_currency, gl_dict, field):
|
||||||
|
|||||||
Reference in New Issue
Block a user