Changes on prod

This commit is contained in:
app@dynamicweb-production 2024-02-09 16:38:10 +01:00
parent 7afa9d2f4c
commit 41461538a3
1 changed files with 19 additions and 19 deletions

View File

@ -29,25 +29,25 @@ class Command(BaseCommand):
logger.debug("VAT rate for %s is %s" % (country_to_change, vat_rate.rate)) logger.debug("VAT rate for %s is %s" % (country_to_change, vat_rate.rate))
logger.debug("vat_rate object = %s" % vat_rate) logger.debug("vat_rate object = %s" % vat_rate)
logger.debug("Create end date for the VATRate %s" % vat_rate.id) logger.debug("Create end date for the VATRate %s" % vat_rate.id)
if MAKE_MODIFS: # if MAKE_MODIFS:
vat_rate.stop_date = datetime.date(2023, 12, 31) # vat_rate.stop_date = datetime.date(2023, 12, 31)
vat_rate.save() # vat_rate.save()
print("Creating a new VATRate for CH") # print("Creating a new VATRate for CH")
obj, created = VATRates.objects.get_or_create( # obj, created = VATRates.objects.get_or_create(
start_date=datetime.date(2024, 1, 1), # start_date=datetime.date(2024, 1, 1),
stop_date=None, # stop_date=None,
territory_codes=country_to_change, # territory_codes=country_to_change,
currency_code=currency_to_change, # currency_code=currency_to_change,
rate=new_rate, # rate=new_rate,
rate_type="standard", # rate_type="standard",
description="Switzerland standard VAT (added manually on %s)" % datetime.datetime.now() # description="Switzerland standard VAT (added manually on %s)" % datetime.datetime.now()
) # )
if created: # if created:
logger.debug("Created new VAT Rate for %s with the new rate %s" % (country_to_change, new_rate)) # logger.debug("Created new VAT Rate for %s with the new rate %s" % (country_to_change, new_rate))
logger.debug(obj) # logger.debug(obj)
else: # else:
logger.debug("VAT Rate for %s already exists with the rate %s" % (country_to_change, new_rate)) # logger.debug("VAT Rate for %s already exists with the rate %s" % (country_to_change, new_rate))
#
logger.debug("Getting all subscriptions of %s that need a VAT Rate change") logger.debug("Getting all subscriptions of %s that need a VAT Rate change")
subscriptions = stripe.Subscription.list(limit=100) # Increase the limit to 100 per page (maximum) subscriptions = stripe.Subscription.list(limit=100) # Increase the limit to 100 per page (maximum)
ch_subs = [] ch_subs = []