chris_format.py 1.2 KB

123456789101112131415161718192021222324
  1. from tool_lib.read_table import Read_unordered_Table
  2. from fast_excel_to_bill.transform_excel_data_to_bill_data.table_config import TABLE_PATH, LIST_OF_KEYS
  3. #TODO Currently not Working
  4. def main():
  5. table_object = Read_unordered_Table(path=TABLE_PATH, type= 'xlsx').get_values_after_key_as_dict(list_of_keys=LIST_OF_KEYS)
  6. # Get Specific Values only useable for this specific format:
  7. table_object['ZWISCHENSUMME']=table_object['BETRAG'][-4]
  8. table_object['STEUERSATZ']=table_object['BETRAG'][-3]
  9. table_object['STEUER']=table_object['BETRAG'][-2]
  10. table_object['SUMME']=table_object['BETRAG'][-1]
  11. for c,value in enumerate(table_object['MENGE']):
  12. if value == 'ZWISCHENSUMME':
  13. table_object['BESCHREIBUNG'] = table_object['BESCHREIBUNG'][1:c]
  14. table_object['MENGE'] = table_object['MENGE'][1:c]
  15. table_object['EINZELPREIS'] = table_object['EINZELPREIS'][1:c]
  16. table_object['BETRAG'] = table_object['BETRAG'][1:c]
  17. assert(len(table_object['BESCHREIBUNG'])==len(table_object['MENGE']),'FORMAT von CHRIS IST FEHLERHAFT, BESCHREIBUNGS Länge =! MENGE Länge')
  18. return table_object
  19. if __name__ == '__main__':
  20. table_object = main()