v1 finalized

This commit is contained in:
Nico Melone
2023-08-24 17:51:28 -05:00
parent e7e10eb315
commit ff20059809
10 changed files with 2041 additions and 147 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -174,3 +174,543 @@
2023-08-16 16:19:34,230 - billing_reports - INFO - Folder already in list: 31976
2023-08-16 16:19:34,254 - billing_reports - INFO - Folder already in list: 31915
2023-08-16 16:19:34,255 - billing_reports - INFO - Folder already in list: 32155
2023-08-17 16:37:29,329 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,330 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,331 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,331 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,331 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,332 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,332 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,333 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,334 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,334 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,335 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,335 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,336 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,336 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,337 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,338 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,338 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,339 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,340 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,340 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,340 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,341 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,344 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,346 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,348 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,350 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,350 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,351 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,351 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,353 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,354 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,355 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,356 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,356 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,358 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,360 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,361 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,363 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,364 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,366 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,367 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,368 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,369 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,370 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,373 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,374 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,375 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,376 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,377 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,378 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,379 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,380 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,380 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,381 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,381 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,381 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,382 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,382 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,383 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,384 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,385 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,386 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,387 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,388 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,389 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,389 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,390 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,391 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,393 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,395 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,396 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,397 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,398 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,400 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,401 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,405 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,406 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,406 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,407 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,407 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,408 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,409 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,409 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,410 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,410 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,411 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-17 16:37:29,462 - billing_reports - INFO - Folder already in list: 31976
2023-08-17 16:37:29,487 - billing_reports - INFO - Folder already in list: 31915
2023-08-17 16:37:29,487 - billing_reports - INFO - Folder already in list: 32155
2023-08-22 09:40:42,665 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,667 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,668 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,669 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,670 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,670 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,672 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,673 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,676 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,677 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,679 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,680 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,682 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,684 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,685 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,686 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,687 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,688 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,689 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,690 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,691 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,692 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,692 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,693 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,694 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,694 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,695 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,695 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,696 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,696 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,696 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,697 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,698 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,698 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,698 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,699 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,699 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,700 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,700 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,701 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,701 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,702 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,702 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,703 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,704 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,704 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,704 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,705 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,705 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,706 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,707 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,708 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,708 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,709 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,709 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,710 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,710 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,710 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,711 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,711 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,712 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,713 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,713 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,714 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,715 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,716 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,716 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,717 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,719 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,721 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,721 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,722 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,723 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,724 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,725 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,729 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,730 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,730 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,731 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,731 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,732 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,732 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,733 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,734 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,734 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,735 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 09:40:42,784 - billing_reports - INFO - Folder already in list: 31976
2023-08-22 09:40:42,808 - billing_reports - INFO - Folder already in list: 31915
2023-08-22 09:40:42,808 - billing_reports - INFO - Folder already in list: 32155
2023-08-22 10:00:22,524 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,525 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,526 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,526 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,527 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,528 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,529 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,530 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,530 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,531 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,532 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,532 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,533 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,534 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,534 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,535 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,536 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,537 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,537 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,538 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,538 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,539 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,540 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,541 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,541 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,542 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,542 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,543 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,543 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,544 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,545 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,545 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,546 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,546 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,547 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,548 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,548 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,549 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,549 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,550 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,550 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,550 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,551 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,552 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,553 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,553 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,554 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,554 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,555 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,557 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,558 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,558 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,559 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,559 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,560 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,560 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,561 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,562 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,562 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,562 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,563 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,564 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,565 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,565 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,566 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,567 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,568 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,568 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,571 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,573 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,573 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,574 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,575 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,577 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,577 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,582 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,583 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,583 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,584 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,584 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,585 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,585 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,586 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,586 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,587 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,588 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 10:00:22,641 - billing_reports - INFO - Folder already in list: 31976
2023-08-22 10:00:22,665 - billing_reports - INFO - Folder already in list: 31915
2023-08-22 10:00:22,665 - billing_reports - INFO - Folder already in list: 32155
2023-08-22 14:18:07,459 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,460 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,461 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,461 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,462 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,463 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,464 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,464 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,465 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,466 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,466 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,467 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,468 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,468 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,469 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,470 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,471 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,471 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,472 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,472 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,473 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,474 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,474 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,475 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,476 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,476 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,477 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,477 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,478 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,478 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,479 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,479 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,480 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,480 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,481 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,481 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,482 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,482 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,483 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,483 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,484 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,484 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,485 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,486 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,487 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,487 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,488 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,488 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,489 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,489 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,491 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,491 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,492 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,493 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,493 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,494 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,494 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,494 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,495 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,495 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,496 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,497 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,497 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,498 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,499 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,500 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,500 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,501 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,501 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,503 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,504 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,506 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,507 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,507 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,508 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,510 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,510 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,515 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,516 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,516 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,517 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,517 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,518 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,518 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,519 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,520 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,520 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:07,521 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 14:18:08,152 - billing_reports - INFO - Folder already in list: 31976
2023-08-22 14:18:08,178 - billing_reports - INFO - Folder already in list: 31915
2023-08-22 14:18:08,178 - billing_reports - INFO - Folder already in list: 32155
2023-08-22 17:25:31,657 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,658 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,659 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,659 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,660 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,661 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,662 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,662 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,663 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,664 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,664 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,665 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,666 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,666 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,667 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,667 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,668 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,668 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,669 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,669 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,670 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,671 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,671 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,672 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,673 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,673 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,674 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,675 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,675 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,676 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,677 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,677 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,677 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,678 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,678 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,679 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,680 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,680 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,681 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,681 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,682 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,682 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,683 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,684 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,684 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,685 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,685 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,685 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,686 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,686 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,688 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,689 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,689 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,690 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,691 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,691 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,692 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,692 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,693 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,693 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,694 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,694 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,695 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,695 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,696 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,697 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,698 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,698 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,699 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,700 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,702 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,704 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,704 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,705 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,706 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,707 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,708 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,713 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,714 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,714 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,715 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,715 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,716 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,716 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,717 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,717 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,718 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:31,719 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-22 17:25:32,117 - billing_reports - INFO - Folder already in list: 31976
2023-08-22 17:25:32,141 - billing_reports - INFO - Folder already in list: 31915
2023-08-22 17:25:32,141 - billing_reports - INFO - Folder already in list: 32155
2023-08-23 16:21:22,781 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,783 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,784 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,784 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,785 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,786 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,787 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,787 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,788 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,789 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,789 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,790 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,791 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,791 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,792 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,792 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,793 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,793 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,794 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,794 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,795 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,795 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,796 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,797 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,797 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,798 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,798 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,799 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,799 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,800 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,801 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,801 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,802 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,802 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,803 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,803 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,804 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,804 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,804 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,805 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,805 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,806 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,807 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,807 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,808 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,808 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,809 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,809 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,809 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,810 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,811 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,812 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,813 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,813 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,813 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,814 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,814 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,815 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,816 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,816 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,817 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,817 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,818 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,819 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,819 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,820 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,821 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,821 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,822 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,824 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,825 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,827 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,827 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,828 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,829 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,830 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,831 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,836 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,836 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,837 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,838 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,838 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,839 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,839 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,840 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,841 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,842 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:22,844 - billing_reports - ERROR - Exception in putFolder: 'NoneType' object does not support item assignment
2023-08-23 16:21:23,208 - billing_reports - INFO - Folder already in list: 31976
2023-08-23 16:21:23,229 - billing_reports - INFO - Folder already in list: 31915
2023-08-23 16:21:23,229 - billing_reports - INFO - Folder already in list: 32155

File diff suppressed because one or more lines are too long

534
hp-billing-report.py Normal file
View File

@@ -0,0 +1,534 @@
# %%
import lattice
import logging
import json
logger = logging.getLogger('billing_reports')
logger.setLevel(logging.INFO)
fh = logging.FileHandler('/Users/nico/Documents/Github/hp-billing-report/billing.log')
fh.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.ERROR)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
fh.setFormatter(formatter)
ch.setFormatter(formatter)
logger.addHandler(fh)
logger.addHandler(ch)
# %%
#Mistaway data collection
from datetime import datetime as dt
json_file_output = False
console_output = False
# %%
nodes = lattice.getNodes()
# %%
# Find a value for a given key in a given dictionary
def _findItem(obj, key):
if key in obj: return obj[key]
for k, v in obj.items():
if isinstance(v,dict):
item = _findItem(v, key)
if item is not None:
return item
# %%
# recursively go through folders to build folder structure
def putFolder(folder, fs):
try:
if not folder["id"] == folder["parentFolderId"]:
parent = _findItem(fs, folder["parentFolderId"])
parent[folder["id"]] = folder
putFolder(parent,fs)
else:
fs[folder["id"]] = folder
return fs
except Exception as e:
logger.error(f"Exception in putFolder: {e}")
# %%
# Go through every folder and build a proper folder structure
# Output to JSON file
folders = lattice.getFolders()
foldermap = {}
#print(json.dumps(folders, indent=4))
for folder in folders:
logger.debug(folder)
putFolder(folder,foldermap)
if console_output:
print(json.dumps(foldermap, indent=4))
if json_file_output:
with open("./folderMap" + str(dt.date(dt.now())) +".json", "w") as f:
json.dump(foldermap, f, indent=4)
# %%
# Go through every node and collect unique device id (MAC)
# Output to JSON file
foldersTracker = []
vanityMap = {}
deviceTypes = {}
for type in lattice.getNodeTypes():
deviceTypes[type["id"]] = type["name"]
for node in nodes:
if not node["uniqueId"][-6:] in [":00:00", ":00:30"]:
if not node["folderId"] in foldersTracker:
foldersTracker.append(node["folderId"])
folder = _findItem(foldermap, node["folderId"])
if folder:
deviceName = folder["name"]
latitude = folder["location"]["lat"]
longitude = folder["location"]["lng"]
pfolder = _findItem(foldermap, folder["parentFolderId"])
ppfolder = _findItem(foldermap, pfolder["parentFolderId"])
customer = ppfolder["name"]
vanityMap[node["uniqueId"]] = {"deviceName": deviceName, "deviceType": deviceTypes[node["nodeTypeId"]], "customer": customer, "latitude": latitude, "longitude": longitude}
else:
logger.info("Folder does not exist: " + str(node["folderId"]))
else:
logger.info("Folder already in list: " + str(node["folderId"]))
#print(vanityMap)
if json_file_output:
with open("./deviceMap" + str(dt.date(dt.now())) +".json", "w") as f:
json.dump(vanityMap, f, indent=4)
# %%
"""
Data to be collected:
{
"customer":{
"sales_order": {
"billable_item_1": {
"sales_price": 75,
"platform_cost": 10,
"platform": "thingsboard", # "thingsboard", "mistaway"
"cellular_cost": 15,
"billing_type": "stand-alone" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
},
"billable_item_2:{...},
...
},
"sales_order_2":{...}
},
"customer_2":{...}
}
"""
# %%
mistaway_data = {}
from shapely.geometry import Point, Polygon
denali_east = Polygon([(31.441289, -102.175343),(31.467676, -101.936571), (31.321496, -101.943604),(31.304714, -102.139878) ])
jitterbug = []
for key, value in vanityMap.items():
customer = value["customer"]
device = value["deviceName"]
type = value["deviceType"]
location = Point(value["latitude"], value["longitude"])
if not device in ["Melinda 252"]:
cellular_cost = 15
so = "HPSO-1"
price = 75
billing_type = "Stand-Alone"
if customer not in mistaway_data:
mistaway_data[customer] = {}
if customer == "CrownQuest":
if device == "LimeQuest 6 SR 1-1":
so = "LimeQuest SO"
price = 75
billing_type = "Stand-Alone"
elif "Wilkinson 39" in device or device in ["Wilkinson 37 WS 1-9B", "Wilkinson 37 WS 1-9B", "Free 40 WS 1-2", "Free 40 WS 1-4", "Free 40 WS 1-1"]:
so = "Wilkinson 39 Field"
price = 0
billing_type = "AP-bundled"
cellular_cost = 0
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
if "Wilkinson 39 AP" not in mistaway_data[customer][so]:
mistaway_data[customer][so]["Wilkinson 39 AP"] = {
"Sales Price": 250,
"Platform Cost": 0,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": 15,
"Billing Type": "AP" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
elif "Wilkinson 37" in device or device in ["Wilkinson 33 WS 3-1", "Wilkinson 33 WS 4-1", "Wilkinson 34 WS 2-10", "Wilkinson 34 WS 1-8"]:
so = "Wilkinson 37 Field"
price = 0
billing_type = "AP-bundled"
cellular_cost = 0
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
if "Wilkinson 37 AP" not in mistaway_data[customer][so]:
mistaway_data[customer][so]["Wilkinson 37 AP"] = {
"Sales Price": 250,
"Platform Cost": 0,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": 15,
"Billing Type": "AP" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
elif "Wilkinson 33" in device or "Wilkinson 34" in device or "Wilkinson 1" in device or "Wilkinson 4" in device:
so = "Wilkinson 33-34 Field"
price = 0
billing_type = "AP-bundled"
cellular_cost = 0
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
if "Wilkinson 33-34 AP" not in mistaway_data[customer][so]:
mistaway_data[customer][so]["Wilkinson 33-34 AP"] = {
"Sales Price": 250,
"Platform Cost": 0,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": 15,
"Billing Type": "AP" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
elif "Free 40" in device or "Free 32" in device:
so = "Free Field"
price = 0
billing_type = "AP-bundled"
cellular_cost = 0
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
if "Free AP" not in mistaway_data[customer][so]:
mistaway_data[customer][so]["Free AP"] = {
"Sales Price": 250,
"Platform Cost": 0,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": 15,
"Billing Type": "AP" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
elif "LimeQuest 5" in device or "LimeQuest 10" in device:
so = "LimeQuest Field"
price = 0
billing_type = "AP-bundled"
cellular_cost = 0
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
if "LimeQuest AP" not in mistaway_data[customer][so]:
mistaway_data[customer][so]["LimeQuest AP"] = {
"Sales Price": 250,
"Platform Cost": 0,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": 15,
"Billing Type": "AP" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
elif "LimeQuest 5" in device or "LimeQuest 10" in device:
so = "LimeQuest Field"
price = 0
billing_type = "AP-bundled"
cellular_cost = 0
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
if "LimeQuest AP" not in mistaway_data[customer][so]:
mistaway_data[customer][so]["LimeQuest AP"] = {
"Sales Price": 250,
"Platform Cost": 0,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": 15,
"Billing Type": "AP" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
elif "Horton 23" in device or "Horton 34" in device:
so = "Horton Field"
price = 0
billing_type = "AP-bundled"
cellular_cost = 0
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
if "Horton AP" not in mistaway_data[customer][so]:
mistaway_data[customer][so]["Horton AP"] = {
"Sales Price": 250,
"Platform Cost": 0,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": 15,
"Billing Type": "AP" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
elif type == "advvfdipp" or type == "ipp":
so = "Santa Rosa"
elif type == "rigpump":
so = "Rig Pump"
elif type == "transferlite":
so = "Transfer"
elif customer == "Patriot Resources":
so = "Patriot Resources"
price = 100
elif customer == "Keagan Faudree Water":
so = "Keagan Faudree Water"
elif customer == "Summit Petroleum":
if location.x >= 31.654963:
so = "Banay"
price = 75
elif location.within(denali_east):
so = "Denali East"
if type == "dual_flowmeter":
price = 75
elif type == "plcfreshwater":
price = 55
cellular_cost = 0
billing_type = "Networked"
else: #if location.within(jitterbug):
so = "Jitterbug"
if type == "dual_flowmeter":
price = 75
elif type == "plcfreshwater":
price = 55
cellular_cost = 0
billing_type = "Networked"
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
mistaway_data[customer][so][device] = {
"Sales Price": price,
"Platform Cost": 10,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": cellular_cost,
"Billing Type": billing_type # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
# %%
#ThingsBoard data collection
from tb_rest_client.rest_client_ce import *
from tb_rest_client.rest import ApiException
# %%
# ThingsBoard REST API URL
url = "https://hp.henrypump.cloud"
# Default Tenant Administrator credentials
username = "henry.pump.automation@gmail.com"
password = "Henry Pump @ 2022"
# %%
def getDevices(rest_client, customers, page=0, pageSize=500):
thingsboard_data = {}
for c in customers.data:
cname = c.name
cid = c.id.id
if cname not in ["Test Company", "Amerus Safety Solutions"]:
#create new company if it doesn't exist
if cname not in thingsboard_data:
thingsboard_data[cname] = {}
#get devices of a company
devices = rest_client.get_customer_devices(customer_id=cid, page_size=pageSize, page=page)
#go through each device and store its data in the dict
for device in devices.data:
cellular_cost = 15
#fix naming to work with JSON/dict
if '"' in device.name:
deviceName = device.name.replace('"', 'in')
else:
deviceName = device.name
# Sort Device details
if cname == "Chuda Resources":
so = "Water Wells"
price = 75
billing_type = "Stand-Alone"
elif cname == "Henry Petroleum":
so = "Check Meters"
price = 50
billing_type = "Stand-Alone"
elif cname == "Faskens":
if device.type == "tankalarms":
so = "Tanks"
billing_type = "Stand-Alone"
price = 50
elif device.type in ["advvfdipp", "plcfreshwater"]:
so = "Water Wells"
billing_type = "Stand-Alone"
price = 50
elif device.type == "plcpond":
so = "Ponds"
billing_type = "Stand-Alone"
price = 50
else:
so = "HPSO-1"
billing_type = "Stand-Alone"
price = 50
elif cname == "Henry Resources":
if deviceName == "Pearl Central":
so = "Henry Resources"
price = 300
billing_type = "Stand-Alone-WiFi"
else:
so = "Henry Resources"
price = 275
billing_type = "Stand-Alone"
elif cname == "ConocoPhillips":
if device.type == "flowmeterskid":
so = "Portable Meter"
price = 50
billing_type = "Stand-Alone"
elif device.type == "plcfreshwater":
so = "Water Well"
price = 50
cellular_cost = 0
billing_type = "Networked"
elif device.type == "advvfdipp":
so = "Santa Rosa"
price = 50
billing_type = "Stand-Alone"
elif device.type == "Gateway":
so = "AP"
price = 0
billing_type = "AP-bundled"
elif cname == "Saulsbury Ventures":
so = "Saulsbury Ventures"
price = 50
billing_type = "Stand-Alone"
else:
so = "HPSO-1"
price = 50
billing_type = "Stand-Alone"
#make a new Sales Order if it doesn't exist
if so not in thingsboard_data[cname]:
thingsboard_data[cname][so] = {}
#add device to Sales Order under Company
thingsboard_data[cname][so][deviceName] = {
"Sales Price": price,
"Platform Cost": 0,
"Platform": "ThingsBoard", # "thingsboard", "mistaway"
"Cellular Cost": cellular_cost,
"Billing Type": billing_type # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
return thingsboard_data
# %%
def getThingsBoardData(url, username, password):
# Creating the REST client object with context manager to get auto token refresh
with RestClientCE(base_url=url) as rest_client:
try:
# Auth with credentials
rest_client.login(username=username, password=password)
# Get customers > get devices under a target customer > get keys for devices > get data for devices
customers = rest_client.get_customers(page_size="100", page="0")
thingsboard_data = getDevices(rest_client=rest_client, customers=customers)
return thingsboard_data
except ApiException as e:
logger.error(e)
return False
# %%
thingsboard_data = getThingsBoardData(url, username,password)
# %%
#Mixing data from Mistaway and ThingsBoard
excel_data = {}
excel_data.update(mistaway_data)
for customer in thingsboard_data.keys():
if customer in excel_data:
for so in thingsboard_data[customer].keys():
if so in excel_data[customer]:
excel_data[customer][so].update(thingsboard_data[customer][so])
else:
excel_data[customer].update(thingsboard_data[customer])
else:
excel_data[customer] = thingsboard_data[customer]
# %%
#Build report from data
import xlsxwriter
import pandas as pd
def highlight_rows(row):
"""Function to apply row highlighting for non 'AP-bundled' billing types."""
return 'background-color: yellow' if row['Billing Type'] != 'AP-bundled' else ''
# Create a new Excel writer object
with pd.ExcelWriter(f"Billing-Report-{dt.date(dt.now())}.xlsx", engine="xlsxwriter") as writer:
overview = writer.book.add_worksheet("Overview")
overview_row = 1
overview.write(0,1, "Revenue")
overview.write(0,2, "Platform Cost")
overview.write(0,3, "Cellular Cost")
overview.write(0,4, "Profit")
# Loop through customers
for customer, orders in excel_data.items():
rows = []
counts = {}
# Loop through each sales order for the customer
for order, items in orders.items():
for item, details in items.items():
"""
details_copy = details.copy()
details_copy["item"] = item
details_copy["order"] = order if item.endswith("1") else "" # Display order only once per customer
rows.append(details_copy)
"""
row = {
"Sales Order": order,
"Location": item
}
row.update(details)
rows.append(row)
counts[order] = len(items)
# Convert the data to a DataFrame
df = pd.DataFrame(rows)
# Sort by sales order
df = df.sort_values(by="Sales Order")
#df = df.sort_values(by=["order", "item"])
# Apply the highlighting
df_style = df.style.applymap(lambda x: highlight_rows({'Billing Type': x}) if isinstance(x, str) else "", subset=['Billing Type'])
# Write to a specific sheet in the Excel file
#df.to_excel(writer, sheet_name=customer, index=False)
df_style.to_excel(writer, sheet_name=customer, index=False, header=True)
for column in df:
column_length = max(df[column].astype(str).map(len).max(), len(column))
col_idx = df.columns.get_loc(column)
writer.sheets[customer].set_column(col_idx, col_idx, column_length)
# Get the dimensions of the dataframe.
(max_row, max_col) = df.shape
#manually adding extra calculated values
sales_formula = f"C2:C{max_row+1}"
platform_formula = f"D2:D{max_row+1}"
cellular_formula = f"F2:F{max_row+1}"
profit_formula = f"=B{max_row+3} - B{max_row+4} - B{max_row+5}"
writer.sheets[customer].write(f'A{max_row+3}', "Revenue")
writer.sheets[customer].write(f'A{max_row+4}', "Platform Cost")
writer.sheets[customer].write(f'A{max_row+5}', "Cellular Cost")
writer.sheets[customer].write(f'A{max_row+6}', "Profit")
writer.sheets[customer].write(f'B{max_row+3}', '=SUM(' + sales_formula + ')', )
writer.sheets[customer].write(f'B{max_row+4}', '=SUM(' + platform_formula + ')', )
writer.sheets[customer].write(f'B{max_row+5}', '=SUM(' + cellular_formula + ')', )
writer.sheets[customer].write_formula(f'B{max_row+6}', profit_formula, )
for ind,order in enumerate(counts):
writer.sheets[customer].write(f'A{max_row+8+ind}', order)
writer.sheets[customer].write(f'B{max_row+8+ind}', counts[order])
overview.write(overview_row,0, customer)
overview.write(overview_row,1, f"='{customer}'!B{max_row+3}")
overview.write(overview_row,2, f"='{customer}'!B{max_row+4}")
overview.write(overview_row,3, f"='{customer}'!B{max_row+5}")
overview.write(overview_row,4, f"='{customer}'!B{max_row+6}")
overview_row += 1
overview.write(overview_row,0, "Total")
overview.write(overview_row,1, f"=SUM(B2:B{overview_row})")
overview.write(overview_row,2, f"=SUM(C2:C{overview_row})+399")
overview.write(overview_row,3, f"=SUM(D2:D{overview_row})")
overview.write(overview_row,4, f"=B{overview_row+1} - C{overview_row+1} - D{overview_row+1}")
overview.set_column(0,4, 18)
# %%

265
mistawayData.py Normal file
View File

@@ -0,0 +1,265 @@
#Mistaway data collection
import lattice, logging
from shapely.geometry import Point, Polygon
from datetime import datetime as dt
logger = logging.getLogger('billing_reports')
logger.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)
# Find a value for a given key in a given dictionary
def _findItem(obj, key):
if key in obj: return obj[key]
for k, v in obj.items():
if isinstance(v,dict):
item = _findItem(v, key)
if item is not None:
return item
# recursively go through folders to build folder structure
def putFolder(folder, fs):
try:
if not folder["id"] == folder["parentFolderId"]:
parent = _findItem(fs, folder["parentFolderId"])
parent[folder["id"]] = folder
putFolder(parent,fs)
else:
fs[folder["id"]] = folder
return fs
except Exception as e:
logger.debug(f"Exception in putFolder: {e}")
def getMistAwayData():
# Go through every folder and build a proper folder structure
# Output to JSON file
nodes = lattice.getNodes()
folders = lattice.getFolders()
foldermap = {}
for folder in folders:
logger.debug(folder)
putFolder(folder,foldermap)
# Go through every node and collect unique device id (MAC)
# Output to JSON file
foldersTracker = []
vanityMap = {}
deviceTypes = {}
for type in lattice.getNodeTypes():
deviceTypes[type["id"]] = type["name"]
for node in nodes:
if not node["uniqueId"][-6:] in [":00:00", ":00:30"]:
if not node["folderId"] in foldersTracker:
foldersTracker.append(node["folderId"])
folder = _findItem(foldermap, node["folderId"])
if folder:
deviceName = folder["name"]
latitude = folder["location"]["lat"]
longitude = folder["location"]["lng"]
pfolder = _findItem(foldermap, folder["parentFolderId"])
ppfolder = _findItem(foldermap, pfolder["parentFolderId"])
customer = ppfolder["name"]
vanityMap[node["uniqueId"]] = {"deviceName": deviceName, "deviceType": deviceTypes[node["nodeTypeId"]], "customer": customer, "latitude": latitude, "longitude": longitude}
else:
logger.info("Folder does not exist: " + str(node["folderId"]))
else:
logger.info("Folder already in list: " + str(node["folderId"]))
"""
Data to be collected:
{
"customer":{
"sales_order": {
"billable_item_1": {
"sales_price": 75,
"platform_cost": 10,
"platform": "thingsboard", # "thingsboard", "mistaway"
"cellular_cost": 15,
"billing_type": "stand-alone" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
},
"billable_item_2:{...},
...
},
"sales_order_2":{...}
},
"customer_2":{...}
}
"""
mistaway_data = {}
denali_east = Polygon([(31.441289, -102.175343),(31.467676, -101.936571), (31.321496, -101.943604),(31.304714, -102.139878) ])
for _, value in vanityMap.items():
customer = value["customer"]
device = value["deviceName"]
type = value["deviceType"]
location = Point(value["latitude"], value["longitude"])
if not device in ["Melinda 252"]:
cellular_cost = 15
so = "HPSO-1"
price = 75
billing_type = "Stand-Alone"
if customer not in mistaway_data:
mistaway_data[customer] = {}
if customer == "CrownQuest":
if device == "LimeQuest 6 SR 1-1":
so = "LimeQuest SO"
price = 75
billing_type = "Stand-Alone"
elif "Wilkinson 39" in device or device in ["Wilkinson 37 WS 1-9B", "Wilkinson 37 WS 1-9B", "Free 40 WS 1-2", "Free 40 WS 1-4", "Free 40 WS 1-1"]:
so = "Wilkinson 39 Field"
price = 0
billing_type = "AP-bundled"
cellular_cost = 0
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
if "Wilkinson 39 AP" not in mistaway_data[customer][so]:
mistaway_data[customer][so]["Wilkinson 39 AP"] = {
"Sales Price": 250,
"Platform Cost": 0,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": 15,
"Billing Type": "AP" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
elif "Wilkinson 37" in device or device in ["Wilkinson 33 WS 3-1", "Wilkinson 33 WS 4-1", "Wilkinson 34 WS 2-10", "Wilkinson 34 WS 1-8"]:
so = "Wilkinson 37 Field"
price = 0
billing_type = "AP-bundled"
cellular_cost = 0
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
if "Wilkinson 37 AP" not in mistaway_data[customer][so]:
mistaway_data[customer][so]["Wilkinson 37 AP"] = {
"Sales Price": 250,
"Platform Cost": 0,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": 15,
"Billing Type": "AP" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
elif "Wilkinson 33" in device or "Wilkinson 34" in device or "Wilkinson 1" in device or "Wilkinson 4" in device:
so = "Wilkinson 33-34 Field"
price = 0
billing_type = "AP-bundled"
cellular_cost = 0
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
if "Wilkinson 33-34 AP" not in mistaway_data[customer][so]:
mistaway_data[customer][so]["Wilkinson 33-34 AP"] = {
"Sales Price": 250,
"Platform Cost": 0,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": 15,
"Billing Type": "AP" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
elif "Free 40" in device or "Free 32" in device:
so = "Free Field"
price = 0
billing_type = "AP-bundled"
cellular_cost = 0
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
if "Free AP" not in mistaway_data[customer][so]:
mistaway_data[customer][so]["Free AP"] = {
"Sales Price": 250,
"Platform Cost": 0,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": 15,
"Billing Type": "AP" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
elif "LimeQuest 5" in device or "LimeQuest 10" in device:
so = "LimeQuest Field"
price = 0
billing_type = "AP-bundled"
cellular_cost = 0
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
if "LimeQuest AP" not in mistaway_data[customer][so]:
mistaway_data[customer][so]["LimeQuest AP"] = {
"Sales Price": 250,
"Platform Cost": 0,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": 15,
"Billing Type": "AP" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
elif "LimeQuest 5" in device or "LimeQuest 10" in device:
so = "LimeQuest Field"
price = 0
billing_type = "AP-bundled"
cellular_cost = 0
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
if "LimeQuest AP" not in mistaway_data[customer][so]:
mistaway_data[customer][so]["LimeQuest AP"] = {
"Sales Price": 250,
"Platform Cost": 0,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": 15,
"Billing Type": "AP" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
elif "Horton 23" in device or "Horton 34" in device:
so = "Horton Field"
price = 0
billing_type = "AP-bundled"
cellular_cost = 0
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
if "Horton AP" not in mistaway_data[customer][so]:
mistaway_data[customer][so]["Horton AP"] = {
"Sales Price": 250,
"Platform Cost": 0,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": 15,
"Billing Type": "AP" # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
elif type == "advvfdipp" or type == "ipp":
so = "Santa Rosa"
elif type == "rigpump":
so = "Rig Pump"
elif type == "transferlite":
so = "Transfer"
elif customer == "Patriot Resources":
so = "Patriot Resources"
price = 100
elif customer == "Keagan Faudree Water":
so = "Keagan Faudree Water"
elif customer == "Summit Petroleum":
if location.x >= 31.654963:
so = "Banay"
price = 75
elif location.within(denali_east):
so = "Denali East"
if type == "dual_flowmeter":
price = 75
elif type == "plcfreshwater":
price = 55
cellular_cost = 0
billing_type = "Networked"
else: #if location.within(jitterbug):
so = "Jitterbug"
if type == "dual_flowmeter":
price = 75
elif type == "plcfreshwater":
price = 55
cellular_cost = 0
billing_type = "Networked"
if so not in mistaway_data[customer]:
mistaway_data[customer][so] = {}
mistaway_data[customer][so][device] = {
"Sales Price": price,
"Platform Cost": 10,
"Platform": "Mistaway", # "thingsboard", "mistaway"
"Cellular Cost": cellular_cost,
"Billing Type": billing_type # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
return mistaway_data

Binary file not shown.

155
reportBuilder.py Normal file
View File

@@ -0,0 +1,155 @@
#Build report from data
import pandas as pd
from datetime import datetime as dt
import os, boto3
from thingsBoardData import getThingsBoardData
from mistawayData import getMistAwayData
import logging
from email.mime.multipart import MIMEMultipart
from email import encoders
from email.mime.base import MIMEBase
logger = logging.getLogger('billing_reports')
logger.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)
ses = boto3.client('ses')
EMAIL_FROM_ADDRESS = "alerts@henry-pump.com"
email_to = [
"nmelone@henry-pump.com"
]
#Get Mistaway Data
mistaway_data = getMistAwayData()
#Get ThingsBoard Data
thingsboard_data = getThingsBoardData(os.environ["url"], os.environ["username"],os.environ["password"])
#Mixing data from Mistaway and ThingsBoard
excel_data = {}
excel_data.update(mistaway_data)
for customer in thingsboard_data.keys():
if customer in excel_data:
for so in thingsboard_data[customer].keys():
if so in excel_data[customer]:
excel_data[customer][so].update(thingsboard_data[customer][so])
else:
excel_data[customer].update(thingsboard_data[customer])
else:
excel_data[customer] = thingsboard_data[customer]
def reportBuilder(event, context):
# Create a new Excel writer object
with pd.ExcelWriter(f"/tmp/Remote-Monitoring-Report-{dt.date(dt.now())}.xlsx", engine="xlsxwriter") as writer:
# Formats
bold_format = writer.book.add_format({'bold': True})
header_format = writer.book.add_format({'bold': True, 'center_across': True, 'border': True, 'bottom': True})
currency_format = writer.book.add_format({'num_format': "[$$-409]#,##0.00"})
bold_currency_format = writer.book.add_format({'num_format': "[$$-409]#,##0.00", 'bold': True})
highlight_format = writer.book.add_format({'bg_color': "yellow"})
# Setting up overview sheet
overview = writer.book.add_worksheet("Overview")
overview_row = 1
overview.write(0,0, "Customer", header_format)
overview.write(0,1, "Revenue", header_format)
overview.write(0,2, "Platform Cost", header_format)
overview.write(0,3, "Cellular Cost", header_format)
overview.write(0,4, "Profit", header_format)
# Loop through customers
for customer, orders in excel_data.items():
rows = []
counts = {}
# Loop through each sales order for the customer
for order, items in orders.items():
for item, details in items.items():
row = {
"Sales Order": order,
"Location": item
}
row.update(details)
rows.append(row)
counts[order] = len(items)
# Convert the data to a DataFrame
df = pd.DataFrame(rows)
# Sort by sales order
df = df.sort_values(by="Sales Order")
# Write to a specific sheet in the Excel file
df.to_excel(writer, sheet_name=customer, index=False)
for column in df:
column_length = max(df[column].astype(str).map(len).max(), len(column))
col_idx = df.columns.get_loc(column)
if col_idx in [2,3,5]:
writer.sheets[customer].set_column(col_idx, col_idx, column_length, currency_format)
else:
writer.sheets[customer].set_column(col_idx, col_idx, column_length)
# Get the dimensions of the dataframe.
(max_row, max_col) = df.shape
#Apply highlighting
writer.sheets[customer].conditional_format(f"G2:G{max_row+1}", {"type": "text", "criteria": "not containing", "value": "AP-bundled", "format": highlight_format})
#writer.sheets[customer].set_column(2,3,None,currency_format)
#manually adding extra calculated values
sales_formula = f"C2:C{max_row+1}"
platform_formula = f"D2:D{max_row+1}"
cellular_formula = f"F2:F{max_row+1}"
profit_formula = f"=B{max_row+3} - B{max_row+4} - B{max_row+5}"
writer.sheets[customer].write(f'A{max_row+3}', "Revenue", bold_format)
writer.sheets[customer].write(f'A{max_row+4}', "Platform Cost", bold_format)
writer.sheets[customer].write(f'A{max_row+5}', "Cellular Cost", bold_format)
writer.sheets[customer].write(f'A{max_row+6}', "Profit", bold_format)
writer.sheets[customer].write(f'B{max_row+3}', '=SUM(' + sales_formula + ')', bold_currency_format)
writer.sheets[customer].write(f'B{max_row+4}', '=SUM(' + platform_formula + ')', bold_currency_format)
writer.sheets[customer].write(f'B{max_row+5}', '=SUM(' + cellular_formula + ')', bold_currency_format)
writer.sheets[customer].write_formula(f'B{max_row+6}', profit_formula, bold_currency_format)
for ind,order in enumerate(counts):
writer.sheets[customer].write(f'A{max_row+8+ind}', order)
writer.sheets[customer].write(f'B{max_row+8+ind}', counts[order])
overview.write(overview_row,0, customer)
overview.write(overview_row,1, f"='{customer}'!B{max_row+3}")
overview.write(overview_row,2, f"='{customer}'!B{max_row+4}")
overview.write(overview_row,3, f"='{customer}'!B{max_row+5}")
overview.write(overview_row,4, f"='{customer}'!B{max_row+6}")
overview_row += 1
overview.write(overview_row,0, "Total", bold_format)
overview.write(overview_row,1, f"=SUM(B2:B{overview_row})", bold_currency_format)
overview.write(overview_row,2, f"=SUM(C2:C{overview_row})+399", bold_currency_format)
overview.write(overview_row,3, f"=SUM(D2:D{overview_row})", bold_currency_format)
overview.write(overview_row,4, f"=B{overview_row+1} - C{overview_row+1} - D{overview_row+1}", bold_currency_format)
overview.set_column(0,4, 18)
send_email()
def send_email():
attachment = MIMEBase('application', 'octet-stream')
attachment.set_payload(open(f"/tmp/Remote-Monitoring-Report-{dt.date(dt.now())}.xlsx", "rb").read())
encoders.encode_base64(attachment)
msg = MIMEMultipart('alternative')
msg['Subject'] = f"Remote Monitoring Report - {dt.date(dt.now())}"
msg['From'] = "alerts@henry-pump.com"
msg['To'] = ", ".join(email_to)
filename = f"Remote-Monitoring-{dt.date(dt.now())} .xlsx"
attachment.add_header('Content-Disposition', 'attachment', filename=filename)
msg.attach(attachment)
response = ses.send_raw_email(
Source=EMAIL_FROM_ADDRESS,
Destinations=email_to,
RawMessage={
'Data': msg.as_string()
},
FromArn='',
SourceArn='',
ReturnPathArn=''
)
return response

6
requirements.txt Normal file
View File

@@ -0,0 +1,6 @@
click==8.1.3
pandas==1.4.2
Requests==2.31.0
Shapely==2.0.1
tb_rest_client==3.5
xlsxwriter==3.1.2

130
thingsBoardData.py Normal file
View File

@@ -0,0 +1,130 @@
#ThingsBoard data collection
from tb_rest_client.rest_client_ce import *
from tb_rest_client.rest import ApiException
import logging
logger = logging.getLogger('billing_reports')
logger.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)
def getDevices(rest_client, customers, page=0, pageSize=500):
thingsboard_data = {}
for c in customers.data:
cname = c.name
cid = c.id.id
if cname not in ["Test Company", "Amerus Safety Solutions"]:
#create new company if it doesn't exist
if cname not in thingsboard_data:
thingsboard_data[cname] = {}
#get devices of a company
devices = rest_client.get_customer_devices(customer_id=cid, page_size=pageSize, page=page)
#go through each device and store its data in the dict
for device in devices.data:
cellular_cost = 15
#fix naming to work with JSON/dict
if '"' in device.name:
deviceName = device.name.replace('"', 'in')
else:
deviceName = device.name
# Sort Device details
if cname == "Chuda Resources":
so = "Water Wells"
price = 75
billing_type = "Stand-Alone"
elif cname == "Henry Petroleum":
so = "Check Meters"
price = 50
billing_type = "Stand-Alone"
elif cname == "Faskens":
if device.type == "tankalarms":
so = "Tanks"
billing_type = "Stand-Alone"
price = 50
elif device.type in ["advvfdipp", "plcfreshwater"]:
so = "Water Wells"
billing_type = "Stand-Alone"
price = 50
elif device.type == "plcpond":
so = "Ponds"
billing_type = "Stand-Alone"
price = 50
else:
so = "HPSO-1"
billing_type = "Stand-Alone"
price = 50
elif cname == "Henry Resources":
if deviceName == "Pearl Central":
so = "Henry Resources"
price = 300
billing_type = "Stand-Alone-WiFi"
else:
so = "Henry Resources"
price = 275
billing_type = "Stand-Alone"
elif cname == "ConocoPhillips":
if device.type == "flowmeterskid":
so = "Portable Meter"
price = 50
billing_type = "Stand-Alone"
elif device.type == "plcfreshwater":
so = "Water Well"
price = 50
cellular_cost = 0
billing_type = "Networked"
elif device.type == "advvfdipp":
so = "Santa Rosa"
price = 50
billing_type = "Stand-Alone"
elif device.type == "Gateway":
so = "AP"
price = 0
billing_type = "AP-bundled"
elif device.type == "cpdualflowmeter":
so = "Pond/Flowmeter"
price = 50
billing_type = "Networked"
elif cname == "Saulsbury Ventures":
so = "Saulsbury Ventures"
price = 50
billing_type = "Stand-Alone"
else:
so = "HPSO-1"
price = 50
billing_type = "Stand-Alone"
#make a new Sales Order if it doesn't exist
if so not in thingsboard_data[cname]:
thingsboard_data[cname][so] = {}
#add device to Sales Order under Company
thingsboard_data[cname][so][deviceName] = {
"Sales Price": price,
"Platform Cost": 0,
"Platform": "ThingsBoard", # "thingsboard", "mistaway"
"Cellular Cost": cellular_cost,
"Billing Type": billing_type # "stand-alone", "AP", "AP-bundled", "networked", "stand-alone-wifi"
}
return thingsboard_data
def getThingsBoardData(url, username, password):
# Creating the REST client object with context manager to get auto token refresh
with RestClientCE(base_url=url) as rest_client:
try:
# Auth with credentials
rest_client.login(username=username, password=password)
# Get customers > get devices under a target customer > get keys for devices > get data for devices
customers = rest_client.get_customers(page_size="100", page="0")
thingsboard_data = getDevices(rest_client=rest_client, customers=customers)
return thingsboard_data
except ApiException as e:
logger.error(e)
return False