def process_statement_entry(inputdata): #triger from to detect whether signal is from new invoice or bank entry etc partyname=inputdata[0] edate=inputdata[1] vnumber=inputdata[2] debitamount=inputdata[3] creditamount=inputdata[4] typetransaction=inputdata[5] emonth=edate[5:7] eyear=edate[0:4] sortpriority=inputdata[6] comments=inputdata[7] misc=["", "", ""] sentrydata=[partyname, edate, vnumber, debitamount, creditamount, typetransaction, emonth, eyear, sortpriority, comments, misc] try: #if company present rowfulldata=guicommon.statementstableins.readrow(partyname) #print(rowfulldata) #print('Above is old, below is new data') #print(sentrydata) rowfulldata.append(sentrydata) #print(rowfulldata) #print('Above after append') guicommon.statementstableins.editrow_without_namechange(partyname, rowfulldata) #print('try block of create statement entry fn completed') except: #if company not present rowfulldata=[sentrydata] guicommon.statementstableins.createrow(partyname, rowfulldata) #print('except block of create statement entry fn completed') guicommon.loadguicommon()
def process_eitem(self, widget, eivarg, invoicingbox, bph, guiinvoicingins): iname = self.einameentry.get_text() isoftversion = '1' ihsn = self.eihsnentry.get_text() igroup = self.eigroupcombo.get_active_text() isubgroup = self.eisubgroupentry.get_text() iunit = self.eiunitcombo.get_active_text() itax = self.eitaxcombo.get_active_text() if self.citaxinclusive_button.get_active(): itaxinclusive = 'y' else: itaxinclusive = 'n' ilastmodified = functions.todaysdate_string iopstock = self.eiopenstentry.get_text( ) # opening stock of financial year isoldunits = self.ei_tempsoldunits icurrentstock = self.ei_tempcurrentstock icritical = self.eicritentry.get_text() ilistprice = self.eilpentry.get_text() istddisc = self.eisdentry.get_text() isellprice = self.eispentry.get_text() ipurprice = self.eippentry.get_text() icomments = self.eicommentry.get_text() iflag = self.eiflagentry.get_text() #reserved for future implementation, dont mess with these 4, create new if required iphasedout = 'NA' icreationdate = 'NA' # item creation date, keep for emergency and future features icreationstock = 'NA' #stock on item creation date iemerg = 'NA' #reserved variables end # iphasedout, iemerg, icreationdate, icreationstock reserved for future features,dont use these. Create new if required. idata = idata = [ iname, iphasedout, iemerg, icreationdate, icreationstock, isoftversion, ihsn, igroup, isubgroup, iunit, itax, itaxinclusive, ilastmodified, iopstock, isoldunits, icurrentstock, icritical, ilistprice, istddisc, isellprice, ipurprice, icomments, iflag ] # Provided creation date and creationstock as failsafe, plus for future reference, can also be used to verify stocks self.itemtableins.editrow(self.noite, idata) self.reset_eientries('nobuttonpress', self.eientries) guicommon.loadguicommon() self.einame_completion.set_model(guicommon.itemname_store) self.ei_nameentry.set_completion(self.einame_completion) self.refreshil('mimicevent') children = invoicingbox.get_children() for eachchild in children: invoicingbox.remove(eachchild) eachchild.destroy() bph = guiinvoicingins.generatepage(self.mainwindow, guiinvoicingins) invoicingbox.add(bph) invoicingbox.show_all() return 1
def create_state(self, button): temp_statename=[str(self.newstname_entry.get_text())] temp_statecode=[str(self.newstcode_entry.get_text())] guicommon.miscdbins.append('statelisthome', temp_statename ) guicommon.miscdbins.append('statecodesgsthome', temp_statename ) guicommon.miscdbins.dump() guicommon.loadguicommon() self.state_combo.append_text(self.newstname_entry.get_text()) self.newstname_entry.set_text('') self.newstcode_entry.set_text('')
def reload_screen(somesignal, mainwindow, guiinvoicingins): children = mainwindow.invoicingbox.get_children() for eachchild in children: mainwindow.invoicingbox.remove(eachchild) eachchild.destroy() guicommon.loadguicommon() mainwindow.bph = guiinvoicingins.generatepage(mainwindow, guiinvoicingins) mainwindow.invoicingbox.add(mainwindow.bph) mainwindow.invoicingbox.show_all() print('successfully reloaded sucreen, reporting from newsalesub line 24')
def delete_pressed(self, button): print('deleted started') self.whichin = self.sel_entry.get_text( ) #name of invoice to be deleted fetchedin = guicommon.invoicetableins.readrow(self.whichin) self.ein_temprowindex = guicommon.invoicetableins.rowlist.index( self.whichin) guicommon.invoicetableins.deleterow(self.whichin) guicommon.loadguicommon() self.reload_screen('mimicsignal') print('deleted invoice successfully')
def process_taxnewslab(self, event): if self.firsttax_button.get_active(): ftenabled = 'y' else: ftenabled = 'n' if self.secondtax_button.get_active(): stenabled = 'y' else: stenabled = 'n' if self.thirdtax_button.get_active(): ttenabled = 'y' else: ttenabled = 'n' ft_rate = float(self.ftrentry.get_text()) st_rate = float(self.strentry.get_text()) tt_rate = float(self.ttrentry.get_text()) total_t_rate = ft_rate + st_rate + tt_rate newslab_data = [ self.tnameentry.get_text(), ftenabled, stenabled, ttenabled, self.ftname_entry.get_text(), self.stname_entry.get_text(), self.ttname_entry.get_text(), ft_rate, st_rate, tt_rate, total_t_rate ] print(newslab_data) guicommon.taxtableins.createrow(self.tnameentry.get_text(), newslab_data) guicommon.loadguicommon() self.tscombo.append_text(self.tnameentry.get_text()) print('Added new tax slab') self.tnameentry.set_text('') self.ftname_entry.set_text('') self.stname_entry.set_text('') self.ttname_entry.set_text('') self.ftrentry.set_text('0') self.strentry.set_text('0') self.ttrentry.set_text('0') self.secondtax_button.set_active(False) self.thirdtax_button.set_active(False) children = self.invoicingbox.get_children() for eachchild in children: self.invoicingbox.remove(eachchild) eachchild.destroy() self.bph = self.guiinvoicingins.generatepage(self.mainwindow, self.guiinvoicingins) self.invoicingbox.add(self.bph) self.invoicingbox.show_all()
def ecdelete_func(self, deletebutton, invoicingbox, bph, guiinvoicingins): self.nocte = self.ecnameentry.get_text() #name of company to be edited self.companytableins.deleterow(self.nocte) self.ecresetfields('delbuttonpress', self.ecentries) guicommon.loadguicommon() self.ecname_completion.set_model(guicommon.companyname_store) self.ecnameentry.set_completion(self.ecname_completion) self.reset_otherpages(invoicingbox, bph, guiinvoicingins) print('deleted company successfully') return 2
def delete_state(self, button): temp_statename=self.state_combo.get_active_text() s_list=guicommon.state_list s_list.remove(temp_statename) guicommon.miscdbins.set('statelisthome', s_list ) guicommon.miscdbins.dump() guicommon.loadguicommon() self.state_combo.remove_all() for esv in guicommon.state_list: self.state_combo.append_text(esv) self.state_combo.get_child().set_text('Select')
def processccompany(self, widget, ccvarg, invoicingbox, bph, guiinvoicingins): cdata = companyprocessor.extractccdata(ccvarg) #print(cdata) self.companytableins.createrow(cdata[0], cdata) self.ccresetfields('mimicevent', self.ccentries) # set form fields to blank fields guicommon.loadguicommon() self.ecname_completion.set_model(guicommon.companyname_store) self.ecnameentry.set_completion(self.ecname_completion) self.reset_otherpages(invoicingbox, bph, guiinvoicingins) print("Successfully created company") return 1
def deleteitem(self, delbutton, invoicingbox, bph, guiinvoicingins): self.noite = self.ei_nameentry.get_text() #name of item to be edited self.itemtableins.deleterow(self.noite) self.reset_eientries('nobuttonpress', self.eientries) guicommon.loadguicommon() self.einame_completion.set_model(guicommon.itemname_store) self.ei_nameentry.set_completion(self.einame_completion) self.refreshil('mimicevent') children = invoicingbox.get_children() for eachchild in children: invoicingbox.remove(eachchild) eachchild.destroy() bph = guiinvoicingins.generatepage(self.mainwindow, guiinvoicingins) invoicingbox.add(bph) invoicingbox.show_all() return 1
def processecompany(self, widget, ecvarg, invoicingbox, bph, guiinvoicingins): cdata = companyprocessor.extractecdata(ecvarg) self.companytableins.editrow(self.nocte, cdata) self.ecresetfields('mimicevent', self.ecentries) # set form fields to blank fields guicommon.loadguicommon() self.ecname_completion.set_model(guicommon.companyname_store) self.ecnameentry.set_completion(self.ecname_completion) self.reset_otherpages(invoicingbox, bph, guiinvoicingins) self.nocte = '' for anyentry in self.ecvarg: anyentry.set_sensitive(False) self.ecvarg[0].set_sensitive(True) print("Successfully modified company") return 1
def delete_slab(self, button): td = self.tscombo.get_active_text() guicommon.taxtableins.deleterow(td) guicommon.loadguicommon() self.tscombo.remove_all() for ets in guicommon.taxtableins.rowlist: self.tscombo.append_text(ets) self.tscombo.get_child().set_text('Select') children = self.invoicingbox.get_children() for eachchild in children: self.invoicingbox.remove(eachchild) eachchild.destroy() self.bph = self.guiinvoicingins.generatepage(self.mainwindow, self.guiinvoicingins) self.invoicingbox.add(self.bph) self.invoicingbox.show_all()
def delete_statement_entry(partyname, edate, vnumber): try: #if company present rowfulldata=guicommon.statementstableins.readrow(partyname) #print(rowfulldata) #print('Above is old, below is new data') #print(sentrydata) search_date=edate search_vnum=vnumber sl_counter=0 for sublist in rowfulldata: if sublist[1] == search_date and sublist[2]==search_vnum: rowfulldata.remove(sublist) print(rowfulldata) print('Above after del') guicommon.statementstableins.editrow_without_namechange(partyname, rowfulldata) #print('try block of create statement entry fn completed') except: #if company not present print('except block of del statement entry fn completed') guicommon.loadguicommon()
def manage_states(self, button): gms = guimanagestates.GtkGeoStates() gms.generatepage(self.mainwindow) guicommon.loadguicommon() children = self.invoicingbox.get_children() for eachchild in children: self.invoicingbox.remove(eachchild) eachchild.destroy() self.bph = self.guiinvoicingins.generatepage(self.mainwindow, self.guiinvoicingins) self.invoicingbox.add(self.bph) self.invoicingbox.show_all() cchildren = self.companybox.get_children() for eachcchild in cchildren: self.companybox.remove(eachcchild) eachcchild.destroy() self.cph = self.guicompanyins.generatepage(self.invoicingbox, self.bph, self.guiinvoicingins, self.mainwindow) self.companybox.add(self.cph) self.companybox.show_all()
def some_initialisations(self, projectdirectory): dbmani.loadidbase(projectdirectory) guicommon.loadguicommon()