Created
October 4, 2017 17:02
-
-
Save minostro/8a260d42cf59404ab2587212d319936e to your computer and use it in GitHub Desktop.
Create a Documento Contable
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