Refactored Credit Note Print Format
diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py
index cb2ebac..03bedc7 100644
--- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py
+++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py
@@ -203,7 +203,7 @@
if account_type in ['Bank', 'Cash']:
company_currency = get_company_currency(self.company)
amt = flt(d.debit) and d.debit or d.credit
- self.total_amount = company_currency + ' ' + cstr(amt)
+ self.total_amount = fmt_money(amt, currency=company_currency)
from frappe.utils import money_in_words
self.total_amount_in_words = money_in_words(amt, company_currency)
diff --git a/erpnext/accounts/print_format/credit_note/credit_note.json b/erpnext/accounts/print_format/credit_note/credit_note.json
index 4b32cc8..31507b4 100644
--- a/erpnext/accounts/print_format/credit_note/credit_note.json
+++ b/erpnext/accounts/print_format/credit_note/credit_note.json
@@ -4,9 +4,9 @@
"doc_type": "Journal Voucher",
"docstatus": 0,
"doctype": "Print Format",
- "html": "<h3 class=\"text-right\">{{ doc.select_print_heading or _(\"Credit Note\") }}</h3>\n<hr>\n<div class=\"row\">\n <div class=\"col-sm-3\"><label align=right>{{ _(\"Credit Note No\") }}</label></div>\n <div class=\"col-sm-9\">{{ doc.name }}</div>\n</div>\n<div class=\"row\">\n <div class=\"col-sm-3\"><label align=right>{{ _(\"Credit Date\") }}</label></div>\n <div class=\"col-sm-9\">{{ frappe.utils.formatdate(doc.voucher_date) }}</div>\n</div>\n<div class=\"row\">\n <div class=\"col-sm-3\"><label align=right>{{ _(\"Credit Type \") }}</label></div>\n <div class=\"col-sm-9\">{{ _(\"Credit Note \") }}</div>\n</div>\n<div class=\"row\">\n <div class=\"col-sm-3\"><label align=right>{{ _(\"Credit To\") }}</label></div>\n <div class=\"col-sm-9\">{{ doc.pay_to_recd_from }}</div>\n</div>\n<hr>\n<div class=\"row\">\n <div class=\"col-sm-3\"><label align=right>{{ _(\"Total Amount\") }}</label></div>\n <div class=\"col-sm-9\"><label>{{ doc.total_amount }}/-<br>{{ doc.total_amount_in_words }}</label></div>\n</div>\n<hr>\n<div class=\"row\">\n <div class=\"col-sm-3\"><label align=right>{{ _(\"Remarks\") }}</label></div>\n <div class=\"col-sm-9\">{{ doc.remark }}</div>\n</div>\n<hr>\n<br>\n<p>\n{{ _(\"For\") }} {{ doc.company }},<br>\n<br>\n<br>\n<br>\n{{ _(\"Authorized Signatory\") }}</p>\n",
+ "html": "{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n\n<div class=\"page-break\">\n {%- if not doc.get(\"print_heading\") and not doc.get(\"select_print_heading\") \n and doc.set(\"select_print_heading\", _(\"Credit Note\")) -%}{%- endif -%}\n {{ add_header(0, 1, doc, letter_head, no_letterhead) }}\n\n {%- for label, value in (\n (_(\"Credit To\"), doc.pay_to_recd_from),\n (_(\"Date\"), frappe.utils.formatdate(doc.voucher_date)),\n (_(\"Amount\"), \"<strong>\" + doc.total_amount + \"</strong><br>\" + (doc.total_amount_in_words or \"\") + \"<br>\"),\n (_(\"Remarks\"), doc.remark)\n ) -%}\n\n <div class=\"row\">\n <div class=\"col-sm-3\"><label class=\"text-right\">{{ label }}</label></div>\n <div class=\"col-sm-9\">{{ value }}</div>\n </div>\n\n {%- endfor -%}\n\n <hr>\n <br>\n <p class=\"strong\">\n {{ _(\"For\") }} {{ doc.company }},<br>\n <br>\n <br>\n <br>\n {{ _(\"Authorized Signatory\") }}\n </p>\n</div>\n\n\n",
"idx": 2,
- "modified": "2014-08-28 11:15:38.677618",
+ "modified": "2014-08-29 13:20:15.789533",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Credit Note",