Files

19 lines
556 B
Python
Raw Permalink Normal View History

2026-02-25 10:24:12 +01:00
from pprint import pprint
import csv
from localconfig import BUYERS_REPAIRED
class RepairedBuyers():
def __init__(self):
'''
Get the repaired buyers detail from disk
'''
self.buyers = {}
with open(BUYERS_REPAIRED, newline="", encoding="utf-8") as f_in:
reader = csv.DictReader(f_in)
for row in reader:
self.buyers[row['Invoice']] = row
def get_buyer_for(self, invoiceid):
if invoiceid in self.buyers.keys():
return self.buyers[invoiceid]