From 014346acbabf478431da220d71d6126d0bd874c0 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Wed, 27 Aug 2014 16:35:59 +0530 Subject: [PATCH 1/4] [print-template] Credit Note --- .../accounts/print_format/credit_note/__init__.py | 0 .../print_format/credit_note/credit_note.json | 15 +++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 erpnext/accounts/print_format/credit_note/__init__.py create mode 100644 erpnext/accounts/print_format/credit_note/credit_note.json diff --git a/erpnext/accounts/print_format/credit_note/__init__.py b/erpnext/accounts/print_format/credit_note/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/accounts/print_format/credit_note/credit_note.json b/erpnext/accounts/print_format/credit_note/credit_note.json new file mode 100644 index 00000000000..0b231a3d2a0 --- /dev/null +++ b/erpnext/accounts/print_format/credit_note/credit_note.json @@ -0,0 +1,15 @@ +{ + "creation": "2014-08-27 14:39:00.593377", + "disabled": 0, + "doc_type": "Journal Voucher", + "docstatus": 0, + "doctype": "Print Format", + "html": "
\n\n\t{% if letter_head and not no_letterhead %}{{ letter_head }}{%- endif -%}\n\t

{{ _(\"Credit Note\") }}

\n
\n\t
\n\t
\n\t
{{ doc.pay_to_recd_from }}
\n\t
\n\t
\n\t
\n\t
{{ doc.name }}
\n\t
\n\t
\n\t
\n\t
{{ frappe.utils.formatdate(doc.voucher_date) }}
\n\t
\n\t
\n\t
\n\t
{{ doc.cheque_no }}
\n\t
\n\t
\n\t
\n\t
{{ frappe.utils.formatdate(doc.cheque_date) }}
\n\t
\n\t
\n\t
\n\t
{{ frappe.utils.formatdate(doc.voucher_date) }}
\n\t
\n\t
\n\t

{{ _(\"This amount is in full / part settlement of the listed bills\") }}:

\n\t
\n\t
\n\t
\n\t
{{ \n\t \tfrappe.format_value(doc.total_amount, doc.meta.get_field(\"total_amount\"), doc) }}
\n\t
\n\t
\n\t
\n\t
{{ doc.remark }}
\n\t
\n\n\t
\n\t\tPrepared By
\n\t
\n\t\tAuthorised Signatory
\n\t
\n\t\tReceived Payment as Above
\n\t
\n\t\t_____________
\n\t
\n\t\tA/C Payee
\n\t
\n\t\t_____________
\n\t
\n\t\t{{ frappe.utils.formatdate(doc.cheque_date) }}
\n\t
\n\t\t{{ doc.pay_to_recd_from }}
\n\t
\n\t\t{{ doc.total_amount_in_words }}
\n\t
\n\t\t{{ doc.total_amount }}
\n
", + "modified": "2014-08-27 14:49:40.088410", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Credit Note", + "owner": "Administrator", + "print_format_type": "Server", + "standard": "Yes" +} \ No newline at end of file From 7a435bb4f18a629f7c95973bda4b3675efc5b54d Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Wed, 27 Aug 2014 18:10:23 +0530 Subject: [PATCH 2/4] [print-template] Credit Note Issue #31 1 --- .../print_format/credit_note/credit_note.json | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/print_format/credit_note/credit_note.json b/erpnext/accounts/print_format/credit_note/credit_note.json index 0b231a3d2a0..bbb04635f21 100644 --- a/erpnext/accounts/print_format/credit_note/credit_note.json +++ b/erpnext/accounts/print_format/credit_note/credit_note.json @@ -4,7 +4,43 @@ "doc_type": "Journal Voucher", "docstatus": 0, "doctype": "Print Format", - "html": "
\n\n\t{% if letter_head and not no_letterhead %}{{ letter_head }}{%- endif -%}\n\t

{{ _(\"Credit Note\") }}

\n
\n\t
\n\t
\n\t
{{ doc.pay_to_recd_from }}
\n\t
\n\t
\n\t
\n\t
{{ doc.name }}
\n\t
\n\t
\n\t
\n\t
{{ frappe.utils.formatdate(doc.voucher_date) }}
\n\t
\n\t
\n\t
\n\t
{{ doc.cheque_no }}
\n\t
\n\t
\n\t
\n\t
{{ frappe.utils.formatdate(doc.cheque_date) }}
\n\t
\n\t
\n\t
\n\t
{{ frappe.utils.formatdate(doc.voucher_date) }}
\n\t
\n\t
\n\t

{{ _(\"This amount is in full / part settlement of the listed bills\") }}:

\n\t
\n\t
\n\t
\n\t
{{ \n\t \tfrappe.format_value(doc.total_amount, doc.meta.get_field(\"total_amount\"), doc) }}
\n\t
\n\t
\n\t
\n\t
{{ doc.remark }}
\n\t
\n\n\t
\n\t\tPrepared By
\n\t
\n\t\tAuthorised Signatory
\n\t
\n\t\tReceived Payment as Above
\n\t
\n\t\t_____________
\n\t
\n\t\tA/C Payee
\n\t
\n\t\t_____________
\n\t
\n\t\t{{ frappe.utils.formatdate(doc.cheque_date) }}
\n\t
\n\t\t{{ doc.pay_to_recd_from }}
\n\t
\n\t\t{{ doc.total_amount_in_words }}
\n\t
\n\t\t{{ doc.total_amount }}
\n
", + "html": "

{{ doc.select_print_heading or _("Credit Note") }}

+
+
+
+
{{ doc.name }}
+
+
+
+
{{ frappe.utils.formatdate(doc.voucher_date) }}
+
+
+
+
{{ _("Credit Note ") }}
+
+
+
+
{{ doc.pay_to_recd_from }}
+
+
+ +
+
+
+
+
+
+
+
{{ doc.remark }}
+
+
+
+

+{{ _("For") }} {{ doc.company }},
+
+
+
+{{ _("Authorized Signatory") }}

", "modified": "2014-08-27 14:49:40.088410", "modified_by": "Administrator", "module": "Accounts", From 9f0ea97d8540e640e47d13054748a367d5f74d31 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 27 Aug 2014 22:09:03 +0530 Subject: [PATCH 3/4] [fix] get future vouchers query [print-template] Credit Note Issue #31 2 --- .../print_format/credit_note/credit_note.json | 46 +++---------------- 1 file changed, 7 insertions(+), 39 deletions(-) diff --git a/erpnext/accounts/print_format/credit_note/credit_note.json b/erpnext/accounts/print_format/credit_note/credit_note.json index bbb04635f21..4b32cc8f5c0 100644 --- a/erpnext/accounts/print_format/credit_note/credit_note.json +++ b/erpnext/accounts/print_format/credit_note/credit_note.json @@ -1,51 +1,19 @@ { - "creation": "2014-08-27 14:39:00.593377", + "creation": "2014-08-28 11:11:39.796473", "disabled": 0, "doc_type": "Journal Voucher", "docstatus": 0, "doctype": "Print Format", - "html": "

{{ doc.select_print_heading or _("Credit Note") }}

-
-
-
-
{{ doc.name }}
-
-
-
-
{{ frappe.utils.formatdate(doc.voucher_date) }}
-
-
-
-
{{ _("Credit Note ") }}
-
-
-
-
{{ doc.pay_to_recd_from }}
-
-
- -
-
-
-
-
-
-
-
{{ doc.remark }}
-
-
-
-

-{{ _("For") }} {{ doc.company }},
-
-
-
-{{ _("Authorized Signatory") }}

", - "modified": "2014-08-27 14:49:40.088410", + "html": "

{{ doc.select_print_heading or _(\"Credit Note\") }}

\n
\n
\n
\n
{{ doc.name }}
\n
\n
\n
\n
{{ frappe.utils.formatdate(doc.voucher_date) }}
\n
\n
\n
\n
{{ _(\"Credit Note \") }}
\n
\n
\n
\n
{{ doc.pay_to_recd_from }}
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
{{ doc.remark }}
\n
\n
\n
\n

\n{{ _(\"For\") }} {{ doc.company }},
\n
\n
\n
\n{{ _(\"Authorized Signatory\") }}

\n", + "idx": 2, + "modified": "2014-08-28 11:15:38.677618", "modified_by": "Administrator", "module": "Accounts", "name": "Credit Note", "owner": "Administrator", + "parent": "Journal Voucher", + "parentfield": "__print_formats", + "parenttype": "DocType", "print_format_type": "Server", "standard": "Yes" } \ No newline at end of file From 4e16e9ed897fd1b39317314d48ba7485e69fcf92 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Fri, 29 Aug 2014 13:20:58 +0530 Subject: [PATCH 4/4] Refactored Credit Note Print Format --- erpnext/accounts/doctype/journal_voucher/journal_voucher.py | 2 +- erpnext/accounts/print_format/credit_note/credit_note.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py index cb2ebace26e..03bedc708d9 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py @@ -203,7 +203,7 @@ class JournalVoucher(AccountsController): 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 4b32cc8f5c0..31507b480d3 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": "

{{ doc.select_print_heading or _(\"Credit Note\") }}

\n
\n
\n
\n
{{ doc.name }}
\n
\n
\n
\n
{{ frappe.utils.formatdate(doc.voucher_date) }}
\n
\n
\n
\n
{{ _(\"Credit Note \") }}
\n
\n
\n
\n
{{ doc.pay_to_recd_from }}
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
{{ doc.remark }}
\n
\n
\n
\n

\n{{ _(\"For\") }} {{ doc.company }},
\n
\n
\n
\n{{ _(\"Authorized Signatory\") }}

\n", + "html": "{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n\n
\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\"), \"\" + doc.total_amount + \"
\" + (doc.total_amount_in_words or \"\") + \"
\"),\n (_(\"Remarks\"), doc.remark)\n ) -%}\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\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",