Browse Source

Merge remote-tracking branch 'ARN/enh-disable-invoice-comment_'

Jocelyn Delalande 6 years ago
parent
commit
aa02805c73
3 changed files with 7 additions and 2 deletions
  1. 1 0
      README.md
  2. 3 2
      coin/billing/create_subscriptions_invoices.py
  3. 3 0
      coin/settings_base.py

+ 1 - 0
README.md

@@ -343,6 +343,7 @@ List of available settings in your `settings_local.py` file.
 - `PAYMENT_DELAY`: Payment delay in days for issued invoices ( default is 30 days which is the default in french law)
 - `MEMBER_CAN_EDIT_PROFILE`: Allow members to edit their profiles
 - `HANDLE_BALANCE`: Allows to handle money balances for members (False default)
+- `INVOICES_INCLUDE_CONFIG_COMMENTS`: Add comment related to a subscription configuration when generating invoices
 
 Accounting logs
 ---------------

+ 3 - 2
coin/billing/create_subscriptions_invoices.py

@@ -11,7 +11,7 @@ from django.core.exceptions import ObjectDoesNotExist
 from coin.offers.models import Offer, OfferSubscription
 from coin.members.models import Member
 from coin.billing.models import Invoice, InvoiceDetail
-
+from django.conf import settings
 
 def create_all_members_invoices_for_a_period(date=None):
     """
@@ -140,7 +140,8 @@ def create_member_invoice_for_a_period(member, date):
                 # à la facture
                 label = offer.name
                 try:
-                    if (offer_subscription.configuration.comment):
+                    if settings.INVOICES_INCLUDE_CONFIG_COMMENTS and \
+                    (offer_subscription.configuration.comment):
                         label += " (%s)" % offer_subscription.configuration.comment
                 except ObjectDoesNotExist:
                     pass

+ 3 - 0
coin/settings_base.py

@@ -275,3 +275,6 @@ MEMBER_CAN_EDIT_PROFILE = False
 
 # Allows to deactivate displays and calculations of balances.
 HANDLE_BALANCE = False
+
+# Add subscription comments in invoice items
+INVOICES_INCLUDE_CONFIG_COMMENTS = True