Created
September 27, 2017 13:36
-
-
Save minostro/e6d3f43ce0112d29f26ab183e6d71d06 to your computer and use it in GitHub Desktop.
Generate Nubox Document
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from facturacion.models import DocumentoContable | |
from utils.nubox import actions as nubox_actions | |
from settings import FACTURACION_CSV_DIR, FACTURACION_PDF_DIR | |
from utils.nubox.client import Client | |
documento_contable = DocumentoContable.objects.get(id=1/0) | |
documento_map = documento_contable.print_repr() | |
extended_document = nubox_actions.create_extended_document(documento_map) | |
csv_filename = "documento_contable_{0}.csv".format(documento_contable.id) | |
csv_filepath = "{0}/{1}".format(FACTURACION_CSV_DIR, csv_filename) | |
nubox_actions.create_csv_file(csv_filepath, extended_document) | |
client = Client() | |
client.autenticar() | |
identificador = client.generar_documento(open(csv_filepath)) | |
nubox_actions.create_documento_legal(documento_contable, identificador, csv_filename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment