=================== Billing / Invoicing =================== View all invoices from all clients. .. image:: /_static/images/staff/billing/invoices/invoices.png You can sort invoices by: * **Status** *paid/unpaid* * **Issue Date** *the date of invoice creation* * **Due Date** *last day to pay an invoice* * **Client** *client name* You can filter invoices by: * **Issue date**: *the issue date of the invoice* * **Due date**: *the due date of the invoice* * **Status**: *unpaid / paid / cancelled / refunded* * **Total**: *invoice total* .. image:: /_static/images/staff/billing/invoices/invoice-detail.png After clicking on a card you get redirected to the invoice details page that looks like in the above image. You can switch through the following tabs: Details tab =========== See details about the invoice, items and journal entries. Add payment tab =============== Here you can add a payment by submitting the required information .. image:: /_static/images/staff/billing/invoices/add-payment-invoice.png Refund tab ========== Here you can make a refund .. image:: /_static/images/staff/billing/invoices/refund.png Editing an invoice ================== You can edit an invoice by clicking the 'edit' icon from the top-right of the invoice details page. You will then be redirected to the edit page where you can perform multiple actions like changing the status of the invoice, adding invoice items or deleting them. .. image:: /_static/images/staff/billing/invoices/invoice-edit.png Creating an invoice =================== You can add an invoice by clicking the button from the bottom right side of the screen .. image:: /_static/images/staff/billing/invoices/invoice-add-button.png This will redirect you to the invoice create form .. image:: /_static/images/staff/billing/invoices/invoice-create-form.png You will need to select a client and add at least an invoice item. The ``(+)`` button for invoice item addition will be available once you select a client. Editing client details on pdf ============================= You can customize what details to show on the "Invoiced to" section from the downloadable invoices pdfs. In order to do this, checkout the ``INVOICE_CUSTOMER_DETAILS_GETTER`` variable from the /var/webapps/fleio/project/fleio/base_settings.py file. Currently, it is set as: .. code-block:: python INVOICE_CUSTOMER_DETAILS_GETTER = 'fleio.billing.utils.get_customer_invoice_details' The string points to a function from the fleio > billing > utils.py file that returns a string with the client details, each one being separated by "\n". You can change the path to point to a function of your own by adding the same variable in the custom settings file (:ref:`How to edit settings.py file`) along with the new path. You can use the existing method as an inspiration, this is an example: .. code-block:: python def get_customer_invoice_details(invoice) -> str: """ Method that gets what info to display on pdf invoices :param invoice: the invoice :return: Returns a string cotaining information separated by '\n' """ client = invoice.client info = [client.long_name, client.vat_id, client.get_country_display(), client.phone] return '\n'.join([x for x in info if x]) With the 2019.08.0 version we have added a new method that will allow you to change the PDF layout. Please see the :doc:`advanced pdf generation configuration ` page.