<gh_stars>0
from datetime import date
import calendar
import os


class InvoicePath(object):

    def __init__(self, medical_aid, patient_name, index, practice_folder_id):
        self.today = date.today()
        self.medical_aid = medical_aid.strip()
        self.patient_name = patient_name.strip()
        self.index = index
        self.practice_folder_id = practice_folder_id


    def date_digits(self, date_component):
        if date_component == 'year':
            return self.today.year
        elif date_component == 'month':
            return self.today.month
        elif date_component == 'day':
            return self.today.day

    def generate(self):
        self.path = os.getenv("INVOICE_URL") + '/' + str(self.practice_folder_id) + '/' + str(self.medical_aid).upper() + '_' + str(self.date_digits('year')) + '/' + str(self.date_digits('month')) + calendar.month_name[self.date_digits('month')] + str(self.date_digits('year')) + '/' + str(self.date_digits('month')) + '_' + str(self.index) + self.patient_name
        return self.path


from datetime import date
import calendar
import os


class InvoicePath(object):

    def __init__(self, medical_aid, patient_name, index, practice_folder_id):
        self.today = date.today()
        self.medical_aid = medical_aid.strip()
        self.patient_name = patient_name.strip()
        self.index = index
        self.practice_folder_id = practice_folder_id


    def date_digits(self, date_component):
        if date_component == 'year':
            return self.today.year
        elif date_component == 'month':
            return self.today.month
        elif date_component == 'day':
            return self.today.day

    def generate(self):
        self.path = os.getenv("INVOICE_URL") + '/' + str(self.practice_folder_id) + '/' + str(self.medical_aid).upper() + '_' + str(self.date_digits('year')) + '/' + str(self.date_digits('month')) + calendar.month_name[self.date_digits('month')] + str(self.date_digits('year')) + '/' + str(self.date_digits('month')) + '_' + str(self.index) + self.patient_name
        return self.path