From 28804bfb62e338aad22ccb6b00b908966cf2319e Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 16 Jul 2014 18:18:34 +0530 Subject: [PATCH 01/12] started sales order print format (new style) --- .../doctype/sales_order/sales_order.json | 108 +++++++++--------- .../doctype/sales_order/sales_order.py | 4 + .../print_formats/includes/item_grid.html | 31 +++++ .../print_formats/includes/taxes.html | 17 +++ 4 files changed, 109 insertions(+), 51 deletions(-) create mode 100644 erpnext/templates/print_formats/includes/item_grid.html create mode 100644 erpnext/templates/print_formats/includes/taxes.html diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json index bb5211312cb..6cc7b83c3d0 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.json +++ b/erpnext/selling/doctype/sales_order/sales_order.json @@ -223,7 +223,8 @@ "fieldtype": "Section Break", "label": "Currency and Price List", "options": "icon-tag", - "permlevel": 0 + "permlevel": 0, + "print_hide": 1 }, { "fieldname": "currency", @@ -341,6 +342,16 @@ "fieldtype": "Section Break", "permlevel": 0 }, + { + "fieldname": "column_break_33a", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "column_break_33", + "fieldtype": "Column Break", + "permlevel": 0 + }, { "fieldname": "net_total_export", "fieldtype": "Currency", @@ -349,11 +360,6 @@ "permlevel": 0, "read_only": 1 }, - { - "fieldname": "column_break_33", - "fieldtype": "Column Break", - "permlevel": 0 - }, { "fieldname": "net_total", "fieldtype": "Currency", @@ -469,50 +475,6 @@ "permlevel": 0, "print_hide": 1 }, - { - "fieldname": "grand_total_export", - "fieldtype": "Currency", - "label": "Grand Total", - "oldfieldname": "grand_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1, - "reqd": 0, - "width": "150px" - }, - { - "fieldname": "rounded_total_export", - "fieldtype": "Currency", - "label": "Rounded Total", - "oldfieldname": "rounded_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1, - "width": "150px" - }, - { - "fieldname": "in_words_export", - "fieldtype": "Data", - "label": "In Words", - "oldfieldname": "in_words_export", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "read_only": 1, - "width": "200px" - }, - { - "fieldname": "column_break3", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 1, - "width": "50%" - }, { "fieldname": "grand_total", "fieldtype": "Currency", @@ -550,6 +512,50 @@ "read_only": 1, "width": "200px" }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "width": "50%" + }, + { + "fieldname": "grand_total_export", + "fieldtype": "Currency", + "label": "Grand Total", + "oldfieldname": "grand_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "reqd": 0, + "width": "150px" + }, + { + "fieldname": "rounded_total_export", + "fieldtype": "Currency", + "label": "Rounded Total", + "oldfieldname": "rounded_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "in_words_export", + "fieldtype": "Data", + "label": "In Words", + "oldfieldname": "in_words_export", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "width": "200px" + }, { "fieldname": "terms_section_break", "fieldtype": "Section Break", @@ -883,7 +889,7 @@ "idx": 1, "is_submittable": 1, "issingle": 0, - "modified": "2014-07-10 02:43:45.504009", + "modified": "2014-07-16 16:32:16.459587", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order", diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index e0a7a1d62dd..9a264049621 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -18,6 +18,10 @@ class SalesOrder(SellingController): person_tname = 'Target Detail' partner_tname = 'Partner Target Detail' territory_tname = 'Territory Target Detail' + table_print_templates = { + "sales_order_details": "templates/print_formats/includes/item_grid.html", + "other_charges": "templates/print_formats/includes/taxes.html", + } def validate_mandatory(self): # validate transaction date v/s delivery date diff --git a/erpnext/templates/print_formats/includes/item_grid.html b/erpnext/templates/print_formats/includes/item_grid.html new file mode 100644 index 00000000000..2ca4289b553 --- /dev/null +++ b/erpnext/templates/print_formats/includes/item_grid.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + {%- for row in data -%} + + + + + + + + + + {%- endfor -%} + +
SrItem NameDescriptionQtyUoMBasic RateAmount
{{ row.idx }} + {{ row.item_name }} + {% if row.item_code != row.item_name -%} +
Item Code: {{ row.item_code}} + {%- endif %} +
+
{{ row.description }}
{{ row.qty }}{{ row.stock_uom }}{{ + format(row.rate, table_meta.get_field("rate"), doc) }}{{ format(row.amount, table_meta.get_field("amount"), doc) }}
diff --git a/erpnext/templates/print_formats/includes/taxes.html b/erpnext/templates/print_formats/includes/taxes.html new file mode 100644 index 00000000000..e23b49cb9b7 --- /dev/null +++ b/erpnext/templates/print_formats/includes/taxes.html @@ -0,0 +1,17 @@ +
+
+
+ {%- for charge in data -%} + {%- if not charge.included_in_print_rate -%} +
+
+
+
+ {{ format(charge.tax_amount / doc.conversion_rate, + table_meta.get_field("tax_amount"), doc) }} +
+
+ {%- endif -%} + {%- endfor -%} +
+
From f84c240d1cff6636a795e2743d86f6f70fd526de Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 18 Jul 2014 16:39:31 +0530 Subject: [PATCH 02/12] cleanup for print format --- erpnext/controllers/selling_controller.py | 6 +++ .../doctype/sales_order/sales_order.py | 4 -- .../material_request_item.json | 39 ++++++++++--------- .../print_formats/includes/item_grid.html | 10 ++--- erpnext/utilities/doctype/note/note.py | 4 ++ test_sites/test_site/site_config.json | 3 +- 6 files changed, 37 insertions(+), 29 deletions(-) diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 1049350c260..6bbdfadd3d3 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -10,6 +10,12 @@ from frappe import _, throw from erpnext.controllers.stock_controller import StockController class SellingController(StockController): + def __setup__(self): + self.table_print_templates = { + self.fname: "templates/print_formats/includes/item_grid.html", + "other_charges": "templates/print_formats/includes/taxes.html", + } + def validate(self): super(SellingController, self).validate() self.validate_max_discount() diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 9a264049621..e0a7a1d62dd 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -18,10 +18,6 @@ class SalesOrder(SellingController): person_tname = 'Target Detail' partner_tname = 'Partner Target Detail' territory_tname = 'Territory Target Detail' - table_print_templates = { - "sales_order_details": "templates/print_formats/includes/item_grid.html", - "other_charges": "templates/print_formats/includes/taxes.html", - } def validate_mandatory(self): # validate transaction date v/s delivery date diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.json b/erpnext/stock/doctype/material_request_item/material_request_item.json index bff669f5f7a..61b03f87190 100644 --- a/erpnext/stock/doctype/material_request_item/material_request_item.json +++ b/erpnext/stock/doctype/material_request_item/material_request_item.json @@ -1,6 +1,6 @@ { "autoname": "MREQD-.#####", - "creation": "2013-02-22 01:28:02.000000", + "creation": "2013-02-22 01:28:02", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -28,6 +28,7 @@ "oldfieldname": "item_name", "oldfieldtype": "Data", "permlevel": 0, + "print_hide": 1, "print_width": "100px", "reqd": 0, "search_index": 1, @@ -70,6 +71,21 @@ "reqd": 1, "width": "80px" }, + { + "fieldname": "uom", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Stock UOM", + "no_copy": 0, + "oldfieldname": "uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "print_width": "70px", + "read_only": 1, + "reqd": 1, + "width": "70px" + }, { "fieldname": "warehouse", "fieldtype": "Link", @@ -89,21 +105,6 @@ "fieldtype": "Column Break", "permlevel": 0 }, - { - "fieldname": "uom", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Stock UOM", - "no_copy": 0, - "oldfieldname": "uom", - "oldfieldtype": "Link", - "options": "UOM", - "permlevel": 0, - "print_width": "70px", - "read_only": 1, - "reqd": 1, - "width": "70px" - }, { "allow_on_submit": 0, "fieldname": "schedule_date", @@ -216,6 +217,7 @@ "oldfieldname": "ordered_qty", "oldfieldtype": "Currency", "permlevel": 0, + "print_hide": 1, "read_only": 1 }, { @@ -232,9 +234,10 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-03 11:35:26.000000", + "modified": "2014-07-18 01:04:18.470761", "modified_by": "Administrator", "module": "Stock", "name": "Material Request Item", - "owner": "Administrator" + "owner": "Administrator", + "permissions": [] } \ No newline at end of file diff --git a/erpnext/templates/print_formats/includes/item_grid.html b/erpnext/templates/print_formats/includes/item_grid.html index 2ca4289b553..a166ced57ab 100644 --- a/erpnext/templates/print_formats/includes/item_grid.html +++ b/erpnext/templates/print_formats/includes/item_grid.html @@ -4,10 +4,9 @@ Sr Item Name Description - Qty - UoM - Basic Rate - Amount + Qty + Rate + Amount {%- for row in data -%} @@ -20,8 +19,7 @@
{{ row.description }}
- {{ row.qty }} - {{ row.stock_uom }} + {{ row.qty }} {{ row.stock_uom }} {{ format(row.rate, table_meta.get_field("rate"), doc) }} {{ format(row.amount, table_meta.get_field("amount"), doc) }} diff --git a/erpnext/utilities/doctype/note/note.py b/erpnext/utilities/doctype/note/note.py index b54681587de..2db4137ddda 100644 --- a/erpnext/utilities/doctype/note/note.py +++ b/erpnext/utilities/doctype/note/note.py @@ -14,6 +14,10 @@ class Note(Document): import re self.name = re.sub("[%'\"#*?`]", "", self.title.strip()) + def before_print(self): + self.print_heading = self.name + self.sub_heading = "" + def get_permission_query_conditions(user): if not user: user = frappe.session.user diff --git a/test_sites/test_site/site_config.json b/test_sites/test_site/site_config.json index 05bf5627669..c77200c3319 100644 --- a/test_sites/test_site/site_config.json +++ b/test_sites/test_site/site_config.json @@ -1,5 +1,6 @@ { "db_name": "test_frappe", "db_password": "test_frappe", - "mute_emails": 1 + "mute_emails": 1, + "developer_mode": 1 } From d82352eacc9c7c3aa16664e79f35a8708e64019b Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 21 Jul 2014 12:02:37 +0530 Subject: [PATCH 03/12] item grid, added other printable fields in description --- .../print_formats/includes/item_grid.html | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/erpnext/templates/print_formats/includes/item_grid.html b/erpnext/templates/print_formats/includes/item_grid.html index a166ced57ab..f9d3c1f5e8f 100644 --- a/erpnext/templates/print_formats/includes/item_grid.html +++ b/erpnext/templates/print_formats/includes/item_grid.html @@ -1,3 +1,7 @@ +{%- from "templates/print_formats/standard_macros.html" import print_value -%} +{%- set std_fields = ("item_code", "item_name", "description", "qty", "rate", "amount", "stock_uom") -%} +{%- set visible_columns = get_visible_columns(doc.get(df.fieldname), table_meta) -%} + @@ -18,11 +22,21 @@ {%- endif %} +
{{ row.description }} + {%- for field in visible_columns -%} + {%- if (field.fieldname not in std_fields) and + (row[field.fieldname] not in (None, "")) -%} +
{{ field.label }}: + {{ frappe.format_value(row[field.fieldname], field, doc) }}

+ {%- endif -%} + {%- endfor -%}
- + frappe.format_value(row.rate, + table_meta.get_field("rate"), doc) }} + {%- endfor -%} From 5b51cc86a960cb5fe307a15546bac51b894e1860 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 21 Jul 2014 18:25:45 +0530 Subject: [PATCH 04/12] many fixes to print --- .../purchase_invoice/purchase_invoice.json | 163 ++++++++--------- .../doctype/sales_invoice/sales_invoice.json | 158 ++++++++--------- .../doctype/sales_invoice/sales_invoice.py | 12 +- .../__init__.py | 0 .../cheque_printing_format.json | 4 +- .../payment_receipt_voucher/__init__.py | 0 .../payment_receipt_voucher.json | 5 +- .../sales_invoice/sales_invoice.html | 135 -------------- .../sales_invoice/sales_invoice.json | 14 -- .../sales_invoice_classic.json | 15 -- .../sales_invoice_modern.json | 15 -- .../sales_invoice_spartan.json | 15 -- .../purchase_order/purchase_order.json | 164 +++++++++--------- .../supplier_quotation.json | 36 ++-- .../purchase_order_classic.json | 15 -- .../purchase_order_modern.json | 15 -- .../purchase_order_spartan.json | 15 -- erpnext/controllers/buying_controller.py | 9 +- erpnext/controllers/selling_controller.py | 9 +- .../hr/doctype/salary_slip/salary_slip.json | 51 +++--- erpnext/hr/doctype/salary_slip/salary_slip.py | 107 +----------- .../salary_slip_deduction.json | 15 +- .../salary_slip_earning.json | 15 +- .../selling/doctype/quotation/quotation.json | 126 +++++++------- .../quotation_classic/quotation_classic.json | 15 -- .../quotation_modern/quotation_modern.json | 15 -- .../quotation_spartan/quotation_spartan.json | 15 -- .../sales_order_classic.json | 15 -- .../sales_order_modern.json | 15 -- .../sales_order_spartan.json | 15 -- .../doctype/delivery_note/delivery_note.json | 12 +- .../purchase_receipt/purchase_receipt.json | 132 +++++++------- .../stock/page/stock_balance/stock_balance.js | 4 +- .../delivery_note_classic.json | 15 -- .../delivery_note_modern.json | 15 -- .../delivery_note_spartan.json | 15 -- .../print_formats/includes/item_grid.html | 4 +- .../print_formats/includes/taxes.html | 4 +- 38 files changed, 480 insertions(+), 924 deletions(-) rename erpnext/accounts/print_format/{sales_invoice => cheque_printing_format}/__init__.py (100%) create mode 100644 erpnext/accounts/print_format/payment_receipt_voucher/__init__.py delete mode 100644 erpnext/accounts/print_format/sales_invoice/sales_invoice.html delete mode 100644 erpnext/accounts/print_format/sales_invoice/sales_invoice.json delete mode 100644 erpnext/accounts/print_format/sales_invoice_classic/sales_invoice_classic.json delete mode 100644 erpnext/accounts/print_format/sales_invoice_modern/sales_invoice_modern.json delete mode 100644 erpnext/accounts/print_format/sales_invoice_spartan/sales_invoice_spartan.json delete mode 100644 erpnext/buying/print_format/purchase_order_classic/purchase_order_classic.json delete mode 100644 erpnext/buying/print_format/purchase_order_modern/purchase_order_modern.json delete mode 100644 erpnext/buying/print_format/purchase_order_spartan/purchase_order_spartan.json delete mode 100644 erpnext/selling/print_format/quotation_classic/quotation_classic.json delete mode 100644 erpnext/selling/print_format/quotation_modern/quotation_modern.json delete mode 100644 erpnext/selling/print_format/quotation_spartan/quotation_spartan.json delete mode 100644 erpnext/selling/print_format/sales_order_classic/sales_order_classic.json delete mode 100644 erpnext/selling/print_format/sales_order_modern/sales_order_modern.json delete mode 100644 erpnext/selling/print_format/sales_order_spartan/sales_order_spartan.json delete mode 100644 erpnext/stock/print_format/delivery_note_classic/delivery_note_classic.json delete mode 100644 erpnext/stock/print_format/delivery_note_modern/delivery_note_modern.json delete mode 100644 erpnext/stock/print_format/delivery_note_spartan/delivery_note_spartan.json diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index 8eb3b0907e2..1de3aa601d2 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -264,22 +264,6 @@ "fieldtype": "Section Break", "permlevel": 0 }, - { - "fieldname": "net_total_import", - "fieldtype": "Currency", - "label": "Net Total", - "oldfieldname": "net_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1 - }, - { - "fieldname": "column_break_28", - "fieldtype": "Column Break", - "permlevel": 0 - }, { "description": "Will be calculated automatically when you enter the details", "fieldname": "net_total", @@ -292,6 +276,22 @@ "print_hide": 1, "read_only": 1 }, + { + "fieldname": "column_break_28", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "net_total_import", + "fieldtype": "Currency", + "label": "Net Total", + "oldfieldname": "net_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, { "fieldname": "taxes", "fieldtype": "Section Break", @@ -340,6 +340,59 @@ "permlevel": 0, "read_only": 0 }, + { + "fieldname": "other_charges_added", + "fieldtype": "Currency", + "label": "Taxes and Charges Added (Company Currency)", + "oldfieldname": "other_charges_added", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "other_charges_deducted", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted (Company Currency)", + "oldfieldname": "other_charges_deducted", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "grand_total", + "fieldtype": "Currency", + "label": "Grand Total (Company Currency)", + "oldfieldname": "grand_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "description": "In Words will be visible once you save the Purchase Invoice.", + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break8", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "50%" + }, { "fieldname": "other_charges_added_import", "fieldtype": "Currency", @@ -409,6 +462,17 @@ "print_hide": 1, "read_only": 1 }, + { + "fieldname": "total_tax", + "fieldtype": "Currency", + "label": "Total Tax (Company Currency)", + "oldfieldname": "total_tax", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, { "fieldname": "outstanding_amount", "fieldtype": "Currency", @@ -424,70 +488,6 @@ "read_only": 1, "search_index": 1 }, - { - "fieldname": "column_break8", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "width": "50%" - }, - { - "fieldname": "total_tax", - "fieldtype": "Currency", - "label": "Total Tax (Company Currency)", - "oldfieldname": "total_tax", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "other_charges_added", - "fieldtype": "Currency", - "label": "Taxes and Charges Added (Company Currency)", - "oldfieldname": "other_charges_added", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "other_charges_deducted", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted (Company Currency)", - "oldfieldname": "other_charges_deducted", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "grand_total", - "fieldtype": "Currency", - "label": "Grand Total (Company Currency)", - "oldfieldname": "grand_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "description": "In Words will be visible once you save the Purchase Invoice.", - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "oldfieldname": "in_words", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, { "fieldname": "write_off_amount", "fieldtype": "Currency", @@ -601,6 +601,7 @@ "label": "Supplier Address", "options": "Address", "permlevel": 0, + "print_hide": 1, "read_only": 0 }, { @@ -752,7 +753,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-06-19 15:50:50.898237", + "modified": "2014-07-21 05:33:36.332474", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index a07b69d09f0..4c3d8a34e98 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -311,20 +311,6 @@ "fieldtype": "Section Break", "permlevel": 0 }, - { - "fieldname": "net_total_export", - "fieldtype": "Currency", - "label": "Net Total", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1 - }, - { - "fieldname": "column_break_32", - "fieldtype": "Column Break", - "permlevel": 0 - }, { "fieldname": "net_total", "fieldtype": "Currency", @@ -337,6 +323,20 @@ "read_only": 1, "reqd": 1 }, + { + "fieldname": "column_break_32", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "net_total_export", + "fieldtype": "Currency", + "label": "Net Total", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, { "fieldname": "taxes", "fieldtype": "Section Break", @@ -445,70 +445,6 @@ "print_hide": 1, "read_only": 0 }, - { - "fieldname": "grand_total_export", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Grand Total", - "oldfieldname": "grand_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1, - "reqd": 1 - }, - { - "fieldname": "rounded_total_export", - "fieldtype": "Currency", - "label": "Rounded Total", - "oldfieldname": "rounded_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1 - }, - { - "fieldname": "in_words_export", - "fieldtype": "Data", - "label": "In Words", - "oldfieldname": "in_words_export", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "read_only": 1 - }, - { - "fieldname": "gross_profit", - "fieldtype": "Currency", - "label": "Gross Profit", - "oldfieldname": "gross_profit", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "gross_profit_percent", - "fieldtype": "Float", - "label": "Gross Profit (%)", - "oldfieldname": "gross_profit_percent", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "column_break5", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "width": "50%" - }, { "fieldname": "grand_total", "fieldtype": "Currency", @@ -569,6 +505,70 @@ "print_hide": 1, "read_only": 1 }, + { + "fieldname": "column_break5", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "grand_total_export", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Grand Total", + "oldfieldname": "grand_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "rounded_total_export", + "fieldtype": "Currency", + "label": "Rounded Total", + "oldfieldname": "rounded_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "in_words_export", + "fieldtype": "Data", + "label": "In Words", + "oldfieldname": "in_words_export", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "gross_profit", + "fieldtype": "Currency", + "label": "Gross Profit", + "oldfieldname": "gross_profit", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "gross_profit_percent", + "fieldtype": "Float", + "label": "Gross Profit (%)", + "oldfieldname": "gross_profit_percent", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, { "fieldname": "advances", "fieldtype": "Section Break", @@ -1188,7 +1188,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-06-19 16:01:19.720382", + "modified": "2014-07-21 05:31:24.670731", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 0f6737cc87e..671bb54f826 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -342,7 +342,7 @@ class SalesInvoice(SellingController): def validate_pos(self): if not self.cash_bank_account and flt(self.paid_amount): frappe.throw(_("Cash or Bank Account is mandatory for making payment entry")) - + if flt(self.paid_amount) + flt(self.write_off_amount) \ - flt(self.grand_total) > 1/(10**(self.precision("grand_total") + 1)): frappe.throw(_("""Paid amount + Write Off Amount can not be greater than Grand Total""")) @@ -434,7 +434,7 @@ class SalesInvoice(SellingController): where docstatus = 1 and name = %s""", d.sales_order) if not submitted: frappe.throw(_("Sales Order {0} is not submitted").format(d.sales_order)) - + if d.delivery_note: submitted = frappe.db.sql("""select name from `tabDelivery Note` where docstatus = 1 and name = %s""", d.delivery_note) @@ -721,11 +721,13 @@ def make_new_invoice(ref_wrapper, posting_date): def send_notification(new_rv): """Notify concerned persons about recurring invoice generation""" - - from frappe.core.doctype.print_format.print_format import get_html frappe.sendmail(new_rv.notification_email_address, subject="New Invoice : " + new_rv.name, - message = get_html(new_rv, new_rv, "Sales Invoice")) + message = _("Please find attached Sales Invoice #{0}").format(new_rw.name), + attachments = { + "fname": new_rv.name + ".pdf", + "fcontent": frappe.get_print_format(new_rv.doctype, new_rv.name, as_pdf=True) + }) def notify_errors(inv, customer, owner): from frappe.utils.user import get_system_managers diff --git a/erpnext/accounts/print_format/sales_invoice/__init__.py b/erpnext/accounts/print_format/cheque_printing_format/__init__.py similarity index 100% rename from erpnext/accounts/print_format/sales_invoice/__init__.py rename to erpnext/accounts/print_format/cheque_printing_format/__init__.py diff --git a/erpnext/accounts/print_format/cheque_printing_format/cheque_printing_format.json b/erpnext/accounts/print_format/cheque_printing_format/cheque_printing_format.json index 7aec5060ea9..4bafe8530a9 100755 --- a/erpnext/accounts/print_format/cheque_printing_format/cheque_printing_format.json +++ b/erpnext/accounts/print_format/cheque_printing_format/cheque_printing_format.json @@ -3,9 +3,9 @@ "doc_type": "Journal Voucher", "docstatus": 0, "doctype": "Print Format", - "html": "\n
\n



\n
\nPAYMENT ADVICE

\n
-
{{ row.description }}
{{ row.qty }} {{ row.stock_uom }} {{ - format(row.rate, table_meta.get_field("rate"), doc) }}{{ format(row.amount, table_meta.get_field("amount"), doc) }}{{ + frappe.format_value(row.amount, + table_meta.get_field("amount"), doc) }}
\n\n\n\n\n\n\n
To :
\n\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Voucher No :\n\n
Voucher Date :\n\n
Cheque No :\n\n
Cheque Date :\n\n
\n
\n
We are pleased to enclose our cheque in full/part Settlement of your under noted bills
\n
\n\n\n\n\n\n\n\n\n\n\n\n
 Total :\n\n
Narration :\n\n


\n
Prepared By
\n
Authorised Signatory
\n
Received Payment as Above
\n
_____________
\n
A/c Payee
\n
_____________
\n
\n\n
\n
\n\n
\n
\n\n
\n
\n\n
\n", + "html": "
\n\n\t{% if letter_head and not no_letterhead %}{{ letter_head }}{%- endif -%}\n\t

{{ _(\"Payment Advice\") }}

\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
", "idx": 1, - "modified": "2014-05-13 16:07:18.792349", + "modified": "2014-07-21 08:53:57.749885", "modified_by": "Administrator", "module": "Accounts", "name": "Cheque Printing Format", diff --git a/erpnext/accounts/print_format/payment_receipt_voucher/__init__.py b/erpnext/accounts/print_format/payment_receipt_voucher/__init__.py new file mode 100644 index 00000000000..e69de29bb2d 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 0a26c085edb..9a9398df8d7 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 @@ -3,12 +3,13 @@ "doc_type": "Journal Voucher", "docstatus": 0, "doctype": "Print Format", - "html": "

\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n
Receipt No.:
Date :
Remark:
Received From:
\n
\n\n

\n

\n
\n\n\n\n\n

For ,


(Authorised Signatory)
", + "html": "

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

\n
\n
\n
\n
{{ doc.name }}
\n
\n
\n
\n
{{ frappe.utils.formatdate(doc.voucher_date) }}
\n
\n
\n
\n
{{ doc.remark }}
\n
\n
\n
\n
{{ doc.pay_to_recd_from }}
\n
\n
\n
\n
{{ doc.total_amount }}
{{ doc.total_amount_in_words }}
\n
\n
\n

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

", "idx": 1, - "modified": "2014-05-13 16:07:19.144006", + "modified": "2014-07-21 08:53:17.393966", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Receipt Voucher", "owner": "Administrator", + "print_format_type": "Server", "standard": "Yes" } \ No newline at end of file diff --git a/erpnext/accounts/print_format/sales_invoice/sales_invoice.html b/erpnext/accounts/print_format/sales_invoice/sales_invoice.html deleted file mode 100644 index 8dc39f94828..00000000000 --- a/erpnext/accounts/print_format/sales_invoice/sales_invoice.html +++ /dev/null @@ -1,135 +0,0 @@ -{%- if doc.letter_head -%} - {{ frappe.db.get_value("Letter Head", doc.letter_head, "content") }} -{%- endif -%} - - -
- - - - - - - - - - - - - {%- for row in doc.get({"doctype":"Sales Invoice Item"}) %} - - - - - - - - - - {% endfor -%} - -
SrItem NameDescriptionQtyUoMBasic RateAmount
{{ row.idx }}{{ row.item_name }}{{ row.description }}{{ row.qty }}{{ row.stock_uom }}{{ utils.fmt_money(row.rate, currency=doc.currency) }}{{ utils.fmt_money(row.amount, currency=doc.currency) }}
-
- diff --git a/erpnext/accounts/print_format/sales_invoice/sales_invoice.json b/erpnext/accounts/print_format/sales_invoice/sales_invoice.json deleted file mode 100644 index 37baa1ce46c..00000000000 --- a/erpnext/accounts/print_format/sales_invoice/sales_invoice.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "creation": "2013-03-21 15:24:28", - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Print Format", - "idx": 1, - "modified": "2014-05-13 17:51:43.245831", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Sales Invoice", - "owner": "Administrator", - "print_format_type": "Server", - "standard": "Yes" -} diff --git a/erpnext/accounts/print_format/sales_invoice_classic/sales_invoice_classic.json b/erpnext/accounts/print_format/sales_invoice_classic/sales_invoice_classic.json deleted file mode 100644 index 7297a768e96..00000000000 --- a/erpnext/accounts/print_format/sales_invoice_classic/sales_invoice_classic.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "creation": "2013-04-19 13:30:27", - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "idx": 1, - "modified": "2014-05-13 16:07:19.241986", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Sales Invoice Classic", - "owner": "Administrator", - "print_format_type": "Client", - "standard": "Yes" -} \ No newline at end of file diff --git a/erpnext/accounts/print_format/sales_invoice_modern/sales_invoice_modern.json b/erpnext/accounts/print_format/sales_invoice_modern/sales_invoice_modern.json deleted file mode 100644 index c1c6a62f79b..00000000000 --- a/erpnext/accounts/print_format/sales_invoice_modern/sales_invoice_modern.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "creation": "2013-04-19 13:30:27", - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "idx": 1, - "modified": "2014-05-13 16:07:19.249479", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Sales Invoice Modern", - "owner": "Administrator", - "print_format_type": "Client", - "standard": "Yes" -} \ No newline at end of file diff --git a/erpnext/accounts/print_format/sales_invoice_spartan/sales_invoice_spartan.json b/erpnext/accounts/print_format/sales_invoice_spartan/sales_invoice_spartan.json deleted file mode 100644 index 7d90d7295c5..00000000000 --- a/erpnext/accounts/print_format/sales_invoice_spartan/sales_invoice_spartan.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "creation": "2013-04-19 13:30:27", - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "idx": 1, - "modified": "2014-05-13 16:07:19.275094", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Sales Invoice Spartan", - "owner": "Administrator", - "print_format_type": "Client", - "standard": "Yes" -} \ No newline at end of file diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 14693c434fc..61646d1af48 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -230,6 +230,24 @@ "fieldtype": "Section Break", "permlevel": 0 }, + { + "fieldname": "net_total", + "fieldtype": "Currency", + "label": "Net Total (Company Currency)", + "no_copy": 1, + "oldfieldname": "net_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 0 + }, + { + "fieldname": "column_break_26", + "fieldtype": "Column Break", + "permlevel": 0 + }, { "fieldname": "net_total_import", "fieldtype": "Currency", @@ -250,24 +268,6 @@ "permlevel": 0, "print_hide": 0 }, - { - "fieldname": "column_break_26", - "fieldtype": "Column Break", - "permlevel": 0 - }, - { - "fieldname": "net_total", - "fieldtype": "Currency", - "label": "Net Total (Company Currency)", - "no_copy": 1, - "oldfieldname": "net_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "reqd": 0 - }, { "fieldname": "taxes", "fieldtype": "Section Break", @@ -316,63 +316,6 @@ "options": "icon-money", "permlevel": 0 }, - { - "fieldname": "other_charges_added_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Added", - "no_copy": 0, - "oldfieldname": "other_charges_added_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0 - }, - { - "fieldname": "other_charges_deducted_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted", - "no_copy": 0, - "oldfieldname": "other_charges_deducted_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0 - }, - { - "fieldname": "grand_total_import", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Grand Total", - "no_copy": 0, - "oldfieldname": "grand_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1, - "report_hide": 0 - }, - { - "fieldname": "in_words_import", - "fieldtype": "Data", - "label": "In Words", - "oldfieldname": "in_words_import", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "read_only": 1 - }, - { - "fieldname": "column_break4", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 0 - }, { "fieldname": "other_charges_added", "fieldtype": "Currency", @@ -421,6 +364,17 @@ "print_hide": 1, "read_only": 1 }, + { + "description": "In Words will be visible once you save the Purchase Order.", + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, { "fieldname": "rounded_total", "fieldtype": "Currency", @@ -433,14 +387,60 @@ "read_only": 1 }, { - "description": "In Words will be visible once you save the Purchase Order.", - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "oldfieldname": "in_words", - "oldfieldtype": "Data", + "fieldname": "column_break4", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 0 + }, + { + "fieldname": "other_charges_added_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Added", + "no_copy": 0, + "oldfieldname": "other_charges_added_import", + "oldfieldtype": "Currency", + "options": "currency", "permlevel": 0, "print_hide": 1, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "other_charges_deducted_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted", + "no_copy": 0, + "oldfieldname": "other_charges_deducted_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "grand_total_import", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Grand Total", + "no_copy": 0, + "oldfieldname": "grand_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "in_words_import", + "fieldtype": "Data", + "label": "In Words", + "oldfieldname": "in_words_import", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, "read_only": 1 }, { @@ -645,7 +645,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-06-23 07:55:50.372486", + "modified": "2014-07-21 05:34:36.390448", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order", diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json index 955aa6857c8..fa0a9f38cdb 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json @@ -229,23 +229,6 @@ "fieldtype": "Section Break", "permlevel": 0 }, - { - "fieldname": "net_total_import", - "fieldtype": "Currency", - "label": "Net Total", - "no_copy": 0, - "oldfieldname": "net_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1 - }, - { - "fieldname": "column_break_24", - "fieldtype": "Column Break", - "permlevel": 0 - }, { "fieldname": "net_total", "fieldtype": "Currency", @@ -259,6 +242,23 @@ "read_only": 1, "reqd": 0 }, + { + "fieldname": "column_break_24", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "net_total_import", + "fieldtype": "Currency", + "label": "Net Total", + "no_copy": 0, + "oldfieldname": "net_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, { "fieldname": "taxes", "fieldtype": "Section Break", @@ -571,7 +571,7 @@ "icon": "icon-shopping-cart", "idx": 1, "is_submittable": 1, - "modified": "2014-06-23 07:55:52.993616", + "modified": "2014-07-21 05:30:30.367353", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation", diff --git a/erpnext/buying/print_format/purchase_order_classic/purchase_order_classic.json b/erpnext/buying/print_format/purchase_order_classic/purchase_order_classic.json deleted file mode 100644 index b5a72647cf2..00000000000 --- a/erpnext/buying/print_format/purchase_order_classic/purchase_order_classic.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "creation": "2012-04-17 11:29:12", - "doc_type": "Purchase Order", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", - "idx": 1, - "modified": "2014-05-13 16:07:19.158692", - "modified_by": "Administrator", - "module": "Buying", - "name": "Purchase Order Classic", - "owner": "Administrator", - "print_format_type": "Client", - "standard": "Yes" -} \ No newline at end of file diff --git a/erpnext/buying/print_format/purchase_order_modern/purchase_order_modern.json b/erpnext/buying/print_format/purchase_order_modern/purchase_order_modern.json deleted file mode 100644 index ee0d9d53966..00000000000 --- a/erpnext/buying/print_format/purchase_order_modern/purchase_order_modern.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "creation": "2012-04-17 11:29:12", - "doc_type": "Purchase Order", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", - "idx": 1, - "modified": "2014-05-13 16:07:19.183637", - "modified_by": "Administrator", - "module": "Buying", - "name": "Purchase Order Modern", - "owner": "Administrator", - "print_format_type": "Client", - "standard": "Yes" -} \ No newline at end of file diff --git a/erpnext/buying/print_format/purchase_order_spartan/purchase_order_spartan.json b/erpnext/buying/print_format/purchase_order_spartan/purchase_order_spartan.json deleted file mode 100644 index 851543a7205..00000000000 --- a/erpnext/buying/print_format/purchase_order_spartan/purchase_order_spartan.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "creation": "2012-04-17 11:29:12", - "doc_type": "Purchase Order", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", - "idx": 1, - "modified": "2014-05-13 16:07:19.195456", - "modified_by": "Administrator", - "module": "Buying", - "name": "Purchase Order Spartan", - "owner": "Administrator", - "print_format_type": "Client", - "standard": "Yes" -} \ No newline at end of file diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index acb00245e68..02eaa032881 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -11,6 +11,13 @@ from erpnext.accounts.party import get_party_details from erpnext.controllers.stock_controller import StockController class BuyingController(StockController): + def __setup__(self): + if hasattr(self, "fname"): + self.table_print_templates = { + self.fname: "templates/print_formats/includes/item_grid.html", + "other_charges": "templates/print_formats/includes/taxes.html", + } + def validate(self): super(BuyingController, self).validate() if getattr(self, "supplier", None) and not self.supplier_name: @@ -324,4 +331,4 @@ class BuyingController(StockController): if d.meta.get_field("stock_qty") and not d.stock_qty: if not d.conversion_factor: frappe.throw(_("Row {0}: Conversion Factor is mandatory")) - d.stock_qty = flt(d.qty) * flt(d.conversion_factor) \ No newline at end of file + d.stock_qty = flt(d.qty) * flt(d.conversion_factor) diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 6bbdfadd3d3..315af0ea995 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -11,10 +11,11 @@ from erpnext.controllers.stock_controller import StockController class SellingController(StockController): def __setup__(self): - self.table_print_templates = { - self.fname: "templates/print_formats/includes/item_grid.html", - "other_charges": "templates/print_formats/includes/taxes.html", - } + if hasattr(self, "fname"): + self.table_print_templates = { + self.fname: "templates/print_formats/includes/item_grid.html", + "other_charges": "templates/print_formats/includes/taxes.html", + } def validate(self): super(SellingController, self).validate() diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.json b/erpnext/hr/doctype/salary_slip/salary_slip.json index 5d2f028e9c4..88a7ef2ae9d 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.json +++ b/erpnext/hr/doctype/salary_slip/salary_slip.json @@ -76,14 +76,8 @@ "fieldtype": "Link", "label": "Letter Head", "options": "Letter Head", - "permlevel": 0 - }, - { - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", "permlevel": 0, - "width": "50%" + "print_hide": 1 }, { "fieldname": "fiscal_year", @@ -107,6 +101,13 @@ "permlevel": 0, "reqd": 1 }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, { "fieldname": "month", "fieldtype": "Select", @@ -123,8 +124,8 @@ }, { "fieldname": "total_days_in_month", - "fieldtype": "Data", - "label": "Total Working Days In The Month", + "fieldtype": "Float", + "label": "Working Days", "oldfieldname": "total_days_in_month", "oldfieldtype": "Int", "permlevel": 0, @@ -208,6 +209,12 @@ "reqd": 0, "width": "50%" }, + { + "fieldname": "html_21", + "fieldtype": "HTML", + "options": "", + "permlevel": 0 + }, { "fieldname": "earning_details", "fieldtype": "Table", @@ -225,6 +232,12 @@ "permlevel": 0, "width": "50%" }, + { + "fieldname": "html_24", + "fieldtype": "HTML", + "options": "", + "permlevel": 0 + }, { "fieldname": "deduction_details", "fieldtype": "Table", @@ -242,11 +255,14 @@ "permlevel": 0 }, { - "fieldname": "column_break2", + "fieldname": "column_break_25", "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "width": "50%" + "permlevel": 0 + }, + { + "fieldname": "column_break_26", + "fieldtype": "Column Break", + "permlevel": 0 }, { "fieldname": "arrear_amount", @@ -286,13 +302,6 @@ "permlevel": 0, "read_only": 1 }, - { - "fieldname": "column_break3", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "width": "50%" - }, { "description": "Gross Pay + Arrear Amount +Encashment Amount - Total Deduction", "fieldname": "net_pay", @@ -326,7 +335,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-06-23 07:55:52.259962", + "modified": "2014-07-21 07:58:08.033784", "modified_by": "Administrator", "module": "HR", "name": "Salary Slip", diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index 3f4b5e30805..946588f5bcd 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -186,109 +186,14 @@ class SalarySlip(TransactionBase): def send_mail_funct(self): from frappe.utils.email_lib import sendmail + receiver = frappe.db.get_value("Employee", self.employee, "company_email") if receiver: subj = 'Salary Slip - ' + cstr(self.month) +'/'+cstr(self.fiscal_year) - earn_ret=frappe.db.sql("""select e_type, e_modified_amount from `tabSalary Slip Earning` - where parent = %s""", self.name) - ded_ret=frappe.db.sql("""select d_type, d_modified_amount from `tabSalary Slip Deduction` - where parent = %s""", self.name) - - earn_table = '' - ded_table = '' - if earn_ret: - earn_table += "" - - for e in earn_ret: - if not e[1]: - earn_table += '' % cstr(e[0]) - else: - earn_table += '' \ - % (cstr(e[0]), cstr(e[1])) - earn_table += '
%s0.00
%s%s
' - - if ded_ret: - - ded_table += "" - - for d in ded_ret: - if not d[1]: - ded_table +='%s' % cstr(d[0]) - else: - ded_table +='' \ - % (cstr(d[0]), cstr(d[1])) - ded_table += '
0.00
%s%s
' - - letter_head = frappe.db.get_value("Letter Head", {"is_default": 1, "disabled": 0}, - "content") - - msg = '''
%s
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Salary Slip

Employee Code : %sEmployee Name : %s
Month : %sFiscal Year : %s
Department : %sBranch : %s
Designation : %s
Bank Account No. : %sBank Name : %s
Arrear Amount : %sPayment days : %s
- - - - - - - - - -
- Earnings - Deductions
%s%s
- - - - - - - - - Net Pay : - - - - - - - -
Gross Pay : %sTotal Deduction : %s
%s
Net Pay(in words) : %s
''' % (cstr(letter_head), cstr(self.employee), - cstr(self.employee_name), cstr(self.month), cstr(self.fiscal_year), - cstr(self.department), cstr(self.branch), cstr(self.designation), - cstr(self.bank_account_no), cstr(self.bank_name), - cstr(self.arrear_amount), cstr(self.payment_days), earn_table, ded_table, - cstr(flt(self.gross_pay)), cstr(flt(self.total_deduction)), - cstr(flt(self.net_pay)), cstr(self.total_in_words)) - - sendmail([receiver], subject=subj, msg = msg) + sendmail([receiver], subject=subj, msg = _("Please see attachment"), + attachments={ + "fname": self.name + ".pdf", + "fcontent": frappe.get_print_format(self.doctype, self.name, as_pdf = True) + }) else: msgprint(_("Company Email ID not found, hence mail not sent")) diff --git a/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.json b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.json index ae07c2c523c..18331294594 100644 --- a/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.json +++ b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.json @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:48.000000", + "creation": "2013-02-22 01:27:48", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -19,18 +19,19 @@ "fieldname": "d_amount", "fieldtype": "Currency", "in_list_view": 1, - "label": "Amount", + "label": "Default Amount", "oldfieldname": "d_amount", "oldfieldtype": "Currency", "options": "Company:company:default_currency", "permlevel": 0, + "print_hide": 1, "read_only": 1 }, { "fieldname": "d_modified_amount", "fieldtype": "Currency", "in_list_view": 1, - "label": "Modified Amount", + "label": "Amount", "options": "Company:company:default_currency", "permlevel": 0 }, @@ -39,14 +40,16 @@ "fieldtype": "Check", "in_list_view": 1, "label": "Depends on LWP", - "permlevel": 0 + "permlevel": 0, + "print_hide": 1 } ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:42.000000", + "modified": "2014-07-21 07:38:36.059879", "modified_by": "Administrator", "module": "HR", "name": "Salary Slip Deduction", - "owner": "Administrator" + "owner": "Administrator", + "permissions": [] } \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.json b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.json index eae64473a3e..b3dfa2b1773 100644 --- a/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.json +++ b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.json @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:48.000000", + "creation": "2013-02-22 01:27:48", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -19,18 +19,19 @@ "fieldname": "e_amount", "fieldtype": "Currency", "in_list_view": 1, - "label": "Amount", + "label": "Default Amount", "oldfieldname": "e_amount", "oldfieldtype": "Currency", "options": "Company:company:default_currency", "permlevel": 0, + "print_hide": 1, "read_only": 1 }, { "fieldname": "e_modified_amount", "fieldtype": "Currency", "in_list_view": 1, - "label": "Modified Amount", + "label": "Amount", "options": "Company:company:default_currency", "permlevel": 0 }, @@ -39,14 +40,16 @@ "fieldtype": "Check", "in_list_view": 1, "label": "Depends on LWP", - "permlevel": 0 + "permlevel": 0, + "print_hide": 1 } ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:43.000000", + "modified": "2014-07-21 07:39:01.262050", "modified_by": "Administrator", "module": "HR", "name": "Salary Slip Earning", - "owner": "Administrator" + "owner": "Administrator", + "permissions": [] } \ No newline at end of file diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index bdd27c4cc75..87943646c7a 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -313,19 +313,6 @@ "permlevel": 0, "read_only": 0 }, - { - "fieldname": "net_total_export", - "fieldtype": "Currency", - "label": "Net Total", - "options": "currency", - "permlevel": 0, - "read_only": 1 - }, - { - "fieldname": "column_break_28", - "fieldtype": "Column Break", - "permlevel": 0 - }, { "fieldname": "net_total", "fieldtype": "Currency", @@ -340,6 +327,19 @@ "reqd": 0, "width": "100px" }, + { + "fieldname": "column_break_28", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "net_total_export", + "fieldtype": "Currency", + "label": "Net Total", + "options": "currency", + "permlevel": 0, + "read_only": 1 + }, { "fieldname": "taxes", "fieldtype": "Section Break", @@ -448,6 +448,55 @@ "print_hide": 1, "read_only": 0 }, + { + "fieldname": "grand_total", + "fieldtype": "Currency", + "label": "Grand Total (Company Currency)", + "no_copy": 0, + "oldfieldname": "grand_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 0, + "width": "200px" + }, + { + "fieldname": "rounded_total", + "fieldtype": "Currency", + "label": "Rounded Total (Company Currency)", + "no_copy": 0, + "oldfieldname": "rounded_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "width": "200px" + }, + { + "description": "In Words will be visible once you save the Quotation.", + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "no_copy": 0, + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "width": "200px" + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "50%" + }, { "fieldname": "grand_total_export", "fieldtype": "Currency", @@ -489,55 +538,6 @@ "read_only": 1, "width": "200px" }, - { - "fieldname": "column_break3", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "width": "50%" - }, - { - "fieldname": "grand_total", - "fieldtype": "Currency", - "label": "Grand Total (Company Currency)", - "no_copy": 0, - "oldfieldname": "grand_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "reqd": 0, - "width": "200px" - }, - { - "fieldname": "rounded_total", - "fieldtype": "Currency", - "label": "Rounded Total (Company Currency)", - "no_copy": 0, - "oldfieldname": "rounded_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "width": "200px" - }, - { - "description": "In Words will be visible once you save the Quotation.", - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "no_copy": 0, - "oldfieldname": "in_words", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "width": "200px" - }, { "fieldname": "terms_section_break", "fieldtype": "Section Break", @@ -827,7 +827,7 @@ "idx": 1, "is_submittable": 1, "max_attachments": 1, - "modified": "2014-06-23 07:55:51.859025", + "modified": "2014-07-21 05:44:26.800041", "modified_by": "Administrator", "module": "Selling", "name": "Quotation", diff --git a/erpnext/selling/print_format/quotation_classic/quotation_classic.json b/erpnext/selling/print_format/quotation_classic/quotation_classic.json deleted file mode 100644 index 97d84eb63bd..00000000000 --- a/erpnext/selling/print_format/quotation_classic/quotation_classic.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "creation": "2013-04-19 13:30:51", - "doc_type": "Quotation", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "idx": 1, - "modified": "2014-05-13 16:07:19.203008", - "modified_by": "Administrator", - "module": "Selling", - "name": "Quotation Classic", - "owner": "Administrator", - "print_format_type": "Client", - "standard": "Yes" -} \ No newline at end of file diff --git a/erpnext/selling/print_format/quotation_modern/quotation_modern.json b/erpnext/selling/print_format/quotation_modern/quotation_modern.json deleted file mode 100644 index d0db3b4531f..00000000000 --- a/erpnext/selling/print_format/quotation_modern/quotation_modern.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "creation": "2013-04-19 13:30:51", - "doc_type": "Quotation", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "idx": 1, - "modified": "2014-05-13 16:07:19.221414", - "modified_by": "Administrator", - "module": "Selling", - "name": "Quotation Modern", - "owner": "Administrator", - "print_format_type": "Client", - "standard": "Yes" -} \ No newline at end of file diff --git a/erpnext/selling/print_format/quotation_spartan/quotation_spartan.json b/erpnext/selling/print_format/quotation_spartan/quotation_spartan.json deleted file mode 100644 index 7532e91bdd1..00000000000 --- a/erpnext/selling/print_format/quotation_spartan/quotation_spartan.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "creation": "2013-04-19 13:30:51", - "doc_type": "Quotation", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "idx": 1, - "modified": "2014-05-13 16:07:19.233782", - "modified_by": "Administrator", - "module": "Selling", - "name": "Quotation Spartan", - "owner": "Administrator", - "print_format_type": "Client", - "standard": "Yes" -} \ No newline at end of file diff --git a/erpnext/selling/print_format/sales_order_classic/sales_order_classic.json b/erpnext/selling/print_format/sales_order_classic/sales_order_classic.json deleted file mode 100644 index 7fbfed42143..00000000000 --- a/erpnext/selling/print_format/sales_order_classic/sales_order_classic.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "creation": "2013-04-19 13:30:51", - "doc_type": "Sales Order", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "idx": 1, - "modified": "2014-05-13 16:07:19.286220", - "modified_by": "Administrator", - "module": "Selling", - "name": "Sales Order Classic", - "owner": "Administrator", - "print_format_type": "Client", - "standard": "Yes" -} \ No newline at end of file diff --git a/erpnext/selling/print_format/sales_order_modern/sales_order_modern.json b/erpnext/selling/print_format/sales_order_modern/sales_order_modern.json deleted file mode 100644 index 011bbc76341..00000000000 --- a/erpnext/selling/print_format/sales_order_modern/sales_order_modern.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "creation": "2013-04-19 13:30:51", - "doc_type": "Sales Order", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "idx": 1, - "modified": "2014-05-13 16:07:19.295735", - "modified_by": "Administrator", - "module": "Selling", - "name": "Sales Order Modern", - "owner": "Administrator", - "print_format_type": "Client", - "standard": "Yes" -} \ No newline at end of file diff --git a/erpnext/selling/print_format/sales_order_spartan/sales_order_spartan.json b/erpnext/selling/print_format/sales_order_spartan/sales_order_spartan.json deleted file mode 100644 index ce08e7cc1c8..00000000000 --- a/erpnext/selling/print_format/sales_order_spartan/sales_order_spartan.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "creation": "2013-04-19 13:30:51", - "doc_type": "Sales Order", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "idx": 1, - "modified": "2014-05-13 16:07:19.303303", - "modified_by": "Administrator", - "module": "Selling", - "name": "Sales Order Spartan", - "owner": "Administrator", - "print_format_type": "Client", - "standard": "Yes" -} \ No newline at end of file diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json index 9b43a719344..89cbc94bf0f 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.json +++ b/erpnext/stock/doctype/delivery_note/delivery_note.json @@ -341,6 +341,11 @@ "fieldtype": "Section Break", "permlevel": 0 }, + { + "fieldname": "column_break_33", + "fieldtype": "Column Break", + "permlevel": 0 + }, { "fieldname": "net_total_export", "fieldtype": "Currency", @@ -349,11 +354,6 @@ "permlevel": 0, "read_only": 1 }, - { - "fieldname": "column_break_33", - "fieldtype": "Column Break", - "permlevel": 0 - }, { "fieldname": "net_total", "fieldtype": "Currency", @@ -1009,7 +1009,7 @@ "idx": 1, "in_create": 0, "is_submittable": 1, - "modified": "2014-07-10 02:45:47.673011", + "modified": "2014-07-21 05:28:55.380728", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note", diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json index 4ea3864258a..66a954318f6 100755 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json @@ -230,15 +230,18 @@ "permlevel": 0 }, { - "fieldname": "net_total_import", + "fieldname": "net_total", "fieldtype": "Currency", - "label": "Net Total", - "oldfieldname": "net_total_import", + "label": "Net Total (Company Currency)", + "oldfieldname": "net_total", "oldfieldtype": "Currency", - "options": "currency", + "options": "Company:company:default_currency", "permlevel": 0, - "print_hide": 0, - "read_only": 1 + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "reqd": 1, + "width": "150px" }, { "fieldname": "get_current_stock", @@ -255,18 +258,15 @@ "permlevel": 0 }, { - "fieldname": "net_total", + "fieldname": "net_total_import", "fieldtype": "Currency", - "label": "Net Total (Company Currency)", - "oldfieldname": "net_total", + "label": "Net Total", + "oldfieldname": "net_total_import", "oldfieldtype": "Currency", - "options": "Company:company:default_currency", + "options": "currency", "permlevel": 0, - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "reqd": 1, - "width": "150px" + "print_hide": 0, + "read_only": 1 }, { "description": "Add / Edit Taxes and Charges", @@ -314,56 +314,6 @@ "options": "icon-money", "permlevel": 0 }, - { - "fieldname": "other_charges_added_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Added", - "oldfieldname": "other_charges_added_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "other_charges_deducted_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted", - "oldfieldname": "other_charges_deducted_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "grand_total_import", - "fieldtype": "Currency", - "label": "Grand Total", - "oldfieldname": "grand_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1 - }, - { - "fieldname": "in_words_import", - "fieldtype": "Data", - "label": "In Words", - "oldfieldname": "in_words_import", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "read_only": 1 - }, - { - "fieldname": "column_break3", - "fieldtype": "Column Break", - "permlevel": 0, - "print_width": "50%", - "width": "50%" - }, { "fieldname": "other_charges_added", "fieldtype": "Currency", @@ -430,6 +380,56 @@ "print_hide": 1, "read_only": 1 }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "other_charges_added_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Added", + "oldfieldname": "other_charges_added_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "other_charges_deducted_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted", + "oldfieldname": "other_charges_deducted_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "grand_total_import", + "fieldtype": "Currency", + "label": "Grand Total", + "oldfieldname": "grand_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "in_words_import", + "fieldtype": "Data", + "label": "In Words", + "oldfieldname": "in_words_import", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, { "fieldname": "terms_section_break", "fieldtype": "Section Break", @@ -762,7 +762,7 @@ "icon": "icon-truck", "idx": 1, "is_submittable": 1, - "modified": "2014-06-23 07:55:50.761516", + "modified": "2014-07-21 05:43:28.156516", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt", diff --git a/erpnext/stock/page/stock_balance/stock_balance.js b/erpnext/stock/page/stock_balance/stock_balance.js index 0503c8bb273..10834147251 100644 --- a/erpnext/stock/page/stock_balance/stock_balance.js +++ b/erpnext/stock/page/stock_balance/stock_balance.js @@ -12,9 +12,7 @@ frappe.pages['stock-balance'].onload = function(wrapper) { new erpnext.StockBalance(wrapper); - - wrapper.appframe.add_module_icon("Stock") - + wrapper.appframe.add_module_icon("Stock"); } erpnext.StockBalance = erpnext.StockAnalytics.extend({ diff --git a/erpnext/stock/print_format/delivery_note_classic/delivery_note_classic.json b/erpnext/stock/print_format/delivery_note_classic/delivery_note_classic.json deleted file mode 100644 index 1304fdec26d..00000000000 --- a/erpnext/stock/print_format/delivery_note_classic/delivery_note_classic.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "creation": "2013-04-19 13:31:11", - "doc_type": "Delivery Note", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "idx": 1, - "modified": "2014-05-13 16:07:19.088869", - "modified_by": "Administrator", - "module": "Stock", - "name": "Delivery Note Classic", - "owner": "Administrator", - "print_format_type": "Client", - "standard": "Yes" -} \ No newline at end of file diff --git a/erpnext/stock/print_format/delivery_note_modern/delivery_note_modern.json b/erpnext/stock/print_format/delivery_note_modern/delivery_note_modern.json deleted file mode 100644 index c523fba3c44..00000000000 --- a/erpnext/stock/print_format/delivery_note_modern/delivery_note_modern.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "creation": "2013-04-19 13:31:11", - "doc_type": "Delivery Note", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "idx": 1, - "modified": "2014-05-13 16:07:19.122031", - "modified_by": "Administrator", - "module": "Stock", - "name": "Delivery Note Modern", - "owner": "Administrator", - "print_format_type": "Client", - "standard": "Yes" -} \ No newline at end of file diff --git a/erpnext/stock/print_format/delivery_note_spartan/delivery_note_spartan.json b/erpnext/stock/print_format/delivery_note_spartan/delivery_note_spartan.json deleted file mode 100644 index 2d6ef68e123..00000000000 --- a/erpnext/stock/print_format/delivery_note_spartan/delivery_note_spartan.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "creation": "2013-04-19 13:31:11", - "doc_type": "Delivery Note", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "idx": 1, - "modified": "2014-05-13 16:07:19.136421", - "modified_by": "Administrator", - "module": "Stock", - "name": "Delivery Note Spartan", - "owner": "Administrator", - "print_format_type": "Client", - "standard": "Yes" -} \ No newline at end of file diff --git a/erpnext/templates/print_formats/includes/item_grid.html b/erpnext/templates/print_formats/includes/item_grid.html index f9d3c1f5e8f..e837966de6f 100644 --- a/erpnext/templates/print_formats/includes/item_grid.html +++ b/erpnext/templates/print_formats/includes/item_grid.html @@ -1,5 +1,5 @@ {%- from "templates/print_formats/standard_macros.html" import print_value -%} -{%- set std_fields = ("item_code", "item_name", "description", "qty", "rate", "amount", "stock_uom") -%} +{%- set std_fields = ("item_code", "item_name", "description", "qty", "rate", "amount", "stock_uom", "uom") -%} {%- set visible_columns = get_visible_columns(doc.get(df.fieldname), table_meta) -%} @@ -30,7 +30,7 @@ {{ frappe.format_value(row[field.fieldname], field, doc) }}

{%- endif -%} {%- endfor -%} - + diff --git a/erpnext/templates/print_formats/includes/taxes.html b/erpnext/templates/print_formats/includes/taxes.html index e23b49cb9b7..56a086f32bd 100644 --- a/erpnext/templates/print_formats/includes/taxes.html +++ b/erpnext/templates/print_formats/includes/taxes.html @@ -6,8 +6,8 @@
-
- {{ format(charge.tax_amount / doc.conversion_rate, +
+ {{ frappe.format_value(charge.tax_amount / doc.conversion_rate, table_meta.get_field("tax_amount"), doc) }}
From 85ff3bcd0419e7e7eb6b94e0e7589e9850ba94b0 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 22 Jul 2014 14:43:14 +0530 Subject: [PATCH 05/12] updated pos invoice --- erpnext/accounts/print_format/pos_invoice/__init__.py | 0 .../accounts/print_format/pos_invoice/pos_invoice.json | 6 +++--- erpnext/config/selling.py | 5 +++++ erpnext/templates/print_formats/includes/item_grid.html | 8 +++----- 4 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 erpnext/accounts/print_format/pos_invoice/__init__.py diff --git a/erpnext/accounts/print_format/pos_invoice/__init__.py b/erpnext/accounts/print_format/pos_invoice/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/accounts/print_format/pos_invoice/pos_invoice.json b/erpnext/accounts/print_format/pos_invoice/pos_invoice.json index e565ab841a2..83174b6c299 100644 --- a/erpnext/accounts/print_format/pos_invoice/pos_invoice.json +++ b/erpnext/accounts/print_format/pos_invoice/pos_invoice.json @@ -3,13 +3,13 @@ "doc_type": "Sales Invoice", "docstatus": 0, "doctype": "Print Format", - "html": "\n\t\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\t\n\n\t\n\t\t\n\t\t
\n\t\t
\n\t\t
\n\t\t
\n\t\t
\n\t\n", + "html": "\n\n

\n\t{{ doc.company }}
\n\t{{ doc.select_print_heading or _(\"Invoice\") }}
\n

\n

\n\t{{ _(\"Receipt No\") }}: {{ doc.name }}
\n\t{{ _(\"Date\") }}: {{ doc.get_formatted(\"posting_date\") }}
\n\t{{ _(\"Customer\") }}: {{ doc.customer_name }}\n

\n\n
\n
{{ row.qty }} {{ row.stock_uom }}{{ row.qty }} {{ row.uom or row.stock_uom }} {{ frappe.format_value(row.rate, table_meta.get_field("rate"), doc) }}
\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n\t\n\t\t{%- for item in doc.entries -%}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{%- endfor -%}\n\t\n
{{ _(\"Item\") }}{{ _(\"Qty\") }}{{ _(\"Rate\") }}
\n\t\t\t\t{{ item.item_code }}\n\t\t\t\t{%- if item.item_name != item.item_code -%}\n\t\t\t\t\t
{{ item.item_name }}{%- endif -%}\n\t\t\t
{{ item.qty }}{{ item.amount }}
\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{%- for row in doc.other_charges -%}\n\t\t{%- if not row.included_in_print_rate -%}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{%- endif -%}\n\t\t{%- endfor -%}\n\t\t{%- if doc.discount_amount -%}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{%- endif -%}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n
\n\t\t\t\t{{ _(\"Net Total\") }}\n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"net_total_export\") }}\n\t\t\t
\n\t\t\t\t{{ row.description }}\n\t\t\t\n\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t
\n\t\t\t\t{{ _(\"Discount\") }}\n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"discount_amount\") }}\n\t\t\t
\n\t\t\t\t{{ _(\"Grand Total\") }}\n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"grand_total_export\") }}\n\t\t\t
\n{% if doc.get(\"other_charges\", filters={\"included_in_print_rate\": 1}) %}\n
\n

Taxes Included:

\n\n\t\n\t\t{%- for row in doc.other_charges -%}\n\t\t{%- if row.included_in_print_rate -%}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{%- endif -%}\n\t\t{%- endfor -%}\n\t\n
\n\t\t\t\t{{ row.description }}\n\t\t\t\n\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t
\n{%- endif -%}\n
\n

{{ doc.terms or \"\" }}

\n

{{ _(\"Thank you, please visit again.\") }}

", "idx": 1, - "modified": "2014-05-26 06:29:57.220753", + "modified": "2014-07-22 02:08:26.603223", "modified_by": "Administrator", "module": "Accounts", "name": "POS Invoice", "owner": "Administrator", - "print_format_type": "Client", + "print_format_type": "Server", "standard": "Yes" } \ No newline at end of file diff --git a/erpnext/config/selling.py b/erpnext/config/selling.py index c95f15aa836..1e5acadb53f 100644 --- a/erpnext/config/selling.py +++ b/erpnext/config/selling.py @@ -57,6 +57,11 @@ def get_data(): "name": "SMS Center", "description":_("Send mass SMS to your contacts"), }, + { + "type": "doctype", + "name": "Newsletter", + "description": _("Newsletters to contacts, leads."), + }, ] }, { diff --git a/erpnext/templates/print_formats/includes/item_grid.html b/erpnext/templates/print_formats/includes/item_grid.html index e837966de6f..e3be8c94dc4 100644 --- a/erpnext/templates/print_formats/includes/item_grid.html +++ b/erpnext/templates/print_formats/includes/item_grid.html @@ -27,16 +27,14 @@ {%- if (field.fieldname not in std_fields) and (row[field.fieldname] not in (None, "")) -%}
{{ field.label }}: - {{ frappe.format_value(row[field.fieldname], field, doc) }}

+ {{ row.get_formatted(field.fieldname, doc) }}

{%- endif -%} {%- endfor -%} {{ row.qty }} {{ row.uom or row.stock_uom }} {{ - frappe.format_value(row.rate, - table_meta.get_field("rate"), doc) }} + row.get_formatted("rate", doc) }} {{ - frappe.format_value(row.amount, - table_meta.get_field("amount"), doc) }} + row.get_formatted("amount", doc) }} {%- endfor -%} From 781ddc3a25224eb81b7525bcb18254693c2a75f7 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 22 Jul 2014 16:11:18 +0530 Subject: [PATCH 06/12] added patch to remove old print formats --- erpnext/patches.txt | 1 + erpnext/patches/v4_2/__init__.py | 0 .../patches/v4_2/delete_old_print_formats.py | 23 +++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 erpnext/patches/v4_2/__init__.py create mode 100644 erpnext/patches/v4_2/delete_old_print_formats.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 5c64213ccbb..676e0d186a6 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -72,3 +72,4 @@ execute:frappe.db.sql("update `tabAccount` set root_type='Liability' where root_ execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool") execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool Detail") execute:frappe.delete_doc("Page", "trial-balance") #2014-07-22 +erpnext.patches.v4_2.delete_old_print_formats diff --git a/erpnext/patches/v4_2/__init__.py b/erpnext/patches/v4_2/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/patches/v4_2/delete_old_print_formats.py b/erpnext/patches/v4_2/delete_old_print_formats.py new file mode 100644 index 00000000000..1456f95131f --- /dev/null +++ b/erpnext/patches/v4_2/delete_old_print_formats.py @@ -0,0 +1,23 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe + +def execute(): + old_formats = ("Sales Invoice", "Sales Invoice Spartan", "Sales Invoice Modern", + "Sales Invoice Classic", + "Sales Order Spartan", "Sales Order Modern", "Sales Order Classic", + "Purchase Order Spartan", "Purchase Order Modern", "Purchase Order Classic", + "Quotation Spartan", "Quotation Modern", "Quotation Classic", + "Delivery Note Spartan", "Delivery Note Modern", "Delivery Note Classic") + + for fmt in old_formats: + # update property setter + for ps in frappe.db.sql_list("""select name from `tabProperty Setter` + where property_type='default_print_format' and value=%s""", fmt): + ps = frappe.get_doc("Property Setter", ps) + ps.value = "Standard" + ps.save(ignore_permissions = True) + + frappe.delete_doc("Print Format", fmt) From 82ec488b9999b85e5cec062f0af7820b34793a07 Mon Sep 17 00:00:00 2001 From: ankitjavalkarwork Date: Tue, 22 Jul 2014 18:14:30 +0530 Subject: [PATCH 07/12] Payment Reconciliation Feature/Tool - Patch --- erpnext/patches.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 676e0d186a6..1a80ef09388 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -73,3 +73,5 @@ execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool") execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool Detail") execute:frappe.delete_doc("Page", "trial-balance") #2014-07-22 erpnext.patches.v4_2.delete_old_print_formats +execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool") +execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool Detail") From 16deabef82358fd7fe5a4811cdfb98d05558d298 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 23 Jul 2014 20:12:04 +0530 Subject: [PATCH 08/12] Format Qty --- erpnext/templates/print_formats/includes/item_grid.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/templates/print_formats/includes/item_grid.html b/erpnext/templates/print_formats/includes/item_grid.html index e3be8c94dc4..ffcf8577e4d 100644 --- a/erpnext/templates/print_formats/includes/item_grid.html +++ b/erpnext/templates/print_formats/includes/item_grid.html @@ -30,7 +30,7 @@ {{ row.get_formatted(field.fieldname, doc) }}

{%- endif -%} {%- endfor -%} - {{ row.qty }} {{ row.uom or row.stock_uom }} + {{ row.get_formatted("qty", doc) }} {{ row.uom or row.stock_uom }} {{ row.get_formatted("rate", doc) }} {{ From a5437cdac1afd383c800bdda8de15b8674af0cf4 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 24 Jul 2014 18:40:57 +0530 Subject: [PATCH 09/12] Fixes for print --- .../purchase_invoice/purchase_invoice.json | 4 +- .../purchase_invoice_item.json | 4 +- .../doctype/sales_invoice/sales_invoice.py | 8 +- .../sales_invoice_item.json | 4 +- .../purchase_order_item.json | 4 +- .../supplier_quotation.json | 116 ++++++++-------- .../supplier_quotation_item.json | 4 +- erpnext/hr/doctype/salary_slip/salary_slip.py | 4 +- erpnext/patches.txt | 2 - .../doctype/opportunity/opportunity.json | 3 +- .../doctype/opportunity/test_opportunity.py | 10 ++ .../doctype/opportunity/test_records.json | 13 ++ .../quotation_item/quotation_item.json | 4 +- .../sales_order_item/sales_order_item.json | 4 +- .../doctype/delivery_note/delivery_note.json | 128 +++++++++--------- .../delivery_note_item.json | 4 +- .../purchase_receipt/purchase_receipt.json | 4 +- .../purchase_receipt_item.json | 4 +- .../doctype/stock_entry/stock_entry.json | 107 +++++++-------- .../emails/recurring_invoice_failed.html | 4 +- .../print_formats/includes/item_grid.html | 23 ++-- test_sites/test_site/site_config.json | 3 +- 22 files changed, 239 insertions(+), 222 deletions(-) create mode 100644 erpnext/selling/doctype/opportunity/test_opportunity.py create mode 100644 erpnext/selling/doctype/opportunity/test_records.json diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index 1de3aa601d2..fc9d3c7b546 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -695,7 +695,7 @@ "oldfieldname": "due_date", "oldfieldtype": "Date", "permlevel": 0, - "print_hide": 0, + "print_hide": 1, "read_only": 0, "search_index": 1 }, @@ -753,7 +753,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-07-21 05:33:36.332474", + "modified": "2014-07-24 08:46:13.099099", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json index d3b46060344..22757430bff 100755 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json @@ -109,7 +109,7 @@ }, { "fieldname": "discount_percentage", - "fieldtype": "Float", + "fieldtype": "Percent", "in_list_view": 0, "label": "Discount %", "permlevel": 0, @@ -421,7 +421,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-05-28 12:43:40.647183", + "modified": "2014-07-24 05:50:20.570629", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice Item", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 671bb54f826..27348bbdfea 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -723,15 +723,15 @@ def send_notification(new_rv): """Notify concerned persons about recurring invoice generation""" frappe.sendmail(new_rv.notification_email_address, subject="New Invoice : " + new_rv.name, - message = _("Please find attached Sales Invoice #{0}").format(new_rw.name), - attachments = { + message = _("Please find attached Sales Invoice #{0}").format(new_rv.name), + attachments = [{ "fname": new_rv.name + ".pdf", "fcontent": frappe.get_print_format(new_rv.doctype, new_rv.name, as_pdf=True) - }) + }]) def notify_errors(inv, customer, owner): from frappe.utils.user import get_system_managers - recipients=get_system_managers() + recipients=get_system_managers(only_name=True) frappe.sendmail(recipients + [frappe.db.get_value("User", owner, "email")], subject="[Urgent] Error while creating recurring invoice for %s" % inv, diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json index 5b3bd9d8889..82d3a7dffe1 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json @@ -103,7 +103,7 @@ }, { "fieldname": "discount_percentage", - "fieldtype": "Float", + "fieldtype": "Percent", "in_list_view": 0, "label": "Discount (%)", "oldfieldname": "adj_rate", @@ -448,7 +448,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-05-28 12:42:28.209942", + "modified": "2014-07-24 05:53:05.889457", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Item", diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json index 224f784c691..f6bcc23e8f1 100755 --- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json +++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json @@ -167,7 +167,7 @@ }, { "fieldname": "discount_percentage", - "fieldtype": "Float", + "fieldtype": "Percent", "in_list_view": 0, "label": "Discount %", "permlevel": 0, @@ -466,7 +466,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-05-28 12:42:53.018610", + "modified": "2014-07-24 05:49:51.099682", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order Item", diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json index fa0a9f38cdb..fb648b9b0cb 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json @@ -306,63 +306,6 @@ "options": "icon-money", "permlevel": 0 }, - { - "fieldname": "other_charges_added_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Added", - "no_copy": 0, - "oldfieldname": "other_charges_added_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0 - }, - { - "fieldname": "other_charges_deducted_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted", - "no_copy": 0, - "oldfieldname": "other_charges_deducted_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0 - }, - { - "fieldname": "grand_total_import", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Grand Total", - "no_copy": 0, - "oldfieldname": "grand_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1, - "report_hide": 0 - }, - { - "fieldname": "in_words_import", - "fieldtype": "Data", - "label": "In Words", - "oldfieldname": "in_words_import", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "read_only": 1 - }, - { - "fieldname": "column_break4", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 0 - }, { "fieldname": "other_charges_added", "fieldtype": "Currency", @@ -433,6 +376,63 @@ "print_hide": 1, "read_only": 1 }, + { + "fieldname": "column_break4", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 0 + }, + { + "fieldname": "other_charges_added_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Added", + "no_copy": 0, + "oldfieldname": "other_charges_added_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "other_charges_deducted_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted", + "no_copy": 0, + "oldfieldname": "other_charges_deducted_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "grand_total_import", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Grand Total", + "no_copy": 0, + "oldfieldname": "grand_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "in_words_import", + "fieldtype": "Data", + "label": "In Words", + "oldfieldname": "in_words_import", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, { "fieldname": "terms_section_break", "fieldtype": "Section Break", @@ -571,7 +571,7 @@ "icon": "icon-shopping-cart", "idx": 1, "is_submittable": 1, - "modified": "2014-07-21 05:30:30.367353", + "modified": "2014-07-24 05:16:47.062261", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation", diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json index 65dfe97af81..11b14e98c22 100644 --- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json +++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json @@ -95,7 +95,7 @@ }, { "fieldname": "discount_percentage", - "fieldtype": "Float", + "fieldtype": "Percent", "in_list_view": 0, "label": "Discount %", "permlevel": 0, @@ -346,7 +346,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-05-28 12:44:17.347236", + "modified": "2014-07-24 05:45:04.371142", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation Item", diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index 946588f5bcd..7e27830ce99 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -191,9 +191,9 @@ class SalarySlip(TransactionBase): if receiver: subj = 'Salary Slip - ' + cstr(self.month) +'/'+cstr(self.fiscal_year) sendmail([receiver], subject=subj, msg = _("Please see attachment"), - attachments={ + attachments=[{ "fname": self.name + ".pdf", "fcontent": frappe.get_print_format(self.doctype, self.name, as_pdf = True) - }) + }]) else: msgprint(_("Company Email ID not found, hence mail not sent")) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 1a80ef09388..676e0d186a6 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -73,5 +73,3 @@ execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool") execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool Detail") execute:frappe.delete_doc("Page", "trial-balance") #2014-07-22 erpnext.patches.v4_2.delete_old_print_formats -execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool") -execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool Detail") diff --git a/erpnext/selling/doctype/opportunity/opportunity.json b/erpnext/selling/doctype/opportunity/opportunity.json index be5f52b4837..a287c227e4a 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.json +++ b/erpnext/selling/doctype/opportunity/opportunity.json @@ -110,6 +110,7 @@ "oldfieldtype": "Select", "options": "Draft\nSubmitted\nQuotation\nLost\nCancelled\nReplied\nOpen", "permlevel": 0, + "print_hide": 1, "read_only": 1, "reqd": 1 }, @@ -410,7 +411,7 @@ "icon": "icon-info-sign", "idx": 1, "is_submittable": 1, - "modified": "2014-06-23 07:55:49.718301", + "modified": "2014-07-24 08:55:09.807048", "modified_by": "Administrator", "module": "Selling", "name": "Opportunity", diff --git a/erpnext/selling/doctype/opportunity/test_opportunity.py b/erpnext/selling/doctype/opportunity/test_opportunity.py new file mode 100644 index 00000000000..b991ffa1003 --- /dev/null +++ b/erpnext/selling/doctype/opportunity/test_opportunity.py @@ -0,0 +1,10 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors +# See license.txt + +import frappe +import unittest + +test_records = frappe.get_test_records('Opportunity') + +class TestOpportunity(unittest.TestCase): + pass diff --git a/erpnext/selling/doctype/opportunity/test_records.json b/erpnext/selling/doctype/opportunity/test_records.json new file mode 100644 index 00000000000..39709036358 --- /dev/null +++ b/erpnext/selling/doctype/opportunity/test_records.json @@ -0,0 +1,13 @@ +[ + { + "doctype": "Opportunity", + "name": "_Test Opportunity 1", + "enquiry_from": "Lead", + "enquiry_type": "Sales", + "lead": "_T-Lead-00001", + "enquiry_details": [{ + "item_name": "Test Item", + "description": "Some description" + }] + } +] diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.json b/erpnext/selling/doctype/quotation_item/quotation_item.json index a1807dd9ada..c260505b294 100644 --- a/erpnext/selling/doctype/quotation_item/quotation_item.json +++ b/erpnext/selling/doctype/quotation_item/quotation_item.json @@ -107,7 +107,7 @@ }, { "fieldname": "discount_percentage", - "fieldtype": "Float", + "fieldtype": "Percent", "in_list_view": 0, "label": "Discount (%)", "oldfieldname": "adj_rate", @@ -345,7 +345,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-05-28 12:41:40.811916", + "modified": "2014-07-24 05:52:49.665788", "modified_by": "Administrator", "module": "Selling", "name": "Quotation Item", diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json index 13ee085eefb..582792f7914 100644 --- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json +++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json @@ -101,7 +101,7 @@ }, { "fieldname": "discount_percentage", - "fieldtype": "Float", + "fieldtype": "Percent", "in_list_view": 0, "label": "Discount(%)", "oldfieldname": "adj_rate", @@ -431,7 +431,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-05-27 14:41:14.996650", + "modified": "2014-07-24 05:55:46.672279", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order Item", diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json index 89cbc94bf0f..84570abd821 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.json +++ b/erpnext/stock/doctype/delivery_note/delivery_note.json @@ -341,19 +341,6 @@ "fieldtype": "Section Break", "permlevel": 0 }, - { - "fieldname": "column_break_33", - "fieldtype": "Column Break", - "permlevel": 0 - }, - { - "fieldname": "net_total_export", - "fieldtype": "Currency", - "label": "Net Total", - "options": "currency", - "permlevel": 0, - "read_only": 1 - }, { "fieldname": "net_total", "fieldtype": "Currency", @@ -369,6 +356,19 @@ "reqd": 0, "width": "150px" }, + { + "fieldname": "column_break_33", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "net_total_export", + "fieldtype": "Currency", + "label": "Net Total", + "options": "currency", + "permlevel": 0, + "read_only": 1 + }, { "fieldname": "taxes", "fieldtype": "Section Break", @@ -479,56 +479,6 @@ "print_hide": 0, "read_only": 0 }, - { - "fieldname": "grand_total_export", - "fieldtype": "Currency", - "label": "Grand Total", - "no_copy": 0, - "oldfieldname": "grand_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "print_width": "150px", - "read_only": 1, - "reqd": 0, - "width": "150px" - }, - { - "fieldname": "rounded_total_export", - "fieldtype": "Currency", - "label": "Rounded Total", - "no_copy": 0, - "oldfieldname": "rounded_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "description": "In Words (Export) will be visible once you save the Delivery Note.", - "fieldname": "in_words_export", - "fieldtype": "Data", - "label": "In Words", - "no_copy": 0, - "oldfieldname": "in_words_export", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "fieldname": "column_break3", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "permlevel": 0, - "read_only": 0 - }, { "fieldname": "grand_total", "fieldtype": "Currency", @@ -572,6 +522,56 @@ "read_only": 1, "width": "200px" }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "grand_total_export", + "fieldtype": "Currency", + "label": "Grand Total", + "no_copy": 0, + "oldfieldname": "grand_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_width": "150px", + "read_only": 1, + "reqd": 0, + "width": "150px" + }, + { + "fieldname": "rounded_total_export", + "fieldtype": "Currency", + "label": "Rounded Total", + "no_copy": 0, + "oldfieldname": "rounded_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "description": "In Words (Export) will be visible once you save the Delivery Note.", + "fieldname": "in_words_export", + "fieldtype": "Data", + "label": "In Words", + "no_copy": 0, + "oldfieldname": "in_words_export", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, { "fieldname": "terms_section_break", "fieldtype": "Section Break", @@ -1009,7 +1009,7 @@ "idx": 1, "in_create": 0, "is_submittable": 1, - "modified": "2014-07-21 05:28:55.380728", + "modified": "2014-07-24 08:48:06.944540", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note", diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json index 13307ef64a0..2f69bc9dc9d 100644 --- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json +++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json @@ -109,7 +109,7 @@ }, { "fieldname": "discount_percentage", - "fieldtype": "Float", + "fieldtype": "Percent", "in_list_view": 0, "label": "Discount (%)", "oldfieldname": "adj_rate", @@ -429,7 +429,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-05-28 12:42:05.788579", + "modified": "2014-07-24 05:56:00.218977", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note Item", diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json index 66a954318f6..ebdc80e463b 100755 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json @@ -109,7 +109,7 @@ "oldfieldname": "posting_date", "oldfieldtype": "Date", "permlevel": 0, - "print_hide": 1, + "print_hide": 0, "print_width": "100px", "reqd": 1, "search_index": 1, @@ -762,7 +762,7 @@ "icon": "icon-truck", "idx": 1, "is_submittable": 1, - "modified": "2014-07-21 05:43:28.156516", + "modified": "2014-07-24 08:49:12.407907", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt", diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json index 548a7dacf10..8c5e73297b0 100755 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json @@ -168,7 +168,7 @@ }, { "fieldname": "discount_percentage", - "fieldtype": "Float", + "fieldtype": "Percent", "in_list_view": 0, "label": "Discount %", "permlevel": 0, @@ -545,7 +545,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-05-28 12:43:16.669040", + "modified": "2014-07-24 05:56:12.997533", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt Item", diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.json b/erpnext/stock/doctype/stock_entry/stock_entry.json index b5222828c40..a455a3b49b6 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.json +++ b/erpnext/stock/doctype/stock_entry/stock_entry.json @@ -127,7 +127,7 @@ "oldfieldname": "posting_date", "oldfieldtype": "Date", "permlevel": 0, - "print_hide": 1, + "print_hide": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -307,6 +307,7 @@ "fieldtype": "Check", "label": "Use Multi-Level BOM", "permlevel": 0, + "print_hide": 1, "read_only": 0 }, { @@ -453,7 +454,35 @@ "read_only": 0 }, { - "fieldname": "col4", + "fieldname": "project_name", + "fieldtype": "Link", + "in_filter": 1, + "label": "Project Name", + "oldfieldname": "project_name", + "oldfieldtype": "Link", + "options": "Project", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "remarks", + "fieldtype": "Text", + "hidden": 0, + "in_filter": 0, + "label": "Remarks", + "no_copy": 1, + "oldfieldname": "remarks", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "col5", "fieldtype": "Column Break", "permlevel": 0, "print_width": "50%", @@ -468,35 +497,6 @@ "permlevel": 0, "read_only": 1 }, - { - "fieldname": "project_name", - "fieldtype": "Link", - "in_filter": 1, - "label": "Project Name", - "oldfieldname": "project_name", - "oldfieldtype": "Link", - "options": "Project", - "permlevel": 0, - "read_only": 0 - }, - { - "allow_on_submit": 0, - "fieldname": "select_print_heading", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 0, - "label": "Print Heading", - "no_copy": 0, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0 - }, { "fieldname": "fiscal_year", "fieldtype": "Link", @@ -508,14 +508,6 @@ "read_only": 0, "reqd": 1 }, - { - "fieldname": "col5", - "fieldtype": "Column Break", - "permlevel": 0, - "print_width": "50%", - "read_only": 0, - "width": "50%" - }, { "allow_on_submit": 0, "fieldname": "company", @@ -534,6 +526,24 @@ "reqd": 1, "search_index": 0 }, + { + "allow_on_submit": 0, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 0, + "label": "Print Heading", + "no_copy": 0, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + }, { "allow_on_submit": 0, "fieldname": "amended_from", @@ -552,23 +562,6 @@ "report_hide": 0, "reqd": 0, "search_index": 0 - }, - { - "allow_on_submit": 0, - "fieldname": "remarks", - "fieldtype": "Text", - "hidden": 0, - "in_filter": 0, - "label": "Remarks", - "no_copy": 1, - "oldfieldname": "remarks", - "oldfieldtype": "Text", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0 } ], "hide_heading": 0, @@ -580,7 +573,7 @@ "is_submittable": 1, "issingle": 0, "max_attachments": 0, - "modified": "2014-05-27 03:49:19.520247", + "modified": "2014-07-24 08:52:33.496200", "modified_by": "Administrator", "module": "Stock", "name": "Stock Entry", diff --git a/erpnext/templates/emails/recurring_invoice_failed.html b/erpnext/templates/emails/recurring_invoice_failed.html index dd3b913cea4..39690d8a85f 100644 --- a/erpnext/templates/emails/recurring_invoice_failed.html +++ b/erpnext/templates/emails/recurring_invoice_failed.html @@ -6,7 +6,7 @@ "Convert into Recurring" field in the invoice {{ name }}.

Please correct the invoice and make the invoice recurring again.


-

It is necessary to take this action today itself for the above mentioned recurring invoice \ -to be generated. If delayed, you will have to manually change the "Repeat on Day of Month" field \ +

It is necessary to take this action today itself for the above mentioned recurring invoice +to be generated. If delayed, you will have to manually change the "Repeat on Day of Month" field of this invoice for generating the recurring invoice.

[This email is autogenerated]

diff --git a/erpnext/templates/print_formats/includes/item_grid.html b/erpnext/templates/print_formats/includes/item_grid.html index ffcf8577e4d..df1859cde84 100644 --- a/erpnext/templates/print_formats/includes/item_grid.html +++ b/erpnext/templates/print_formats/includes/item_grid.html @@ -5,12 +5,12 @@ - - - - - - + + + + + + {%- for row in data -%} @@ -25,12 +25,15 @@
{{ row.description }} {%- for field in visible_columns -%} {%- if (field.fieldname not in std_fields) and - (row[field.fieldname] not in (None, "")) -%} -
{{ field.label }}: - {{ row.get_formatted(field.fieldname, doc) }}

+ (row[field.fieldname] not in (None, "", 0)) -%} +
{{ _(field.label) }}: + {{ row.get_formatted(field.fieldname, doc) }} {%- endif -%} {%- endfor -%} -
+ + +
SrItem NameDescriptionQtyRateAmount{{ _("Sr") }}{{ _("Item Name") }}{{ _("Description") }}{{ _("Qty") }}{{ _("Rate") }}{{ _("Amount") }}
{{ row.get_formatted("qty", doc) }} {{ row.uom or row.stock_uom }}{{ row.get_formatted("qty", doc) }}
+ {{ row.uom or row.stock_uom }}
{{ row.get_formatted("rate", doc) }} {{ diff --git a/test_sites/test_site/site_config.json b/test_sites/test_site/site_config.json index c77200c3319..05bf5627669 100644 --- a/test_sites/test_site/site_config.json +++ b/test_sites/test_site/site_config.json @@ -1,6 +1,5 @@ { "db_name": "test_frappe", "db_password": "test_frappe", - "mute_emails": 1, - "developer_mode": 1 + "mute_emails": 1 } From 62b1cbf00321e47675c7b830711e9c62e10b8d52 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 25 Jul 2014 12:50:00 +0530 Subject: [PATCH 10/12] [impact] Limit available functions in jinja environment --- .../chart_of_accounts/charts/import_from_openerp.py | 2 +- .../journal_voucher_detail/journal_voucher_detail.json | 9 ++++++--- erpnext/controllers/buying_controller.py | 6 +++--- erpnext/controllers/selling_controller.py | 6 +++--- erpnext/hr/doctype/salary_slip/salary_slip.py | 8 ++++---- .../hr/doctype/upload_attendance/upload_attendance.py | 6 +++--- .../doctype/stock_reconciliation/stock_reconciliation.py | 2 +- erpnext/utilities/doctype/rename_tool/rename_tool.py | 2 +- 8 files changed, 22 insertions(+), 19 deletions(-) diff --git a/erpnext/accounts/doctype/chart_of_accounts/charts/import_from_openerp.py b/erpnext/accounts/doctype/chart_of_accounts/charts/import_from_openerp.py index 7a3a877aae2..a03cab4c996 100644 --- a/erpnext/accounts/doctype/chart_of_accounts/charts/import_from_openerp.py +++ b/erpnext/accounts/doctype/chart_of_accounts/charts/import_from_openerp.py @@ -9,7 +9,7 @@ from __future__ import unicode_literals import os, json import ast from xml.etree import ElementTree as ET -from frappe.utils.datautils import read_csv_content +from frappe.utils.csvutils import read_csv_content from frappe.utils import cstr import frappe diff --git a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.json b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.json index defd88e6dbc..a751ed9c66f 100644 --- a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.json +++ b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.json @@ -1,6 +1,6 @@ { "autoname": "JVD.######", - "creation": "2013-02-22 01:27:39.000000", + "creation": "2013-02-22 01:27:39", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -31,6 +31,7 @@ "oldfieldtype": "Link", "options": "Cost Center", "permlevel": 0, + "print_hide": 1, "print_width": "180px", "search_index": 0, "width": "180px" @@ -50,6 +51,7 @@ "oldfieldtype": "Data", "options": "Company:company:default_currency", "permlevel": 0, + "print_hide": 1, "read_only": 1 }, { @@ -158,9 +160,10 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-03 12:44:31.000000", + "modified": "2014-07-25 03:16:51.149899", "modified_by": "Administrator", "module": "Accounts", "name": "Journal Voucher Detail", - "owner": "Administrator" + "owner": "Administrator", + "permissions": [] } \ No newline at end of file diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 02eaa032881..85d7a9ee603 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe from frappe import _, msgprint -from frappe.utils import flt, _round +from frappe.utils import flt, rounded from erpnext.setup.utils import get_company_currency from erpnext.accounts.party import get_party_details @@ -118,10 +118,10 @@ class BuyingController(StockController): self.precision("total_tax")) if self.meta.get_field("rounded_total"): - self.rounded_total = _round(self.grand_total) + self.rounded_total = rounded(self.grand_total) if self.meta.get_field("rounded_total_import"): - self.rounded_total_import = _round(self.grand_total_import) + self.rounded_total_import = rounded(self.grand_total_import) if self.meta.get_field("other_charges_added"): self.other_charges_added = flt(sum([flt(d.tax_amount) for d in self.tax_doclist diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 315af0ea995..55b4a43b247 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe -from frappe.utils import cint, flt, _round, cstr, comma_or +from frappe.utils import cint, flt, rounded, cstr, comma_or from erpnext.setup.utils import get_company_currency from frappe import _, throw @@ -220,8 +220,8 @@ class SellingController(StockController): self.net_total_export + flt(self.discount_amount), self.precision("other_charges_total_export")) - self.rounded_total = _round(self.grand_total) - self.rounded_total_export = _round(self.grand_total_export) + self.rounded_total = rounded(self.grand_total) + self.rounded_total_export = rounded(self.grand_total_export) def apply_discount_amount(self): if self.discount_amount: diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index 7e27830ce99..7c905a666cc 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -from frappe.utils import add_days, cint, cstr, flt, getdate, nowdate, _round +from frappe.utils import add_days, cint, cstr, flt, getdate, nowdate, rounded from frappe.model.naming import make_autoname from frappe import msgprint, _ @@ -152,7 +152,7 @@ class SalarySlip(TransactionBase): self.gross_pay = flt(self.arrear_amount) + flt(self.leave_encashment_amount) for d in self.get("earning_details"): if cint(d.e_depends_on_lwp) == 1: - d.e_modified_amount = _round(flt(d.e_amount) * flt(self.payment_days) + d.e_modified_amount = rounded(flt(d.e_amount) * flt(self.payment_days) / cint(self.total_days_in_month), 2) elif not self.payment_days: d.e_modified_amount = 0 @@ -164,7 +164,7 @@ class SalarySlip(TransactionBase): self.total_deduction = 0 for d in self.get('deduction_details'): if cint(d.d_depends_on_lwp) == 1: - d.d_modified_amount = _round(flt(d.d_amount) * flt(self.payment_days) + d.d_modified_amount = rounded(flt(d.d_amount) * flt(self.payment_days) / cint(self.total_days_in_month), 2) elif not self.payment_days: d.d_modified_amount = 0 @@ -177,7 +177,7 @@ class SalarySlip(TransactionBase): self.calculate_earning_total() self.calculate_ded_total() self.net_pay = flt(self.gross_pay) - flt(self.total_deduction) - self.rounded_total = _round(self.net_pay) + self.rounded_total = rounded(self.net_pay) def on_submit(self): if(self.email_check == 1): diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.py b/erpnext/hr/doctype/upload_attendance/upload_attendance.py index b6e56d0d06a..44e77a797e4 100644 --- a/erpnext/hr/doctype/upload_attendance/upload_attendance.py +++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.py @@ -7,7 +7,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, add_days, date_diff from frappe import _ -from frappe.utils.datautils import UnicodeWriter +from frappe.utils.csvutils import UnicodeWriter from frappe.model.document import Document class UploadAttendance(Document): @@ -96,7 +96,7 @@ def upload(): if not frappe.has_permission("Attendance", "create"): raise frappe.PermissionError - from frappe.utils.datautils import read_csv_content_from_uploaded_file + from frappe.utils.csvutils import read_csv_content_from_uploaded_file from frappe.modules import scrub rows = read_csv_content_from_uploaded_file() @@ -110,7 +110,7 @@ def upload(): ret = [] error = False - from frappe.utils.datautils import check_record, import_doc + from frappe.utils.csvutils import check_record, import_doc for i, row in enumerate(rows[5:]): if not row: continue diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 78cf194cc25..6f0e5cac75f 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -302,6 +302,6 @@ class StockReconciliation(StockController): @frappe.whitelist() def upload(): - from frappe.utils.datautils import read_csv_content_from_uploaded_file + from frappe.utils.csvutils import read_csv_content_from_uploaded_file csv_content = read_csv_content_from_uploaded_file() return filter(lambda x: x and any(x), csv_content) diff --git a/erpnext/utilities/doctype/rename_tool/rename_tool.py b/erpnext/utilities/doctype/rename_tool/rename_tool.py index 07d44c3b6a8..bd34ae1c9e4 100644 --- a/erpnext/utilities/doctype/rename_tool/rename_tool.py +++ b/erpnext/utilities/doctype/rename_tool/rename_tool.py @@ -19,7 +19,7 @@ def get_doctypes(): @frappe.whitelist() def upload(select_doctype=None, rows=None): - from frappe.utils.datautils import read_csv_content_from_uploaded_file + from frappe.utils.csvutils import read_csv_content_from_uploaded_file from frappe.model.rename_doc import rename_doc if not select_doctype: From 8f49cf7c033bfc570092c29464339fd5b19336dc Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 25 Jul 2014 13:01:00 +0530 Subject: [PATCH 11/12] [minor] fixed testcase --- erpnext/controllers/selling_controller.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 55b4a43b247..7faba41b771 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -149,6 +149,7 @@ class SellingController(StockController): (1 + cumulated_tax_fraction), self.precision("base_amount", item)) item.base_rate = flt(item.base_amount / item.qty, self.precision("base_rate", item)) + item.discount_percentage = flt(item.discount_percentage, self.precision("discount_percentage", item)) if item.discount_percentage == 100: item.base_price_list_rate = item.base_rate From 161f63d393b58b5e65f94fd0c3373c53ba51571e Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 25 Jul 2014 13:36:47 +0530 Subject: [PATCH 12/12] [travis] Install wkhtmltopdf --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6eab0e4af6a..71ab0f73e2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,9 @@ install: - sudo apt-get update - sudo apt-get purge -y mysql-common - sudo apt-get install mariadb-server mariadb-common libmariadbclient-dev + - wget http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-precise-amd64.deb + - sudo dpkg -i wkhtmltox-0.12.1_linux-precise-amd64.deb + - CFLAGS=-O0 pip install git+https://github.com/frappe/frappe.git@$develop && - pip install --editable .