Repository: fossasia/open-event-server

Issue:
No local pdf ticket/invoice being generated for PLACED orders
**Describe the bug**
<!-- A clear and concise description of what the bug is. -->
There is no local pdf being generated for *placed* orders and hence download ticket/invoice throws error on frontend.

**Expected behavior**
<!-- A clear and concise description of what you expected to happen. -->
The file should be generated on local

**Stacktrace**
<!-- If applicable, add stacktrace to help explain your problem. -->

When trying to download the file : 

```
Traceback (most recent call last):
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask/app.py", line 2328, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/uddeshya/Desktop/localSetup/open-event-server/app/__init__.py", line 69, in __call__
    return self.app(environ, start_response)
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask/app.py", line 2314, in wsgi_app
    response = self.handle_exception(e)
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask/app.py", line 1760, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask/_compat.py", line 36, in reraise
    raise value
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask/app.py", line 2311, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask/app.py", line 1834, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask/app.py", line 1737, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask/_compat.py", line 36, in reraise
    raise value
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask/app.py", line 1832, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask/app.py", line 1818, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask_jwt/__init__.py", line 177, in decorator
    return fn(*args, **kwargs)
  File "/home/uddeshya/Desktop/localSetup/open-event-server/app/api/auth.py", line 327, in order_invoices
    response = make_response(send_file(file_path))
  File "/home/uddeshya/venv/lib/python3.5/site-packages/flask/helpers.py", line 595, in send_file
    file = open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/home/uddeshya/Desktop/localSetup/open-event-server/app/../generated/invoices/orders/invoices/pdf/f4e5f26d-3e76-4fdb-96ac-9fc5a18ee90a/RU9wTitJbG/f4e5f26d-3e76-4fdb-96ac-9fc5a18ee90a.pdf'

```

**Additional details (please complete the following information):**
 - OS: [e.g. MacOS, Ubuntu, CentOS] Ubuntu
 - Python Version [e.g. `3.5`, `3.6`] 3.6

**Additional context**
<!-- Add any other context about the problem here. -->
Working on it


Discussion:

Resolving patch:
diff --git a/app/api/helpers/order.py b/app/api/helpers/order.py
--- a/app/api/helpers/order.py
+++ b/app/api/helpers/order.py
@@ -50,7 +50,7 @@ def create_pdf_tickets_for_holder(order):
     Create tickets and invoices for the holders of an order.
     :param order: The order for which to create tickets for.
     """
-    if order.status == 'completed':
+    if order.status == 'completed' or order.status == 'placed':
         pdf = create_save_pdf(render_template('pdf/ticket_purchaser.html', order=order),
                               UPLOAD_PATHS['pdf']['ticket_attendee'],
                               dir_path='/static/uploads/pdf/tickets/', identifier=order.identifier, upload_dir='generated/tickets/')


Test patch: