Merge pull request #6440 from rohitwaghchaure/additional_discount_amount_issue
[Fix] Additional Discount Amount can't be refresh automatically #6199
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index bf4ca7f..85b7acb 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe
-__version__ = '7.0.45'
+__version__ = '7.0.46'
def get_default_company(user=None):
'''Get default company for user'''
diff --git a/erpnext/accounts/report/sales_register/sales_register.py b/erpnext/accounts/report/sales_register/sales_register.py
index 97b7173..5b1742a 100644
--- a/erpnext/accounts/report/sales_register/sales_register.py
+++ b/erpnext/accounts/report/sales_register/sales_register.py
@@ -124,7 +124,7 @@
def get_invoices(filters):
conditions = get_conditions(filters)
return frappe.db.sql("""select name, posting_date, debit_to, project, customer, customer_name, remarks,
- base_net_total, base_grand_total, base_rounded_total, outstanding_amount, mode_of_payment
+ base_net_total, base_grand_total, base_rounded_total, outstanding_amount
from `tabSales Invoice`
where docstatus = 1 %s order by posting_date desc, name desc""" %
conditions, filters, as_dict=1)
@@ -196,11 +196,12 @@
def get_mode_of_payments(invoice_list):
mode_of_payments = {}
- inv_mop = frappe.db.sql("""select parent, mode_of_payment
- from `tabSales Invoice Payment` where parent in (%s) group by parent, mode_of_payment""" %
- ', '.join(['%s']*len(invoice_list)), tuple(invoice_list), as_dict=1)
+ if invoice_list:
+ inv_mop = frappe.db.sql("""select parent, mode_of_payment
+ from `tabSales Invoice Payment` where parent in (%s) group by parent, mode_of_payment""" %
+ ', '.join(['%s']*len(invoice_list)), tuple(invoice_list), as_dict=1)
- for d in inv_mop:
- mode_of_payments.setdefault(d.parent, []).append(d.mode_of_payment)
+ for d in inv_mop:
+ mode_of_payments.setdefault(d.parent, []).append(d.mode_of_payment)
return mode_of_payments
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index ced3679..0435141 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -553,6 +553,9 @@
def make_purchase_order_for_drop_shipment(source_name, for_supplier, target_doc=None):
def set_missing_values(source, target):
target.supplier = for_supplier
+ target.apply_discount_on = ""
+ target.additional_discount_percentage = 0.0
+ target.discount_amount = 0.0
default_price_list = frappe.get_value("Supplier", for_supplier, "default_price_list")
if default_price_list: