| Total Complexity | 5 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import yaml |
||
| 2 | from satcfdi import Code |
||
| 3 | |||
| 4 | |||
| 5 | def print_yaml(data): |
||
| 6 | print( |
||
| 7 | yaml.safe_dump(data, allow_unicode=True, width=1280, sort_keys=False) |
||
| 8 | ) |
||
| 9 | |||
| 10 | |||
| 11 | def log_email(receptor, notify_invoices, facturas_pendientes): |
||
| 12 | print_yaml({ |
||
| 13 | "Rfc": Code(receptor["Rfc"], receptor["RazonSocial"]), |
||
| 14 | "Facturas": [f"{i.name} - {i.uuid}" for i in notify_invoices], |
||
| 15 | "PendientesMesesAnteriores": [f"{i.name} - {i.uuid}" for i in facturas_pendientes], |
||
| 16 | "Correos": receptor["Email"] |
||
| 17 | }) |
||
| 18 | |||
| 19 | |||
| 20 | def log_line(text): |
||
| 21 | ln = (150 - len(text)) // 2 |
||
| 22 | print( |
||
| 23 | ("=" * ln) + " " + text + " " + ("=" * ln), |
||
| 24 | ) |
||
| 25 | |||
| 26 | |||
| 27 | def log_item(text): |
||
| 28 | ln = (150 - len(text)) // 2 |
||
| 29 | print( |
||
| 30 | ("*" * ln) + " " + text + " " + ("*" * ln), |
||
| 31 | ) |
||
| 32 | |||
| 33 | |||
| 34 | def cfdi_header(cfdi): |
||
| 35 | receptor = Code(cfdi['Receptor']['Rfc'], cfdi['Receptor']['Nombre']) |
||
| 36 | return f"{cfdi.name} - {cfdi.uuid} {receptor}" |
||
| 37 |