tiny refactor of invoice setting logic
This commit is contained in:
parent
9df4f0bd43
commit
16afa8765e
@ -267,17 +267,16 @@ class Subscriptions(Document):
|
||||
)
|
||||
|
||||
# Discounts
|
||||
if self.apply_additional_discount:
|
||||
invoice.apply_discount_on = self.apply_additional_discount
|
||||
else:
|
||||
invoice.apply_discount_on = 'Grand Total'
|
||||
|
||||
if self.additional_discount_percentage:
|
||||
invoice.additional_discount_percentage = self.additional_discount_percentage
|
||||
|
||||
if self.additional_discount_amount:
|
||||
invoice.additional_discount_amount = self.additional_discount_amount
|
||||
|
||||
if (self.additional_discount_percentage or self.additional_discount_amount) \
|
||||
and not self.apply_additional_discount:
|
||||
self.apply_additional_discount = 'Grand Total'
|
||||
|
||||
invoice.save()
|
||||
invoice.submit()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user