codacy review
This commit is contained in:
parent
9e863b9572
commit
e13570f343
@ -1,8 +1,2 @@
|
||||
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Subscriber', {
|
||||
refresh: function(frm) {
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -3,7 +3,6 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class Subscriber(Document):
|
||||
|
@ -3,7 +3,6 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
class TestSubscriber(unittest.TestCase):
|
||||
|
@ -1,8 +1,2 @@
|
||||
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Subscription Invoice', {
|
||||
refresh: function(frm) {
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -3,7 +3,6 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class SubscriptionInvoice(Document):
|
||||
|
@ -3,7 +3,6 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
class TestSubscriptionInvoice(unittest.TestCase):
|
||||
|
@ -1,8 +1,2 @@
|
||||
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Subscription Plan', {
|
||||
refresh: function(frm) {
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -3,7 +3,6 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
class TestSubscriptionPlan(unittest.TestCase):
|
||||
|
@ -3,7 +3,6 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class SubscriptionPlanDetail(Document):
|
||||
|
@ -1,8 +1,2 @@
|
||||
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Subscription Settings', {
|
||||
refresh: function(frm) {
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -3,7 +3,6 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class SubscriptionSettings(Document):
|
||||
|
@ -3,7 +3,6 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
class TestSubscriptionSettings(unittest.TestCase):
|
||||
|
@ -30,7 +30,6 @@ class Subscriptions(Document):
|
||||
def set_current_invoice_start(self, date=None):
|
||||
"""
|
||||
This sets the date of the beginning of the current billing period.
|
||||
|
||||
If the `date` parameter is not given , it will be automatically set as today's
|
||||
date.
|
||||
"""
|
||||
@ -276,8 +275,7 @@ class Subscriptions(Document):
|
||||
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:
|
||||
if not self.apply_additional_discount and (self.additional_discount_percentage or self.additional_discount_amount):
|
||||
self.apply_additional_discount = 'Grand Total'
|
||||
|
||||
invoice.save()
|
||||
|
@ -10,8 +10,7 @@ from erpnext.accounts.doctype.subscriptions.subscriptions import get_prorata_fac
|
||||
from frappe.utils.data import nowdate, add_days, add_to_date, add_months, date_diff
|
||||
|
||||
|
||||
class TestSubscriptions(unittest.TestCase):
|
||||
def create_plan(self):
|
||||
def create_plan():
|
||||
if not frappe.db.exists('Subscription Plan', '_Test Plan Name'):
|
||||
plan = frappe.new_doc('Subscription Plan')
|
||||
plan.plan_name = '_Test Plan Name'
|
||||
@ -39,16 +38,20 @@ class TestSubscriptions(unittest.TestCase):
|
||||
plan.billing_interval_count = 14
|
||||
plan.insert()
|
||||
|
||||
def create_subscriber(self):
|
||||
|
||||
def create_subscriber():
|
||||
if not frappe.db.exists('Subscriber', '_Test Customer'):
|
||||
subscriber = frappe.new_doc('Subscriber')
|
||||
subscriber.subscriber_name = '_Test Customer'
|
||||
subscriber.customer = '_Test Customer'
|
||||
subscriber.insert()
|
||||
|
||||
|
||||
class TestSubscriptions(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.create_plan()
|
||||
self.create_subscriber()
|
||||
create_plan()
|
||||
create_subscriber()
|
||||
|
||||
def test_create_subscription_with_trial_with_correct_period(self):
|
||||
subscription = frappe.new_doc('Subscriptions')
|
||||
|
Loading…
x
Reference in New Issue
Block a user