Merge pull request #16849 from frappe/bcornwellmott-patch-1

fix: Add date to currency exchange caching
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index 0ec0366..ea25fcf 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -5,7 +5,7 @@
 from erpnext.hooks import regional_overrides
 from frappe.utils import getdate
 
-__version__ = '11.1.13'
+__version__ = '11.1.14'
 
 def get_default_company(user=None):
 	'''Get default company for user'''
diff --git a/erpnext/accounts/doctype/account/account.json b/erpnext/accounts/doctype/account/account.json
index e47f8d2..460c025 100644
--- a/erpnext/accounts/doctype/account/account.json
+++ b/erpnext/accounts/doctype/account/account.json
@@ -632,6 +632,39 @@
    "set_only_once": 0, 
    "translatable": 0, 
    "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_in_quick_entry": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:(doc.report_type == 'Profit and Loss' && !doc.is_group)", 
+   "fieldname": "include_in_gross", 
+   "fieldtype": "Check", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Include in gross", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "translatable": 0, 
+   "unique": 0
   }
  ], 
  "has_web_view": 0, 
@@ -645,7 +678,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2019-01-07 16:52:02.557837", 
+ "modified": "2019-03-04 14:42:07.208893", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Account", 
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 7898bb2..3a17ce5 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -52,6 +52,12 @@
 		self.update_loan()
 		self.update_inter_company_jv()
 
+	def before_print(self):
+		self.gl_entries = frappe.get_list("GL Entry",filters={"voucher_type": "Journal Entry",
+			"voucher_no": self.name} ,
+			fields=["account", "party_type", "party", "debit", "credit", "remarks"]
+		)
+
 	def get_title(self):
 		return self.pay_to_recd_from or self.accounts[0].account
 
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py
index 2d57da0..818b950 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -70,6 +70,12 @@
 		self.update_advance_paid()
 		self.update_expense_claim()
 
+	def before_print(self):
+		self.gl_entries = frappe.get_list("GL Entry",filters={"voucher_type": "Payment Entry",
+			"voucher_no": self.name} ,
+			fields=["account", "party_type", "party", "debit", "credit", "remarks"]
+		)
+
 	def on_cancel(self):
 		self.setup_party_account_field()
 		self.make_gl_entries(cancel=1)
diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.js b/erpnext/accounts/doctype/pos_profile/pos_profile.js
index 13d53d1..a6386dd 100755
--- a/erpnext/accounts/doctype/pos_profile/pos_profile.js
+++ b/erpnext/accounts/doctype/pos_profile/pos_profile.js
@@ -33,6 +33,14 @@
 			};
 		});
 
+		frm.set_query("account_for_change_amount", function() {
+			return {
+				filters: {
+					account_type: ['in', ["Cash", "Bank"]]
+				}
+			};
+		});
+
 		frm.set_query("print_format", function() {
 			return { filters: { doc_type: "Sales Invoice", print_format_type: "Js"} };
 		});
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index a9e8fbc..c0d0d83 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -54,6 +54,12 @@
 		if not self.on_hold:
 			self.release_date = ''
 
+	def before_print(self):
+		self.gl_entries = frappe.get_list("GL Entry",filters={"voucher_type": "Purchase Invoice",
+			"voucher_no": self.name} ,
+			fields=["account", "party_type", "party", "debit", "credit"]
+		)
+
 	def invoice_is_blocked(self):
 		return self.on_hold and (not self.release_date or self.release_date > getdate(nowdate()))
 
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 773d1cf..a4a5940 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -556,6 +556,14 @@
 		frm.add_fetch('payment_term', 'invoice_portion', 'invoice_portion');
 		frm.add_fetch('payment_term', 'description', 'description');
 
+		frm.set_query("account_for_change_amount", function() {
+			return {
+				filters: {
+					account_type: ['in', ["Cash", "Bank"]]
+				}
+			};
+		});
+
 		frm.custom_make_buttons = {
 			'Delivery Note': 'Delivery',
 			'Sales Invoice': 'Sales Return',
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 4cf3a1a..62d8ffd 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -205,6 +205,12 @@
 	def before_cancel(self):
 		self.update_time_sheet(None)
 
+	def before_print(self):
+		self.gl_entries = frappe.get_list("GL Entry",filters={"voucher_type": "Sales Invoice",
+			"voucher_no": self.name} ,
+			fields=["account", "party_type", "party", "debit", "credit"]
+		)
+
 	def on_cancel(self):
 		self.check_close_sales_order("sales_order")
 
@@ -523,8 +529,8 @@
 
 	def validate_pos(self):
 		if self.is_return:
-			if flt(self.paid_amount) + flt(self.write_off_amount) - flt(self.grand_total) < \
-				1/(10**(self.precision("grand_total") + 1)):
+			if flt(self.paid_amount) + flt(self.write_off_amount) - flt(self.grand_total) > \
+				1.0/(10.0**(self.precision("grand_total") + 1.0)):
 					frappe.throw(_("Paid amount + Write Off Amount can not be greater than Grand Total"))
 
 	def validate_item_code(self):
diff --git a/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json b/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json
index ccdabfe..1c5962a 100644
--- a/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json
+++ b/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json
@@ -20,6 +20,7 @@
    "collapsible": 0, 
    "columns": 0, 
    "depends_on": "eval:parent.doctype == 'POS Profile'", 
+   "fetch_if_empty": 0, 
    "fieldname": "default", 
    "fieldtype": "Check", 
    "hidden": 0, 
@@ -52,6 +53,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fetch_if_empty": 0, 
    "fieldname": "mode_of_payment", 
    "fieldtype": "Link", 
    "hidden": 0, 
@@ -85,8 +87,9 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "default": "", 
+   "default": "0", 
    "depends_on": "eval:parent.doctype == 'Sales Invoice'", 
+   "fetch_if_empty": 0, 
    "fieldname": "amount", 
    "fieldtype": "Currency", 
    "hidden": 0, 
@@ -120,6 +123,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fetch_if_empty": 0, 
    "fieldname": "column_break_3", 
    "fieldtype": "Column Break", 
    "hidden": 0, 
@@ -151,6 +155,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fetch_if_empty": 0, 
    "fieldname": "account", 
    "fieldtype": "Link", 
    "hidden": 0, 
@@ -185,6 +190,7 @@
    "collapsible": 0, 
    "columns": 0, 
    "fetch_from": "mode_of_payment.type", 
+   "fetch_if_empty": 0, 
    "fieldname": "type", 
    "fieldtype": "Read Only", 
    "hidden": 0, 
@@ -218,6 +224,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fetch_if_empty": 0, 
    "fieldname": "base_amount", 
    "fieldtype": "Currency", 
    "hidden": 0, 
@@ -251,6 +258,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fetch_if_empty": 0, 
    "fieldname": "clearance_date", 
    "fieldtype": "Date", 
    "hidden": 0, 
@@ -287,7 +295,7 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2019-02-18 15:03:59.720469", 
+ "modified": "2019-03-06 15:58:37.839241", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Sales Invoice Payment", 
diff --git a/erpnext/accounts/print_format/bank_and_cash_payment_voucher/__init__.py b/erpnext/accounts/print_format/bank_and_cash_payment_voucher/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/print_format/bank_and_cash_payment_voucher/__init__.py
diff --git a/erpnext/accounts/print_format/bank_and_cash_payment_voucher/bank_and_cash_payment_voucher.html b/erpnext/accounts/print_format/bank_and_cash_payment_voucher/bank_and_cash_payment_voucher.html
new file mode 100644
index 0000000..2eadb2a
--- /dev/null
+++ b/erpnext/accounts/print_format/bank_and_cash_payment_voucher/bank_and_cash_payment_voucher.html
@@ -0,0 +1,82 @@
+{%- from "templates/print_formats/standard_macros.html" import add_header -%}
+<style>
+    .table-bordered td.top-bottom {border-top: none !important;border-bottom: none !important;}
+    .table-bordered td.right{border-right: none !important;}
+    .table-bordered td.left{border-left: none !important;}
+
+
+</style>
+<div class="page-break">
+    {%- if not doc.get("print_heading") and not doc.get("select_print_heading")
+        and doc.set("select_print_heading", _("Payment Entry")) -%}{%- endif -%}
+    {{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
+    <div class="row margin-bottom">
+            <div class="col-sm-6">
+                <table>
+                <tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
+                </table>
+            </div>
+            <div>
+                <table>
+                    <tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
+                </table>
+            </div>
+    </div>
+    <div class="margin-top">
+        <table class="table table-bordered table-condensed">
+            <tr>
+                <th>Account</th>
+                <th>Party Type</th>
+                <th>Party</th>
+                <th>Amount</th>
+            </tr>
+            <tr>
+                    <td class="top-bottom" colspan="5"><strong>Credit</strong></td>
+            </tr>
+            {% set total_credit = 0 -%}
+            {% for entries in doc.gl_entries %}
+            {% if entries.debit == 0.0 %}
+            <tr>
+                <td class="right top-bottom">{{ entries.account }}</td>
+                <td class="right left top-bottom">{{ entries.party_type }}</td>
+                <td class="right left top-bottom">{{ entries.party }}</td>
+                <td class="left top-bottom">{{ entries.credit }}</td>
+                {% set total_credit = total_credit + entries.credit -%}
+            </tr>
+            <tr>
+                <td class="top-bottom" colspan="4"><strong> Narration </strong><br>{{ entries.remarks }}</td>
+            </tr>
+            <tr>
+                    <td class="right" colspan="3"><strong>Total (credit) </strong></td>
+                    <td class="left" >{{total_credit}}</td>
+            </tr>
+            {% endif %}
+            {% endfor %}
+            <tr>
+                    <td class="top-bottom" colspan="4"> </td>
+            </tr>
+            <tr>
+                    <td class="top-bottom" colspan="5"><strong>Debit</strong></td>
+            </tr>
+            {% set total_debit = 0 -%}
+            {% for entries in doc.gl_entries %}
+            {% if entries.credit == 0.0 %}
+            <tr>
+                <td class="right top-bottom">{{ entries.account }}</td>
+                <td class="right left top-bottom">{{ entries.party_type }}</td>
+                <td class="right left top-bottom">{{ entries.party }}</td>
+                {% set total_debit = total_debit + entries.debit -%}
+                <td class="left top-bottom">{{ entries.debit }}</td>
+            </tr>
+            <tr>
+                <td class="top-bottom"colspan="4"><strong> Narration </strong><br>{{ entries.remarks }}</td>
+            </tr>
+            <tr>
+                    <td class="right" colspan="3" ><strong>Total (debit) </strong></td>
+                    <td class="left" >{{total_debit}}</td>
+            </tr>
+            {% endif %}
+            {% endfor %}
+        </table>
+    <div>
+</div>
\ No newline at end of file
diff --git a/erpnext/accounts/print_format/bank_and_cash_payment_voucher/bank_and_cash_payment_voucher.json b/erpnext/accounts/print_format/bank_and_cash_payment_voucher/bank_and_cash_payment_voucher.json
new file mode 100644
index 0000000..e3afaec
--- /dev/null
+++ b/erpnext/accounts/print_format/bank_and_cash_payment_voucher/bank_and_cash_payment_voucher.json
@@ -0,0 +1,22 @@
+{
+ "align_labels_right": 0, 
+ "creation": "2019-02-15 11:49:08.608619", 
+ "custom_format": 0, 
+ "default_print_language": "en", 
+ "disabled": 0, 
+ "doc_type": "Payment Entry", 
+ "docstatus": 0, 
+ "doctype": "Print Format", 
+ "font": "Default", 
+ "idx": 0, 
+ "line_breaks": 0, 
+ "modified": "2019-02-15 11:49:08.608619", 
+ "modified_by": "Administrator", 
+ "module": "Accounts", 
+ "name": "Bank and Cash Payment Voucher", 
+ "owner": "Administrator", 
+ "print_format_builder": 0, 
+ "print_format_type": "Server", 
+ "show_section_headings": 0, 
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/print_format/gst_purchase_invoice/gst_purchase_invoice.json b/erpnext/accounts/print_format/gst_purchase_invoice/gst_purchase_invoice.json
index 2b7f9ce..6d7c3d3 100644
--- a/erpnext/accounts/print_format/gst_purchase_invoice/gst_purchase_invoice.json
+++ b/erpnext/accounts/print_format/gst_purchase_invoice/gst_purchase_invoice.json
@@ -7,10 +7,10 @@
  "docstatus": 0, 
  "doctype": "Print Format", 
  "font": "Default", 
- "format_data": "[{\"fieldname\": \"print_heading_template\", \"fieldtype\": \"Custom HTML\", \"options\": \"<div class=\\\"print-heading\\\">\\t\\t\\t\\t<h2>Purchase Invoice<br><small>{{ doc.name }}</small>\\t\\t\\t\\t</h2></div>\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"supplier_name\", \"label\": \"Supplier Name\"}, {\"print_hide\": 0, \"fieldname\": \"due_date\", \"label\": \"Due Date\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Address\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"address_display\", \"label\": \"Address\"}, {\"print_hide\": 0, \"fieldname\": \"contact_display\", \"label\": \"Contact\"}, {\"print_hide\": 0, \"fieldname\": \"contact_mobile\", \"label\": \"Mobile No\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"item_name\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"300px\"}, {\"print_hide\": 0, \"fieldname\": \"image\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"received_qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rejected_qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"discount_percentage\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"pricing_rule\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"weight_per_unit\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"total_weight\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"weight_uom\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"warehouse\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rejected_warehouse\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"batch_no\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"serial_no\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"bom\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"asset\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"items\", \"label\": \"Items\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"total\", \"label\": \"Total\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"category\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"add_deduct_tax\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"charge_type\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"row_id\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"included_in_print_rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"account_head\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"cost_center\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"300px\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"tax_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"total\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"taxes\", \"label\": \"Purchase Taxes and Charges\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"grand_total\", \"label\": \"Grand Total\"}, {\"print_hide\": 0, \"fieldname\": \"in_words\", \"label\": \"In Words\"}, {\"print_hide\": 0, \"fieldname\": \"disable_rounded_total\", \"label\": \"Disable Rounded Total\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Payments\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"cash_bank_account\", \"label\": \"Cash/Bank Account\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"other_charges_calculation\", \"align\": \"left\", \"label\": \"Tax Breakup\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Raw\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"main_item_code\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rm_item_code\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"300px\"}, {\"print_hide\": 0, \"fieldname\": \"batch_no\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"serial_no\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"required_qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"consumed_qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"stock_uom\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"conversion_factor\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"current_stock\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"reference_name\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"bom_detail_no\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"supplied_items\", \"label\": \"Supplied Items\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Terms\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"terms\", \"label\": \"Terms and Conditions1\"}]", 
+ "format_data": "[{\"fieldname\": \"print_heading_template\", \"fieldtype\": \"Custom HTML\", \"options\": \"<div class=\\\"print-heading\\\">\\t\\t\\t\\t<h2>Purchase Invoice<br><small>{{ doc.name }}</small>\\t\\t\\t\\t</h2></div>\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"supplier_name\", \"label\": \"Supplier Name\"}, {\"print_hide\": 0, \"fieldname\": \"due_date\", \"label\": \"Due Date\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Address\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"address_display\", \"label\": \"Address\"}, {\"print_hide\": 0, \"fieldname\": \"contact_display\", \"label\": \"Contact\"}, {\"print_hide\": 0, \"fieldname\": \"contact_mobile\", \"label\": \"Mobile No\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"item_name\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"300px\"}, {\"print_hide\": 0, \"fieldname\": \"image\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"received_qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rejected_qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"discount_percentage\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"pricing_rule\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"weight_per_unit\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"total_weight\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"weight_uom\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"warehouse\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rejected_warehouse\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"batch_no\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"serial_no\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"bom\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"asset\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"gst_hsn_code\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"items\", \"label\": \"Items\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"total\", \"label\": \"Total\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"category\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"add_deduct_tax\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"charge_type\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"row_id\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"included_in_print_rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"account_head\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"cost_center\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"300px\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"tax_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"total\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"taxes\", \"label\": \"Purchase Taxes and Charges\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"grand_total\", \"label\": \"Grand Total\"}, {\"print_hide\": 0, \"fieldname\": \"in_words\", \"label\": \"In Words\"}, {\"print_hide\": 0, \"fieldname\": \"disable_rounded_total\", \"label\": \"Disable Rounded Total\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Payments\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"cash_bank_account\", \"label\": \"Cash/Bank Account\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"other_charges_calculation\", \"align\": \"left\", \"label\": \"Tax Breakup\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Raw\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"main_item_code\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rm_item_code\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"300px\"}, {\"print_hide\": 0, \"fieldname\": \"batch_no\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"serial_no\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"required_qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"consumed_qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"stock_uom\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"conversion_factor\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"current_stock\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"reference_name\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"bom_detail_no\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"supplied_items\", \"label\": \"Supplied Items\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Terms\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"terms\", \"label\": \"Terms and Conditions1\"}]", 
  "idx": 0, 
  "line_breaks": 0, 
- "modified": "2018-04-07 13:06:08.060353", 
+ "modified": "2019-03-04 13:38:47.362002", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "GST Purchase Invoice", 
diff --git a/erpnext/accounts/print_format/journal_auditing_voucher/__init__.py b/erpnext/accounts/print_format/journal_auditing_voucher/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/print_format/journal_auditing_voucher/__init__.py
diff --git a/erpnext/accounts/print_format/journal_auditing_voucher/journal_auditing_voucher.html b/erpnext/accounts/print_format/journal_auditing_voucher/journal_auditing_voucher.html
new file mode 100644
index 0000000..4565559
--- /dev/null
+++ b/erpnext/accounts/print_format/journal_auditing_voucher/journal_auditing_voucher.html
@@ -0,0 +1,76 @@
+{%- from "templates/print_formats/standard_macros.html" import add_header -%}
+<style>
+    .table-bordered td.top-bottom {border-top: none !important;border-bottom: none !important;}
+    .table-bordered td.right{border-right: none !important;}
+    .table-bordered td.left{border-left: none !important;}
+
+
+</style>
+<div class="page-break">
+    {%- if not doc.get("print_heading") and not doc.get("select_print_heading")
+        and doc.set("select_print_heading", _("Journal Entry")) -%}{%- endif -%}
+    {{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
+    <div class="row margin-bottom">
+            <div class="col-sm-6">
+                <table>
+                <tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
+                </table>
+            </div>
+            <div>
+                <table>
+                    <tr><td><strong>Date: </strong></td><td>{{  frappe.utils.formatdate(doc.creation)  }}</td></tr>
+                </table>
+            </div>
+    </div>
+    <div class="margin-top">
+        <table class="table table-bordered table-condensed">
+            <tr>
+                <th>Account</th>
+                <th>Party Type</th>
+                <th>Party</th>
+                <th>Amount</th>
+            </tr>
+            <tr>
+                    <td class="top-bottom" colspan="5"><strong>Credit</strong></td>
+            </tr>
+            {% set total_credit = 0 -%}
+            {% for entries in doc.gl_entries %}
+            {% if entries.debit == 0.0 %}
+            <tr>
+                <td class="right top-bottom">{{ entries.account }}</td>
+                <td class="right left top-bottom">{{ entries.party_type }}</td>
+                <td class="right left top-bottom">{{ entries.party }}</td>
+                <td class="left top-bottom">{{ entries.credit }}</td>
+                {% set total_credit = total_credit + entries.credit -%}
+            </tr>
+            <tr>
+                    <td class="right" colspan="3"><strong>Total (credit) </strong></td>
+                    <td class="left" >{{total_credit}}</td>
+            </tr>
+            {% endif %}
+            {% endfor %}
+            <tr>
+                    <td class="top-bottom" colspan="4"> </td>
+            </tr>
+            <tr>
+                    <td class="top-bottom" colspan="5"><strong>Debit</strong></td>
+            </tr>
+            {% set total_debit = 0 -%}
+            {% for entries in doc.gl_entries %}
+            {% if entries.credit == 0.0 %}
+            <tr>
+                <td class="right top-bottom">{{ entries.account }}</td>
+                <td class="right left top-bottom">{{ entries.party_type }}</td>
+                <td class="right left top-bottom">{{ entries.party }}</td>
+                {% set total_debit = total_debit + entries.debit -%}
+                <td class="left top-bottom">{{ entries.debit }}</td>
+            </tr>
+            <tr>
+                    <td class="right" colspan="3" ><strong>Total (debit) </strong></td>
+                    <td class="left" >{{total_debit}}</td>
+            </tr>
+            {% endif %}
+            {% endfor %}
+        </table>
+    <div>
+</div>
\ No newline at end of file
diff --git a/erpnext/accounts/print_format/journal_auditing_voucher/journal_auditing_voucher.json b/erpnext/accounts/print_format/journal_auditing_voucher/journal_auditing_voucher.json
new file mode 100644
index 0000000..927e818
--- /dev/null
+++ b/erpnext/accounts/print_format/journal_auditing_voucher/journal_auditing_voucher.json
@@ -0,0 +1,22 @@
+{
+ "align_labels_right": 0, 
+ "creation": "2019-02-15 14:13:05.721784", 
+ "custom_format": 0, 
+ "default_print_language": "en", 
+ "disabled": 0, 
+ "doc_type": "Journal Entry", 
+ "docstatus": 0, 
+ "doctype": "Print Format", 
+ "font": "Default", 
+ "idx": 0, 
+ "line_breaks": 0, 
+ "modified": "2019-02-15 14:13:05.721784", 
+ "modified_by": "Administrator", 
+ "module": "Accounts", 
+ "name": "Journal Auditing Voucher", 
+ "owner": "Administrator", 
+ "print_format_builder": 0, 
+ "print_format_type": "Server", 
+ "show_section_headings": 0, 
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/print_format/purchase_auditing_voucher/__init__.py b/erpnext/accounts/print_format/purchase_auditing_voucher/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/print_format/purchase_auditing_voucher/__init__.py
diff --git a/erpnext/accounts/print_format/purchase_auditing_voucher/purchase_auditing_voucher.html b/erpnext/accounts/print_format/purchase_auditing_voucher/purchase_auditing_voucher.html
new file mode 100644
index 0000000..35852e1
--- /dev/null
+++ b/erpnext/accounts/print_format/purchase_auditing_voucher/purchase_auditing_voucher.html
@@ -0,0 +1,99 @@
+{%- from "templates/print_formats/standard_macros.html" import add_header -%}
+<div class="page-break">
+    {%- if not doc.get("print_heading") and not doc.get("select_print_heading")
+        and doc.set("select_print_heading", _("Purchase Invoice")) -%}{%- endif -%}
+    {{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
+    <div class="row margin-bottom">
+        <div class="col-sm-6">
+            <table>
+            <tr><td><strong>Supplier Name: </strong></td><td>{{ doc.supplier }}</td></tr>
+            <tr><td><strong>Due Date: </strong></td><td>{{ frappe.utils.formatdate(doc.due_date) }}</td></tr>
+            <tr><td><strong>Address: </strong></td><td>{{doc.address_display}}</td></tr>
+            <tr><td><strong>Contact: </strong></td><td>{{doc.contact_display}}</td></tr>
+            <tr><td><strong>Mobile no: </strong> </td><td>{{doc.contact_mobile}}</td></tr>
+            </table>
+        </div>
+        <div>
+            <table>
+                <tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
+                <tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
+            </table>
+        </div>
+    </div>
+    <div class="margin-top margin-bottom">
+        <table class="table table-bordered table-condensed">
+            <tr>
+                <th>SL</th>
+                <th>Item Code</th>
+                <th>Item Name</th>
+                <th>UOM</th>
+                <th>Received Qty.</th>
+                <th>Rejected Qty</th>
+                <th>Qty</th>
+                <th>Basic Rate</th>
+                <th>Amount</th>
+            </tr>
+            {% for item in doc.items %}
+            <tr>
+                <td>{{ loop.index }}</td>
+                <td>{{ item.item_code }}</td>
+                <td>{{ item.item_name }}</td>
+                <td>{{ item.uom }}</td>
+                <td>{{ item.received_qty }}</td>
+                <td>{{ item.rejected_qty }}</td>
+                <td>{{ item.qty}}</td>
+                <td>{{ item.rate }}</td>
+                <td>{{ item.amount }}</td>
+            </tr>
+            {% endfor %}
+        </table>
+    </div>
+    <div class="row margin-bottom">
+        <div class="col-sm-6">
+            <table>
+            <tr><td><strong>Total Quantity: </strong></td><td>{{ doc.total_qty }}</td></tr>
+            <tr><td><strong>Total: </strong></td><td>{{doc.total}}</td></tr>
+            <tr><td><strong>Net Weight: </strong></td><td>{{ doc.total_net_weight }}</td></tr>
+        </table>
+    </div>
+    <div>
+        <table>
+                <tr><td><strong>Tax and Charges: </strong></td><td>{{doc.taxes_and_charges}}</td></tr>
+                {% for tax in doc.taxes %}
+                <tr><td><strong>{{ tax.account_head }}: </strong></td><td>{{ tax.tax_amount_after_discount_amount }}</td></tr>
+                {% endfor %}
+                <tr><td><strong> Taxes and Charges Added: </strong></td><td>{{ doc.taxes_and_charges_added }}</td></tr>
+                <tr><td><strong> Taxes and Charges Deducted: </strong></td><td>{{ doc.taxes_and_charges_deducted }}</td></tr>
+                <tr><td><strong> Total Taxes and Charges: </strong></td><td>{{ doc.total_taxes_and_charges }}</td></tr>
+                <tr><td><strong> Net Payable: </strong></td><td>{{ doc.grand_total }}</td></tr>
+            </table>
+        </div>
+    </div>
+    <div class="margin-top">
+        <table class='table table-bordered table-condensed'>
+            <tr>
+                <th>SL</th>
+                <th>Account</th>
+                <th>Party Type</th>
+                <th>Party</th>
+                <th>Credit Amount</th>
+                <th>Debit Amount</th>
+            </tr>
+            {% for entries in doc.gl_entries %}
+            <tr>
+                <td>{{ loop.index }}</td>
+                <td>{{ entries.account }}</td>
+                <td>{{ entries.party_type }}</td>
+                <td>{{ entries.party }}</td>
+                <td>{{ entries.credit }}</td>
+                <td>{{ entries.debit }}</td>
+            </tr>
+            {% endfor %}
+            <tr>
+                <td colspan="4"><strong>Total</strong></td>
+                <td>{{ doc.grand_total|flt }}</td>
+                <td>{{ doc.grand_total|flt }}</td>
+            </tr>
+        </table>
+    </div>
+</div>
\ No newline at end of file
diff --git a/erpnext/accounts/print_format/purchase_auditing_voucher/purchase_auditing_voucher.json b/erpnext/accounts/print_format/purchase_auditing_voucher/purchase_auditing_voucher.json
new file mode 100644
index 0000000..73779d4
--- /dev/null
+++ b/erpnext/accounts/print_format/purchase_auditing_voucher/purchase_auditing_voucher.json
@@ -0,0 +1,22 @@
+{
+ "align_labels_right": 0, 
+ "creation": "2019-02-14 14:42:35.151611", 
+ "custom_format": 0, 
+ "default_print_language": "en", 
+ "disabled": 0, 
+ "doc_type": "Purchase Invoice", 
+ "docstatus": 0, 
+ "doctype": "Print Format", 
+ "font": "Default", 
+ "idx": 0, 
+ "line_breaks": 0, 
+ "modified": "2019-02-14 14:42:35.151611", 
+ "modified_by": "Administrator", 
+ "module": "Accounts", 
+ "name": "Purchase Auditing Voucher", 
+ "owner": "Administrator", 
+ "print_format_builder": 0, 
+ "print_format_type": "Server", 
+ "show_section_headings": 0, 
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/print_format/sales_auditing_voucher/__init__.py b/erpnext/accounts/print_format/sales_auditing_voucher/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/print_format/sales_auditing_voucher/__init__.py
diff --git a/erpnext/accounts/print_format/sales_auditing_voucher/sales_auditing_voucher.html b/erpnext/accounts/print_format/sales_auditing_voucher/sales_auditing_voucher.html
new file mode 100644
index 0000000..04de83d
--- /dev/null
+++ b/erpnext/accounts/print_format/sales_auditing_voucher/sales_auditing_voucher.html
@@ -0,0 +1,93 @@
+{%- from "templates/print_formats/standard_macros.html" import add_header -%}
+<div class="page-break">
+    {%- if not doc.get("print_heading") and not doc.get("select_print_heading")
+        and doc.set("select_print_heading", _("Sales Invoice")) -%}{%- endif -%}
+    {{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
+    <div class="row margin-bottom">
+        <div class="col-sm-6">
+            <table>
+            <tr><td><strong>Customer Name: </strong></td><td>{{ doc.customer }}</td></tr>
+            <tr><td><strong>Due Date: </strong></td><td>{{ frappe.utils.formatdate(doc.due_date) }}</td></tr>
+            <tr><td><strong>Address: </strong></td><td>{{doc.address_display}}</td></tr>
+            <tr><td><strong>Contact: </strong></td><td>{{doc.contact_display}}</td></tr>
+            <tr><td><strong>Mobile no: </strong> </td><td>{{doc.contact_mobile}}</td></tr>
+            </table>
+        </div>
+        <div>
+            <table>
+                <tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
+                <tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
+            </table>
+        </div>
+    </div>
+    <div class="margin-top margin-bottom">
+        <table class="table table-bordered table-condensed">
+            <tr>
+                <th>SL</th>
+                <th>Item Code</th>
+                <th>Item Name</th>
+                <th>UOM</th>
+                <th>Quantity</th>
+                <th>Basic Rate</th>
+                <th>Amount</th>
+            </tr>
+            {% for item in doc.items %}
+            <tr>
+                <td>{{ loop.index }}</td>
+                <td>{{ item.item_code }}</td>
+                <td>{{ item.item_name }}</td>
+                <td>{{ item.uom }}</td>
+                <td>{{ item.qty}}</td>
+                <td>{{ item.rate }}</td>
+                <td>{{ item.amount }}</td>
+            </tr>
+            {% endfor %}
+        </table>
+    </div>
+    <div class="row margin-bottom">
+        <div class="col-sm-6">
+            <table>
+            <tr><td><strong>Total Quantity: </strong></td><td>{{ doc.total_qty }}</td></tr>
+            <tr><td><strong>Total: </strong></td><td>{{doc.total}}</td></tr>
+            <tr><td><strong>Net Weight: </strong></td><td>{{ doc.total_net_weight }}</td></tr>
+        </table>
+    </div>
+    <div>
+        <table>
+                <tr><td><strong>Tax and Charges: </strong></td><td>{{doc.taxes_and_charges}}</td></tr>
+                {% for tax in doc.taxes %}
+                <tr><td><strong>{{ tax.account_head }}: </strong></td><td>{{ tax.tax_amount_after_discount_amount }}</td></tr>
+                {% endfor %}
+                <tr><td><strong> Total Taxes and Charges: </strong></td><td>{{ doc.total_taxes_and_charges }}</td></tr>
+                <tr><td><strong> Net Payable: </strong></td><td>{{ doc.grand_total }}</td></tr>
+            </table>
+        </div>
+    </div>
+    <div class="margin-top">
+        <table class='table table-bordered table-condensed'>
+            <tr>
+                <th>SL</th>
+                <th>Account</th>
+                <th>Party Type</th>
+                <th>Party</th>
+                <th>Credit Amount</th>
+                <th>Debit Amount</th>
+            </tr>
+            {% for entries in doc.gl_entries %}
+            <tr>
+                <td>{{ loop.index }}</td>
+                <td>{{ entries.account }}</td>
+                <td>{{ entries.party_type }}</td>
+                <td>{{ entries.party }}</td>
+                <td>{{ entries.credit }}</td>
+                <td>{{ entries.debit }}</td>
+            </tr>
+            {% endfor %}
+            <tr>
+                <td colspan="4"><strong>Total</strong></td>
+                <td>{{ doc.grand_total|flt }}</td>
+                <td>{{ doc.grand_total|flt }}</td>
+            </tr>
+        </table>
+    </div>
+</div>
\ No newline at end of file
diff --git a/erpnext/accounts/print_format/sales_auditing_voucher/sales_auditing_voucher.json b/erpnext/accounts/print_format/sales_auditing_voucher/sales_auditing_voucher.json
new file mode 100644
index 0000000..0544e0b
--- /dev/null
+++ b/erpnext/accounts/print_format/sales_auditing_voucher/sales_auditing_voucher.json
@@ -0,0 +1,22 @@
+{
+ "align_labels_right": 0, 
+ "creation": "2019-02-15 15:02:51.454754", 
+ "custom_format": 0, 
+ "default_print_language": "en", 
+ "disabled": 0, 
+ "doc_type": "Sales Invoice", 
+ "docstatus": 0, 
+ "doctype": "Print Format", 
+ "font": "Default", 
+ "idx": 0, 
+ "line_breaks": 0, 
+ "modified": "2019-02-15 15:02:51.454754", 
+ "modified_by": "Administrator", 
+ "module": "Accounts", 
+ "name": "Sales Auditing Voucher", 
+ "owner": "Administrator", 
+ "print_format_builder": 0, 
+ "print_format_type": "Server", 
+ "show_section_headings": 0, 
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/financial_statements.html b/erpnext/accounts/report/financial_statements.html
index 4b3b5f2..449fb84 100644
--- a/erpnext/accounts/report/financial_statements.html
+++ b/erpnext/accounts/report/financial_statements.html
@@ -15,7 +15,7 @@
 		height: 37px;
 	}
 </style>
-{% var letterhead= filters.letter_head || (frappe.get_doc(":Company", filters.company) && frappe.get_doc(":Company", filters.company).default_letter_head) || frappe.defaults.get_default("letter_head"); %}
+{% var letterhead= filters.letter_head || (frappe.get_doc(":Company", filters.company) && frappe.get_doc(":Company", filters.company).default_letter_head) %}
 {% if(letterhead) { %}
 <div style="margin-bottom: 7px;" class="text-center">
 	{%= frappe.boot.letter_heads[letterhead].header %}
diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py
index c251a02..43fb87c 100644
--- a/erpnext/accounts/report/financial_statements.py
+++ b/erpnext/accounts/report/financial_statements.py
@@ -126,7 +126,7 @@
 def get_data(
 		company, root_type, balance_must_be, period_list, filters=None,
 		accumulated_values=1, only_current_fiscal_year=True, ignore_closing_entries=False,
-		ignore_accumulated_values_for_fy=False):
+		ignore_accumulated_values_for_fy=False , total = True):
 
 	accounts = get_accounts(company, root_type)
 	if not accounts:
@@ -154,7 +154,7 @@
 	out = prepare_data(accounts, balance_must_be, period_list, company_currency)
 	out = filter_out_zero_value_rows(out, parent_children_map)
 
-	if out:
+	if out and total:
 		add_total_row(out, root_type, balance_must_be, period_list, company_currency)
 
 	return out
@@ -218,6 +218,9 @@
 			"year_start_date": year_start_date,
 			"year_end_date": year_end_date,
 			"currency": company_currency,
+			"include_in_gross": d.include_in_gross,
+			"account_type": d.account_type,
+			"is_group": d.is_group,
 			"opening_balance": d.get("opening_balance", 0.0) * (1 if balance_must_be=="Debit" else -1),
 			"account_name": ('%s - %s' %(_(d.account_number), _(d.account_name))
 				if d.account_number else _(d.account_name))
@@ -285,7 +288,7 @@
 
 def get_accounts(company, root_type):
 	return frappe.db.sql("""
-		select name, account_number, parent_account, lft, rgt, root_type, report_type, account_name
+		select name, account_number, parent_account, lft, rgt, root_type, report_type, account_name, include_in_gross, account_type, is_group, lft, rgt
 		from `tabAccount`
 		where company=%s and root_type=%s order by lft""", (company, root_type), as_dict=True)
 
diff --git a/erpnext/accounts/report/gross_and_net_profit_report/__init__.py b/erpnext/accounts/report/gross_and_net_profit_report/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/report/gross_and_net_profit_report/__init__.py
diff --git a/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.html b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.html
new file mode 100644
index 0000000..40ba20c
--- /dev/null
+++ b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.html
@@ -0,0 +1 @@
+{% include "accounts/report/financial_statements.html" %}
\ No newline at end of file
diff --git a/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.js b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.js
new file mode 100644
index 0000000..63ac281
--- /dev/null
+++ b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.js
@@ -0,0 +1,51 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+/* eslint-disable */
+
+frappe.query_reports["Gross and Net Profit Report"] = {
+	"filters": [
+
+	]
+}
+frappe.require("assets/erpnext/js/financial_statements.js", function() {
+	frappe.query_reports["Gross and Net Profit Report"] = $.extend({},
+		erpnext.financial_statements);
+
+	frappe.query_reports["Gross and Net Profit Report"]["filters"].push(
+		{
+			"fieldname":"project",
+			"label": __("Project"),
+			"fieldtype": "MultiSelect",
+			get_data: function() {
+				var projects = frappe.query_report.get_filter_value("project") || "";
+
+				const values = projects.split(/\s*,\s*/).filter(d => d);
+				const txt = projects.match(/[^,\s*]*$/)[0] || '';
+				let data = [];
+
+				frappe.call({
+					type: "GET",
+					method:'frappe.desk.search.search_link',
+					async: false,
+					no_spinner: true,
+					args: {
+						doctype: "Project",
+						txt: txt,
+						filters: {
+							"name": ["not in", values]
+						}
+					},
+					callback: function(r) {
+						data = r.results;
+					}
+				});
+				return data;
+			}
+		},
+		{
+			"fieldname": "accumulated_values",
+			"label": __("Accumulated Values"),
+			"fieldtype": "Check"
+		}
+	);
+});
diff --git a/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.json b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.json
new file mode 100644
index 0000000..994b47f
--- /dev/null
+++ b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.json
@@ -0,0 +1,30 @@
+{
+ "add_total_row": 0, 
+ "creation": "2019-02-08 10:58:55.763090", 
+ "disable_prepared_report": 0, 
+ "disabled": 0, 
+ "docstatus": 0, 
+ "doctype": "Report", 
+ "idx": 0, 
+ "is_standard": "Yes", 
+ "modified": "2019-02-08 10:58:55.763090", 
+ "modified_by": "Administrator", 
+ "module": "Accounts", 
+ "name": "Gross and Net Profit Report", 
+ "owner": "Administrator", 
+ "prepared_report": 0, 
+ "ref_doctype": "GL Entry", 
+ "report_name": "Gross and Net Profit Report", 
+ "report_type": "Script Report", 
+ "roles": [
+  {
+   "role": "Accounts User"
+  }, 
+  {
+   "role": "Accounts Manager"
+  }, 
+  {
+   "role": "Auditor"
+  }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.py b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.py
new file mode 100644
index 0000000..6550981
--- /dev/null
+++ b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.py
@@ -0,0 +1,154 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from frappe.utils import flt
+from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, get_data)
+import copy
+
+
+def execute(filters=None):
+	period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year,
+		filters.periodicity, filters.accumulated_values, filters.company)
+
+	columns, data = [], []
+
+	income = get_data(filters.company, "Income", "Credit", period_list, filters = filters,
+		accumulated_values=filters.accumulated_values,
+		ignore_closing_entries=True, ignore_accumulated_values_for_fy= True, total= False)
+
+	expense = get_data(filters.company, "Expense", "Debit", period_list, filters=filters,
+		accumulated_values=filters.accumulated_values,
+		ignore_closing_entries=True, ignore_accumulated_values_for_fy= True, total= False)
+
+	columns = get_columns(filters.periodicity, period_list, filters.accumulated_values, filters.company)
+
+
+	gross_income = get_revenue(income, period_list)
+
+	gross_expense = get_revenue(expense, period_list)
+
+	if(len(gross_income)==0 and len(gross_expense)== 0):
+		data.append({"account_name": "'" + _("Nothing is included in gross") + "'",
+		"account": "'" + _("Nothing is included in gross") + "'"})
+
+		return columns, data
+
+	data.append({"account_name": "'" + _("Included in Gross Profit") + "'",
+		"account": "'" + _("Included in Gross Profit") + "'"})
+
+	data.append({})
+	data.extend(gross_income or [])
+
+	data.append({})
+	data.extend(gross_expense or [])
+
+	data.append({})
+	gross_profit = get_profit(gross_income, gross_expense, period_list, filters.company, 'Gross Profit',filters.presentation_currency)
+	data.append(gross_profit)
+
+	non_gross_income = get_revenue(income, period_list, 0)
+	data.append({})
+	data.extend(non_gross_income or [])
+
+	non_gross_expense = get_revenue(expense, period_list, 0)
+	data.append({})
+	data.extend(non_gross_expense or [])
+
+	net_profit = get_net_profit(non_gross_income, gross_income, gross_expense, non_gross_expense, period_list, filters.company,filters.presentation_currency)
+	data.append({})
+	data.append(net_profit)
+
+	return columns, data
+
+def get_revenue(data, period_list, include_in_gross=1):
+	revenue = [item for item in data if item['include_in_gross']==include_in_gross or item['is_group']==1]
+
+	data_to_be_removed =True
+	while data_to_be_removed:
+		revenue, data_to_be_removed = remove_parent_with_no_child(revenue, period_list)
+	revenue = adjust_account(revenue, period_list)
+	return copy.deepcopy(revenue)
+
+def remove_parent_with_no_child(data, period_list):
+	data_to_be_removed = False
+	for parent in data:
+		if 'is_group' in parent and parent.get("is_group") == 1:
+			have_child = False
+			for child in data:
+				if 'parent_account' in child  and child.get("parent_account") == parent.get("account"):
+					have_child = True
+					break
+
+			if not have_child:
+				data_to_be_removed = True
+				data.remove(parent)
+
+	return data, data_to_be_removed
+
+def adjust_account(data, period_list, consolidated= False):
+	leaf_nodes = [item for item in data if item['is_group'] == 0]
+	totals = {}
+	for node in leaf_nodes:
+		set_total(node, node["total"], data, totals)
+	for d in data:
+		for period in period_list:
+			key = period if consolidated else period.key
+			d[key] = totals[d["account"]]
+			d['total'] = totals[d["account"]]
+	return data
+
+def set_total(node, value, complete_list, totals):
+	if not totals.get(node['account']):
+		totals[node["account"]] = 0
+	totals[node["account"]] += value
+
+	parent = node['parent_account']
+	if not parent == '':
+		return set_total(next(item for item in complete_list if item['account'] == parent), value, complete_list, totals)
+
+
+def get_profit(gross_income, gross_expense, period_list, company, profit_type, currency=None, consolidated=False):
+
+	profit_loss = {
+		"account_name": "'" + _(profit_type) + "'",
+		"account": "'" + _(profit_type) + "'",
+		"warn_if_negative": True,
+		"currency": currency or frappe.get_cached_value('Company',  company,  "default_currency")
+	}
+
+	has_value = False
+
+	for period in period_list:
+		key = period if consolidated else period.key
+		profit_loss[key] = flt(gross_income[0].get(key, 0)) - flt(gross_expense[0].get(key, 0))
+
+		if profit_loss[key]:
+			has_value=True
+
+	if has_value:
+		return profit_loss
+
+def get_net_profit(non_gross_income, gross_income, gross_expense, non_gross_expense, period_list, company, currency=None, consolidated=False):
+	profit_loss = {
+		"account_name": "'" + _("Net Profit") + "'",
+		"account": "'" + _("Net Profit") + "'",
+		"warn_if_negative": True,
+		"currency": currency or frappe.get_cached_value('Company',  company,  "default_currency")
+	}
+
+	has_value = False
+
+	for period in period_list:
+		key = period if consolidated else period.key
+		total_income = flt(gross_income[0].get(key, 0)) + flt(non_gross_income[0].get(key, 0))
+		total_expense = flt(gross_expense[0].get(key, 0)) + flt(non_gross_expense[0].get(key, 0))
+		profit_loss[key] = flt(total_income) - flt(total_expense)
+
+		if profit_loss[key]:
+			has_value=True
+
+	if has_value:
+		return profit_loss
diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py
index 20af2c2..4d26aa3 100644
--- a/erpnext/accounts/report/gross_profit/gross_profit.py
+++ b/erpnext/accounts/report/gross_profit/gross_profit.py
@@ -6,7 +6,7 @@
 from frappe import _, scrub
 from erpnext.stock.utils import get_incoming_rate
 from erpnext.controllers.queries import get_match_cond
-from frappe.utils import flt
+from frappe.utils import flt, cint
 
 
 def execute(filters=None):
@@ -106,11 +106,14 @@
 		self.grouped = {}
 		self.grouped_data = []
 
+		self.currency_precision = cint(frappe.db.get_default("currency_precision")) or 3
+		self.float_precision = cint(frappe.db.get_default("float_precision")) or 2
+
 		for row in self.si_list:
 			if self.skip_row(row, self.product_bundles):
 				continue
 
-			row.base_amount = flt(row.base_net_amount)
+			row.base_amount = flt(row.base_net_amount, self.currency_precision)
 
 			product_bundles = []
 			if row.update_stock:
@@ -129,15 +132,15 @@
 
 			# get buying rate
 			if row.qty:
-				row.buying_rate = row.buying_amount / row.qty
-				row.base_rate = row.base_amount / row.qty
+				row.buying_rate = flt(row.buying_amount / row.qty, self.float_precision)
+				row.base_rate = flt(row.base_amount / row.qty, self.float_precision)
 			else:
 				row.buying_rate, row.base_rate = 0.0, 0.0
 
 			# calculate gross profit
-			row.gross_profit = flt(row.base_amount - row.buying_amount, 3)
+			row.gross_profit = flt(row.base_amount - row.buying_amount, self.currency_precision)
 			if row.base_amount:
-				row.gross_profit_percent = flt((row.gross_profit / row.base_amount) * 100.0, 3)
+				row.gross_profit_percent = flt((row.gross_profit / row.base_amount) * 100.0, self.currency_precision)
 			else:
 				row.gross_profit_percent = 0.0
 
@@ -156,8 +159,8 @@
 						new_row = row
 					else:
 						new_row.qty += row.qty
-						new_row.buying_amount += row.buying_amount
-						new_row.base_amount += row.base_amount
+						new_row.buying_amount += flt(row.buying_amount, self.currency_precision)
+						new_row.base_amount += flt(row.base_amount, self.currency_precision)
 				new_row = self.set_average_rate(new_row)
 				self.grouped_data.append(new_row)
 			else:
@@ -167,18 +170,19 @@
 						returned_item_rows = self.returned_invoices[row.parent][row.item_code]
 						for returned_item_row in returned_item_rows:
 							row.qty += returned_item_row.qty
-							row.base_amount += returned_item_row.base_amount
-						row.buying_amount = row.qty * row.buying_rate
+							row.base_amount += flt(returned_item_row.base_amount, self.currency_precision)
+						row.buying_amount = flt(row.qty * row.buying_rate, self.currency_precision)
 					if row.qty or row.base_amount:
 						row = self.set_average_rate(row)
 						self.grouped_data.append(row)
 
 	def set_average_rate(self, new_row):
-		new_row.gross_profit = flt(new_row.base_amount - new_row.buying_amount,3)
-		new_row.gross_profit_percent = flt(((new_row.gross_profit / new_row.base_amount) * 100.0),3) \
+		new_row.gross_profit = flt(new_row.base_amount - new_row.buying_amount, self.currency_precision)
+		new_row.gross_profit_percent = flt(((new_row.gross_profit / new_row.base_amount) * 100.0), self.currency_precision) \
 			if new_row.base_amount else 0
-		new_row.buying_rate = (new_row.buying_amount / new_row.qty) if new_row.qty else 0
-		new_row.base_rate = (new_row.base_amount / new_row.qty) if new_row.qty else 0
+		new_row.buying_rate = flt(new_row.buying_amount / new_row.qty, self.float_precision) if new_row.qty else 0
+		new_row.base_rate = flt(new_row.base_amount / new_row.qty, self.float_precision) if new_row.qty else 0
+
 		return new_row
 
 	def get_returned_invoice_items(self):
diff --git a/erpnext/buying/doctype/supplier/supplier_dashboard.py b/erpnext/buying/doctype/supplier/supplier_dashboard.py
index aea1e2d..887a093 100644
--- a/erpnext/buying/doctype/supplier/supplier_dashboard.py
+++ b/erpnext/buying/doctype/supplier/supplier_dashboard.py
@@ -1,11 +1,16 @@
 from __future__ import unicode_literals
+
 from frappe import _
 
+
 def get_data():
 	return {
 		'heatmap': True,
 		'heatmap_message': _('This is based on transactions against this Supplier. See timeline below for details'),
 		'fieldname': 'supplier',
+		'non_standard_fieldnames': {
+			'Payment Entry': 'party_name'
+		},
 		'transactions': [
 			{
 				'label': _('Procurement'),
@@ -16,8 +21,12 @@
 				'items': ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']
 			},
 			{
+				'label': _('Payments'),
+				'items': ['Payment Entry']
+			},
+			{
 				'label': _('Pricing'),
 				'items': ['Pricing Rule']
 			}
 		]
-	}
\ No newline at end of file
+	}
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index 85a6310..1bf03ec 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -172,8 +172,8 @@
 				or tabItem.item_code LIKE %(txt)s
 				or tabItem.item_group LIKE %(txt)s
 				or tabItem.item_name LIKE %(txt)s
-				or tabItem.item_code IN (select parent from `tabItem Barcode` where barcode LIKE %(txt)s
-				{description_cond}))
+				or tabItem.item_code IN (select parent from `tabItem Barcode` where barcode LIKE %(txt)s)
+				{description_cond})
 			{fcond} {mcond}
 		order by
 			if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999),
diff --git a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py
index c21f11e..1c39d88 100644
--- a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py
+++ b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py
@@ -162,6 +162,8 @@
 		igroup.parent_item_group =  mws_settings.item_group
 		igroup.insert()
 
+	item.append("item_defaults", {'company':mws_settings.company})
+
 	item.insert(ignore_permissions=True)
 	create_item_price(amazon_item_json, item.item_code)
 
@@ -213,7 +215,7 @@
 			fulfillment_channels=["MFN", "AFN"],
 			lastupdatedafter=after_date,
 			orderstatus=statuses,
-			max_results='20')
+			max_results='50')
 
 		while True:
 			orders_list = []
@@ -432,8 +434,8 @@
 	return final_order_items
 
 def get_item_code(order_item):
-	asin = order_item.ASIN
-	item_code = frappe.db.get_value("Item", {"amazon_item_code": asin}, "item_code")
+	sku = order_item.SellerSKU
+	item_code = frappe.db.get_value("Item", {"item_code": sku}, "item_code")
 	if item_code:
 		return item_code
 
@@ -451,11 +453,16 @@
 			shipment_item_list = return_as_list(shipment_event.ShipmentEvent.ShipmentItemList.ShipmentItem)
 
 			for shipment_item in shipment_item_list:
-				charges = return_as_list(shipment_item.ItemChargeList.ChargeComponent)
-				fees = return_as_list(shipment_item.ItemFeeList.FeeComponent)
+				charges, fees = []
+
+				if 'ItemChargeList' in shipment_item.keys():
+					charges = return_as_list(shipment_item.ItemChargeList.ChargeComponent)
+
+				if 'ItemFeeList' in shipment_item.keys():
+					fees = return_as_list(shipment_item.ItemFeeList.FeeComponent)
 
 				for charge in charges:
-					if(charge.ChargeType != "Principal"):
+					if(charge.ChargeType != "Principal") and float(charge.ChargeAmount.CurrencyAmount) != 0:
 						charge_account = get_account(charge.ChargeType)
 						charges_fees.get("charges").append({
 							"charge_type":"Actual",
@@ -465,13 +472,14 @@
 							})
 
 				for fee in fees:
-					fee_account = get_account(fee.FeeType)
-					charges_fees.get("fees").append({
-						"charge_type":"Actual",
-						"account_head": fee_account,
-						"tax_amount": fee.FeeAmount.CurrencyAmount,
-						"description": fee.FeeType + " for " + shipment_item.SellerSKU
-						})
+					if float(fee.FeeAmount.CurrencyAmount) != 0:
+						fee_account = get_account(fee.FeeType)
+						charges_fees.get("fees").append({
+							"charge_type":"Actual",
+							"account_head": fee_account,
+							"tax_amount": fee.FeeAmount.CurrencyAmount,
+							"description": fee.FeeType + " for " + shipment_item.SellerSKU
+							})
 
 	return charges_fees
 
diff --git a/erpnext/hr/doctype/training_event/training_event.json b/erpnext/hr/doctype/training_event/training_event.json
index 4b812a9..527ac1b 100644
--- a/erpnext/hr/doctype/training_event/training_event.json
+++ b/erpnext/hr/doctype/training_event/training_event.json
@@ -214,7 +214,7 @@
    "label": "Level", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "\nBeginner\nExpert\nAdvance", 
+   "options": "\nBeginner\nIntermediate\nAdvance", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -847,4 +847,4 @@
  "title_field": "event_name", 
  "track_changes": 0, 
  "track_seen": 0
-}
\ No newline at end of file
+}
diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py
index 9873efa..947d693 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order.py
+++ b/erpnext/manufacturing/doctype/work_order/work_order.py
@@ -282,6 +282,10 @@
 			total_bundle_qty = frappe.db.sql(""" select sum(qty) from
 				`tabProduct Bundle Item` where parent = %s""", (frappe.db.escape(self.product_bundle_item)))[0][0]
 
+			if not total_bundle_qty:
+				# product bundle is 0 (product bundle allows 0 qty for items)
+				total_bundle_qty = 1
+
 		cond = "product_bundle_item = %s" if self.product_bundle_item else "production_item = %s"
 
 		qty = frappe.db.sql(""" select sum(qty) from
diff --git a/erpnext/patches/v10_0/item_barcode_childtable_migrate.py b/erpnext/patches/v10_0/item_barcode_childtable_migrate.py
index bc60056..e30e0a7 100644
--- a/erpnext/patches/v10_0/item_barcode_childtable_migrate.py
+++ b/erpnext/patches/v10_0/item_barcode_childtable_migrate.py
@@ -27,5 +27,5 @@
 					'parent': item.name,
 					'parentfield': 'barcodes'
 				}).insert()
-			except frappe.DuplicateEntryError:
+			except (frappe.DuplicateEntryError, frappe.UniqueValidationError):
 				continue
diff --git a/erpnext/patches/v12_0/set_task_status.py b/erpnext/patches/v12_0/set_task_status.py
index 44000cf..32b8177 100644
--- a/erpnext/patches/v12_0/set_task_status.py
+++ b/erpnext/patches/v12_0/set_task_status.py
@@ -1,5 +1,17 @@
 import frappe
 
 def execute():
+    frappe.reload_doctype('Task')
+    frappe.reload_doctype('Project Task')
+
+    # add "Completed" if customized
+    for doctype in ('Task', 'Project Task'):
+        property_setter_name = frappe.db.exists('Property Setter', dict(doc_type = doctype, field_name = 'status', property = 'options'))
+        if property_setter_name:
+            property_setter = frappe.get_doc('Property Setter', property_setter_name)
+            if not "Completed" in property_setter.value:
+                property_setter.value = property_setter.value + '\nCompleted'
+                property_setter.save()
+
     # renamed default status to Completed as status "Closed" is ambiguous
     frappe.db.sql('update tabTask set status = "Completed" where status = "Closed"')
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js
index a366a25..6de6454 100644
--- a/erpnext/projects/doctype/project/project.js
+++ b/erpnext/projects/doctype/project/project.js
@@ -9,7 +9,7 @@
 					indicator = 'red';
 				} else if (doc.status == 'Cancelled') {
 					indicator = 'dark grey';
-				} else if (doc.status == 'Closed') {
+				} else if (doc.status == 'Completed') {
 					indicator = 'green';
 				}
 				return indicator;
diff --git a/erpnext/projects/doctype/task/task_list.js b/erpnext/projects/doctype/task/task_list.js
index 29d2a73..941fe97 100644
--- a/erpnext/projects/doctype/task/task_list.js
+++ b/erpnext/projects/doctype/task/task_list.js
@@ -9,7 +9,7 @@
 			listview.call_for_selected_items(method, {"status": "Open"});
 		});
 
-		listview.page.add_menu_item(__("Set as Closed"), function() {
+		listview.page.add_menu_item(__("Set as Completed"), function() {
 			listview.call_for_selected_items(method, {"status": "Completed"});
 		});
 	},
diff --git a/erpnext/projects/report/billing_summary.py b/erpnext/projects/report/billing_summary.py
new file mode 100644
index 0000000..214dcef
--- /dev/null
+++ b/erpnext/projects/report/billing_summary.py
@@ -0,0 +1,123 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from frappe.utils import time_diff_in_hours
+
+def get_columns():
+	return [
+		{
+			"label": _("Employee ID"),
+			"fieldtype": "Link",
+			"fieldname": "employee",
+			"options": "Employee",
+			"width": 300
+		},
+		{
+			"label": _("Employee Name"),
+			"fieldtype": "data",
+			"fieldname": "employee_name",
+			"hidden": 1,
+			"width": 200
+		},
+		{
+			"label": _("Timesheet"),
+			"fieldtype": "Link",
+			"fieldname": "timesheet",
+			"options": "Timesheet",
+			"width": 150
+		},
+		{
+			"label": _("Total Billable Hours"),
+			"fieldtype": "Int",
+			"fieldname": "total_billable_hours",
+			"width": 50
+		},
+		{
+			"label": _("Total Hours"),
+			"fieldtype": "Int",
+			"fieldname": "total_hours",
+			"width": 50
+		},
+		{
+			"label": _("Amount"),
+			"fieldtype": "Int",
+			"fieldname": "amount",
+			"width": 100
+		}
+	]
+
+def get_data(filters):
+	data = []
+	record = get_records(filters)
+
+	for entries in record:
+		total_hours = 0
+		total_billable_hours = 0
+		total_amount = 0
+		entries_exists = False
+		timesheet_details = get_timesheet_details(filters, entries.name)
+		for activity in timesheet_details:
+			entries_exists = True
+			time_start = activity.from_time
+			time_end = frappe.utils.add_to_date(activity.from_time, hours=activity.hours)
+			from_date = frappe.utils.get_datetime(filters.from_date)
+			to_date = frappe.utils.get_datetime(filters.to_date)
+
+			if time_start <= from_date and time_end <= to_date:
+				total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
+					time_end, from_date, total_hours, total_billable_hours, total_amount)
+			elif time_start >= from_date and time_end >= to_date:
+				total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
+					to_date, time_start, total_hours, total_billable_hours, total_amount)
+			elif time_start >= from_date and time_end <= to_date:
+				total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
+					time_end, time_start, total_hours, total_billable_hours, total_amount)
+
+		row = {
+			"employee": entries.employee,
+			"employee_name": entries.employee_name,
+			"timesheet": entries.name,
+			"total_billable_hours": total_billable_hours,
+			"total_hours": total_hours,
+			"amount": total_amount
+		}
+
+		if entries_exists:
+			data.append(row)
+			entries_exists = False
+
+	return data
+
+def get_records(filters):
+	record_filters = [
+			["start_date", "<=", filters.to_date],
+			["end_date", ">=", filters.from_date]
+		]
+
+	if "employee" in filters:
+		record_filters.append(["employee", "=", filters.employee])
+
+	return frappe.get_all("Timesheet", filters=record_filters, fields=[" * "] )
+
+def get_billable_and_total_hours(activity, end, start, total_hours, total_billable_hours, total_amount):
+	total_hours += abs(time_diff_in_hours(end, start))
+	if activity.billable:
+		total_billable_hours += abs(time_diff_in_hours(end, start))
+		total_amount += total_billable_hours * activity.billing_rate
+	return total_hours, total_billable_hours, total_amount
+
+def get_timesheet_details(filters, parent):
+	timesheet_details_filter = {"parent": parent}
+
+	if "project" in filters:
+		timesheet_details_filter["project"] = filters.project
+
+	return frappe.get_all(
+		"Timesheet Detail",
+		filters = timesheet_details_filter,
+		fields=["*"]
+		)
diff --git a/erpnext/projects/report/employee_billing_summary/__init__.py b/erpnext/projects/report/employee_billing_summary/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/projects/report/employee_billing_summary/__init__.py
diff --git a/erpnext/projects/report/employee_billing_summary/employee_billing_summary.js b/erpnext/projects/report/employee_billing_summary/employee_billing_summary.js
new file mode 100644
index 0000000..65c2a69
--- /dev/null
+++ b/erpnext/projects/report/employee_billing_summary/employee_billing_summary.js
@@ -0,0 +1,29 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+/* eslint-disable */
+
+frappe.query_reports["Employee Billing Summary"] = {
+	"filters": [
+		{
+			fieldname: "employee",
+			label: __("Employee"),
+			fieldtype: "Link",
+			options: "Employee",
+			reqd: 1
+		},
+		{
+			fieldname:"from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1
+		},
+		{
+			fieldname:"to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_days(frappe.datetime.get_today(), 30),
+			reqd: 1
+		},
+	]
+}
diff --git a/erpnext/projects/report/employee_billing_summary/employee_billing_summary.json b/erpnext/projects/report/employee_billing_summary/employee_billing_summary.json
new file mode 100644
index 0000000..433ebac
--- /dev/null
+++ b/erpnext/projects/report/employee_billing_summary/employee_billing_summary.json
@@ -0,0 +1,36 @@
+{
+ "add_total_row": 0, 
+ "creation": "2019-03-08 15:08:19.929728", 
+ "disable_prepared_report": 0, 
+ "disabled": 0, 
+ "docstatus": 0, 
+ "doctype": "Report", 
+ "idx": 0, 
+ "is_standard": "Yes", 
+ "modified": "2019-03-08 15:08:19.929728", 
+ "modified_by": "Administrator", 
+ "module": "Projects", 
+ "name": "Employee Billing Summary", 
+ "owner": "Administrator", 
+ "prepared_report": 0, 
+ "ref_doctype": "Timesheet", 
+ "report_name": "Employee Billing Summary", 
+ "report_type": "Script Report", 
+ "roles": [
+  {
+   "role": "Projects User"
+  }, 
+  {
+   "role": "HR User"
+  }, 
+  {
+   "role": "Manufacturing User"
+  }, 
+  {
+   "role": "Employee"
+  }, 
+  {
+   "role": "Accounts User"
+  }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/projects/report/employee_billing_summary/employee_billing_summary.py b/erpnext/projects/report/employee_billing_summary/employee_billing_summary.py
new file mode 100644
index 0000000..cd5ad78
--- /dev/null
+++ b/erpnext/projects/report/employee_billing_summary/employee_billing_summary.py
@@ -0,0 +1,14 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from erpnext.projects.report.billing_summary import get_columns, get_data
+
+def execute(filters=None):
+	filters = frappe._dict(filters or {})
+	columns = get_columns()
+
+	data = get_data(filters)
+	return columns, data
\ No newline at end of file
diff --git a/erpnext/projects/report/project_billing_summary/__init__.py b/erpnext/projects/report/project_billing_summary/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/projects/report/project_billing_summary/__init__.py
diff --git a/erpnext/projects/report/project_billing_summary/project_billing_summary.js b/erpnext/projects/report/project_billing_summary/project_billing_summary.js
new file mode 100644
index 0000000..62362c3
--- /dev/null
+++ b/erpnext/projects/report/project_billing_summary/project_billing_summary.js
@@ -0,0 +1,29 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+/* eslint-disable */
+
+frappe.query_reports["Project Billing Summary"] = {
+	"filters": [
+		{
+			fieldname: "project",
+			label: __("Project"),
+			fieldtype: "Link",
+			options: "Project",
+			reqd: 1
+		},
+		{
+			fieldname:"from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1
+		},
+		{
+			fieldname:"to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_days(frappe.datetime.get_today(), 30),
+			reqd: 1
+		},
+	]
+}
diff --git a/erpnext/projects/report/project_billing_summary/project_billing_summary.json b/erpnext/projects/report/project_billing_summary/project_billing_summary.json
new file mode 100644
index 0000000..a3f91c8
--- /dev/null
+++ b/erpnext/projects/report/project_billing_summary/project_billing_summary.json
@@ -0,0 +1,36 @@
+{
+ "add_total_row": 0, 
+ "creation": "2019-03-11 16:22:39.460524", 
+ "disable_prepared_report": 0, 
+ "disabled": 0, 
+ "docstatus": 0, 
+ "doctype": "Report", 
+ "idx": 0, 
+ "is_standard": "Yes", 
+ "modified": "2019-03-11 16:22:39.460524", 
+ "modified_by": "Administrator", 
+ "module": "Projects", 
+ "name": "Project Billing Summary", 
+ "owner": "Administrator", 
+ "prepared_report": 0, 
+ "ref_doctype": "Timesheet", 
+ "report_name": "Project Billing Summary", 
+ "report_type": "Script Report", 
+ "roles": [
+  {
+   "role": "Projects User"
+  }, 
+  {
+   "role": "HR User"
+  }, 
+  {
+   "role": "Manufacturing User"
+  }, 
+  {
+   "role": "Employee"
+  }, 
+  {
+   "role": "Accounts User"
+  }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/projects/report/project_billing_summary/project_billing_summary.py b/erpnext/projects/report/project_billing_summary/project_billing_summary.py
new file mode 100644
index 0000000..cd5ad78
--- /dev/null
+++ b/erpnext/projects/report/project_billing_summary/project_billing_summary.py
@@ -0,0 +1,14 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from erpnext.projects.report.billing_summary import get_columns, get_data
+
+def execute(filters=None):
+	filters = frappe._dict(filters or {})
+	columns = get_columns()
+
+	data = get_data(filters)
+	return columns, data
\ No newline at end of file
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index 5da7e73..1430383 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -314,14 +314,21 @@
 
 				show_description(row_to_modify.idx, row_to_modify.item_code);
 
+				this.frm.from_barcode = true;
 				frappe.model.set_value(row_to_modify.doctype, row_to_modify.name, {
 					item_code: data.item_code,
 					qty: (row_to_modify.qty || 0) + 1
 				});
 
-				this.frm.refresh_field('items');
+				['serial_no', 'batch_no', 'barcode'].forEach(field => {
+					if (data[field] && frappe.meta.has_field(row_to_modify.doctype, field)) {
+						frappe.model.set_value(row_to_modify.doctype,
+							row_to_modify.name, field, data[field]);
+					}
+				});
+
+				scan_barcode_field.set_value('');
 			});
-			scan_barcode_field.set_value('');
 		}
 		return false;
 	},
@@ -384,10 +391,12 @@
 			// barcode cleared, remove item
 			d.item_code = "";
 		}
-		this.item_code(doc, cdt, cdn, true);
+
+		this.frm.from_barcode = true;
+		this.item_code(doc, cdt, cdn);
 	},
 
-	item_code: function(doc, cdt, cdn, from_barcode) {
+	item_code: function(doc, cdt, cdn) {
 		var me = this;
 		var item = frappe.get_doc(cdt, cdn);
 		var update_stock = 0, show_batch_dialog = 0;
@@ -400,9 +409,11 @@
 			show_batch_dialog = 1;
 		}
 		// clear barcode if setting item (else barcode will take priority)
-		if(!from_barcode) {
+		if(!this.frm.from_barcode) {
 			item.barcode = null;
 		}
+
+		this.frm.from_barcode = false;
 		if(item.item_code || item.barcode || item.serial_no) {
 			if(!this.validate_company_and_party()) {
 				this.frm.fields_dict["items"].grid.grid_rows[item.idx - 1].remove();
diff --git a/erpnext/regional/italy/utils.py b/erpnext/regional/italy/utils.py
index f55fa97..52a5ddc 100644
--- a/erpnext/regional/italy/utils.py
+++ b/erpnext/regional/italy/utils.py
@@ -353,4 +353,7 @@
 		return
 
 	state_codes_lower = {key.lower():value for key,value in state_codes.items()}
-	doc.state_code = state_codes_lower.get(doc.get('state','').lower())
+
+	state = doc.get('state','').lower()
+	if state_codes_lower.get(state):
+		doc.state_code = state_codes_lower.get(state)
diff --git a/erpnext/selling/doctype/customer/customer_dashboard.py b/erpnext/selling/doctype/customer/customer_dashboard.py
index f2f430a..3142ea2 100644
--- a/erpnext/selling/doctype/customer/customer_dashboard.py
+++ b/erpnext/selling/doctype/customer/customer_dashboard.py
@@ -1,11 +1,16 @@
 from __future__ import unicode_literals
+
 from frappe import _
 
+
 def get_data():
 	return {
 		'heatmap': True,
 		'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'),
 		'fieldname': 'customer',
+		'non_standard_fieldnames': {
+			'Payment Entry': 'party_name'
+		},
 		'transactions': [
 			{
 				'label': _('Pre Sales'),
@@ -16,6 +21,10 @@
 				'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
 			},
 			{
+				'label': _('Payments'),
+				'items': ['Payment Entry']
+			},
+			{
 				'label': _('Support'),
 				'items': ['Issue']
 			},
@@ -32,4 +41,4 @@
 				'items': ['Subscription']
 			}
 		]
-	}
\ No newline at end of file
+	}
diff --git a/erpnext/selling/report/address_and_contacts/address_and_contacts.py b/erpnext/selling/report/address_and_contacts/address_and_contacts.py
index eb242d0..a9e4303 100644
--- a/erpnext/selling/report/address_and_contacts/address_and_contacts.py
+++ b/erpnext/selling/report/address_and_contacts/address_and_contacts.py
@@ -102,8 +102,7 @@
 	records = frappe.get_list(doctype, filters=filters, fields=fields, as_list=True)
 	for d in records:
 		details = party_details.get(d[0])
-		if details:
-			details.setdefault(frappe.scrub(doctype), []).append(d[1:])
+		details.setdefault(frappe.scrub(doctype), []).append(d[1:])
 
 	return party_details
 
diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.py b/erpnext/stock/report/stock_ledger/stock_ledger.py
index 0bb0b23..46c55d2 100644
--- a/erpnext/stock/report/stock_ledger/stock_ledger.py
+++ b/erpnext/stock/report/stock_ledger/stock_ledger.py
@@ -113,7 +113,7 @@
 		cf_join = "left join `tabUOM Conversion Detail` ucd on ucd.parent=item.name and ucd.uom='%s'" \
 			% frappe.db.escape(include_uom)
 
-	item_codes = ', '.join(['"' + frappe.db.escape(i, percent=False) + '"' for i in items])
+	item_codes = ', '.join([frappe.db.escape(i, percent=False) for i in items])
 	res = frappe.db.sql("""
 		select
 			item.name, item.item_name, item.description, item.item_group, item.brand, item.stock_uom {cf_field}