[fix] total amount in journal entry

This commit is contained in:
Rushabh Mehta
2015-11-25 17:51:00 +05:30
parent 131bec67bc
commit b82bdd6f1f
5 changed files with 63 additions and 15 deletions

View File

@@ -0,0 +1,13 @@
import frappe
# patch all for-print field (total amount) in Journal Entry in 2015
def execute():
for je in frappe.get_all("Journal Entry", filters={"creation": (">", "2015-01-01")}):
je = frappe.get_doc("Journal Entry", je.name)
original = je.total_amount
je.set_print_format_fields()
if je.total_amount != original:
je.db_set("total_amount", je.total_amount, update_modified=False)
je.db_set("total_amount_in_words", je.total_amount_in_words, update_modified=False)