Fakultas Ilmu Komputer UI

Commit 57d19d3c authored by rayhan muzakki's avatar rayhan muzakki
Browse files

[CHORES] delete auto batch in utils.py

parent be946c90
......@@ -122,21 +122,6 @@ def validate_product_stock(cart_items):
def get_batch_transaction(transaction):
today = timezone.now().date()
transaction_batch = models.Batch.objects.filter(start_date__lte=today, end_date__gt=today).first()
if transaction_batch is None:
days_to_saturday = 5 - today.weekday()
if days_to_saturday == -1:
end_date = today + timedelta(days=6)
start_date = end_date - timedelta(days=7)
else:
end_date = today + timedelta(days=days_to_saturday)
start_date = end_date - timedelta(days=7)
transaction_batch = models.Batch.objects.create(
batch_name='Auto Batch',
start_date=start_date,
end_date=end_date,
shipping_cost=0
)
transaction_batch.save()
return transaction_batch
def get_transfer_destination(program_donation):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment