diff --git a/netforce_clinic/models/utils.py b/netforce_clinic/models/utils.py index b6eab78..e5d13f9 100644 --- a/netforce_clinic/models/utils.py +++ b/netforce_clinic/models/utils.py @@ -161,14 +161,14 @@ def num2word(n,l="th_TH"): word = sym[l][sign] + sym[l]['sep'] + base + sym[l]['sep'] + currency[l]['name'] + sym[l]['sep'] + currency[l]['end'] return word.strip() -def read_excel(fpath=None,show_datetime=False): +def read_excel(fpath=None,sheet_name="Sheet1",show_datetime=False): data={} if fpath: suffix=fpath.split(".")[-1] if suffix not in ('xls', 'xlsx'): raise Exception("ERROR : please should file xls or xlsx") wb=xlrd.open_workbook(fpath) - sheet=wb.sheet_by_name("Sheet1") + sheet=wb.sheet_by_name(sheet_name) keys = [sheet.cell(0, col_index).value for col_index in range(sheet.ncols)] data=[] for row_index in range(1, sheet.nrows):