File size: 853 Bytes
d79b7f7 566dc81 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
import sys
sys.path.append('src')
from extraction import extract_dates, extract_amounts, extract_total, extract_vendor, extract_invoice_number
receipt_text = """
tan chay yee
*** COPY ***
OJC MARKETING SDN BHD.
ROC NO: 538358-H
TAX INVOICE
Invoice No: PEGIV-1030765
Date: 15/01/2019 11:05:16 AM
TOTAL: 193.00
"""
print("🧪 Testing Extraction Functions")
print("=" * 60)
dates = extract_dates(receipt_text)
print(f"\n📅 Date: {dates}")
amounts = extract_amounts(receipt_text)
print(f"\n💰 Amounts: {amounts}")
total = extract_total(receipt_text)
print(f"\n💵 Total: {total}")
vendor = extract_vendor(receipt_text)
print(f"\n🏢 Vendor: {vendor}")
invoice_num = extract_invoice_number(receipt_text)
print(f"\n📄 Invoice Number: {invoice_num}")
print("\n✅ All extraction tests complete!") |