From 4ce020f5214b2a026da8cf25b9c4c1c528dfe01c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 3 Feb 2015 14:31:11 +0530 Subject: [PATCH 1/2] Item grid header in print format --- .../print_formats/includes/item_grid.html | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/erpnext/templates/print_formats/includes/item_grid.html b/erpnext/templates/print_formats/includes/item_grid.html index 7e1d1a62cf..0c912ca811 100644 --- a/erpnext/templates/print_formats/includes/item_grid.html +++ b/erpnext/templates/print_formats/includes/item_grid.html @@ -6,17 +6,19 @@ - - - - - {% if not hide_rate -%} - - {%- endif %} - {% if not hide_amount -%} - - {%- endif %} - + {% if data|length -%} + + + + + {% if not hide_rate -%} + + {%- endif %} + {% if not hide_amount -%} + + {%- endif %} + + {%- endif %} {%- for row in data -%} From 0c883500bb0ade2de2f71153de3aebd707940aa8 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 3 Feb 2015 17:58:46 +0530 Subject: [PATCH 2/2] Expense account query in purchase invoice --- erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 6c7e87f048..c9a4ff090b 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -405,7 +405,7 @@ def get_expense_account(doctype, txt, searchfield, start, page_len, filters): # Hence the first condition is an "OR" return frappe.db.sql("""select tabAccount.name from `tabAccount` where (tabAccount.report_type = "Profit and Loss" - or tabAccount.account_type = "Expense Account") + or tabAccount.account_type in ("Expense Account", "Fixed Asset")) and tabAccount.group_or_ledger="Ledger" and tabAccount.docstatus!=2 and ifnull(tabAccount.master_type, "")=""
{{ _("Sr") }}{{ _("Item") }}{{ _(data[0].meta.get_label("qty")) }}{{ _(data[0].meta.get_label("rate")) }}{{ _(data[0].meta.get_label("amount")) }}
{{ _("Sr") }}{{ _("Item") }}{{ _(data[0].meta.get_label("qty")) }}{{ _(data[0].meta.get_label("rate")) }}{{ _(data[0].meta.get_label("amount")) }}
{{ row.idx }}