Add payment time column to Stripe export

This commit is contained in:
Ben Sturmfels 2024-10-11 21:58:46 +11:00
parent a74244efb4
commit 6139a13fde
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0

View file

@ -9,13 +9,14 @@ class Command(BaseCommand):
help = "Closes the specified poll for voting" help = "Closes the specified poll for voting"
def handle(self, *args, **options): def handle(self, *args, **options):
orders = SustainerOrder.objects.filter(paid_time__isnull=False) orders = SustainerOrder.objects.filter(paid_time__isnull=False).order_by('paid_time')
columns = ['time', 'name', 'email', 'amount', 'transaction_id', 'public_ack', 'shirt_size', 'join_list', 'street', 'city', 'state', 'zip_code', 'country'] columns = ['order_time', 'payment_time', 'name', 'email', 'amount', 'transaction_id', 'public_ack', 'shirt_size', 'join_list', 'street', 'city', 'state', 'zip_code', 'country']
writer = csv.writer(sys.stdout) writer = csv.writer(sys.stdout)
writer.writerow(columns) writer.writerow(columns)
for order in orders: for order in orders:
writer.writerow([ writer.writerow([
order.created_time, order.created_time,
order.paid_time,
order.name, order.name,
order.email, order.email,
order.amount, order.amount,