(self, workbook, data, objects)
Create vat book xlsx in BOE format
Create vat book xlsx in BOE format
Create vat book xlsx in BOE format
def generate_xlsx_report(self, workbook, data, objects):
        """ Create vat book xlsx in BOE format """

        book = objects[0]
        draft_export = bool(book.state not in ["done", "posted"])

        # Issued
        issued_sheet = self.create_issued_sheet(workbook, book, draft_export)
        lines = book.issued_line_ids + book.rectification_issued_line_ids
        lines = lines.sorted(key=lambda l: (l.invoice_date, l.ref))
        row = 8
        for line in lines:
            with_total = True
            for tax_line in line.tax_line_ids:
                if not tax_line.special_tax_group:
                    # TODO: Payments bucle
                    self.fill_issued_row_data(
                        issued_sheet, row, line, tax_line, with_total, draft_export
                    )
                    with_total = False
                    row += 1

        # Received
        received_sheet = self.create_received_sheet(workbook, book, draft_export)
        lines = book.received_line_ids + book.rectification_received_line_ids
        lines = lines.sorted(key=lambda l: (l.invoice_date, l.ref))
        row = 8
        for line in lines:
            with_total = True
            for tax_line in line.tax_line_ids:
                if not tax_line.special_tax_group:
                    # TODO: Payments bucle
                    self.fill_received_row_data(
                        received_sheet, row, line, tax_line, with_total, draft_export
                    )
                    with_total = False
                    row += 1
def generate_xlsx_report ( self , workbook , data , objects ) : book = objects [ 0 ] draft_export = bool ( book . state not in [ "done" , "posted" ] ) # Issued issued_sheet = self . create_issued_sheet ( workbook , book , draft_export ) lines = book . issued_line_ids + book . rectification_issued_line_ids lines = lines . sorted ( key = lambda l : ( l . invoice_date , l . ref ) ) row = 8 for line in lines : with_total = True for tax_line in line . tax_line_ids : if not tax_line . special_tax_group : # TODO: Payments bucle self . fill_issued_row_data ( issued_sheet , row , line , tax_line , with_total , draft_export ) with_total = False row += 1 # Received received_sheet = self . create_received_sheet ( workbook , book , draft_export ) lines = book . received_line_ids + book . rectification_received_line_ids lines = lines . sorted ( key = lambda l : ( l . invoice_date , l . ref ) ) row = 8 for line in lines : with_total = True for tax_line in line . tax_line_ids : if not tax_line . special_tax_group : # TODO: Payments bucle self . fill_received_row_data ( received_sheet , row , line , tax_line , with_total , draft_export ) with_total = False row += 1