Spaces:
Running

hub / backend /scripts /check_lines.py
Andre
deploy: snapshot c96b9ab -- Inventory Journals (Lagerforandringsjournal) na Contabilidade (v1.3.61)
77db408
Raw History Blame Contribute Delete
782 Bytes
import csv
import io
import os
def check_lines(f):
if not os.path.exists(f):
print(f"File {f} not found.")
return
with open(f, 'rb') as file:
content = file.read().decode('utf-8-sig')
reader = csv.DictReader(io.StringIO(content), delimiter=';')
count = 0
for row in reader:
if row.get('Currency_Code') == 'EUR' and row.get('Invoice_Date', '') >= '2024-01-01':
print(f"Inv: {row.get('Invoice_Number')} | CCY: {row.get('Currency_Code')} | FX: {row.get('Revenue_FX')} | SEK_ERP: {row.get('Revenue_SEK_ERP')} | SEK_Final: {row.get('Revenue_SEK_Final')}")
count += 1
if count >= 5: break
if __name__ == "__main__":
check_lines("assets/fact_invoice_lines.csv")