'Draws the footer.'

def draw_footer(self, y_pos):

    para_style = getSampleStyleSheet()['Normal']
    para_style.fontSize = 8
    footer_para = Paragraph(self.footer_text.replace('\n', '<br/>'), para_style)
    disclaimer_para = Paragraph(self.disclaimer_text.replace('\n', '<br/>'), para_style)
    billing_address_para = Paragraph(self.billing_address_text.replace('\n', '<br/>'), para_style)
    footer_data = [['', footer_para], [_('Billing    Address'), ''], ['', billing_address_para], [_('Disclaimer'), ''], ['', disclaimer_para]]
    footer_style = [('ALIGN', (0, 0), ((-1), (-1)), 'LEFT'), ('VALIGN', (0, 0), ((-1), (-1)), 'MIDDLE'), ('TEXTCOLOR', (0, 0), ((-1), (-1)), colors.black), ('FONTSIZE', (0, 0), ((-1), (-1)), 9), ('TEXTCOLOR', (0, 0), ((-1), (-1)), '#AAAAAA'), ('LEFTPADDING', (0, 1), (0, 1), (5 * mm)), ('LEFTPADDING', (0, 3), (0, 3), (5 * mm)), ('TOPPADDING', (0, 3), (0, 3), (2 * mm)), ('BACKGROUND', (1, 2), (1, 2), '#EEEEEE'), ('BACKGROUND', (1, 4), (1, 4), '#EEEEEE')]
    if self.is_invoice:
        terms_conditions_para = Paragraph(self.terms_conditions_text.replace('\n', '<br/>'), para_style)
        footer_data.append([_('TERMS    AND    CONDITIONS'), ''])
        footer_data.append(['', terms_conditions_para])
        footer_style.append(('LEFTPADDING', (0, 5), (0, 5), (5 * mm)))
        footer_style.append(('TOPPADDING', (0, 5), (0, 5), (2 * mm)))
        footer_style.append(('BACKGROUND', (1, 6), (1, 6), '#EEEEEE'))
    footer_table = Table(footer_data, [(5 * mm), (176 * mm)])
    footer_table.setStyle(TableStyle(footer_style))
    (__, rendered_height) = footer_table.wrap(0, 0)
    if ((y_pos - (self.margin + self.min_clearance)) <= rendered_height):
        self.prepare_new_page()
    footer_table.drawOn(self.pdf, self.margin, (self.margin + (5 * mm)))
