from decimal import Decimal import os CODEPAGE = 'cp437' try: import dbf except: dbf = None CHARSET = 'latin1' CODEPAGE = 'cp437' DEBUG = True if dbf and hasattr(dbf, "encoding"): dbf.encoding(CODEPAGE) # Formato de entrada/salida similar a SIAP RECE, con agregados # definición del formato del archivo de intercambio: from .formato_txt import A, N, I, ENCABEZADO, DETALLE, TRIBUTO, IVA, CMP_ASOC, PERMISO, DATO # agrego identificadores unicos para relacionarlos con el encabezado DETALLE = [('id', 15, N)] + DETALLE TRIBUTO = [('id', 15, N)] + TRIBUTO IVA = [('id', 15, N)] + IVA CMP_ASOC = [('id', 15, N)] + CMP_ASOC PERMISO = [('id', 15, N)] + PERMISO DATO = [('id', 15, N)] + DATO
CODEPAGE = 'cp437' try: import dbf print "Encoding!" except: print "para soporte de DBF debe instalar dbf" print " http://pypi.python.org/pypi/dbf/" dbf = None CHARSET = 'latin1' CODEPAGE = 'cp437' DEBUG = True if dbf: dbf.encoding(CODEPAGE) # Formato de entrada/salida similar a SIAP RECE, con agregados # definición del formato del archivo de intercambio: from formato_txt import A, N, I, ENCABEZADO, DETALLE, TRIBUTO, IVA, CMP_ASOC, PERMISO, DATO # agrego identificadores unicos para relacionarlos con el encabezado DETALLE = [('id', 15, N)] + DETALLE TRIBUTO = [('id', 15, N)] + TRIBUTO IVA = [('id', 15, N)] + IVA CMP_ASOC = [('id', 15, N)] + CMP_ASOC PERMISO = [('id', 15, N)] + PERMISO DATO = [('id', 15, N)] + DATO