diff --git a/ILE_MainWindow.py b/ILE_MainWindow.py new file mode 100644 index 0000000..28a4f7b --- /dev/null +++ b/ILE_MainWindow.py @@ -0,0 +1,192 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'ILE_MainWindow.ui' +# +# Created by: PyQt5 UI code generator 5.15.7 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + MainWindow.setObjectName("MainWindow") + MainWindow.resize(889, 634) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap("assets/extract.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + MainWindow.setWindowIcon(icon) + self.centralwidget = QtWidgets.QWidget(MainWindow) + self.centralwidget.setObjectName("centralwidget") + self.gridLayout_2 = QtWidgets.QGridLayout(self.centralwidget) + self.gridLayout_2.setObjectName("gridLayout_2") + self.gridLayout = QtWidgets.QGridLayout() + self.gridLayout.setObjectName("gridLayout") + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.reportTypeL = QtWidgets.QLabel(self.centralwidget) + font = QtGui.QFont() + font.setPointSize(14) + font.setBold(True) + font.setWeight(75) + self.reportTypeL.setFont(font) + self.reportTypeL.setObjectName("reportTypeL") + self.horizontalLayout_2.addWidget(self.reportTypeL, 0, QtCore.Qt.AlignLeft) + self.reportTypeCB = QtWidgets.QComboBox(self.centralwidget) + self.reportTypeCB.setObjectName("reportTypeCB") + self.reportTypeCB.addItem("") + self.reportTypeCB.addItem("") + self.reportTypeCB.addItem("") + self.reportTypeCB.addItem("") + self.reportTypeCB.addItem("") + self.reportTypeCB.addItem("") + self.reportTypeCB.addItem("") + self.reportTypeCB.addItem("") + self.reportTypeCB.addItem("") + self.reportTypeCB.addItem("") + self.reportTypeCB.addItem("") + self.reportTypeCB.addItem("") + self.reportTypeCB.addItem("") + self.horizontalLayout_2.addWidget(self.reportTypeCB) + self.gridLayout.addLayout(self.horizontalLayout_2, 0, 0, 1, 1) + self.fileSettingsBox = QtWidgets.QVBoxLayout() + self.fileSettingsBox.setObjectName("fileSettingsBox") + self.inputFileBox = QtWidgets.QHBoxLayout() + self.inputFileBox.setObjectName("inputFileBox") + self.inputFileButton = QtWidgets.QPushButton(self.centralwidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.inputFileButton.sizePolicy().hasHeightForWidth()) + self.inputFileButton.setSizePolicy(sizePolicy) + self.inputFileButton.setMinimumSize(QtCore.QSize(250, 0)) + self.inputFileButton.setMaximumSize(QtCore.QSize(250, 55)) + icon1 = QtGui.QIcon() + icon1.addPixmap(QtGui.QPixmap("assets/folder.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.inputFileButton.setIcon(icon1) + self.inputFileButton.setObjectName("inputFileButton") + self.inputFileBox.addWidget(self.inputFileButton) + self.inputFileLE = QtWidgets.QLineEdit(self.centralwidget) + self.inputFileLE.setReadOnly(True) + self.inputFileLE.setObjectName("inputFileLE") + self.inputFileBox.addWidget(self.inputFileLE) + self.fileSettingsBox.addLayout(self.inputFileBox) + self.outFileLocation = QtWidgets.QHBoxLayout() + self.outFileLocation.setObjectName("outFileLocation") + self.outputFileButton = QtWidgets.QPushButton(self.centralwidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.outputFileButton.sizePolicy().hasHeightForWidth()) + self.outputFileButton.setSizePolicy(sizePolicy) + self.outputFileButton.setMinimumSize(QtCore.QSize(250, 0)) + self.outputFileButton.setMaximumSize(QtCore.QSize(250, 55)) + self.outputFileButton.setIcon(icon1) + self.outputFileButton.setObjectName("outputFileButton") + self.outFileLocation.addWidget(self.outputFileButton) + self.outputFileLE = QtWidgets.QLineEdit(self.centralwidget) + self.outputFileLE.setReadOnly(True) + self.outputFileLE.setObjectName("outputFileLE") + self.outFileLocation.addWidget(self.outputFileLE) + self.fileSettingsBox.addLayout(self.outFileLocation) + self.gridLayout.addLayout(self.fileSettingsBox, 1, 0, 1, 1) + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.processReportButton = QtWidgets.QPushButton(self.centralwidget) + self.processReportButton.setEnabled(False) + icon2 = QtGui.QIcon() + icon2.addPixmap(QtGui.QPixmap("assets/process.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.processReportButton.setIcon(icon2) + self.processReportButton.setObjectName("processReportButton") + self.horizontalLayout.addWidget(self.processReportButton) + self.copyButton = QtWidgets.QPushButton(self.centralwidget) + self.copyButton.setEnabled(False) + icon3 = QtGui.QIcon() + icon3.addPixmap(QtGui.QPixmap("assets/copy.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.copyButton.setIcon(icon3) + self.copyButton.setObjectName("copyButton") + self.horizontalLayout.addWidget(self.copyButton) + self.openFolderButton = QtWidgets.QPushButton(self.centralwidget) + self.openFolderButton.setEnabled(False) + self.openFolderButton.setIcon(icon1) + self.openFolderButton.setObjectName("openFolderButton") + self.horizontalLayout.addWidget(self.openFolderButton) + self.openExcelButton = QtWidgets.QPushButton(self.centralwidget) + self.openExcelButton.setEnabled(False) + icon4 = QtGui.QIcon() + icon4.addPixmap(QtGui.QPixmap("assets/excel.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.openExcelButton.setIcon(icon4) + self.openExcelButton.setObjectName("openExcelButton") + self.horizontalLayout.addWidget(self.openExcelButton) + self.gridLayout.addLayout(self.horizontalLayout, 2, 0, 1, 1) + self.inputFilePreview = QtWidgets.QTextBrowser(self.centralwidget) + self.inputFilePreview.setObjectName("inputFilePreview") + self.gridLayout.addWidget(self.inputFilePreview, 3, 0, 1, 1) + self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1) + MainWindow.setCentralWidget(self.centralwidget) + self.menubar = QtWidgets.QMenuBar(MainWindow) + self.menubar.setGeometry(QtCore.QRect(0, 0, 889, 24)) + self.menubar.setObjectName("menubar") + self.menu_Settings = QtWidgets.QMenu(self.menubar) + icon5 = QtGui.QIcon() + icon5.addPixmap(QtGui.QPixmap("assets/settings.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.menu_Settings.setIcon(icon5) + self.menu_Settings.setObjectName("menu_Settings") + self.menuStart_Maximized = QtWidgets.QMenu(self.menu_Settings) + icon6 = QtGui.QIcon() + icon6.addPixmap(QtGui.QPixmap("assets/maximize.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.menuStart_Maximized.setIcon(icon6) + self.menuStart_Maximized.setObjectName("menuStart_Maximized") + MainWindow.setMenuBar(self.menubar) + self.statusbar = QtWidgets.QStatusBar(MainWindow) + self.statusbar.setObjectName("statusbar") + MainWindow.setStatusBar(self.statusbar) + self.action_Default_Locations = QtWidgets.QAction(MainWindow) + icon7 = QtGui.QIcon() + icon7.addPixmap(QtGui.QPixmap("assets/fileSearch.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.action_Default_Locations.setIcon(icon7) + self.action_Default_Locations.setObjectName("action_Default_Locations") + self.menu_Settings.addAction(self.action_Default_Locations) + self.menubar.addAction(self.menu_Settings.menuAction()) + self.reportTypeL.setBuddy(self.reportTypeCB) + + self.retranslateUi(MainWindow) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + MainWindow.setTabOrder(self.reportTypeCB, self.inputFileButton) + MainWindow.setTabOrder(self.inputFileButton, self.outputFileButton) + MainWindow.setTabOrder(self.outputFileButton, self.processReportButton) + MainWindow.setTabOrder(self.processReportButton, self.copyButton) + MainWindow.setTabOrder(self.copyButton, self.inputFileLE) + MainWindow.setTabOrder(self.inputFileLE, self.outputFileLE) + MainWindow.setTabOrder(self.outputFileLE, self.inputFilePreview) + + def retranslateUi(self, MainWindow): + _translate = QtCore.QCoreApplication.translate + MainWindow.setWindowTitle(_translate("MainWindow", "IL Extract")) + self.reportTypeL.setText(_translate("MainWindow", "Infolease Report Type:")) + self.reportTypeCB.setItemText(0, _translate("MainWindow", "ACH")) + self.reportTypeCB.setItemText(1, _translate("MainWindow", "Disposition")) + self.reportTypeCB.setItemText(2, _translate("MainWindow", "Gain Loss")) + self.reportTypeCB.setItemText(3, _translate("MainWindow", "Lock Box")) + self.reportTypeCB.setItemText(4, _translate("MainWindow", "Minv_C")) + self.reportTypeCB.setItemText(5, _translate("MainWindow", "Net Inv. Loans")) + self.reportTypeCB.setItemText(6, _translate("MainWindow", "NI Renewal")) + self.reportTypeCB.setItemText(7, _translate("MainWindow", "NIV After")) + self.reportTypeCB.setItemText(8, _translate("MainWindow", "PBP / Epay")) + self.reportTypeCB.setItemText(9, _translate("MainWindow", "Returned Check")) + self.reportTypeCB.setItemText(10, _translate("MainWindow", "Unapplied")) + self.reportTypeCB.setItemText(11, _translate("MainWindow", "VMCC")) + self.reportTypeCB.setItemText(12, _translate("MainWindow", "Wires")) + self.inputFileButton.setText(_translate("MainWindow", "Select &InfoLease Report")) + self.inputFileLE.setPlaceholderText(_translate("MainWindow", "No file selected")) + self.outputFileButton.setText(_translate("MainWindow", "Select &Report Output Location")) + self.outputFileLE.setPlaceholderText(_translate("MainWindow", "No location selected")) + self.processReportButton.setText(_translate("MainWindow", "&Process Report")) + self.copyButton.setText(_translate("MainWindow", "&Copy to Clipboard")) + self.openFolderButton.setText(_translate("MainWindow", "&Open Folder")) + self.openExcelButton.setText(_translate("MainWindow", "&Open File")) + self.menu_Settings.setTitle(_translate("MainWindow", "&Settings")) + self.action_Default_Locations.setText(_translate("MainWindow", "&Default Locations")) + diff --git a/ILExtract.py b/ILExtract.py index f1f9e98..7be1d3a 100644 --- a/ILExtract.py +++ b/ILExtract.py @@ -32,6 +32,7 @@ class ILReport: def process(self): + print("Processing file") try: # Open the file and read it to a string | errors = 'replace' deals with non UTF-8 characters (no affect on output) with open(self.location, errors="replace") as ifile: @@ -234,7 +235,6 @@ def gainloss(report: str, save_name: str): 'RCV OFFSET' : [], 'GAIN/LOSS' : [], 'DISPOSITION CODE' : [], - 'DISPOSITION DESC' 'UNEARNED IDC' : [], 'UNPAID INT' : [], 'PENALTY FEE' : [], @@ -293,6 +293,52 @@ def gainloss(report: str, save_name: str): disp_descriptoin.append(" ".join(disp_split[1:])) df["DISPOSITION CODE"] = disp_code df["DISPOSITION DESC"] = disp_descriptoin + df["Fund"] = df["CONTRACT NUMBER"].apply( + lambda con_num: con_num[0:3]) + df = df[['Fund', + 'CONTRACT NUMBER', + 'CUSTOMER NAME', + 'DISPOSITION CODE', + 'DISPOSITION DESC', + 'CASH RECEIVED', + 'GAIN/LOSS', + 'NET RESERVE', + 'REM RENT RCVB', + 'RESIDUAL', + 'UNAMORT RES', + 'UNEARNED FIN', + 'BLENDED INC', + 'END/SEC DEP', + 'UNEARNED IDC', + 'UNPAID INT', + 'MISC', + 'ASSET VAL', + 'CTD OPER DEPR' + 'CURR INT RCVB', + 'CURR RENT RCVB', + 'DEF REN INC', + 'DEF REN INT', + 'DISPOSITION DESCUNEARNED IDC', + 'EARNED IDC', + 'EQUITY ADDON', + 'GST BOOK G/L', + 'GUAR RESIDUAL', + 'INT EARNED', + 'INVENT CHANGE', + 'LATE CHGS', + 'MISC G/L', + 'MISC TAX', + 'OPER BASIS', + 'OPER RCVB', + 'OVER/SHORT', + 'PENALTY FEE', + 'RCV OFFSET', + 'RENEWAL RCVBL', + 'SALES TAX', + 'UNPAID ACCRD', + 'UNRECOG GST', + 'REM RENT RCVB', + ]] df.to_excel(save_name, index=False) return df @@ -300,101 +346,188 @@ def gainloss(report: str, save_name: str): def net_invest_trial_balance(report: str, save_name: str): lines = report.splitlines() extracted_data_dict = { - 'CUSTOMER NAME' : [], - 'CURR INT RCVB' : [], - 'UNEARNED BLENDED' : [], - 'BLEND NET INV' : [], - 'LEASE NUMBER' : [], - 'GROSS CONTRACT' : [], - 'CURR RENT RCVB' : [], - 'UNEARN FIN' : [], - 'END DEPOSIT' : [], - 'SEC DEPOSIT' : [], - 'LEASE PYMTS' : [], - 'TOTAL' : [], - 'CONTRACT STAT' : [], - 'PAYMENTS RCVD' : [], - 'REM RENT RCVB' : [], - 'UNEARN RESID' : [], - 'PROV LOSS' : [], - 'NET RESERVE' : [], - 'UNEARN INC' : [], - 'BAL REMAINING' : [], - 'RESIDUAL' : [], - 'UNPAID INT' : [], - 'NET INV' : [], - 'UNEARNED IDC' : [], - "LESSOR": [] + 'CUSTOMER NAME': [], + 'CURR INT RCVB': [], + 'UNEARNED BLENDED': [], + 'BLEND NET INV': [], + 'LEASE NUMBER': [], + 'GROSS CONTRACT': [], + 'CURR RENT RCVB': [], + 'UNEARN FIN': [], + 'END DEPOSIT': [], + 'SEC DEPOSIT': [], + 'LEASE PYMTS': [], + 'TOTAL': [], + 'CONTRACT STAT': [], + 'PAYMENTS RCVD': [], + 'REM RENT RCVB': [], + 'UNEARN RESID': [], + 'PROV LOSS': [], + 'NET RESERVE': [], + 'UNEARN INC': [], + 'BAL REMAINING': [], + 'RESIDUAL': [], + 'UNPAID INT': [], + 'NET INV': [], + 'UNEARNED IDC': [], } lessors = [] columns = list(extracted_data_dict.keys()) - line0 = list(zip(columns[0:4], [0,3,4,5])) - line1 = list(zip(columns[4:12], [i for i in range(0,8)])) - line2 = list(zip(columns[12:19], [i for i in range(0,7)])) - line3 = list(zip(columns[19:-1], [i for i in range(1,6)])) + line0 = list(zip(columns[0:4], [0, 3, 4, 5])) + line1 = list(zip(columns[4:12], [i for i in range(0, 8)])) + line2 = list(zip(columns[12:19], [i for i in range(0, 7)])) + line3 = list(zip(columns[19:], [i for i in range(1, 6)])) - for l in [line0,line1,line2,line3]: + for l in [line0, line1, line2, line3]: print(f"\n{l}") - data_extractor = create_line_divider([18,32,50,66,84,100,117]) + data_extractor = create_line_divider([18, 32, 50, 66, 84, 100, 117]) for line in enumerate(lines): - slot1 = data_extractor(0,line[1],False) - if type(slot1) != str : continue + slot1 = data_extractor(0, line[1], False) + if type(slot1) != str: + continue if re.search(contract_number_regex, slot1) != None: - data_section = lines[line[0]-1:line[0]+3] - # There were issues were the IL Report would have random blank lines so that needs to be checked - # and adjusted for - # A dead give away of an empty line in a data section is a line without a '.' - # Check the first data line - if data_section[0].find(".") == -1: - # Move it back if empty - data_section[0] = lines[line[0]-2] - # Now we go through each relevant data line and make sure they're not blank - for ds in enumerate(data_section): - if ds[1].find(".") == -1: - if ds[0] < len(data_section) -1: - for i in range(ds[0], len(data_section)-1): - # This allows us to move down all the data lines after a blank data line - data_section[i] = data_section[i+1] - # This handles the last data line which goes 'out-of-bounds' of the existing data selection - data_section[3] = lines[line[0]+3] - else: - data_section[3] = lines[line[0]+3] - # Now that the datasection is sorted we can extract the data - [extracted_data_dict[c[0]].append(data_extractor(c[1], data_section[0], False)) for c in line0] - [extracted_data_dict[c[0]].append(data_extractor(c[1], data_section[1], False)) for c in line1] - [extracted_data_dict[c[0]].append(data_extractor(c[1], data_section[2], False)) for c in line2] - [extracted_data_dict[c[0]].append(data_extractor(c[1], data_section[3], False)) for c in line3] - extracted_data_dict["LESSOR"].append(extracted_data_dict["LEASE NUMBER"][-1][0:3]) - # We keep track of when we see new lessors for a summary tab - if extracted_data_dict["LESSOR"][-1] not in lessors: - lessors.append(extracted_data_dict["LESSOR"][-1]) + data_section = lines[line[0]-1:line[0]+3] + # There were issues were the IL Report would have random blank lines so that needs to be checked + # and adjusted for + # A dead give away of an empty line in a data section is a line without a '.' + # Check the first data line + if data_section[0].find(".") == -1: + # Move it back if empty + data_section[0] = lines[line[0]-2] + # Now we go through each relevant data line and make sure they're not blank + for ds in enumerate(data_section): + if ds[1].find(".") == -1: + if ds[0] < len(data_section) - 1: + for i in range(ds[0], len(data_section)-1): + # This allows us to move down all the data lines after a blank data line + data_section[i] = data_section[i+1] + # This handles the last data line which goes 'out-of-bounds' of the existing data selection + data_section[3] = lines[line[0]+3] + else: + data_section[3] = lines[line[0]+3] + # Now that the datasection is sorted we can extract the data + [extracted_data_dict[c[0]].append(data_extractor( + c[1], data_section[0], False)) for c in line0] + [extracted_data_dict[c[0]].append(data_extractor( + c[1], data_section[1], False)) for c in line1] + [extracted_data_dict[c[0]].append(data_extractor( + c[1], data_section[2], False)) for c in line2] + [extracted_data_dict[c[0]].append(data_extractor( + c[1], data_section[3], False)) for c in line3] dataframe = pd.DataFrame(extracted_data_dict) - - summary_series = [] - for lessor in lessors: - reduced_df = dataframe.loc[dataframe["LESSOR"] == lessor] - # Delete columns that are strings as we don't need to sum them - del reduced_df["CUSTOMER NAME"] - del reduced_df["LEASE NUMBER"] - del reduced_df["CONTRACT STAT"] - reduced_df = reduced_df.replace("", np.NaN) - # There can sometimes be REVOLVING ACCOUNT over part of the data - # Just get rid of it - reduced_df = reduced_df.replace("REVOLV", np.NaN) - reduced_df = reduced_df.replace("ING ACCOUNT", np.NaN) - summation = reduced_df.sum(skipna=True, axis=0) - summation["LESSOR"] = lessor - summation["CONTRACT COUNT"] = len(reduced_df.index) - summary_series.append(summation) - summary_df = pd.concat(summary_series, axis=1).transpose().set_index("LESSOR") - with pd.ExcelWriter(save_name) as writer: + dataframe["LESSOR"] = dataframe["LEASE NUMBER"].apply(lambda con: con[0:3]) + dataframe = dataframe.replace("REVOLV", np.NaN) + dataframe = dataframe.replace("ING ACCOUNT", np.NaN) + dataframe = dataframe.replace("", np.NaN) + + prt(dataframe) + summary = pd.pivot_table(dataframe, + values=['CUSTOMER NAME', + 'RESIDUAL', + 'UNEARN FIN', + 'UNEARNED BLENDED', + 'UNEARN RESID', + 'SEC DEPOSIT', + 'UNEARNED IDC', + 'NET RESERVE', + 'UNPAID INT', + 'NET INV', + 'BLEND NET INV', + 'GROSS CONTRACT', + 'PAYMENTS RCVD', + 'REM RENT RCVB', + 'LEASE PYMTS', + 'UNEARN INC', + 'TOTAL', + 'CURR INT RCVB', + 'PROV LOSS', + 'CURR RENT RCVB', + 'END DEPOSIT', + ], + aggfunc={ + 'CUSTOMER NAME': np.size, + 'RESIDUAL': np.sum, + 'UNEARN FIN': np.sum, + 'UNEARNED BLENDED': np.sum, + 'UNEARN RESID': np.sum, + 'SEC DEPOSIT': np.sum, + 'UNEARNED IDC': np.sum, + 'NET RESERVE': np.sum, + 'UNPAID INT': np.sum, + 'NET INV': np.sum, + 'BLEND NET INV': np.sum, + 'GROSS CONTRACT': np.sum, + 'PAYMENTS RCVD': np.sum, + 'REM RENT RCVB': np.sum, + 'LEASE PYMTS': np.sum, + 'UNEARN INC': np.sum, + 'TOTAL': np.sum, + 'CURR INT RCVB': np.sum, + 'PROV LOSS': np.sum, + 'CURR RENT RCVB': np.sum, + 'END DEPOSIT': np.sum, + }, + + index="LESSOR") + summary.rename(columns={"CUSTOMER NAME": "Contract Count"}, inplace=True) + summary = summary[['Contract Count', + 'REM RENT RCVB', + 'RESIDUAL', + 'UNEARN FIN', + 'UNEARNED BLENDED', + 'UNEARN RESID', + 'SEC DEPOSIT', + 'UNEARNED IDC', + 'NET RESERVE', + 'UNPAID INT', + 'NET INV', + 'BLEND NET INV', + 'GROSS CONTRACT', + 'PAYMENTS RCVD', + 'REM RENT RCVB', + 'LEASE PYMTS', + 'UNEARN INC', + 'TOTAL', + 'CURR INT RCVB', + 'PROV LOSS', + 'CURR RENT RCVB', + 'END DEPOSIT', + ]] + dataframe = dataframe[['LESSOR', + 'LEASE NUMBER', + 'REM RENT RCVB', + 'RESIDUAL', + 'UNEARN FIN', + 'UNEARNED BLENDED', + 'UNEARN RESID', + 'SEC DEPOSIT', + 'NET RESERVE', + 'UNEARNED IDC', + 'CURR INT RCVB', + 'BLEND NET INV', + 'NET INV', + 'CUSTOMER NAME', + 'GROSS CONTRACT', + 'CURR RENT RCVB', + 'END DEPOSIT', + 'LEASE PYMTS', + 'TOTAL', + 'CONTRACT STAT', + 'PAYMENTS RCVD', + 'PROV LOSS', + 'UNEARN INC', + 'BAL REMAINING', + 'UNPAID INT', + ]] + + with pd.ExcelWriter(save_name) as writer: dataframe.to_excel(writer, index=False, sheet_name="data") - pd.DataFrame(summary_df).to_excel(writer, index=True, sheet_name="Summary") + pd.DataFrame(summary_df).to_excel( + writer, index=True, sheet_name="Summary") return dataframe - def lockbox(report: str, save_name: str): lines = report.splitlines() extracted_data_dict = { @@ -447,6 +580,7 @@ def lockbox(report: str, save_name: str): def minv(report: str, save_name: str): + print("Started minv process") lines = report.splitlines() data_extractor = create_line_divider([15,32,52,71,83,107,116,128]) extracted_data_dict = { @@ -464,15 +598,18 @@ def minv(report: str, save_name: str): for line in enumerate(lines): if re.search(contract_number_regex, line[1]) != None: [extracted_data_dict[columns[c]].append(data_extractor(c,line[1],debug=False)) for c in range(0,len(columns))] + #All the list lengths need to be the same so if anything was missed it will fail to build dataframe = pd.DataFrame(extracted_data_dict) - filtered = dataframe[ - ((dataframe["BookingDate"] != '04/26/2022') & (dataframe["RentalDue"] > 0)) |\ - ((dataframe["BookingDate"] != '04/26/2022') & (dataframe["RentalDue"] == 0) & (dataframe["OutstandBalance"] > 100))] - #filtered.to_excel(save_name, index=False) + filtered = dataframe[(dataframe["BookingDate"] != dt.today().strftime("%m/%d/%Y")) & + ((dataframe["RentalDue"] > 0) | ((dataframe["RentalDue"] == 0) & (dataframe["OutstandBalance"] > 100)))] with open(save_name, 'w') as output: - [output.write(f"{contract}\n") for contract in filtered['ContractNumber'].to_list()] + add_contracts = [] + for contract in filtered['ContractNumber'].to_list(): + output.write(f"{contract}\n") if contract not in add_contracts else None + add_contracts.append(contract) return filtered + # Good for PUB_WIRES, VMCC, PBP_EPAY, returned check def payment_transactions(report: str, save_name: str): lines = report.splitlines() @@ -515,54 +652,124 @@ def payment_transactions(report: str, save_name: str): def renewal_net_invest_trial_balance(report: str, save_name: str): lines = report.splitlines() - data_extractor = create_line_divider([21,29,43,58,71,88,99,113]) + data_extractor = create_line_divider([21, 29, 43, 58, 71, 88, 99, 113]) extracted_data_dict = { - 'CUSTOMER NAME' : [], - 'TYPE' : [], - 'GROSS RENEWAL' : [], - 'REMAINING BAL' : [], - 'FINANCED RES' : [], - 'REMAINING RES' : [], - 'LEASE PYMTS' : [], - 'CONTRACT NUMBER' : [], - 'RENEWAL' : [], - 'PAYMENTS RCVD' : [], - 'CUR RENT RCVB' : [], - 'UNEARNED RIN' : [], - 'SECURITY DEP' : [], - 'NET INVEST' : [], - 'UNEARN INCOME' : [], - 'TOTAL' : [], - 'REM RENT RCVB' : [], - 'UNPAID RES' : [], + 'CUSTOMER NAME': [], + 'TYPE': [], + 'GROSS RENEWAL': [], + 'REMAINING BAL': [], + 'FINANCED RES': [], + 'REMAINING RES': [], + 'LEASE PYMTS': [], + 'CONTRACT NUMBER': [], + 'RENEWAL': [], + 'PAYMENTS RCVD': [], + 'CUR RENT RCVB': [], + 'UNEARNED RIN': [], + 'SECURITY DEP': [], + 'NET INVEST': [], + 'UNEARN INCOME': [], + 'TOTAL': [], + 'REM RENT RCVB': [], + 'UNPAID RES': [], } columns = list(extracted_data_dict.keys()) - line0 = list(zip(columns[0:7], [0,1,2,3,4,5,7])) - line1 = list(zip(columns[7:16], [i for i in range(0,9)])) - line2 = list(zip(columns[16:], [3,4])) + line0 = list(zip(columns[0:7], [0, 1, 2, 3, 4, 5, 7])) + line1 = list(zip(columns[7:16], [i for i in range(0, 9)])) + line2 = list(zip(columns[16:], [3, 4])) for line in enumerate(lines): - slot1 = data_extractor(0,line[1],False) - if type(slot1) != str : continue + slot1 = data_extractor(0, line[1], False) + if type(slot1) != str: + continue if re.search(contract_number_regex, slot1) != None: data_section = lines[line[0]-1:line[0]+2] # SEE net_invest_trial_balance FOR EXPLAINATION if data_section[0].find(".") == -1: - data_section[0] = lines[line[0]-2] + data_section[0] = lines[line[0]-2] for ds in enumerate(data_section): if ds[1].find(".") == -1: - if ds[0] < len(data_section) -1: + if ds[0] < len(data_section) - 1: for i in range(ds[0], len(data_section)-1): data_section[i] = data_section[i+1] data_section[2] = lines[line[0]+2] else: data_section[2] = lines[line[0]+2] - [extracted_data_dict[c[0]].append(data_extractor(c[1], data_section[0])) for c in line0] - [extracted_data_dict[c[0]].append(data_extractor(c[1], data_section[1])) for c in line1] - [extracted_data_dict[c[0]].append(data_extractor(c[1], data_section[2])) for c in line2] + [extracted_data_dict[c[0]].append( + data_extractor(c[1], data_section[0])) for c in line0] + [extracted_data_dict[c[0]].append( + data_extractor(c[1], data_section[1])) for c in line1] + [extracted_data_dict[c[0]].append( + data_extractor(c[1], data_section[2])) for c in line2] dataframe = pd.DataFrame(extracted_data_dict) - dataframe.to_excel(save_name, index=False) + dataframe["Fund"] = dataframe["CONTRACT NUMBER"].apply( + lambda con_num: con_num[0:3]) + summary = pd.pivot_table(dataframe, + values=['CUSTOMER NAME', + "UNPAID RES", "REMAINING RES", "SECURITY DEP", 'GROSS RENEWAL', + "FINANCED RES", "LEASE PYMTS", "PAYMENTS RCVD", "NET INVEST", "TOTAL", + "CUR RENT RCVB", "UNEARNED RIN", "UNEARN INCOME", "REM RENT RCVB"], + aggfunc={ + 'CUSTOMER NAME': np.size, + "UNPAID RES": np.sum, + "REMAINING RES": np.sum, + "SECURITY DEP": np.sum, + 'GROSS RENEWAL': np.sum, + "FINANCED RES": np.sum, + "LEASE PYMTS": np.sum, + "PAYMENTS RCVD": np.sum, + "NET INVEST": np.sum, + "TOTAL": np.sum, + "CUR RENT RCVB": np.sum, + "UNEARNED RIN": np.sum, + "UNEARN INCOME": np.sum, + "REM RENT RCVB": np.sum + }, + + index="Fund") + summary.rename(columns={"CUSTOMER NAME": "Renewal Count"}, inplace=True) + summary = summary[['LESSOR', + 'RENEWAL COUNT' + 'UNPAID RES' + 'REMAINING RES', + 'SECURITY DEP', + 'GROSS RENEWAL', + 'REMAINING RES', + 'FINANCED RES', + 'LEASE PYMTS', + 'PAYMENTS RCVD', + 'NET INVEST', + 'TOTAL', + 'CUR RENT RCVB', + 'UNEARNED RIN', + 'UNEARN INCOME', + 'REM RENT RCVB', + ]] + dataframe = dataframe[['Fund', + 'CONTRACT NUMBER', + 'TYPE', + 'RENEWAL', + 'UNPAID RES' + 'REMAINING RES', + 'SECURITY DEP', + 'GROSS RENEWAL', + 'FINANCED RES', + 'PAYMENTS RCVD', + 'NET INVEST', + 'REMAINING BAL', + 'CUSTOMER NAME', + 'LEASE PYMTS', + 'CUR RENT RCVB', + 'UNEARNED RIN', + 'UNEARN INCOME', + 'TOTAL', + 'REM RENT RCVB', + ]] + with pd.ExcelWriter(save_name) as writer: + dataframe.to_excel(writer, index=False, sheet_name="data") + pd.DataFrame(summary).to_excel( + writer, index=True, sheet_name="Summary") return dataframe diff --git a/MINV/2022.06.09_MINV_C b/MINV/2022.06.09_MINV_C new file mode 100644 index 0000000..2f07c06 --- /dev/null +++ b/MINV/2022.06.09_MINV_C @@ -0,0 +1,42 @@ + + DAILY.MANUAL.INVOICE + CONTRACTS THAT WERE NOT INVOICED + PAGE 06-09-22 1 + + CHRG BUSINESS +CONTRACT.NO........ UATB.OIC.DUE RENTAL DUE......... UATB.IDS.OIC.PAYME TYPEM..... OUTSTANDING BALANCE.... SEGMENT. BOOKING.DATE BRANCH + +100-0553300-001 04/01/2022 413.81 0.00 RENT 413.81 001.000 11/01/2020 4.3 +047-4725409-001 04/14/2022 351.30 0.00 MISC 380.28 001.000 01/14/2019 3 +100-1864627-002 05/14/2022 146.71 156.07 MISC 9.36 001.000 07/14/2017 9 +100-6651721-001 07/14/2021 0.00 761.00 MISC 53.27 001.000 07/14/2021 9 +100-0553300-001 05/01/2022 413.81 0.00 RENT 413.81 001.000 11/01/2020 4.3 +100-6651721-002 07/25/2021 0.00 761.00 MISC 53.27 001.000 07/27/2021 9 +100-0553300-001 01/01/2022 413.81 319.43 RENT 94.38 001.000 11/01/2020 4.3 +047-4725409-001 05/14/2022 351.30 31.54 MISC 348.74 001.000 01/14/2019 3 +100-5047921-001 06/15/2022 94.69 0.00 RENT 94.69 001.000 04/11/2019 3 +100-3285968-004 05/25/2022 2,027.75 0.00 MISC 2,139.28 001.000 02/27/2019 9 +100-0553300-001 06/01/2022 413.81 0.00 RENT 413.81 001.000 11/01/2020 4.3 +100-0553300-001 02/01/2022 413.81 0.00 RENT 413.81 001.000 11/01/2020 4.3 +100-7218171-001 05/19/2022 0.00 157.00 MISC 10.60 001.000 05/19/2022 3 +047-4725409-001 06/14/2022 351.30 0.00 MISC 380.28 001.000 01/14/2019 3 +100-5189011-002 07/01/2022 130.58 275.67 RENT 130.58 001.000 07/16/2019 12 +100-2772548-003 06/25/2022 -830.51 0.00 MISC 601.48 001.000 05/30/2017 9 +100-3285968-004 06/25/2022 2,027.75 0.00 MISC 2,139.28 001.000 02/27/2019 9 +047-2903398-005 05/25/2022 0.00 0.00 MISC 58.25 001.000 04/25/2017 9 +100-2911448-002 05/25/2022 0.00 1,895.04 RENT 30.43 001.000 04/29/2022 9 +100-0553300-001 07/01/2022 413.81 0.00 RENT 413.81 001.000 11/01/2020 4.3 +100-0553300-001 03/01/2022 413.81 0.00 RENT 413.81 001.000 11/01/2020 4.3 +100-7220451-001 06/06/2022 0.00 171.00 RENT 19.45 001.000 06/06/2022 3 +100-7268381-001 06/06/2022 0.00 151.00 RENT 11.33 001.000 06/06/2022 3 +100-7314881-001 06/06/2022 0.00 119.00 RENT 9.88 001.000 06/06/2022 3 +100-7317551-001 06/25/2022 2,916.00 0.00 RENT 2,916.00 001.000 05/27/2022 12 +100-7289411-001 07/03/2022 556.33 0.00 RENT 556.33 001.000 06/03/2022 3 +100-7304881-002 07/01/2022 60.90 0.00 MISC 66.27 001.000 06/08/2022 9 +100-6943321-002 06/15/2022 8,012.77 0.03 RENT 8,012.77 001.000 04/12/2022 9 +100-1477460-002 07/08/2022 34,915.99 0.00 RENT 34,915.99 001.000 06/08/2022 12 +100-1516251-002 06/20/2022 1,485.99 0.00 RENT 1,485.99 001.000 09/24/2019 10 +100-7352541-001 06/09/2022 1,422.30 0.00 RENT 711.15 001.000 06/09/2022 3 +100-7352541-001 06/09/2022 1,422.30 0.00 RENT 711.15 001.000 06/09/2022 3 +100-9677665-001 06/25/2022 242.11 0.00 RENT 242.11 001.000 08/30/2021 10 +33 records listed diff --git a/MINV/2022.06.10_MINV_C b/MINV/2022.06.10_MINV_C new file mode 100644 index 0000000..a7aac68 --- /dev/null +++ b/MINV/2022.06.10_MINV_C @@ -0,0 +1,51 @@ + + + DAILY.MANUAL.INVOICE + CONTRACTS THAT WERE NOT INVOICED + PAGE 06-10-22 1 + + CHRG BUSINESS +CONTRACT.NO........ UATB.OIC.DUE RENTAL DUE......... UATB.IDS.OIC.PAYME TYPEM..... OUTSTANDING BALANCE.... SEGMENT. BOOKING.DATE BRANCH + +100-1049364-003 03/15/2022 79.56 0.00 RENT 79.56 001.000 10/01/2021 4.3 +100-1049364-003 04/15/2022 79.56 0.00 RENT 79.56 001.000 10/01/2021 4.3 +100-6651721-001 07/14/2021 0.00 761.00 MISC 53.27 001.000 07/14/2021 9 +100-1049364-003 12/15/2021 79.56 68.40 RENT 11.16 001.000 10/01/2021 4.3 +100-6651721-002 07/25/2021 0.00 761.00 MISC 53.27 001.000 07/27/2021 9 +100-1049364-003 05/15/2022 79.56 0.00 RENT 79.56 001.000 10/01/2021 4.3 +100-1049364-003 01/15/2022 79.56 0.00 RENT 79.56 001.000 10/01/2021 4.3 +100-2170587-001 05/21/2022 484.62 0.00 RENT 484.62 001.000 03/26/2013 9 +100-7218171-001 05/19/2022 0.00 157.00 MISC 10.60 001.000 05/19/2022 3 +100-1049364-003 06/15/2022 79.56 0.00 RENT 79.56 001.000 10/01/2021 4.3 +100-1049364-003 02/15/2022 79.56 0.00 RENT 79.56 001.000 10/01/2021 4.3 +100-2170587-001 06/21/2022 484.62 0.00 RENT 484.62 001.000 03/26/2013 9 +100-2772548-003 06/25/2022 -830.51 0.00 MISC 601.48 001.000 05/30/2017 9 +047-2903398-005 05/25/2022 0.00 0.00 MISC 58.25 001.000 04/25/2017 9 +100-2911448-002 05/25/2022 0.00 1,895.04 RENT 30.43 001.000 04/29/2022 9 +100-7220451-001 06/06/2022 0.00 171.00 RENT 19.45 001.000 06/06/2022 3 +100-7268381-001 06/06/2022 0.00 151.00 RENT 11.33 001.000 06/06/2022 3 +100-7314881-001 06/06/2022 0.00 119.00 RENT 9.88 001.000 06/06/2022 3 +100-7352541-001 06/09/2022 0.00 0.00 RENT 711.15 001.000 06/09/2022 3 +100-7352541-001 06/09/2022 0.00 0.00 RENT 711.15 001.000 06/09/2022 3 +100-9678164-001 06/25/2022 242.11 0.00 RENT 242.11 001.000 08/31/2021 10 +100-1570785-001 06/24/2022 765.50 0.00 RENT 765.50 001.000 02/24/2020 10 +100-4693949-001 06/17/2022 326.11 0.00 RENT 326.11 001.000 10/17/2018 3 +100-1500564-011 07/04/2022 1,239.97 0.00 RENT 1,239.97 001.000 06/09/2022 12 +100-9704497-001 06/16/2022 2,127.68 0.00 RENT 2,127.68 001.000 02/16/2022 10 +100-7318371-001 07/01/2022 257.76 0.00 RENT 257.76 001.000 06/09/2022 9 +100-1697447-005 06/20/2022 184.11 0.00 RENT 184.11 001.000 08/23/2019 3 +100-1697447-004 06/20/2022 287.93 0.00 RENT 287.93 001.000 07/30/2019 3 +100-4714407-008 07/01/2022 671.57 0.00 MISC 714.21 001.000 06/09/2022 9 +100-6051107-001 06/20/2022 30.15 39.99 RENT 30.15 001.000 09/08/2020 9 +100-3240348-006 06/14/2022 227.52 0.00 MISC 241.17 001.000 04/14/2022 9 +100-6795737-003 07/10/2022 0.00 0.00 RENT 30,000.00 001.000 06/10/2022 12 +100-9729335-001 06/10/2022 1,841.70 0.00 RENT 920.85 001.000 06/10/2022 10 +100-9729335-001 06/10/2022 1,841.70 0.00 RENT 920.85 001.000 06/10/2022 10 +100-7252451-001 06/10/2022 15.63 169.00 RENT 15.63 001.000 06/10/2022 3 +100-6238218-001 06/19/2022 74.99 0.00 RENT 74.99 001.000 11/19/2021 9 +100-7337851-001 06/10/2022 216.36 0.00 RENT 108.18 001.000 06/10/2022 3 +100-7337851-001 06/10/2022 216.36 0.00 RENT 108.18 001.000 06/10/2022 3 +100-7275051-001 06/10/2022 0.00 843.27 MISC 0.01 001.000 06/10/2022 3 +100-1017678-003 07/01/2022 718.61 0.00 MISC 777.89 001.000 05/16/2019 12 +100-4266879-003 07/03/2022 339.42 0.00 MISC 368.95 001.000 06/10/2022 9 +41 records listed diff --git a/MINV/2022.06.13_MINV_C b/MINV/2022.06.13_MINV_C new file mode 100644 index 0000000..8d17329 --- /dev/null +++ b/MINV/2022.06.13_MINV_C @@ -0,0 +1,33 @@ + + DAILY.MANUAL.INVOICE + CONTRACTS THAT WERE NOT INVOICED + PAGE 06-13-22 1 + + CHRG BUSINESS +CONTRACT.NO........ UATB.OIC.DUE RENTAL DUE......... UATB.IDS.OIC.PAYME TYPEM..... OUTSTANDING BALANCE.... SEGMENT. BOOKING.DATE BRANCH + +100-6651721-001 07/14/2021 0.00 761.00 MISC 53.27 001.000 07/14/2021 9 +100-6550098-001 05/20/2022 619.26 108.80 RENT 510.46 001.000 05/25/2021 3 +100-6651721-002 07/25/2021 0.00 761.00 MISC 53.27 001.000 07/27/2021 9 +100-7218171-001 05/19/2022 0.00 157.00 MISC 10.60 001.000 05/19/2022 3 +100-2772548-003 06/25/2022 -830.51 0.00 MISC 601.48 001.000 05/30/2017 9 +047-2903398-005 05/25/2022 0.00 0.00 MISC 58.25 001.000 04/25/2017 9 +100-2911448-002 05/25/2022 0.00 1,895.04 RENT 30.43 001.000 04/29/2022 9 +100-6795737-003 07/10/2022 30,000.00 0.00 RENT 30,000.00 001.000 06/10/2022 12 +100-7252451-001 06/10/2022 0.00 169.00 RENT 15.63 001.000 06/10/2022 3 +100-6238218-001 06/19/2022 74.99 0.00 RENT 74.99 001.000 11/19/2021 9 +100-7337851-001 06/10/2022 0.00 0.00 RENT 108.18 001.000 06/10/2022 3 +100-7337851-001 06/10/2022 0.00 0.00 RENT 108.18 001.000 06/10/2022 3 +100-7275051-001 06/10/2022 0.00 843.27 MISC 0.01 001.000 06/10/2022 3 +100-4266879-003 07/03/2022 339.42 0.00 MISC 368.95 001.000 06/10/2022 9 +100-7203501-002 07/01/2022 40.00 0.00 MISC 42.50 001.000 06/10/2022 9 +100-7282331-001 06/10/2022 0.00 0.00 RENT 1,432.54 001.000 06/10/2022 3 +100-9735444-001 06/10/2022 0.00 0.00 RENT 214.90 001.000 06/10/2022 10 +100-9735444-001 06/10/2022 0.00 0.00 RENT 214.90 001.000 06/10/2022 10 +100-6930421-001 06/10/2022 0.00 0.00 RENT 1,982.24 001.000 06/10/2022 3 +100-6930421-001 06/10/2022 0.00 0.00 RENT 1,982.24 001.000 06/10/2022 3 +100-6721551-003 06/20/2022 1,210.36 0.00 RENT 1,210.36 001.000 09/24/2021 3 +100-6721551-002 06/20/2022 613.92 0.00 RENT 613.92 001.000 09/23/2021 3 +100-7136271-001 07/20/2022 176.54 0.00 RENT 176.54 001.000 03/22/2022 3 +100-7171001-001 06/17/2022 68.92 0.00 RENT 68.92 001.000 03/17/2022 9 +24 records listed diff --git a/MINV/2022.06.14_MINV_C b/MINV/2022.06.14_MINV_C new file mode 100644 index 0000000..22a6a95 --- /dev/null +++ b/MINV/2022.06.14_MINV_C @@ -0,0 +1,40 @@ + + + DAILY.MANUAL.INVOICE + CONTRACTS THAT WERE NOT INVOICED + PAGE 06-14-22 1 + + CHRG BUSINESS +CONTRACT.NO........ UATB.OIC.DUE RENTAL DUE......... UATB.IDS.OIC.PAYME TYPEM..... OUTSTANDING BALANCE.... SEGMENT. BOOKING.DATE BRANCH + +100-7269201-001 06/14/2022 17.11 172.00 RENT 17.11 001.000 06/14/2022 3 +100-3654949-003 06/24/2022 1,086.99 0.00 RENT 1,086.99 001.000 09/24/2019 9 +100-3654949-002 06/20/2022 1,789.52 0.00 RENT 1,789.52 001.000 09/19/2019 9 +100-7199137-001 06/20/2022 1,068.97 0.00 RENT 1,068.97 001.000 04/29/2022 3 +100-7284391-001 07/08/2022 91.25 0.00 RENT 91.25 001.000 06/08/2022 9 +100-7209951-001 06/14/2022 0.00 160.00 MISC 11.20 001.000 06/14/2022 3 +100-7334181-001 07/01/2022 338.41 0.00 MISC 366.32 001.000 06/14/2022 9 +100-9570778-001 06/24/2022 637.91 0.00 RENT 637.91 001.000 02/24/2020 10 +100-7234311-001 06/14/2022 15.81 204.00 RENT 15.81 001.000 06/14/2022 3 +100-7294191-001 06/14/2022 14.80 160.00 RENT 14.80 001.000 06/14/2022 3 +100-0849508-002 04/15/2022 2,392.50 0.00 RENT 2,392.50 001.000 10/01/2021 4.3 +100-6651721-001 07/14/2021 0.00 761.00 MISC 53.27 001.000 07/14/2021 9 +100-6651721-002 07/25/2021 0.00 761.00 MISC 53.27 001.000 07/27/2021 9 +100-0849508-002 05/15/2022 2,392.50 0.00 RENT 2,392.50 001.000 10/01/2021 4.3 +100-0849508-002 06/15/2022 2,392.50 0.00 RENT 2,392.50 001.000 10/01/2021 4.3 +100-2772548-003 06/25/2022 -830.51 0.00 MISC 601.48 001.000 05/30/2017 9 +100-3618019-001 06/25/2022 428.34 0.00 MISC 466.36 001.000 09/28/2016 9 +047-2903398-005 05/25/2022 0.00 0.00 MISC 58.25 001.000 04/25/2017 9 +100-2911448-002 05/25/2022 0.00 1,895.04 RENT 30.43 001.000 04/29/2022 9 +100-7252451-001 06/10/2022 0.00 169.00 RENT 15.63 001.000 06/10/2022 3 +100-7275051-001 06/10/2022 0.00 843.27 MISC 0.01 001.000 06/10/2022 3 +100-7113121-001 07/13/2022 2,500.39 0.00 RENT 2,500.39 001.000 06/13/2022 3 +100-7342981-001 07/08/2022 103.56 0.00 MISC 109.77 001.000 06/08/2022 9 +100-7113391-002 07/01/2022 2,275.30 0.00 RENT 2,275.30 001.000 06/13/2022 3 +100-5398561-002 07/01/2022 786.33 0.00 MISC 847.27 001.000 06/13/2022 9 +100-4457819-001 06/20/2022 5,785.12 0.00 RENT 5,785.12 001.000 05/31/2018 3 +100-3744149-012 07/08/2022 50.00 0.00 MISC 53.00 001.000 06/13/2022 9 +100-3154768-008 07/01/2022 897.26 0.00 MISC 980.27 001.000 06/13/2022 9 +100-7318021-001 07/03/2022 295.00 0.00 MISC 320.08 001.000 06/13/2022 9 +100-2146226-002 07/01/2022 558.96 0.00 RENT 558.96 001.000 06/13/2022 9 +30 records listed diff --git a/MINV/2022.06.15_MINV_C b/MINV/2022.06.15_MINV_C new file mode 100644 index 0000000..cdea9dc --- /dev/null +++ b/MINV/2022.06.15_MINV_C @@ -0,0 +1,32 @@ + + + DAILY.MANUAL.INVOICE + CONTRACTS THAT WERE NOT INVOICED + PAGE 06-15-22 1 + + CHRG BUSINESS +CONTRACT.NO........ UATB.OIC.DUE RENTAL DUE......... UATB.IDS.OIC.PAYME TYPEM..... OUTSTANDING BALANCE.... SEGMENT. BOOKING.DATE BRANCH + +100-7269201-001 06/14/2022 0.00 172.00 RENT 17.11 001.000 06/14/2022 3 +100-7209951-001 06/14/2022 0.00 160.00 MISC 11.20 001.000 06/14/2022 3 +100-7334181-001 07/01/2022 338.41 0.00 MISC 366.32 001.000 06/14/2022 9 +100-7234311-001 06/14/2022 0.00 204.00 RENT 15.81 001.000 06/14/2022 3 +100-7294191-001 06/14/2022 0.00 160.00 RENT 14.80 001.000 06/14/2022 3 +100-9570729-001 06/24/2022 637.91 0.00 RENT 637.91 001.000 02/24/2020 10 +100-7080901-001 06/14/2022 0.00 0.00 MISC 177.62 001.000 06/14/2022 3 +100-7313341-001 07/09/2022 217.00 0.00 RENT 217.00 001.000 06/14/2022 9 +100-7363251-001 06/14/2022 0.00 0.00 RENT 13,168.80 001.000 06/14/2022 3 +100-1564449-001 07/03/2022 430.01 0.00 RENT 430.01 001.000 02/03/2020 10 +100-7233611-001 06/15/2022 17.36 179.00 RENT 17.36 001.000 06/15/2022 3 +100-7151111-001 06/15/2022 480.40 0.00 RENT 480.40 001.000 06/15/2022 9 +100-9737145-001 06/15/2022 590.20 0.00 RENT 295.10 001.000 06/15/2022 10 +100-9737145-001 06/15/2022 590.20 0.00 RENT 295.10 001.000 06/15/2022 10 +100-7303761-001 08/14/2022 0.00 0.00 RENT 240,632.43 001.000 06/14/2022 12 +100-6651721-001 07/14/2021 0.00 761.00 MISC 53.27 001.000 07/14/2021 9 +100-6651721-002 07/25/2021 0.00 761.00 MISC 53.27 001.000 07/27/2021 9 +100-6726271-001 06/15/2022 1,588.04 0.00 RENT 1,588.04 001.000 08/31/2021 12 +100-2772548-003 06/25/2022 -830.51 0.00 MISC 601.48 001.000 05/30/2017 9 +047-2903398-005 05/25/2022 0.00 0.00 MISC 58.25 001.000 04/25/2017 9 +100-2911448-002 05/25/2022 0.00 1,895.04 RENT 30.43 001.000 04/29/2022 9 +100-5864201-501 07/07/2022 143.00 0.00 MISC 153.01 001.000 09/01/2020 9 +22 records listed diff --git a/assets/checkedCircle.svg b/assets/checkedCircle.svg new file mode 100644 index 0000000..06598ca --- /dev/null +++ b/assets/checkedCircle.svg @@ -0,0 +1,44 @@ + + + + diff --git a/assets/copy.svg b/assets/copy.svg new file mode 100644 index 0000000..1012fc1 --- /dev/null +++ b/assets/copy.svg @@ -0,0 +1,60 @@ + + + diff --git a/assets/excel.svg b/assets/excel.svg new file mode 100644 index 0000000..99c6cd6 --- /dev/null +++ b/assets/excel.svg @@ -0,0 +1,6 @@ + diff --git a/assets/extract.ico b/assets/extract.ico new file mode 100644 index 0000000..faab094 Binary files /dev/null and b/assets/extract.ico differ diff --git a/assets/extract.svg b/assets/extract.svg new file mode 100644 index 0000000..c392432 --- /dev/null +++ b/assets/extract.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/fileSearch.svg b/assets/fileSearch.svg new file mode 100644 index 0000000..6e04a1c --- /dev/null +++ b/assets/fileSearch.svg @@ -0,0 +1,4 @@ + + diff --git a/assets/folder.svg b/assets/folder.svg new file mode 100644 index 0000000..5488499 --- /dev/null +++ b/assets/folder.svg @@ -0,0 +1,2 @@ + + diff --git a/assets/maximize.svg b/assets/maximize.svg new file mode 100644 index 0000000..1d60cee --- /dev/null +++ b/assets/maximize.svg @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/assets/process.svg b/assets/process.svg new file mode 100644 index 0000000..e20b6ba --- /dev/null +++ b/assets/process.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/settings.svg b/assets/settings.svg new file mode 100644 index 0000000..0469ed4 --- /dev/null +++ b/assets/settings.svg @@ -0,0 +1,62 @@ + + + diff --git a/compile_gui b/compile_gui index 7cd2165..587c054 100644 --- a/compile_gui +++ b/compile_gui @@ -1 +1,2 @@ -pyinstaller -w --add-data "extract.svg;." --add-data "process.svg;." --add-data "folder.svg;." --add-data "copy.svg;." -i .\extract.ico -n "IL Extract" .\main.py \ No newline at end of file +pyinstaller -w --add-data "extract.svg;." --add-data "process.svg;." --add-data "folder.svg;." --add-data "copy.svg;." -i .\extract.ico -n "IL Extract" .\main.py + diff --git a/defLocs_Window.py b/defLocs_Window.py new file mode 100644 index 0000000..ee138fd --- /dev/null +++ b/defLocs_Window.py @@ -0,0 +1,196 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'ui/default_locations.ui' +# +# Created by: PyQt5 UI code generator 5.15.7 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_defaultLocationDiag(object): + def setupUi(self, defaultLocationDiag): + defaultLocationDiag.setObjectName("defaultLocationDiag") + defaultLocationDiag.setWindowModality(QtCore.Qt.NonModal) + defaultLocationDiag.resize(954, 525) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(defaultLocationDiag.sizePolicy().hasHeightForWidth()) + defaultLocationDiag.setSizePolicy(sizePolicy) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap("ui/extract.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + defaultLocationDiag.setWindowIcon(icon) + self.gridLayout_2 = QtWidgets.QGridLayout(defaultLocationDiag) + self.gridLayout_2.setObjectName("gridLayout_2") + self.gridLayout = QtWidgets.QGridLayout() + self.gridLayout.setObjectName("gridLayout") + self.label = QtWidgets.QLabel(defaultLocationDiag) + font = QtGui.QFont() + font.setPointSize(14) + font.setBold(True) + font.setWeight(75) + self.label.setFont(font) + self.label.setObjectName("label") + self.gridLayout.addWidget(self.label, 0, 0, 1, 2) + self.label_2 = QtWidgets.QLabel(defaultLocationDiag) + self.label_2.setWordWrap(True) + self.label_2.setObjectName("label_2") + self.gridLayout.addWidget(self.label_2, 1, 0, 1, 4) + self.label_3 = QtWidgets.QLabel(defaultLocationDiag) + self.label_3.setWordWrap(True) + self.label_3.setObjectName("label_3") + self.gridLayout.addWidget(self.label_3, 2, 0, 1, 4) + self.label_4 = QtWidgets.QLabel(defaultLocationDiag) + font = QtGui.QFont() + font.setItalic(True) + self.label_4.setFont(font) + self.label_4.setWordWrap(True) + self.label_4.setObjectName("label_4") + self.gridLayout.addWidget(self.label_4, 3, 0, 1, 4) + self.label_5 = QtWidgets.QLabel(defaultLocationDiag) + font = QtGui.QFont() + font.setBold(True) + font.setWeight(75) + self.label_5.setFont(font) + self.label_5.setObjectName("label_5") + self.gridLayout.addWidget(self.label_5, 4, 0, 1, 1) + spacerItem = QtWidgets.QSpacerItem(588, 13, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) + self.gridLayout.addItem(spacerItem, 4, 1, 1, 2) + self.label_6 = QtWidgets.QLabel(defaultLocationDiag) + font = QtGui.QFont() + font.setBold(True) + font.setWeight(75) + self.label_6.setFont(font) + self.label_6.setObjectName("label_6") + self.gridLayout.addWidget(self.label_6, 4, 3, 1, 1) + self.ach_B = QtWidgets.QPushButton(defaultLocationDiag) + self.ach_B.setObjectName("ach_B") + self.gridLayout.addWidget(self.ach_B, 5, 0, 1, 1) + self.ach_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.ach_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.ach_LE.setObjectName("ach_LE") + self.gridLayout.addWidget(self.ach_LE, 5, 1, 1, 1) + self.ach_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.ach_FN.setObjectName("ach_FN") + self.gridLayout.addWidget(self.ach_FN, 5, 2, 1, 2) + self.disp_B = QtWidgets.QPushButton(defaultLocationDiag) + self.disp_B.setObjectName("disp_B") + self.gridLayout.addWidget(self.disp_B, 6, 0, 1, 1) + self.disp_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.disp_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.disp_LE.setObjectName("disp_LE") + self.gridLayout.addWidget(self.disp_LE, 6, 1, 1, 1) + self.disp_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.disp_FN.setObjectName("disp_FN") + self.gridLayout.addWidget(self.disp_FN, 6, 2, 1, 2) + self.gl_B = QtWidgets.QPushButton(defaultLocationDiag) + self.gl_B.setObjectName("gl_B") + self.gridLayout.addWidget(self.gl_B, 7, 0, 1, 1) + self.gl_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.gl_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.gl_LE.setObjectName("gl_LE") + self.gridLayout.addWidget(self.gl_LE, 7, 1, 1, 1) + self.gl_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.gl_FN.setObjectName("gl_FN") + self.gridLayout.addWidget(self.gl_FN, 7, 2, 1, 2) + self.lb_B = QtWidgets.QPushButton(defaultLocationDiag) + self.lb_B.setObjectName("lb_B") + self.gridLayout.addWidget(self.lb_B, 8, 0, 1, 1) + self.lb_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.lb_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.lb_LE.setObjectName("lb_LE") + self.gridLayout.addWidget(self.lb_LE, 8, 1, 1, 1) + self.lb_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.lb_FN.setObjectName("lb_FN") + self.gridLayout.addWidget(self.lb_FN, 8, 2, 1, 2) + self.minv_B = QtWidgets.QPushButton(defaultLocationDiag) + self.minv_B.setObjectName("minv_B") + self.gridLayout.addWidget(self.minv_B, 9, 0, 1, 1) + self.minv_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.minv_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.minv_LE.setObjectName("minv_LE") + self.gridLayout.addWidget(self.minv_LE, 9, 1, 1, 1) + self.minv_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.minv_FN.setObjectName("minv_FN") + self.gridLayout.addWidget(self.minv_FN, 9, 2, 1, 2) + self.niv_B = QtWidgets.QPushButton(defaultLocationDiag) + self.niv_B.setObjectName("niv_B") + self.gridLayout.addWidget(self.niv_B, 10, 0, 1, 1) + self.niv_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.niv_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.niv_LE.setObjectName("niv_LE") + self.gridLayout.addWidget(self.niv_LE, 10, 1, 1, 1) + self.niv_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.niv_FN.setObjectName("niv_FN") + self.gridLayout.addWidget(self.niv_FN, 10, 2, 1, 2) + self.ren_B = QtWidgets.QPushButton(defaultLocationDiag) + self.ren_B.setObjectName("ren_B") + self.gridLayout.addWidget(self.ren_B, 11, 0, 1, 1) + self.ren_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.ren_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.ren_LE.setObjectName("ren_LE") + self.gridLayout.addWidget(self.ren_LE, 11, 1, 1, 1) + self.ren_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.ren_FN.setObjectName("ren_FN") + self.gridLayout.addWidget(self.ren_FN, 11, 2, 1, 2) + self.pymt_B = QtWidgets.QPushButton(defaultLocationDiag) + self.pymt_B.setObjectName("pymt_B") + self.gridLayout.addWidget(self.pymt_B, 12, 0, 1, 1) + self.pymt_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.pymt_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.pymt_LE.setObjectName("pymt_LE") + self.gridLayout.addWidget(self.pymt_LE, 12, 1, 1, 1) + self.pymt_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.pymt_FN.setObjectName("pymt_FN") + self.gridLayout.addWidget(self.pymt_FN, 12, 2, 1, 2) + self.uap_B = QtWidgets.QPushButton(defaultLocationDiag) + self.uap_B.setObjectName("uap_B") + self.gridLayout.addWidget(self.uap_B, 13, 0, 1, 1) + self.uap_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.uap_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.uap_LE.setObjectName("uap_LE") + self.gridLayout.addWidget(self.uap_LE, 13, 1, 1, 1) + self.uap_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.uap_FN.setObjectName("uap_FN") + self.gridLayout.addWidget(self.uap_FN, 13, 2, 1, 2) + self.optionBBox = QtWidgets.QDialogButtonBox(defaultLocationDiag) + self.optionBBox.setOrientation(QtCore.Qt.Horizontal) + self.optionBBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Save) + self.optionBBox.setObjectName("optionBBox") + self.gridLayout.addWidget(self.optionBBox, 14, 3, 1, 1) + self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1) + + self.retranslateUi(defaultLocationDiag) + self.optionBBox.accepted.connect(defaultLocationDiag.accept) # type: ignore + self.optionBBox.rejected.connect(defaultLocationDiag.reject) # type: ignore + QtCore.QMetaObject.connectSlotsByName(defaultLocationDiag) + + def retranslateUi(self, defaultLocationDiag): + _translate = QtCore.QCoreApplication.translate + defaultLocationDiag.setWindowTitle(_translate("defaultLocationDiag", "Default locations")) + self.label.setText(_translate("defaultLocationDiag", "Default File Locations:")) + self.label_2.setText(_translate("defaultLocationDiag", "Here you can determine which folders will be automatically be opened for each report type. You can even specify which file should be defaulted to.")) + self.label_3.setText(_translate("defaultLocationDiag", "Use the following inline formaters to specify dates that will be automatically filled with the current date when running the program:")) + self.label_4.setText(_translate("defaultLocationDiag", "Day of Month {d} | Month of Year {m} | Year {y} | Note that using multiple characters equates to representing with that number of digits so: {dd} == 07 or {mm} == 02 or {yy} == 22 or {yyyy} == 2022")) + self.label_5.setText(_translate("defaultLocationDiag", "Folder Path")) + self.label_6.setToolTip(_translate("defaultLocationDiag", "
Default file name to look for. Don\'t foreget the file type (.xlsx)
")) + self.label_6.setText(_translate("defaultLocationDiag", "File Name")) + self.ach_B.setText(_translate("defaultLocationDiag", "Edit ACH")) + self.disp_B.setText(_translate("defaultLocationDiag", "Edit Dispostition")) + self.gl_B.setWhatsThis(_translate("defaultLocationDiag", "Gain Loss
")) + self.gl_B.setText(_translate("defaultLocationDiag", "Edit Gain Loss")) + self.lb_B.setText(_translate("defaultLocationDiag", "Edit Lock Box")) + self.minv_B.setWhatsThis(_translate("defaultLocationDiag", "Good for Manual Invoicing
")) + self.minv_B.setText(_translate("defaultLocationDiag", "Edit Manual Invoice")) + self.niv_B.setWhatsThis(_translate("defaultLocationDiag", "Good for: Net Investment reports (loan and after)
")) + self.niv_B.setText(_translate("defaultLocationDiag", "Edit Net Inv")) + self.ren_B.setWhatsThis(_translate("defaultLocationDiag", "Renewal Net Investment Trial Balance
")) + self.ren_B.setText(_translate("defaultLocationDiag", "Edit Renewl NIV")) + self.pymt_B.setWhatsThis(_translate("defaultLocationDiag", "Payment transactions:
- Wires, VMCC, PBP. EPAY, Returned Check
")) + self.pymt_B.setText(_translate("defaultLocationDiag", "Edit Payments")) + self.uap_B.setWhatsThis(_translate("defaultLocationDiag", "Unapplied
")) + self.uap_B.setText(_translate("defaultLocationDiag", "Edit Unaplied")) diff --git a/defLocs_Window2.py b/defLocs_Window2.py new file mode 100644 index 0000000..ee138fd --- /dev/null +++ b/defLocs_Window2.py @@ -0,0 +1,196 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'ui/default_locations.ui' +# +# Created by: PyQt5 UI code generator 5.15.7 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_defaultLocationDiag(object): + def setupUi(self, defaultLocationDiag): + defaultLocationDiag.setObjectName("defaultLocationDiag") + defaultLocationDiag.setWindowModality(QtCore.Qt.NonModal) + defaultLocationDiag.resize(954, 525) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(defaultLocationDiag.sizePolicy().hasHeightForWidth()) + defaultLocationDiag.setSizePolicy(sizePolicy) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap("ui/extract.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + defaultLocationDiag.setWindowIcon(icon) + self.gridLayout_2 = QtWidgets.QGridLayout(defaultLocationDiag) + self.gridLayout_2.setObjectName("gridLayout_2") + self.gridLayout = QtWidgets.QGridLayout() + self.gridLayout.setObjectName("gridLayout") + self.label = QtWidgets.QLabel(defaultLocationDiag) + font = QtGui.QFont() + font.setPointSize(14) + font.setBold(True) + font.setWeight(75) + self.label.setFont(font) + self.label.setObjectName("label") + self.gridLayout.addWidget(self.label, 0, 0, 1, 2) + self.label_2 = QtWidgets.QLabel(defaultLocationDiag) + self.label_2.setWordWrap(True) + self.label_2.setObjectName("label_2") + self.gridLayout.addWidget(self.label_2, 1, 0, 1, 4) + self.label_3 = QtWidgets.QLabel(defaultLocationDiag) + self.label_3.setWordWrap(True) + self.label_3.setObjectName("label_3") + self.gridLayout.addWidget(self.label_3, 2, 0, 1, 4) + self.label_4 = QtWidgets.QLabel(defaultLocationDiag) + font = QtGui.QFont() + font.setItalic(True) + self.label_4.setFont(font) + self.label_4.setWordWrap(True) + self.label_4.setObjectName("label_4") + self.gridLayout.addWidget(self.label_4, 3, 0, 1, 4) + self.label_5 = QtWidgets.QLabel(defaultLocationDiag) + font = QtGui.QFont() + font.setBold(True) + font.setWeight(75) + self.label_5.setFont(font) + self.label_5.setObjectName("label_5") + self.gridLayout.addWidget(self.label_5, 4, 0, 1, 1) + spacerItem = QtWidgets.QSpacerItem(588, 13, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) + self.gridLayout.addItem(spacerItem, 4, 1, 1, 2) + self.label_6 = QtWidgets.QLabel(defaultLocationDiag) + font = QtGui.QFont() + font.setBold(True) + font.setWeight(75) + self.label_6.setFont(font) + self.label_6.setObjectName("label_6") + self.gridLayout.addWidget(self.label_6, 4, 3, 1, 1) + self.ach_B = QtWidgets.QPushButton(defaultLocationDiag) + self.ach_B.setObjectName("ach_B") + self.gridLayout.addWidget(self.ach_B, 5, 0, 1, 1) + self.ach_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.ach_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.ach_LE.setObjectName("ach_LE") + self.gridLayout.addWidget(self.ach_LE, 5, 1, 1, 1) + self.ach_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.ach_FN.setObjectName("ach_FN") + self.gridLayout.addWidget(self.ach_FN, 5, 2, 1, 2) + self.disp_B = QtWidgets.QPushButton(defaultLocationDiag) + self.disp_B.setObjectName("disp_B") + self.gridLayout.addWidget(self.disp_B, 6, 0, 1, 1) + self.disp_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.disp_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.disp_LE.setObjectName("disp_LE") + self.gridLayout.addWidget(self.disp_LE, 6, 1, 1, 1) + self.disp_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.disp_FN.setObjectName("disp_FN") + self.gridLayout.addWidget(self.disp_FN, 6, 2, 1, 2) + self.gl_B = QtWidgets.QPushButton(defaultLocationDiag) + self.gl_B.setObjectName("gl_B") + self.gridLayout.addWidget(self.gl_B, 7, 0, 1, 1) + self.gl_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.gl_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.gl_LE.setObjectName("gl_LE") + self.gridLayout.addWidget(self.gl_LE, 7, 1, 1, 1) + self.gl_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.gl_FN.setObjectName("gl_FN") + self.gridLayout.addWidget(self.gl_FN, 7, 2, 1, 2) + self.lb_B = QtWidgets.QPushButton(defaultLocationDiag) + self.lb_B.setObjectName("lb_B") + self.gridLayout.addWidget(self.lb_B, 8, 0, 1, 1) + self.lb_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.lb_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.lb_LE.setObjectName("lb_LE") + self.gridLayout.addWidget(self.lb_LE, 8, 1, 1, 1) + self.lb_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.lb_FN.setObjectName("lb_FN") + self.gridLayout.addWidget(self.lb_FN, 8, 2, 1, 2) + self.minv_B = QtWidgets.QPushButton(defaultLocationDiag) + self.minv_B.setObjectName("minv_B") + self.gridLayout.addWidget(self.minv_B, 9, 0, 1, 1) + self.minv_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.minv_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.minv_LE.setObjectName("minv_LE") + self.gridLayout.addWidget(self.minv_LE, 9, 1, 1, 1) + self.minv_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.minv_FN.setObjectName("minv_FN") + self.gridLayout.addWidget(self.minv_FN, 9, 2, 1, 2) + self.niv_B = QtWidgets.QPushButton(defaultLocationDiag) + self.niv_B.setObjectName("niv_B") + self.gridLayout.addWidget(self.niv_B, 10, 0, 1, 1) + self.niv_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.niv_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.niv_LE.setObjectName("niv_LE") + self.gridLayout.addWidget(self.niv_LE, 10, 1, 1, 1) + self.niv_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.niv_FN.setObjectName("niv_FN") + self.gridLayout.addWidget(self.niv_FN, 10, 2, 1, 2) + self.ren_B = QtWidgets.QPushButton(defaultLocationDiag) + self.ren_B.setObjectName("ren_B") + self.gridLayout.addWidget(self.ren_B, 11, 0, 1, 1) + self.ren_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.ren_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.ren_LE.setObjectName("ren_LE") + self.gridLayout.addWidget(self.ren_LE, 11, 1, 1, 1) + self.ren_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.ren_FN.setObjectName("ren_FN") + self.gridLayout.addWidget(self.ren_FN, 11, 2, 1, 2) + self.pymt_B = QtWidgets.QPushButton(defaultLocationDiag) + self.pymt_B.setObjectName("pymt_B") + self.gridLayout.addWidget(self.pymt_B, 12, 0, 1, 1) + self.pymt_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.pymt_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.pymt_LE.setObjectName("pymt_LE") + self.gridLayout.addWidget(self.pymt_LE, 12, 1, 1, 1) + self.pymt_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.pymt_FN.setObjectName("pymt_FN") + self.gridLayout.addWidget(self.pymt_FN, 12, 2, 1, 2) + self.uap_B = QtWidgets.QPushButton(defaultLocationDiag) + self.uap_B.setObjectName("uap_B") + self.gridLayout.addWidget(self.uap_B, 13, 0, 1, 1) + self.uap_LE = QtWidgets.QLineEdit(defaultLocationDiag) + self.uap_LE.setMinimumSize(QtCore.QSize(581, 0)) + self.uap_LE.setObjectName("uap_LE") + self.gridLayout.addWidget(self.uap_LE, 13, 1, 1, 1) + self.uap_FN = QtWidgets.QLineEdit(defaultLocationDiag) + self.uap_FN.setObjectName("uap_FN") + self.gridLayout.addWidget(self.uap_FN, 13, 2, 1, 2) + self.optionBBox = QtWidgets.QDialogButtonBox(defaultLocationDiag) + self.optionBBox.setOrientation(QtCore.Qt.Horizontal) + self.optionBBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Save) + self.optionBBox.setObjectName("optionBBox") + self.gridLayout.addWidget(self.optionBBox, 14, 3, 1, 1) + self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1) + + self.retranslateUi(defaultLocationDiag) + self.optionBBox.accepted.connect(defaultLocationDiag.accept) # type: ignore + self.optionBBox.rejected.connect(defaultLocationDiag.reject) # type: ignore + QtCore.QMetaObject.connectSlotsByName(defaultLocationDiag) + + def retranslateUi(self, defaultLocationDiag): + _translate = QtCore.QCoreApplication.translate + defaultLocationDiag.setWindowTitle(_translate("defaultLocationDiag", "Default locations")) + self.label.setText(_translate("defaultLocationDiag", "Default File Locations:")) + self.label_2.setText(_translate("defaultLocationDiag", "Here you can determine which folders will be automatically be opened for each report type. You can even specify which file should be defaulted to.")) + self.label_3.setText(_translate("defaultLocationDiag", "Use the following inline formaters to specify dates that will be automatically filled with the current date when running the program:")) + self.label_4.setText(_translate("defaultLocationDiag", "Day of Month {d} | Month of Year {m} | Year {y} | Note that using multiple characters equates to representing with that number of digits so: {dd} == 07 or {mm} == 02 or {yy} == 22 or {yyyy} == 2022")) + self.label_5.setText(_translate("defaultLocationDiag", "Folder Path")) + self.label_6.setToolTip(_translate("defaultLocationDiag", "Default file name to look for. Don\'t foreget the file type (.xlsx)
")) + self.label_6.setText(_translate("defaultLocationDiag", "File Name")) + self.ach_B.setText(_translate("defaultLocationDiag", "Edit ACH")) + self.disp_B.setText(_translate("defaultLocationDiag", "Edit Dispostition")) + self.gl_B.setWhatsThis(_translate("defaultLocationDiag", "Gain Loss
")) + self.gl_B.setText(_translate("defaultLocationDiag", "Edit Gain Loss")) + self.lb_B.setText(_translate("defaultLocationDiag", "Edit Lock Box")) + self.minv_B.setWhatsThis(_translate("defaultLocationDiag", "Good for Manual Invoicing
")) + self.minv_B.setText(_translate("defaultLocationDiag", "Edit Manual Invoice")) + self.niv_B.setWhatsThis(_translate("defaultLocationDiag", "Good for: Net Investment reports (loan and after)
")) + self.niv_B.setText(_translate("defaultLocationDiag", "Edit Net Inv")) + self.ren_B.setWhatsThis(_translate("defaultLocationDiag", "Renewal Net Investment Trial Balance
")) + self.ren_B.setText(_translate("defaultLocationDiag", "Edit Renewl NIV")) + self.pymt_B.setWhatsThis(_translate("defaultLocationDiag", "Payment transactions:
- Wires, VMCC, PBP. EPAY, Returned Check
")) + self.pymt_B.setText(_translate("defaultLocationDiag", "Edit Payments")) + self.uap_B.setWhatsThis(_translate("defaultLocationDiag", "Unapplied
")) + self.uap_B.setText(_translate("defaultLocationDiag", "Edit Unaplied")) diff --git a/main.py b/main.py index e28425e..999e138 100644 --- a/main.py +++ b/main.py @@ -1,108 +1,123 @@ -from mainWindow_new import Ui_MainWindow +from ILE_MainWindow import Ui_MainWindow +from defLocs_Window2 import Ui_defaultLocationDiag import sys import os import pandas as pd +import json from PyQt5 import QtWidgets +from PyQt5.QtWidgets import QApplication, QDialog, QMainWindow, QPushButton from datetime import datetime as dt import ILExtract as ilx - +print("Starting GUI... will anything else print?") class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): def __init__(self, *args, obj=None, **kwargs): super(MainWindow, self).__init__(*args, **kwargs) self.setupUi(self) + self.setAcceptDrops(True) self.inputFile = "" self.outputFile = "" - self.rtp = False # Ready to Process - self.ofa = False # Output file ready - + self.inputCustomized = False + with open("settings.json") as s: + self.settings = json.loads(s.read()) + self.curReportType = "ach" + self.extract_function = ilx.ach + + cbs = self.copyButton.objectName() + self.report_type_change() # Actions self.inputFileButton.clicked.connect(self.getfile) self.outputFileButton.clicked.connect(self.setOutput) self.processReportButton.clicked.connect(self.process_selection) - self.openReportButton.clicked.connect(self.to_clipboard) + self.copyButton.clicked.connect(self.to_clipboard) + self.reportTypeCB.currentTextChanged.connect(self.report_type_change) + self.openFolderButton.clicked.connect(lambda: self.openWithDefaultApp(self.outputFile.removesuffix(self.outputFile.split('/')[-1]))) + self.openExcelButton.clicked.connect(lambda: self.openWithDefaultApp(self.outputFile)) + self.action_Default_Locations.triggered.connect(self.df) + self.inputFilePreview.setText("Drag & Drop Input file here!") - def getfile(self): - inFile = QtWidgets.QFileDialog.getOpenFileName(self, 'Open file') - self.inputFileLE.setText(inFile[0]) - if inFile[0] == '' : return '' - # Replacing errors fixes some UTF-8 character issues - with open(inFile[0], errors="replace") as inF: + def set_input(self, ifile): + with open(ifile, errors="replace") as inF: txt = inF.read() self.inputFilePreview.setText(txt) - self.inputFile = inFile[0] + self.inputFileLE.setText(ifile) + self.inputFile = ifile # This gets the actual file name - inFileEnd = inFile[0].split('/')[-1] + inFileEnd = ifile.split('/')[-1] # Takes just the root of the input file outputRoot = self.inputFile.removesuffix(inFileEnd) # Automatically sets output to be in the same file as input, with a naming scheme # The report type selected in the combo box will dictate the naming - self.outputFile = f"{outputRoot}{self.reportTypeCB.currentText()}_{dt.now().strftime('%Y%m%d_%H%M')}.xlsx" - self.outputFileLE.setText(self.outputFile) - # Check to make sure the user has selected the correct report type - if self.reportTypeCB.currentText().split(" ")[-1].lower() not in self.inputFile.lower(): - print("Possibly wrong file type") - warning = QtWidgets.QMessageBox() - warning.setWindowTitle("Warning: File Type Mis-Match") - warning.setText(f"Selected report type is {self.reportTypeCB.currentText()} but input file did not contain '{self.reportTypeCB.currentText().split(' ')[-1].lower()}'!\n\ -Make sure you select the correct report type before processing!") - s = warning.exec() + if self.reportTypeCB.currentText() == "Minv_C": + self.outputFile = f"{outputRoot}{self.reportTypeCB.currentText()}_{dt.now().strftime('%Y%m%d_%H%M')}.txt" + else: + self.outputFile = f"{outputRoot}{self.reportTypeCB.currentText()}_{dt.now().strftime('%Y%m%d_%H%M')}.xlsx" + self.outputFileLE.setText(self.outputFile) + self.inputCustomized = True + self.openExcelButton.setEnabled(False) + self.copyButton.setEnabled(False) + self.openFolderButton.setEnabled(True) # Enables the process button self.check_ready_to_process() + def getfile(self): + inFile = QtWidgets.QFileDialog.getOpenFileName(self, 'Open file') + if inFile[0] == '': + return 1 + else: + self.set_input(inFile[0]) + + def df(self): + dlg = defLocWindow(self) + dlg.exec() + with open("settings.json") as s: + self.settings = json.loads(s.read()) + + def dragEnterEvent(self, event): + if event.mimeData().hasUrls(): + event.accept() + else: + event.ignore() + + def dropEvent(self, event): + file = [u.toLocalFile() for u in event.mimeData().urls()][0] + print(file) + self.set_input(file) + def setOutput(self): # This allows the user to change the automatic naming and location outFile = QtWidgets.QFileDialog.getSaveFileName(self, "Output file name") if outFile[0] == '': return '' - self.outputFileLE.setText(f"{outFile[0]}__{dt.now().strftime('%Y%m%d_%H_%M')}.xlsx") + if self.reportTypeCB.currentText() == "Minv_C": + self.outputFileLE.setText(f"{outFile[0]}__{dt.now().strftime('%Y%m%d_%H_%M')}.txt") + else: + self.outputFileLE.setText(f"{outFile[0]}__{dt.now().strftime('%Y%m%d_%H_%M')}.xlsx") print(f"Output: {outFile}") self.outputFile = f"{outFile[0]}__{dt.now().strftime('%Y%m%d_%H_%M')}.xlsx" self.check_ready_to_process() def check_ready_to_process(self): # Makes sure there is an input and output selected before allowing processing - self.rtp = True if ((self.inputFile != "") & (self.outputFile != "")) else False - if self.rtp : + rtp = True if ((self.inputFile != "") & (self.outputFile != "")) else False + if rtp : self.processReportButton.setEnabled(True) + if self.outputFile == "": + self.openFolderButton.setEnabled(False) def process_selection(self): + print("Processing selection...") self.inputFilePreview.setText("Processing file...") # If only this was python 3.10 and we could use switch statments # but this should get the job done try: - # Here we set the extraction function that will be used on the report - if self.reportTypeCB.currentText() == "ACH": - extract_function = ilx.ach - elif self.reportTypeCB.currentText() == "Disposition": - extract_function = ilx.disposition - elif self.reportTypeCB.currentText() == "Gain Loss": - extract_function = ilx.gainloss - elif self.reportTypeCB.currentText() == "Lock Box": - extract_function = ilx.lockbox - elif self.reportTypeCB.currentText() == "Minv_C": - extract_function = ilx.minv - elif self.reportTypeCB.currentText() == "Net Inv. Loans": - extract_function = ilx.net_invest_trial_balance - elif self.reportTypeCB.currentText() == "NI Renewal": - extract_function = ilx.renewal_net_invest_trial_balance - elif self.reportTypeCB.currentText() == "NIV After": - extract_function = ilx.net_invest_trial_balance - elif self.reportTypeCB.currentText() == "PBP Epay": - extract_function = ilx.payment_transactions - elif self.reportTypeCB.currentText() == "Unapplied": - extract_function = ilx.unapplied - elif self.reportTypeCB.currentText() == "VMCC": - extract_function = ilx.payment_transactions - elif self.reportTypeCB.currentText() == "Wires": - extract_function = ilx.payment_transactions - elif self.reportTypeCB.currentText() == "Returned Check": - extract_function = ilx.payment_transactions # This is where the actual processing happens # We create an ILReport object and pass in the nessecary information + print(self.inputFile) + print(self.outputFile) dataframe = ilx.ILReport( location= self.inputFile, - extraction_function=extract_function, + extraction_function=self.extract_function, output_location=self.outputFile, ).process() # The text preview box can have trouble loading the larger dataframes so @@ -113,6 +128,11 @@ Make sure you select the correct report type before processing!") error = QtWidgets.QMessageBox() error.setWindowTitle('Error Processing File!') error.setText(f"Unable to process {self.inputFile}!\nPlease check input file!") + self.openExcelButton.setEnabled(True) + self.copyButton.setEnabled(True) + self.checked_for_saved() + self.openFolderButton.setEnabled(True) + self.inputCustomized = False def preview_report(self): df = pd.read_excel(self.outputFile) @@ -122,6 +142,261 @@ Make sure you select the correct report type before processing!") df = pd.read_excel(self.outputFile) df.to_clipboard(excel=True) + def openFolder(self): + outputRoot = self.outputFile.removesuffix(self.outputFile.split('/')[-1]) + os.startfile(outputRoot) + + def openWithDefaultApp(self, item): + print(item) + outputRoot = self.outputFile.removesuffix(self.outputFile.split('/')[-1]) + os.startfile(item) + + def checked_for_saved(self): + if self.settings["defaultLocations"][self.curReportType]["dir"] == '': + self.settings["defaultLocations"][self.curReportType]["dir"] = ('/').join(self.inputFile.split('/')[:-1]) + with open('settings.json', 'w') as s: + json.dump(self.settings, s) + + def report_type_change(self): + # Adjust the report type according to the combo box + # This will be used in settings the the extract function and determining file locations + self.processReportButton.setEnabled(False) + if self.reportTypeCB.currentText() == "ACH": + self.curReportType = "ach" + self.extract_function = ilx.ach + elif self.reportTypeCB.currentText() == "Disposition": + self.curReportType = "disp" + self.extract_function = ilx.disposition + elif self.reportTypeCB.currentText() == "Gain Loss": + self.curReportType = "gl" + self.extract_function = ilx.gainloss + elif self.reportTypeCB.currentText() == "Lock Box": + self.curReportType = "lb" + self.extract_function = ilx.lockbox + elif self.reportTypeCB.currentText() == "Minv_C": + self.curReportType = "minv" + self.extract_function = ilx.minv + elif self.reportTypeCB.currentText() == "Net Inv. Loans": + self.curReportType = "niv" + self.extract_function = ilx.net_invest_trial_balance + elif self.reportTypeCB.currentText() == "NI Renewal": + self.curReportType = "ren" + self.extract_function = ilx.renewal_net_invest_trial_balance + elif self.reportTypeCB.currentText() == "NIV After": + self.curReportType = "niv" + self.extract_function = ilx.net_invest_trial_balance + elif self.reportTypeCB.currentText() == "PBP Epay": + self.curReportType = "pymt" + self.extract_function = ilx.payment_transactions + elif self.reportTypeCB.currentText() == "Unapplied": + self.curReportType = "uap" + self.extract_function = ilx.unapplied + elif self.reportTypeCB.currentText() == "VMCC": + self.curReportType = "pymt" + self.extract_function = ilx.payment_transactions + elif self.reportTypeCB.currentText() == "Wires": + self.curReportType = "pymt" + self.extract_function = ilx.payment_transactions + elif self.reportTypeCB.currentText() == "Returned Check": + self.curReportType = "pymt" + self.extract_function = ilx.payment_transactions + inputRoot = self.settings["defaultLocations"][self.curReportType]["dir"]\ + .replace("{dd}",dt.now().strftime('%d'))\ + .replace("{mm}",dt.now().strftime('%m'))\ + .replace("{yyyy}",dt.now().strftime('%Y')).replace("{yy}",dt.now().strftime('%y')) + inputFile = self.settings["defaultLocations"][self.curReportType]["fn"]\ + .replace("{dd}",dt.now().strftime('%d'))\ + .replace("{mm}",dt.now().strftime('%m'))\ + .replace("{yyyy}",dt.now().strftime('%Y')).replace("{yy}",dt.now().strftime('%y')) + self.inputFile = f"{inputRoot}/{inputFile}" if (inputFile != '') else inputRoot + self.inputFileLE.setText(self.inputFile) + # Automatically sets output to be in the same file as input, with a naming scheme + # The report type selected in the combo box will dictate the naming + if self.inputFile == "": + outputroot = ('/').join(self.inputFileLE.text().split('/')[:-1]) + else: + outputroot = inputRoot + '/' + if self.curReportType == "minv": + self.outputFile = f"{outputroot}{self.reportTypeCB.currentText()}_{dt.now().strftime('%Y%m%d_%H%M')}.txt" + else: + self.outputFile = f"{outputroot}{self.reportTypeCB.currentText()}_{dt.now().strftime('%Y%m%d_%H%M')}.xlsx" + self.outputFileLE.setText(self.outputFile) + self.openExcelButton.setEnabled(False) + self.copyButton.setEnabled(False) + self.openFolderButton.setEnabled(True) + print(self.inputFile) + print(self.outputFile) + self.check_ready_to_process() + +class defLocWindow(QtWidgets.QDialog): + def __init__(self, parent=None): + super().__init__(parent) + # Create an instance of the GUI + self.ui = Ui_defaultLocationDiag() + # Run the .setupUi() method to show the GUI + self.ui.setupUi(self) + with open("settings.json") as s: + self.settings = json.loads(s.read()) + + self.load_user_settings() + + # Add dest folder buttons + # Lambdas are used to create anon functions to that they don't execute at init + self.ui.ach_B.clicked.connect(lambda : self.add_defloc(self.ui.ach_B.objectName(), True)) + self.ui.disp_B.clicked.connect(lambda : self.add_defloc(self.ui.disp_B.objectName(), True)) + self.ui.gl_B.clicked.connect(lambda : self.add_defloc(self.ui.gl_B.objectName(), True)) + self.ui.lb_B.clicked.connect(lambda : self.add_defloc(self.ui.lb_B.objectName(), True)) + self.ui.minv_B.clicked.connect(lambda : self.add_defloc(self.ui.minv_B.objectName(), True)) + self.ui.niv_B.clicked.connect(lambda : self.add_defloc(self.ui.niv_B.objectName(), True)) + self.ui.ren_B.clicked.connect(lambda : self.add_defloc(self.ui.ren_B.objectName(), True)) + self.ui.pymt_B.clicked.connect(lambda : self.add_defloc(self.ui.pymt_B.objectName(), True)) + self.ui.uap_B.clicked.connect(lambda : self.add_defloc(self.ui.uap_B.objectName(), True)) + # Text Changes + self.ui.ach_LE.textChanged.connect(lambda : self.add_defloc(self.ui.ach_B.objectName(), False)) + self.ui.disp_LE.textChanged.connect(lambda : self.add_defloc(self.ui.disp_B.objectName(), False)) + self.ui.gl_LE.textChanged.connect(lambda : self.add_defloc(self.ui.gl_B.objectName(), False)) + self.ui.lb_LE.textChanged.connect(lambda : self.add_defloc(self.ui.lb_B.objectName(), False)) + self.ui.minv_LE.textChanged.connect(lambda : self.add_defloc(self.ui.minv_B.objectName(), False)) + self.ui.niv_LE.textChanged.connect(lambda : self.add_defloc(self.ui.niv_B.objectName(), False)) + self.ui.ren_LE.textChanged.connect(lambda : self.add_defloc(self.ui.ren_B.objectName(), False)) + self.ui.pymt_LE.textChanged.connect(lambda : self.add_defloc(self.ui.pymt_B.objectName(), False)) + self.ui.uap_LE.textChanged.connect(lambda : self.add_defloc(self.ui.uap_B.objectName(), False)) + + self.ui.ach_FN.textChanged.connect(lambda : self.add_fn(self.ui.ach_FN.objectName())) + self.ui.disp_FN.textChanged.connect(lambda : self.add_fn(self.ui.disp_FN.objectName())) + self.ui.gl_FN.textChanged.connect(lambda : self.add_fn(self.ui.gl_FN.objectName())) + self.ui.lb_FN.textChanged.connect(lambda : self.add_fn(self.ui.lb_FN.objectName())) + self.ui.minv_FN.textChanged.connect(lambda : self.add_fn(self.ui.minv_FN.objectName())) + self.ui.niv_FN.textChanged.connect(lambda : self.add_fn(self.ui.niv_FN.objectName())) + self.ui.ren_FN.textChanged.connect(lambda : self.add_fn(self.ui.ren_FN.objectName())) + self.ui.pymt_FN.textChanged.connect(lambda : self.add_fn(self.ui.pymt_FN.objectName())) + self.ui.uap_FN.textChanged.connect(lambda : self.add_fn(self.ui.uap_FN.objectName())) + + self.ui.optionBBox.accepted.connect(self.save_changes) + + def add_defloc(self, button_name, use_filebrowser: bool): + folder = QtWidgets.QFileDialog.getExistingDirectory() if use_filebrowser else None + if folder == '': + use_filebrowser = False + report_type = button_name.split('_')[0] + if report_type == "ach": + if use_filebrowser: + self.ui.ach_LE.setText(folder) + else: + folder = self.ui.ach_LE.text() + elif report_type == "disp": + if use_filebrowser: + self.ui.disp_LE.setText(folder) + else: + folder = self.ui.disp_LE.text() + elif report_type == "gl": + if use_filebrowser: + self.ui.gl_LE.setText(folder) + else: + folder = self.ui.gl_LE.text() + elif report_type == "lb": + if use_filebrowser: + self.ui.lb_LE.setText(folder) + else: + folder = self.ui.lb_LE.text() + elif report_type == "minv": + if use_filebrowser: + self.ui.minv_LE.setText(folder) + else: + folder = self.ui.minv_LE.text() + elif report_type == "niv": + if use_filebrowser: + self.ui.niv_LE.setText(folder) + else: + folder = self.ui.niv_LE.text() + elif report_type == "ren": + if use_filebrowser: + self.ui.ren_LE.setText(folder) + else: + folder = self.ui.ren_LE.text() + elif report_type == "pymt": + if use_filebrowser: + self.ui.pymt_LE.setText(folder) + else: + folder = self.ui.pymt_LE.text() + elif report_type == "uap": + if use_filebrowser: + self.ui.uap_LE.setText(folder) + else: + folder = self.ui.uap_LE.text() + if folder != "": + self.settings["defaultLocations"][report_type]["dir"] = folder + def chg_folder(self, button_name): + report_type = button_name.split('_')[0] + if report_type == "ach": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.ach_FN.text() + elif report_type == "disp": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.disp_FN.text() + elif report_type == "gl": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.gl_FN.text() + elif report_type == "lb": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.lb_FN.text() + elif report_type == "minv": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.minv_FN.text() + elif report_type == "niv": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.niv_FN.text() + elif report_type == "ren": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.ren_FN.text() + elif report_type == "pymt": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.pymt_FN.text() + elif report_type == "uap": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.uap_FN.text() + def add_fn(self, button_name): + report_type = button_name.split('_')[0] + if report_type == "ach": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.ach_FN.text() + elif report_type == "disp": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.disp_FN.text() + elif report_type == "gl": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.gl_FN.text() + elif report_type == "lb": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.lb_FN.text() + elif report_type == "minv": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.minv_FN.text() + elif report_type == "niv": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.niv_FN.text() + elif report_type == "ren": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.ren_FN.text() + elif report_type == "pymt": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.pymt_FN.text() + elif report_type == "uap": + self.settings["defaultLocations"][report_type]["fn"] = self.ui.uap_FN.text() + + + def load_user_settings(self): + self.ui.ach_LE.setText(self.settings["defaultLocations"]["ach"]["dir"]) + self.ui.ach_FN.setText(self.settings["defaultLocations"]["ach"]["fn"]) + self.ui.disp_LE.setText(self.settings["defaultLocations"]["disp"]["dir"]) + self.ui.disp_FN.setText(self.settings["defaultLocations"]["disp"]["fn"]) + self.ui.gl_LE.setText(self.settings["defaultLocations"]["gl"]["dir"]) + self.ui.gl_FN.setText(self.settings["defaultLocations"]["gl"]["fn"]) + self.ui.lb_LE.setText(self.settings["defaultLocations"]["lb"]["dir"]) + self.ui.lb_FN.setText(self.settings["defaultLocations"]["lb"]["fn"]) + self.ui.minv_LE.setText(self.settings["defaultLocations"]["minv"]["dir"]) + self.ui.minv_FN.setText(self.settings["defaultLocations"]["minv"]["fn"]) + self.ui.niv_LE.setText(self.settings["defaultLocations"]["niv"]["dir"]) + self.ui.niv_FN.setText(self.settings["defaultLocations"]["niv"]["fn"]) + self.ui.ren_LE.setText(self.settings["defaultLocations"]["ren"]["dir"]) + self.ui.ren_FN.setText(self.settings["defaultLocations"]["ren"]["fn"]) + self.ui.pymt_LE.setText(self.settings["defaultLocations"]["pymt"]["dir"]) + self.ui.pymt_FN.setText(self.settings["defaultLocations"]["pymt"]["fn"]) + self.ui.uap_LE.setText(self.settings["defaultLocations"]["uap"]["dir"]) + self.ui.uap_FN.setText(self.settings["defaultLocations"]["uap"]["fn"]) + + def save_changes(self): + print(self.settings) + with open('settings.json', 'w') as s: + json.dump(self.settings, s) + print(self.settings) + + + + app = QtWidgets.QApplication(sys.argv) app.setStyle("Fusion") @@ -129,4 +404,4 @@ app.setStyle("Fusion") window = MainWindow() window.setWindowTitle("IL Extract") window.show() -app.exec() \ No newline at end of file +app.exec() diff --git a/package.sh b/package.sh old mode 100644 new mode 100755 index 0c12e68..dd69f28 --- a/package.sh +++ b/package.sh @@ -1,2 +1,2 @@ #!/bin/bash -zip -r ILEXTRACT_SRC.zip ../'IL Extract SRC' -x "IL Extract SRC/__pycache__V/*" "IL Extract SRC/GUIVENV/*" \ No newline at end of file +zip -r ILEXTRACT_SRC.zip ../'IL Extract SRC' -x "../IL Extract SRC/GUIVENV/*" "../IL Extract SRC/__pycache__" "../IL Extract SRC/testing" \ No newline at end of file diff --git a/settings.json b/settings.json new file mode 100644 index 0000000..8ff6bac --- /dev/null +++ b/settings.json @@ -0,0 +1 @@ +{"firstRun": true, "startMaxed": false, "defaultLocations": {"ach": {"dir": "", "fn": "", "custom": false}, "disp": {"dir": "", "fn": "", "custom": false}, "gl": {"dir": "", "fn": "", "custom": false}, "lb": {"dir": "", "fn": "", "custom": false}, "minv": {"dir": "", "fn": "", "custom": false}, "niv": {"dir": "", "fn": "", "custom": false}, "ren": {"dir": "", "fn": "", "custom": false}, "pymt": {"dir": "", "fn": "", "custom": false}, "uap": {"dir": "", "fn": "", "custom": false}}} \ No newline at end of file