diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 2bfad4eff1..e9449d7ef7 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -339,15 +339,17 @@ class JournalEntry(AccountsController):
self.remark = ("\n").join(r) #User Remarks is not mandatory
def set_print_format_fields(self):
+ total_amount = 0.0
for d in self.get('accounts'):
if d.party_type and d.party:
if not self.pay_to_recd_from:
self.pay_to_recd_from = frappe.db.get_value(d.party_type, d.party,
"customer_name" if d.party_type=="Customer" else "supplier_name")
- self.set_total_amount(d.debit or d.credit)
elif frappe.db.get_value("Account", d.account, "account_type") in ["Bank", "Cash"]:
- self.set_total_amount(d.debit or d.credit)
+ total_amount += (d.debit or d.credit)
+
+ self.set_total_amount(total_amount)
def set_total_amount(self, amt):
self.total_amount = amt
diff --git a/erpnext/accounts/print_format/payment_receipt_voucher/payment_receipt_voucher.html b/erpnext/accounts/print_format/payment_receipt_voucher/payment_receipt_voucher.html
new file mode 100644
index 0000000000..a4f8fa6e9f
--- /dev/null
+++ b/erpnext/accounts/print_format/payment_receipt_voucher/payment_receipt_voucher.html
@@ -0,0 +1,30 @@
+{%- from "templates/print_formats/standard_macros.html" import add_header -%}
+
+ {%- if not doc.get("print_heading") and not doc.get("select_print_heading")
+ and doc.set("select_print_heading", _("Payment Receipt Note")) -%}{%- endif -%}
+ {{ add_header(0, 1, doc, letter_head, no_letterhead) }}
+
+ {%- for label, value in (
+ (_("Received On"), frappe.utils.formatdate(doc.voucher_date)),
+ (_("Received From"), doc.pay_to_recd_from),
+ (_("Amount"), "
" + doc.get_formatted("total_amount") + "" + (doc.total_amount_in_words or "") + "
"),
+ (_("Remarks"), doc.remark)
+ ) -%}
+
+
+
{{ value }}
+
+
+ {%- endfor -%}
+
+
+
+
+ {{ _("For") }} {{ doc.company }},
+
+
+
+ {{ _("Authorized Signatory") }}
+
+
+
diff --git a/erpnext/accounts/print_format/payment_receipt_voucher/payment_receipt_voucher.json b/erpnext/accounts/print_format/payment_receipt_voucher/payment_receipt_voucher.json
index 5445f6641b..f1de448bb9 100755
--- a/erpnext/accounts/print_format/payment_receipt_voucher/payment_receipt_voucher.json
+++ b/erpnext/accounts/print_format/payment_receipt_voucher/payment_receipt_voucher.json
@@ -1,15 +1,17 @@
{
- "creation": "2012-05-01 12:46:31",
- "doc_type": "Journal Entry",
- "docstatus": 0,
- "doctype": "Print Format",
- "html": "{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n\n {%- if not doc.get(\"print_heading\") and not doc.get(\"select_print_heading\") \n and doc.set(\"select_print_heading\", _(\"Payment Receipt Note\")) -%}{%- endif -%}\n {{ add_header(0, 1, doc, letter_head, no_letterhead) }}\n\n {%- for label, value in (\n (_(\"Received On\"), frappe.utils.formatdate(doc.voucher_date)),\n (_(\"Received From\"), doc.pay_to_recd_from),\n (_(\"Amount\"), \"
\" + doc.get_formatted(\"total_amount\") + \"\" + (doc.total_amount_in_words or \"\") + \"
\"),\n (_(\"Remarks\"), doc.remark)\n ) -%}\n
\n
\n
{{ value }}
\n
\n\n {%- endfor -%}\n\n
\n
\n
\n {{ _(\"For\") }} {{ doc.company }},
\n
\n
\n
\n {{ _(\"Authorized Signatory\") }}\n
\n
\n\n",
- "idx": 1,
- "modified": "2015-01-16 11:03:22.893209",
- "modified_by": "Administrator",
- "module": "Accounts",
- "name": "Payment Receipt Voucher",
- "owner": "Administrator",
- "print_format_type": "Server",
+ "creation": "2012-05-01 12:46:31",
+ "custom_format": 0,
+ "disabled": 0,
+ "doc_type": "Journal Entry",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "",
+ "idx": 1,
+ "modified": "2015-11-25 07:06:00.668141",
+ "modified_by": "Administrator",
+ "name": "Payment Receipt Voucher",
+ "owner": "Administrator",
+ "print_format_builder": 0,
+ "print_format_type": "Server",
"standard": "Yes"
-}
+}
\ No newline at end of file
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 37f8f36bcc..89bf7c4f73 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -235,3 +235,4 @@ execute:frappe.delete_doc_if_exists("DocType", "Stock UOM Replace Utility")
erpnext.patches.v6_8.make_webform_standard #2015-11-23
erpnext.patches.v6_8.move_drop_ship_to_po_items
erpnext.patches.v6_10.fix_ordered_received_billed
+erpnext.patches.v6_10.fix_jv_total_amount
diff --git a/erpnext/patches/v6_10/fix_jv_total_amount.py b/erpnext/patches/v6_10/fix_jv_total_amount.py
new file mode 100644
index 0000000000..3797ff441d
--- /dev/null
+++ b/erpnext/patches/v6_10/fix_jv_total_amount.py
@@ -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)