|
@@ -199,15 +199,18 @@ class Efactoauth(Anafoauth):
|
|
|
cif_ben = 'cif_ben erro'
|
|
|
type_ = inv['tip']
|
|
|
print(index_, date_, cif, type_)
|
|
|
- dir_dates = '{:02d}_{}'.format(date_.month, date_.year)
|
|
|
+ # dir_dates = '{:02d}_{}'.format(date_.month, date_.year)
|
|
|
+ dir_dates = '{}_{:02d}'.format(date_.year, date_.month)
|
|
|
dir_cifs = '{}'.format(cif)
|
|
|
dir_cifs_ben = '{}'.format(cif_ben)
|
|
|
dir_types = type_
|
|
|
dir_days = '{:02d}'.format(date_.day)
|
|
|
if type_ == 'FACTURA TRIMISA':
|
|
|
- dirs = os.path.join(root_path, dir_cifs, dir_types, dir_dates, dir_days, dir_cifs_ben)
|
|
|
+ # dirs = os.path.join(root_path, dir_cifs, dir_types, dir_dates, dir_days, dir_cifs_ben)
|
|
|
+ dirs = os.path.join(root_path, dir_types, dir_dates, dir_cifs, dir_days, dir_cifs_ben)
|
|
|
else:
|
|
|
- dirs = os.path.join(root_path, dir_cifs, dir_types, dir_dates, dir_days)
|
|
|
+ # dirs = os.path.join(root_path, dir_cifs, dir_types, dir_dates, dir_days)
|
|
|
+ dirs = os.path.join(root_path, dir_types, dir_dates, dir_cifs, dir_days)
|
|
|
# print(dirs)
|
|
|
os.makedirs(dirs, exist_ok=True)
|
|
|
new = self.download_invoice(download_id=inv['id'], path=dirs, env=env)
|