fix: discounting not applied on sales invoice created by subscriptions (#20432)

* fix: imporer escaping

* fix: discounting not applied on sales invoice created by subscriptions
This commit is contained in:
Pranav Nachnekar
2020-01-28 07:22:42 +00:00
committed by Nabin Hait
parent fe56c7ce39
commit f2838c4a13
2 changed files with 5 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
{ {
"actions": [],
"autoname": "ACC-SUB-.YYYY.-.#####", "autoname": "ACC-SUB-.YYYY.-.#####",
"creation": "2017-07-18 17:50:43.967266", "creation": "2017-07-18 17:50:43.967266",
"doctype": "DocType", "doctype": "DocType",
@@ -155,7 +156,7 @@
"fieldname": "apply_additional_discount", "fieldname": "apply_additional_discount",
"fieldtype": "Select", "fieldtype": "Select",
"label": "Apply Additional Discount On", "label": "Apply Additional Discount On",
"options": "\nGrand Total\nNet total" "options": "\nGrand Total\nNet Total"
}, },
{ {
"fieldname": "cb_2", "fieldname": "cb_2",
@@ -196,7 +197,8 @@
"fieldtype": "Column Break" "fieldtype": "Column Break"
} }
], ],
"modified": "2019-07-25 18:45:38.579579", "links": [],
"modified": "2020-01-27 14:37:32.845173",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Subscription", "name": "Subscription",

View File

@@ -280,7 +280,7 @@ class Subscription(Document):
if self.additional_discount_percentage or self.additional_discount_amount: if self.additional_discount_percentage or self.additional_discount_amount:
discount_on = self.apply_additional_discount discount_on = self.apply_additional_discount
invoice.apply_additional_discount = discount_on if discount_on else 'Grand Total' invoice.apply_discount_on = discount_on if discount_on else 'Grand Total'
# Subscription period # Subscription period
invoice.from_date = self.current_invoice_start invoice.from_date = self.current_invoice_start