| Total Complexity | 6 |
| Total Lines | 41 |
| 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 header_line(text): |
||
| 21 | ln = (150 - len(text)) // 2 |
||
| 22 | return ("=" * ln) + " " + text + " " + ("=" * ln) |
||
| 23 | |||
| 24 | |||
| 25 | def log_line(text): |
||
| 26 | print( |
||
| 27 | header_line(text) |
||
| 28 | ) |
||
| 29 | |||
| 30 | |||
| 31 | def log_item(text): |
||
| 32 | ln = (150 - len(text)) // 2 |
||
| 33 | print( |
||
| 34 | ("*" * ln) + " " + text + " " + ("*" * ln), |
||
| 35 | ) |
||
| 36 | |||
| 37 | |||
| 38 | def cfdi_header(cfdi): |
||
| 39 | receptor = Code(cfdi['Receptor']['Rfc'], cfdi['Receptor']['Nombre']) |
||
| 40 | return f"{cfdi.name} - {cfdi.uuid} {receptor}" |
||
| 41 |