Merge pull request #7529 from rohitwaghchaure/budget_issue

[Fix] Budget not working properly
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py
index aa69342..f690878 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.py
+++ b/erpnext/manufacturing/doctype/production_order/production_order.py
@@ -304,9 +304,9 @@
 
 	def get_operations_data(self, data):
 		return {
-			'from_time': data.planned_start_time,
+			'from_time': get_datetime(data.planned_start_time),
 			'hours': data.time_in_mins / 60.0,
-			'to_time': data.planned_end_time,
+			'to_time': get_datetime(data.planned_end_time),
 			'project': self.project,
 			'operation': data.operation,
 			'operation_id': data.name,
diff --git a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py
index cdf7263..acb709f 100644
--- a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py
+++ b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py
@@ -12,22 +12,23 @@
 	def get_items_from_purchase_receipts(self):
 		self.set("items", [])
 		for pr in self.get("purchase_receipts"):
-			pr_items = frappe.db.sql("""select pr_item.item_code, pr_item.description,
-				pr_item.qty, pr_item.base_rate, pr_item.base_amount, pr_item.name
-				from `tab{doctype} Item` pr_item where parent = %s
-				and exists(select name from tabItem where name = pr_item.item_code and is_stock_item = 1)
-				""".format(doctype=pr.receipt_document_type), pr.receipt_document, as_dict=True)
+			if pr.receipt_document_type and pr.receipt_document:
+				pr_items = frappe.db.sql("""select pr_item.item_code, pr_item.description,
+					pr_item.qty, pr_item.base_rate, pr_item.base_amount, pr_item.name
+					from `tab{doctype} Item` pr_item where parent = %s
+					and exists(select name from tabItem where name = pr_item.item_code and is_stock_item = 1)
+					""".format(doctype=pr.receipt_document_type), pr.receipt_document, as_dict=True)
 
-			for d in pr_items:
-				item = self.append("items")
-				item.item_code = d.item_code
-				item.description = d.description
-				item.qty = d.qty
-				item.rate = d.base_rate
-				item.amount = d.base_amount
-				item.receipt_document_type = pr.receipt_document_type
-				item.receipt_document = pr.receipt_document
-				item.purchase_receipt_item = d.name
+				for d in pr_items:
+					item = self.append("items")
+					item.item_code = d.item_code
+					item.description = d.description
+					item.qty = d.qty
+					item.rate = d.base_rate
+					item.amount = d.base_amount
+					item.receipt_document_type = pr.receipt_document_type
+					item.receipt_document = pr.receipt_document
+					item.purchase_receipt_item = d.name
 
 		if self.get("taxes"):
 			self.set_applicable_charges_for_item()