Get folios by Pac

This commit is contained in:
Mauricio Baeza 2020-01-22 22:30:11 -06:00
parent 3f0daec6ad
commit 92e6a317ad
2 changed files with 19 additions and 1 deletions

View File

@ -591,3 +591,16 @@ def xml_stamp(xml, auth, name):
result['uuid'] = pac.cfdi_uuid
result['fecha'] = pac.date_stamped
return result
def get_client_balance(auth, name):
if DEBUG:
return '-d'
pac = PACS[name]()
auth = {'usr': auth['USER'], 'pwd': auth['PASS']}
balance = pac.client_balance(auth)
if pac.error:
balance = '-e'
return balance

View File

@ -1025,7 +1025,12 @@ class Emisor(BaseModel):
if not auth:
return 'c/e'
return util.get_timbres(auth)
pac = Configuracion.get_('lst_pac').lower()
if pac:
result = utils.get_client_balance(auth, pac)
else:
result = util.get_timbres(auth)
return result
@classmethod
def get_regimenes(cls):