Ejemplo n.º 1
0
def BestHR(fcastRev, totCycles):
    '''Returns the Best Case HR Decisions.'''
    # CFO ?
    cfoCt = 1 if fcastRev > 1500000 else 0
    # Head of Marketing ?
    headMktgCt = 1 if fcastRev > 1500000 else 0
    # Sales Representatives
    if fcastRev >= 3000000:
        salesRepCt = X_utilities.roundup(fcastRev / 3000000.0)
    else:
        salesRepCt = 0
    # Customer Service ?
    custServCt = 1 if fcastRev > 4500000 else 0
    # Drivers
    if totCycles > 0:
        driverCt = X_utilities.roundup((totCycles * 100000) / 1800000.0)
    else:
        driverCt = 0
    # Quality Control Specialist ?
    qualityCtrlCt = 1 if totCycles > 20 else 0
    # Brewers
    if totCycles > 20:
        brewerCt = X_utilities.roundup(totCycles / 20.0)
    else:
        brewerCt = 0
    # Packager ?
    packagerCt = 1 if totCycles > 1 else 0
    # Cleaners
    if totCycles / 30.0 > 1:
        cleanerCt = int(totCycles / 30.0)
    else:
        cleanerCt = 0
    
    workerCt = brewerCt + packagerCt + driverCt + cleanerCt
    # Managers 
    if workerCt > 0 and workerCt <= 5:
        managerCt = 1
    elif workerCt > 5:
        managerCt = 1 + int(workerCt / 5.0)
    else:
        managerCt = 0
    # Assistant Managers
    if workerCt > 10:
        asstManagerCt = X_utilities.roundup(workerCt / 10.0)
    else:
        asstManagerCt = 0
    
    return [1, cfoCt, managerCt, asstManagerCt, headMktgCt,
              salesRepCt, custServCt, qualityCtrlCt, brewerCt,
              packagerCt, driverCt, cleanerCt]
Ejemplo n.º 2
0
    def OnInit(self):
        self.splash = A_splash.Novus_Splash(None)
        X_utilities.teamDataCheck()
        X_utilities.teamDataCheck2()
        
        self.title_lbl = "Entrepreneurship Traning Program"
        self.frame = A_frame.Novus_Frame(None, -1,  title="Novus " + self.title_lbl)
        
#        wx.Sleep(1)
        self.frame.Center()
        self.SetTopWindow(self.frame)
        self.frame.Maximize()
        self.frame.Show()
        
        return True
Ejemplo n.º 3
0
 def Init(self, year):
     '''Sets up the short term finance panel.'''
     self.year = year
     if year < 3:
         self.slider.SetRange(0, 0)
         self.limitVal_st.SetLabel('$ 0')
         return False
     
     # Get AR, Inventory and Net Fixed Assets
     accountsRec = self.data.GetData1()[59][self.year-1]
     inventory = self.data.GetData1()[60][self.year-1]
     grossFixedAssets = self.data.GetData1()[61][self.year-1]
     depreciation = self.data.GetData1()[62][self.year-1]
     netFixedAssets = grossFixedAssets - depreciation
     self.drawLimit = int(accountsRec*0.5+inventory*0.25+netFixedAssets*0.1)
     self.drawLimit = X_utilities.roundto(self.drawLimit, 100)
     self.slider.SetRange(0, self.drawLimit)
     self.limitVal_st.SetLabel("$ " + format(self.drawLimit, ',d'))
     
     # Get Starting STB Amount
     lastDraw = self.data.GetData1()[14][year-1]
     
     # If the starting STB amount is greater than the draw limit,
     #       set the limit to the maximum allowed. Otherwise, set
     #       the draw to the previous year's amount.
     if lastDraw < self.drawLimit:
         self.slider.SetValue(lastDraw)
     else:
         self.slider.SetValue(self.drawLimit)
     
     self.OnBorrow(None)
Ejemplo n.º 4
0
 def OnEquity(self, evt):
     '''Gets the current value from the slider and sets the value
     of the equity amount label.'''
     equity = self.slider.GetValue()
     equity = X_utilities.roundto(equity, 250)
     self.shareNum_st.SetLabel(format(equity, ',d'))
     self.amount_st.SetLabel('$ ' + format(equity, ',d'))
Ejemplo n.º 5
0
 def ReturnInfo(self):
     '''Returns the current STD decision.'''
     draw = X_utilities.roundto(self.slider.GetValue(), 100)
     if self.rate_st.GetLabel():
         rate = float(self.rate_st.GetLabel().split(' ')[0])
     else:
         rate = 0
     return [draw, rate]
Ejemplo n.º 6
0
 def Init(self, year, panel):
     '''Loads the correct html file to the panel.'''
     path = X_utilities.yearDirFP(year=year)
     file = 'panel_'+unicode(panel)+'_y'+unicode(year)+'.html'
     path = os.path.join(path, file)
     if os.path.isfile(path):
         self.html_display.LoadFile(path)
     else:
         wx.MessageBox(self.noFileMsg, self.noFileCap)
Ejemplo n.º 7
0
 def OnBorrow(self, evt):
     '''Gets a borrowing amount and sets the borrowing label.'''
     draw = X_utilities.roundto(self.slider.GetValue(), 100)
     self.drawVal_st.SetLabel('$ ' + format(draw, ',d'))
     if draw >= self.drawLimit*0.5:
         self.rate = 6.50
     elif draw > 0 and draw < self.drawLimit*0.5:
         self.rate = 3.50
     else:
         self.rate = 0
     self.rate_st.SetLabel("%.2f %%" % (self.rate,))
Ejemplo n.º 8
0
    def RawMatRent(self, maxCapacity, year):
        """Gets the sq. ft. needed for raw materials, 
        the price per sq. ft., and the annual rent."""
        sqFeetNeeded = int(X_utilities.roundup(maxCapacity / 12.0 / 2.0) * 100000.0 / 16.0)
        if sqFeetNeeded < 5000:
            sqFeetNeeded = 5000
        pricePerFoot = self.PriceFoot(year)
        annualRent = int(sqFeetNeeded * pricePerFoot)

        self.feetRM_st.SetLabel(format(sqFeetNeeded, ",d"))
        self.perFootRM_st.SetLabel("$ %.2f" % (pricePerFoot,))
        self.rentRM_st.SetLabel("$ " + format(annualRent, ",d"))
Ejemplo n.º 9
0
 def OnBorrow(self, evt):
     '''Calculates the interest rate and the payback period when the 
     user selects a borrowing amount.'''
     amount = X_utilities.roundto(self.slider.GetValue(), 250)
     if self.year < 4:
         self.amount_st.SetLabel('$ ' + format(amount, ',d'))
         if amount <= 500000:
             self.rate_st.SetLabel('8 %')
             self.time_st.SetLabel('3 ' + self.years_lbl)
         elif amount > 500000 and amount <=1000000:
             self.rate_st.SetLabel('10 %')
             self.time_st.SetLabel('5 ' + self.years_lbl)
         elif amount > 1000000 and amount <=1500000:
             self.rate_st.SetLabel('12 %')
             self.time_st.SetLabel('7 ' + self.years_lbl)
         elif amount > 1500000 and amount <=2000000:
             self.rate_st.SetLabel('14 %')
             self.time_st.SetLabel('9 ' + self.years_lbl)
         else:
             self.rate_st.SetLabel('')
             self.time_st.SetLabel('')
     
     else:
         # Get the average LoC rate for Years 1 - 3
         avgLoc = 0
         for x in self.data.GetData1()[65][1:4]:
             avgLoc += (1/3.0) * Z_gameIO.GetLoCRate(x) * 100.0
 
         self.amount_st.SetLabel('$ ' + format(amount, ',d'))
         
         if amount <= 500000:
             r = avgLoc + 5.0
             self.rate_st.SetLabel("%.2f %%" % r)
             self.time_st.SetLabel('5 ' + self.years_lbl)
         elif amount > 500000 and amount <=1000000:
             r = avgLoc + 7.50
             self.rate_st.SetLabel("%.2f %%" % r)
             self.time_st.SetLabel('6 ' + self.years_lbl)
         elif amount > 1000000 and amount <=1500000:
             r = avgLoc + 10.00
             self.rate_st.SetLabel("%.2f %%" % r)
             self.time_st.SetLabel('7 ' + self.years_lbl)
         elif amount > 1500000 and amount <=2000000:
             r = avgLoc + 12.50
             self.rate_st.SetLabel("%.2f %%" % r)
             self.time_st.SetLabel('8 ' + self.years_lbl)
         else:
             self.rate_st.SetLabel('')
             self.time_st.SetLabel('')
Ejemplo n.º 10
0
    def Init(self, year, lessonNum, lessonTitle):
        '''Sets up the panel with the correct title and loads the correct
        video.'''
        # Set up the video information
        self.year_st.SetLabel(self.year_lbl + ' ' + year)
        self.lesson_st.SetLabel(self.lesson_lbl + ' ' + unicode(lessonNum))
        self.lessonTitle_st.SetLabel(lessonTitle)
        # Get the correct video path:
        path = X_utilities.yearDirFP(int(year))
        file = 'LessonVid_y'+year+'_'+unicode(lessonNum)+'.mov'
        vidFile = os.path.join(path, file)
        
        # CHECK 1: LOAD FROM HDD
        #------------------------------------------------------------------
        if os.path.isfile(vidFile):
            # FOR LITE VERSION ONLY -- LOAD STRAIGHT FROM INTERNET
            self.vidPlayer.LoadFile(vidFile)
            return 1
        
        
        # IF LOAD FROM HDD FAIL => DLG: SELECT FILE LOCATION or YOUTUBE
        else:
#            busy = wx.BusyInfo(self.searching_lbl+'...')
            
            # Check the internet connection -------------------------------
            self.inet_connected = True
            try:
                urllib2.urlopen("http://google.com", timeout=2)
            except urllib2.URLError:
                self.inet_connected = False
                return 0
#                path = self.OpenFile(file)
#                if path:
#                    self.vidPlayer.LoadFile(path)
#                    return 1
#                else:
#                    return 2
            finally:
                busy=None
                
            # TEMPORARY - FOR LITE VERSION ONLY
            self.OpenURL(year, lessonNum)
            return 2
Ejemplo n.º 11
0
 def GetData1(self):
     '''Reads the team data 1 file and returns a formatted 
     table.'''
     X_utilities.teamDataCheck()
     file = open(self.data1FP, 'rb')
     reader = csv.reader(file, dialect='excel')
     table = []
     for row in reader:
         table.append(row)
     file.close()
     
     # Format Output
     table[0][1] = int(table[0][1])
     # Man. / Pack. Equipment and FG Storage Years 1-3
     table[2][1] = int(table[2][1])
     table[3][1] = int(table[3][1])
     table[4][1] = int(table[4][1])
     table[5][1] = int(table[5][1])
     table[6][1] = int(table[6][1])
     
     table[7][1] = int(table[7][1])
     table[8][1] = int(table[8][1])
     table[9][1] = int(table[9][1])
     
     table[10][1] = int(table[10][1])
     # Man. / Pack. Equipment and FG Storage Years 4 - 6
     table[2][2] = int(table[2][2])
     table[3][2] = int(table[3][2])
     table[4][2] = int(table[4][2])
     table[5][2] = int(table[5][2])
     table[6][2] = int(table[6][2])
     
     table[7][2] = int(table[7][2])
     table[8][2] = int(table[8][2])
     table[9][2] = int(table[9][2])
     
     table[10][1] = int(table[10][1])
     table[10][2] = int(table[10][2])
     
     table[2][3] = int(table[2][3])
     table[3][3] = int(table[3][3])
     table[4][3] = int(table[4][3])
     table[5][3] = int(table[5][3])
     table[6][3] = int(table[6][3])
     
     # Long Term Debt Amt, Rate, Payback Period - Year 1
     table[11][1] = int(table[11][1])
     table[11][2] = float(table[11][2])
     table[11][3] = int(table[11][3])
     # Equity Amount and Shares
     table[12][1] = int(table[12][1])
     table[12][2] = int(table[12][2])
     # Long Term Debt Amt, Rate, Payback Period - Year 1
     table[13][1] = int(table[13][1])
     table[13][2] = float(table[13][2])
     table[13][3] = int(table[13][3])
     
     # Six Years - All Integers
     intRows = (14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
                27, 28, 29, 30, 31, 32, 39, 40, 41, 42, 43, 44, 45, 46)
     
     for row in intRows:
         for i in range(1, 7):
             table[row][i] = int(table[row][i])
 
     # Six Years - All Float
     floatRows = (15, 33, 34, 35, 36, 37, 38, 47, 48, 49, 50)
     
     for row in floatRows:
         for i in range(1, 7):
             table[row][i] = round(float(table[row][i]), 3)
             
     # All Historical Performace Info Formatted as Integers
     for row in range(51, 71):
         for col in range(1, 7):
             table[row][col] = int(table[row][col])
     
     return table
Ejemplo n.º 12
0
 def __init__(self, parent, *args, **kwargs):
     
     X_utilities.teamDataCheck()
     md = os.path.expanduser('~/')
     self.data1FP = os.path.join(md, 'My Documents', 'Novus Data', 'teamData1.csv')
Ejemplo n.º 13
0
 def ReturnInfo(self):
     '''Returns the current Equity decision.'''
     return [X_utilities.roundto(self.slider.GetValue(), 250)]