Jelajahi Sumber

New Tool Start-> Fast automatic Bills

Eco Calender Update
Danny 2 tahun lalu
induk
melakukan
a100972273

+ 0 - 3
Image2PDF/Readme

@@ -1,3 +0,0 @@
-#Installings
-
-pip install img2pdf

+ 4 - 0
fast_excel_to_bill/Readme

@@ -0,0 +1,4 @@
+#Installings
+
+pip install img2pdf
+conda install python-docx

+ 53 - 0
fast_excel_to_bill/bill_doc/create_custom_bill_doc.py

@@ -0,0 +1,53 @@
+from docx import Document
+from docx.shared import Inches
+import time
+
+'https://python-docx.readthedocs.io/en/latest/user/text.html'
+
+def create_custome_doc_file():
+    '''
+    :return: Bill as Doc file
+    '''
+
+
+
+document = Document()
+
+document.add_heading('Document Title', 0)
+
+p = document.add_paragraph('A plain paragraph having some ')
+p.add_run('bold').bold = True
+p.add_run(' and some ')
+p.add_run('italic.').italic = True
+
+document.add_heading('Heading, level 1', level=1)
+document.add_paragraph('Intense quote', style='Intense Quote')
+
+document.add_paragraph(
+    'first item in unordered list', style='List Bullet'
+)
+document.add_paragraph(
+    'first item in ordered list', style='List Number'
+)
+
+records = (
+    (3, '101', 'Spam'),
+    (7, '422', 'Eggs'),
+    (4, '631', 'Spam, spam, eggs, and spam')
+)
+
+table = document.add_table(rows=1, cols=3)
+hdr_cells = table.rows[0].cells
+hdr_cells[0].text = 'Qty'
+hdr_cells[1].text = 'Id'
+hdr_cells[2].text = 'Desc'
+for qty, id, desc in records:
+    row_cells = table.add_row().cells
+    row_cells[0].text = str(qty)
+    row_cells[1].text = id
+    row_cells[2].text = desc
+
+document.add_page_break()
+
+doc_output_path = r'C:\Users\Danny\Desktop\ssd wichtige dinge D\Tools\fast_excel_to_bill\test_folder' + r'\doc_test_{}.docx'.format(time.strftime("%Y-%m-%d_H%H-M%M"))
+document.save(doc_output_path)

+ 0 - 0
fast_excel_to_bill/ReadMe → fast_excel_to_bill/excel_data_chris_format/ReadMe


+ 24 - 0
fast_excel_to_bill/excel_data_chris_format/main.py

@@ -0,0 +1,24 @@
+from tool_lib.read_table import Read_unordered_Table
+from fast_excel_to_bill.excel_data_chris_format.table_config import TABLE_PATH, LIST_OF_KEYS
+
+
+def main():
+    table_object = Read_unordered_Table(path=TABLE_PATH, type= 'xlsx').get_values_after_key_as_dict(list_of_keys=LIST_OF_KEYS)
+
+    # Get Specific Values only useable for this specific format:
+    table_object['ZWISCHENSUMME']=table_object['BETRAG'][-4]
+    table_object['STEUERSATZ']=table_object['BETRAG'][-3]
+    table_object['STEUER']=table_object['BETRAG'][-2]
+    table_object['SUMME']=table_object['BETRAG'][-1]
+
+    for c,value in enumerate(table_object['MENGE']):
+        if value == 'ZWISCHENSUMME':
+            table_object['BESCHREIBUNG'] = table_object['BESCHREIBUNG'][1:c]
+            table_object['MENGE'] = table_object['MENGE'][1:c]
+            table_object['EINZELPREIS'] = table_object['EINZELPREIS'][1:c]
+            table_object['BETRAG'] = table_object['BETRAG'][1:c]
+    assert(len(table_object['BESCHREIBUNG'])==len(table_object['MENGE']),'FORMAT von CHRIS IST FEHLERHAFT, BESCHREIBUNGS Länge =! MENGE Länge')
+    return table_object
+
+if __name__ == '__main__':
+    table_object = main()

+ 0 - 0
fast_excel_to_bill/table_config.py → fast_excel_to_bill/excel_data_chris_format/table_config.py


+ 4 - 20
fast_excel_to_bill/main.py

@@ -1,24 +1,8 @@
-from tool_lib.read_table import Read_unordered_Table
-from fast_excel_to_bill.table_config import TABLE_PATH, LIST_OF_KEYS
-
-
 def main():
-    table_object = Read_unordered_Table(path=TABLE_PATH, type= 'xlsx').get_values_after_key_as_dict(list_of_keys=LIST_OF_KEYS)
-
-    # Get Specific Values only useable for this specific format:
-    table_object['ZWISCHENSUMME']=table_object['BETRAG'][-4]
-    table_object['STEUERSATZ']=table_object['BETRAG'][-3]
-    table_object['STEUER']=table_object['BETRAG'][-2]
-    table_object['SUMME']=table_object['BETRAG'][-1]
+    get_data_from_excel=...
+    data_to_bill_doc = ...
+    doc_to_pdf = ...
 
-    for c,value in enumerate(table_object['MENGE']):
-        if value == 'ZWISCHENSUMME':
-            table_object['BESCHREIBUNG'] = table_object['BESCHREIBUNG'][1:c]
-            table_object['MENGE'] = table_object['MENGE'][1:c]
-            table_object['EINZELPREIS'] = table_object['EINZELPREIS'][1:c]
-            table_object['BETRAG'] = table_object['BETRAG'][1:c]
-    assert(len(table_object['BESCHREIBUNG'])==len(table_object['MENGE']),'FORMAT von CHRIS IST FEHLERHAFT, BESCHREIBUNGS Länge =! MENGE Länge')
-    return table_object
 
 if __name__ == '__main__':
-    table_object = main()
+    main()

TEMPAT SAMPAH
fast_excel_to_bill/test_folder/Bentomax-08.21.pdf


TEMPAT SAMPAH
fast_excel_to_bill/test_folder/Bentomax-Rechnungsvorlage-August.doc


TEMPAT SAMPAH
fast_excel_to_bill/test_folder/Rechnung-Juli-h1.pdf


TEMPAT SAMPAH
fast_excel_to_bill/test_folder/TourTeam-Rechnung-Dezember.pdf


TEMPAT SAMPAH
fast_excel_to_bill/test_folder/Zeitplanner.xlsx