-
-
Save jah2488/4383151 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#=========================================================================================================================================== | |
# ---- Productivity Calculator for Erepublik Beta and V1 ---- | |
## Created by me | |
# | |
# Beta 0.3.5 -- October 25th 2008 | |
# | |
##Notes | |
# | |
## Fatal Occurs during Windows EXE. Something wrong with the SHELVE Module | |
# Possible reason = Failure to import all modules for exe or unable to write the .dat file | |
# Possible Fixes = change the shelve module// change the .dat to a .txt and have them fill it in manually | |
# | |
# Realize that I havn't utilized a single function within the entire program and will need to rewrite to place them in.10/20 | |
# | |
# -Still working on the GUI, but the formula seems to be stable enough for V1. 10/17 | |
# - When a large company (3xRM) is placed into the system a negative number is registered, this has been fixed. | |
# - For some reason Q4 companies come up as negative instead of 1/4, i might try switching to decimals through an If statement assignment | |
# - Can someone please tell me why when i use raw_input instead of just input it doesn't recognize 1 or 2 as being 1 or 2? | |
# - FORMULA UPDATE 10/24 :: Admins Changed the Formula for productivity to make normal production smaller in standard companies (probably to stop the overproduction) | |
## ::but kept it the same for the RM Companies. So now any Q1 RM company can easily make 4 times more product then a Q1 food company of equal skill. | |
## | |
#### - Future Edits and Additions Needed | |
## View Company Profile Page with all the data currently stored on the company | |
## The ability to add and change additional variables and data from the company page | |
## Finish GM reports and the write to file. | |
# ADD a Load function to recall old company data. Make sure to add an edit function to this to ensure up to data info 10/20 | |
# Right now I want to make some executables of this to get people testing it out but at the same time | |
# I wanna work on the GUI and give it all a big tinker make over to make it look and run nicely, but that will be a big overhaul, | |
# kind of like the Beta to V1 and I need to make sure people like it first and that everything works properly | |
# I still want to eventually get this running off of the erep servers to auto update, but that will take a considerable amount of work, but will make this program simply amazing. | |
# --SO Manager. Oh yes. The Over view Management of several different companies | |
# | |
import urllib2, urllib, cookielib | |
import time | |
import math | |
import random | |
import os | |
import shelve | |
import anydbm | |
from Tkinter import * | |
day = str(time.localtime()[2]) | |
company = '0' | |
useragent = {'User-Agent':'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'} | |
global Version | |
Version = "\n Created with Justinious's Productivity Business Calculator Beta V0.3.5" | |
## Creates the Needed Directories inside the Company Folder for placement of the Reports and Data | |
try: | |
os.mkdir("./Company_Data/") | |
os.mkdir("./Company_Reports/") | |
os.mkdir("./Company_Reports/Financial_Reports/") | |
os.mkdir("./Company_Reports/Management_Reports/") | |
os.mkdir("./Company_Reports/Special_Reports/") | |
except: | |
None | |
##Sets the File Paths for the Forms and Data | |
DataPath = "./Company_Data/" | |
CRPath = "./Company_Reports/" | |
FRPath = "./Company_Reports/Financial_Reports/" | |
MRPath = "./Company_Reports/Management_Reports/" | |
SRPath = "./Company_Reports/Special_Reports/" | |
#The Welcome//Start Screen Function | |
# - Grabs Variables from the User [Consider Revising for GUI] | |
RP = 1 #Regional Productivity should default at once with the exception of Raw Mat Companies | |
def start(): | |
print "Welcome to Erepublik V1 GM/Employee Productivity Calculator" + "\n" | |
#time.sleep(.5) | |
print "Beta Version 0.3.4" + "\t Last Updated October 24th" + "\n\n" | |
#time.sleep(.2) | |
User = input("Please select your user type." + "\n\n" + " -Press (1) for General Manager" + "\n" + " -Press (2) for Employee" + "\n\n") | |
if User == 1: | |
WGMCalc() | |
elif User == 2: | |
EmployeeCalc() | |
elif User is not 1 or 2: | |
print "Thats not an option" | |
time.sleep(1) | |
print "\n\n\n\n" | |
start() | |
##### ## ## ### ## ##### ###### ###### ###### ### ## ##### | |
#### ## ## #### ## ## ## ## ## ## #### ## ### | |
## ## ## ## #### ## ## ## ## ## ## #### ### | |
## ### ## ### ##### ## ###### ###### ## ### ##### | |
#===================== | |
# Create The Company Data File Function | |
##### | |
def CreateCompany(CoID): | |
print "\n Your Company ID thing ---",CoID # Double Checks and Prints the Company ID #, string, w/e | |
db = shelve.open("./Company_Data/%s.dat" % CoID, 'c' ) #Opens the Data File | |
FullCoR() #Calls the Full Company Report Function to call all the input/data from the user | |
print CoN, "\n" ## | |
print CQ, "\n" ## Writes all the input back to the user just to make the screen look cool and to double check its receiving the data | |
print CE, "\n" | |
print industry1, "\n" | |
print industry, "\n" | |
print RE, "\n" | |
print REA, "\n" | |
print RP, "\n" | |
print CEH, "\n" | |
print CEL, "\n" | |
print AEA, "\n" | |
print CoG, "\n" | |
print CoC, "\n" | |
print CoS, "\n" | |
print CoRM, "\n" | |
print AGP, "\n" | |
print CoE, "\n" | |
print CoF, "\n" | |
print CoLi, "\n" | |
print CoLiG, "\n" | |
print CoLiC, "\n" | |
print CQW, "\n" | |
print CQRM, "\n" | |
print RMCQ, "\n" | |
print SM, "\n" | |
db['CoN'] = CoN | |
db['CQ'] = CQ | |
db['CE'] = CE | |
db['industry1'] = industry1 | |
db['industry'] = industry | |
db['RE'] = RE | |
db['REA'] = REA | |
db['RP'] = RP | |
db['CEH'] = CEH | |
db['CEL'] = CEL | |
db['AEA'] = AEA | |
db['CoG'] = CoG | |
db['CoC'] = CoC | |
db['CoS'] = CoS | |
db['CoRM'] = CoRM | |
db['AGP'] = AGP | |
db['CoE'] = CoE | |
db['CoF'] = CoF | |
db['CoLi'] = CoLi | |
db['CoLiG'] = CoLiG | |
db['CoLiC'] = CoLiC | |
db['CQW'] = CQW | |
db['CQRM'] = CQRM | |
db['RMCQ'] = RMCQ | |
db['SM'] = SM | |
print db.keys() | |
print "\n" | |
print db.values() | |
db.close ### Closes the File when Finished with it. This should be only a quick open, input, write, and close process. | |
print "closing file" | |
time.sleep(.75) | |
#print"opening file" | |
#f = shelve.open("./Company_Data/%s.dat" % CoID, 'r') | |
#data = f.read() | |
#print "Printing Data from File, ::: ",data, "\n\n" | |
#f.close | |
GMCalc() ### Goes back to the GMCalc Screen to re-check for the Company ID and it should now exist. | |
#============================================# | |
## Loads an Existing Company Database File ### | |
#============================================# | |
def LoadCompany(CoID): | |
print "\nLoading Company with ID --", CoID | |
db = shelve.open("./Company_Data/%s.dat" % CoID, "r") | |
print db.keys(), "\n" | |
print db.values(), "\n" | |
for k in db.keys(): | |
obj = db[k] | |
print "%s: %s " % (k, obj) | |
CoN = db['CoN'] | |
CQ = db['CQ'] | |
CE = db['CE'] | |
industry1 = db['industry1'] | |
industry = db['industry'] | |
RE = db['RE'] | |
REA = db['REA'] | |
RP = db['RP'] | |
CEH = db['CEH'] | |
CEL = db['CEL'] | |
AEA = db['AEA'] | |
CoG = db['CoG'] | |
CoC= db['CoC'] | |
CoS= db['CoS'] | |
CoRM = db['CoRM'] | |
AGP = db['AGP'] | |
CoE = db['CoE'] | |
CoF = db['CoF'] | |
CoLi= db['CoLi'] | |
CoLiG= db['CoLiG'] | |
CoLiC= db['CoLiC'] | |
CQW= db['CQW'] | |
CQRM= db['CQRM'] | |
RMCQ= db['RMCQ'] | |
SM = db['SM'] | |
try: | |
global CoN | |
global CQ | |
global CE | |
global industry1 | |
global industry | |
global RE | |
global REA | |
global RP | |
global CEH | |
global CEL | |
global AEA | |
global CoG | |
global CoC | |
global CoS | |
global CoRM | |
global AGP | |
global CoE | |
global CoF | |
global CoLi | |
global CoLiG | |
global CoLiC | |
global CQW | |
global CQRM | |
global RMCQ | |
global SM | |
except: | |
None | |
print CoN, "\n" | |
print CQ, "\n" | |
print CE, "\n" | |
print industry1, "\n" | |
print industry, "\n" | |
print RE, "\n" | |
print REA, "\n" | |
print RP, "\n" | |
print CEH, "\n" | |
print CEL, "\n" | |
print AEA, "\n" | |
print CoG, "\n" | |
print CoC, "\n" | |
print CoS, "\n" | |
print CoRM, "\n" | |
print AGP, "\n" | |
print CoE, "\n" | |
print CoF, "\n" | |
print CoLi, "\n" | |
print CoLiG, "\n" | |
print CoLiC, "\n" | |
print CQW, "\n" | |
print CQRM, "\n" | |
print RMCQ, "\n" | |
print SM, "\n" | |
print "\n\n\n" | |
db.close() | |
############# | |
## Employee Productivity Calculator | |
################## | |
# | |
def EmployeeCalc(): | |
formula = input("\n\n\n" + "Please select your desired Productivity Formula." +\ | |
"\n\n" + " -BETA Formula Press (1)" + "\n" + " -V1 Formula Press (2)" +\ | |
"\n" + " -V1 Detailed Formula Press (3)" + "\n" + "\n-Press (0) To Go Back To The Main Menu\n\n\n") | |
if formula == 1: | |
print "\n\n" + "Calculating Productivity Using BETA Formula" + "\n\n" | |
elif formula == 2: | |
print "\n\n" + "Calculating Productivity Using V1 Formula" + "\n\n" | |
elif formula == 3: | |
print "\n\n" + "Calculating Productivity Using Detailed V1 Formula" + "\n\n" | |
elif formula == 0: | |
start() | |
elif formula is not 1 or 2 or 3 or 0: | |
print "Thats not really an option" | |
time.sleep(1) | |
print "\n\n\n\n" | |
EmployeeCalc() | |
## | |
## User Picks either 1 or 2 to use either Beta formula or V1 respectively | |
## | |
if formula == 1: | |
skill = input("Employee Skill : ") | |
wellness = input("Employee Wellness : ") | |
CQ = input("Company Quality: ") | |
if CQ == 1: | |
CQ = 1 | |
elif CQ == 2: | |
CQ = .50 | |
elif CQ == 3: | |
CQ = .6667 | |
elif CQ == 4: | |
CQ = .25 | |
elif CQ == 5: | |
CQ = .20 | |
elif CQ > 5: | |
print "Your Lying...\n" | |
CQ = input("What is the Actual Company Quality: ") | |
if CQ > 5: | |
print "If you do not stop, i swear \n" | |
CQ = input("Now, What is the REAL Company Quality? : ") | |
if CQ > 5: | |
CQ = input("Tell ME THE COMPANY QUALITY!! : ") | |
if CQ > 5: | |
print "die now \n" | |
print "..hrmm.. what number am I thinking of?" | |
input() | |
CE = input("Company Employees: ") | |
## Assigns the proper productivity requirements for each industry and | |
## assigns the recommended Employee number. | |
## | |
industry1 = raw_input("Company Industry : ") | |
if industry1 == "gifts": | |
industry = 2 | |
RE = 10 | |
RP = 1 | |
elif industry1 == "food": | |
industry = 1 | |
RE = 10 | |
RP = 1 | |
elif industry1 == "weapons": | |
industry = 5 | |
RE = 10 | |
RP = 1 | |
elif industry1 == "housing": | |
industry = 200 | |
RE = 20 | |
RP = 1 | |
elif industry1 == "moving": | |
industry = 10 | |
RE = 10 | |
RP = 1 | |
elif industry1 == "hospitals": | |
industry = 2000 | |
RE = 20 | |
RP = 1 | |
elif industry1 == "Defense": | |
industry = 2000 | |
RE = .05 | |
REA = 20 | |
RP = 1 | |
elif industry1 == "Diamonds": | |
industry = 1 | |
RE = .10 | |
REA = 10 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "wood": | |
industry = 1 | |
RE = 10 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "grain": | |
industry = 1 | |
RE = 10 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "oil": | |
industry = 1 | |
RE = 10 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "iron": | |
industry = 1 | |
RE = 10 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 is not "gifts" or "food" or "weapons" or "housing" or "moving" or "hospitals" or "Defense" or "wood" or "grain" or "oil" or "iron" or "diamonds": | |
print '''\nI'm sorry That wasn't a recognized industry. Please type either\n "gifts" or "food" or "weapons" or "housing" or "moving" or "hospitals" or "Defense" or "wood" or "grain" or "oil" or "iron" or "diamonds"''' | |
time.sleep(5) | |
EmployeeCalc() | |
AGP = input("What is the lowest market price for this product? : ") | |
productivity = (skill - (CQ * (1/CQ)) + 1) * (1 + (wellness/50) + 1 - .316) * (.91 + (CE/200)) | |
print "\nEmployee Producitivity is", productivity | |
#print productivity | |
Units = productivity/industry | |
EGP = Units * AGP | |
print "\n" + "Employee Makes ", Units | |
#print Units | |
print "product per day, and the break even point for this employee is ", EGP | |
#print EGP | |
print "\n\n\n" | |
decision = input("Would you like to go back to the main menu? Press 1 for Yes and 2 for No\n\n\n") | |
if decision == 1: | |
start() | |
elif decision == 2: | |
print "Then What do you want to do?" | |
################################################# | |
#### Calculator for V1 Productivity | |
# I changed the formula to reflect and be computed the same way as described in the wiki | |
# | |
elif formula == 2: | |
skill = input("Employee Skill : ") | |
wellness = input("Employee Wellness : ") | |
CQ = input("Company Quality: ") | |
if CQ == 1: | |
CQ = 1 | |
elif CQ == 2: | |
CQ = .50 | |
elif CQ == 3: | |
CQ = .6667 | |
elif CQ == 4: | |
CQ = .25 | |
elif CQ == 5: | |
CQ = .20 | |
elif CQ > 5: | |
print "Your Lying...\n" | |
CQ = input("What is the Actual Company Quality: ") | |
if CQ > 5: | |
print "If you do not stop, i swear \n" | |
CQ = input("Now, What is the REAL Company Quality? : ") | |
if CQ > 5: | |
CQ = input("Tell ME THE COMPANY QUALITY!! : ") | |
if CQ > 5: | |
print "die now \n" | |
print "..hrmm.. what number am I thinking of?" | |
input() | |
if CQ == 1: | |
CQW = 1 ## Company Quality Worth (as in how much gold it costs to upgrade) | |
CQRM = 1 ## Company Quality Modifier to Calculate the use of Raw Materials | |
RMCQ = 1 ## Raw Material Company Quality Modifier | |
elif CQ == .50: | |
CQW = 20 | |
CQRM = 2 | |
RMCQ = .9 | |
elif CQ == .33: | |
CQW = 50 | |
CQRM = 3 | |
RMCQ = .8 | |
elif CQ == .25: | |
CQW = 100 | |
CQRM = 4 | |
RMCQ = .7 | |
elif CQ == .20: | |
CQW = 200 | |
CQRM = 5 | |
RMCQ = .6 | |
CE = input("Company Employees: ") | |
## Assigns the proper productivity requirements for each industry and | |
## assigns the recommended Employee number. | |
## [Raw Material Industries need to be added] | |
industry1 = raw_input("Company Industry \n(gifts, food, weapons, housing, moving, hospitals, defense,\ | |
diamonds,wood,grain,oil,iron)\n :: ") | |
if industry1 == "gifts": | |
industry = 2.0 | |
RE = .10 | |
REA = 10 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "food": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "weapons": | |
industry = 5.0 | |
RE = .10 | |
REA = 10 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "housing": | |
industry = 200.0 | |
RE = .05 | |
REA = 20 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "moving": | |
industry = 10.0 | |
RE = .10 | |
REA = 10 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "hospitals": | |
industry = 2000.0 | |
RE = .05 | |
REA = 20 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "defense": | |
industry = 2000.0 | |
RE = .05 | |
REA = 20 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "diamonds": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
SM = 2 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "wood": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
SM = 2 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "grain": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
SM = 2 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "oil": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "iron": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
SM = 2 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 is not "gifts" or "food" or "weapons" or "housing" or "moving" or "hospitals" or "Defense" or "wood" or "grain" or "oil" or "iron" or "diamonds": | |
print '''\nI'm sorry That wasn't a recognized industry. Please type either\n "gifts" or "food" or "weapons" or "housing" or "moving" or "hospitals" or "Defense" or "wood" or "grain" or "oil" or "iron" or "diamonds"''' | |
time.sleep(5) | |
AGP = input("What is the lowest market price for this product? : ") | |
# If the company has less than or equal to the desired amount of Employees | |
if CE <= RE: | |
A = (skill * SM) | |
B = (1 + 2 * (wellness/100)) | |
C = (1 + (CE/RE)) | |
D = (RP) | |
E = (1 + random.randint(1,10)/10)#Generates a random Variable for the Trivia Result. | |
if SM == 2: | |
F = (RMCQ) | |
elif SM == 1: | |
F = (CQ) | |
if F == 0: | |
F = 1 | |
productivity2 = A * B * C * D * E * F | |
#productivity2 = (skill) * (1 + 2 * (wellness/100)) * ( 1 + (CE/RE)) * (1) * (1 + 2/5) * (1/CQ) | |
print "Your Company has the Correct Amount of Employees according to Admin Standards" | |
print "Employee Producitivity is" | |
print productivity2 | |
Units = productivity2/industry | |
EGP = Units * AGP | |
print "\n" + "Employee Makes " | |
print Units | |
print "product per day, and the break even point for this employee is " | |
print EGP | |
print "\n\n\n" | |
decision = input("Would you like to go back to the main menu? Press 1 for Yes and 2 for No\n\n\n") | |
if decision == 1: | |
start() | |
elif decision == 2: | |
print "Then What do you want to do?" | |
elif CE > RE: | |
A = (skill * SM) | |
B = (1 + 2 * (wellness/100)) | |
C = (3 - (CE/RE)) | |
D = (RP) | |
E = (1 + random.randint(1,10)/10)#Generates a random Variable for the Trivia Result. | |
if SM == 2: | |
F = (RMCQ) | |
elif SM == 1: | |
F = (CQ) | |
if C < 1: | |
C = 1 | |
if F <= 0: | |
F = 1 | |
productivity3 = A * B * C * D * E * F | |
#productivity3 = (skill) * (1 + 2 * (wellness/100)) * (1) * (1 + 2/5) * (1/CQ) | |
#productivity4 = productivity3 + ( 3 - (CE/RE)) | |
print "\n" + "Your Company has too many Employees according to Admin Standards" | |
print "Employee Producitivity is" | |
if productivity3 <= 1: | |
print "Your Company Productivity Multiplier is 1 due to over hiring." | |
print productivity3 | |
Units = productivity3/industry | |
EGP = Units * AGP | |
print "\n" + "Employee Makes " | |
print Units | |
print "product per day, and the break even point for this employee is " | |
print EGP | |
print "\n\n\n" | |
decision = input("Would you like to go back to the main menu? Press 1 for Yes and 2 for No\n\n\n") | |
if decision == 1: | |
start() | |
elif decision == 2: | |
print "Then What do you want to do?" | |
time.sleep(.5) | |
f = raw_input("Press 0 to quit") | |
if f == 0: | |
quit() | |
elif f is not 0: | |
exit() | |
else: | |
print "you win, the winning number is 999887",EGP,"00x34534xx2488. Give this number to me to claim your 10GOLD" | |
elif productivity3 > 1: | |
print productivity3 | |
Units = productivity3/industry | |
EGP = Units * AGP | |
print "\n" + "Employee Makes " | |
print Units | |
print "product per day, and the break even point for this employee is " | |
print EGP | |
print "\n\n\n" | |
decision = input("Would you like to go back to the main menu? Press 1 for Yes and 2 for No\n\n\n") | |
if decision == 1: | |
start() | |
elif decision == 2: | |
print "Then What do you want to do?" | |
time.sleep(.5) | |
f = raw_input("Press 0 to quit") | |
if f == 0: | |
quit() | |
elif f is not 0: | |
exit() | |
else: | |
print "you win, the winning number is 999887",EGP,"00x34534xx2488. Give this number to me to claim your 10GOLD" | |
########################### | |
########### DETAILED V1 VERISION | |
### Formula 3 is a slight "debug" version of the V1 productivity, it simply displays more variables. | |
elif formula == 3: | |
skill = input("Employee Skill : ") | |
wellness = input("Employee Wellness : ") | |
CQ = input("Company Quality: ") | |
if CQ == 1: | |
CQ = 1 | |
elif CQ == 2: | |
CQ = .50 | |
elif CQ == 3: | |
CQ = .6667 | |
elif CQ == 4: | |
CQ = .25 | |
elif CQ == 5: | |
CQ = .20 | |
elif CQ > 5: | |
print "Your Lying...\n" | |
CQ = input("What is the Actual Company Quality: ") | |
if CQ > 5: | |
print "If you do not stop, i swear \n" | |
CQ = input("Now, What is the REAL Company Quality? : ") | |
if CQ > 5: | |
CQ = input("Tell ME THE COMPANY QUALITY!! : ") | |
if CQ > 5: | |
print "die now \n" | |
print "..hrmm.. what number am I thinking of?" | |
input() | |
if CQ == 1: | |
CQW = 1 ## Company Quality Worth (as in how much gold it costs to upgrade) | |
CQRM = 1 ## Company Quality Modifier to Calculate the use of Raw Materials | |
RMCQ = 1 ## Raw Material Company Quality Modifier | |
elif CQ == .50: | |
CQW = 20 | |
CQRM = 2 | |
RMCQ = .9 | |
elif CQ == .33: | |
CQW = 50 | |
CQRM = 3 | |
RMCQ = .8 | |
elif CQ == .25: | |
CQW = 100 | |
CQRM = 4 | |
RMCQ = .7 | |
elif CQ == .20: | |
CQW = 200 | |
CQRM = 5 | |
RMCQ = .6 | |
CE = input("Company Employees: ") | |
## Assigns the proper productivity requirements for each industry and | |
## assigns the recommended Employee number. | |
## [Raw Material Industries need to be added] | |
industry1 = raw_input("Company Industry \n(gifts, food, weapons, housing, moving, hospitals, defense,\ | |
diamonds,wood,grain,oil,iron)\n :: ") | |
if industry1 == "gifts": | |
industry = 2.0 | |
RE = .10 | |
REA = 10 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "food": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "weapons": | |
industry = 5.0 | |
RE = .10 | |
REA = 10 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "housing": | |
industry = 200.0 | |
RE = .05 | |
REA = 20 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "moving": | |
industry = 10.0 | |
RE = .10 | |
REA = 10 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "hospitals": | |
industry = 2000.0 | |
RE = .05 | |
REA = 20 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "defense": | |
industry = 2000.0 | |
RE = .05 | |
REA = 20 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "diamonds": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
SM = 2 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "wood": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
SM = 2 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "grain": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
SM = 2 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "oil": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "iron": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
SM = 2 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 is not "gifts" or "food" or "weapons" or "housing" or "moving" or "hospitals" or "Defense" or "wood" or "grain" or "oil" or "iron" or "diamonds": | |
print '''\nI'm sorry That wasn't a recognized industry. Please type either\n "gifts" or "food" or "weapons" or "housing" or "moving" or "hospitals" or "Defense" or "wood" or "grain" or "oil" or "iron" or "diamonds"''' | |
time.sleep(5) | |
EmployeeCalc() | |
AGP = input("What is the lowest market price for this product? : ") | |
if CE <= REA: | |
A = (skill * SM) | |
B = (1 + (2 * (wellness *0.010)))#Python wasn't interpritting the formula correctly so i have had to change the division slightly to account for decimals | |
C = (1 + (CE * RE)) | |
D = (RP) | |
E = (1 + random.randint(1,8) * 0.10)#Generates a random Variable for the Trivia Result. | |
if SM == 2: | |
F = (RMCQ) | |
elif SM == 1: | |
F = (CQ) | |
if F == 0: | |
F = 1 | |
productivity2 = A * B * C * D * E * F | |
#productivity2 = (skill) * (1 + 2 * (wellness/100)) * ( 1 + (CE/RE)) * (1) * (1 + 2/5) * (1/CQ) | |
print A, " Skill Modifier\n" | |
print B, " Wellness Modifier (1-3)\n" | |
print C, " Company Employee Bonus or 'Max Productivity' Modifier. (1-2)\n" | |
print D, " Regional Productivity Modifer (1 in all Companies except for RMs Where it can range from .01 to 2)\n" | |
print E, " Trivia Bonus Modifer (1-2: This program uses a random integer to calculate the trivia bonus\n" | |
print F, " Company Quality Modifier (1,.5,.33,.25,.20) or for RMs(1,.9,.8,.7,.6)\n" | |
if CE == REA: | |
print "\nYour Company has the Correct Amount of Employees according to Admin Standards\n\ | |
What this means is that your company is operating at the exact amount of employees to receive the Max Productivity bonus\ | |
which is currently a 2.00 multiplier to your productivity\n" | |
elif CE < REA: | |
CEN = REA - CE | |
print "\nYour Company has less than the Correct Amount of Employees according to the Admin Standards\n\ | |
This means that your company will benefit from hiring ", CEN," more works so you will receive the max employee bonus.\n" | |
print "\nEmployee Producitivity is ", productivity2 | |
Units = productivity2/industry | |
EGP = Units * AGP | |
print "\n" + "Employee Makes ",Units, industry1," per day.\n" | |
print "The amount of income produced for the company by this employee per day is ",EGP | |
print "\nIf the employee wage is higher than this amount the company is losing money" | |
print "Conversly if the employee wage is lower than this amount the company is possibly making a profit." | |
print "In order for the company to make a profit and stay in business the company needs to make sure that\n\ | |
the money that comes in from each product sold is enough to pay for RM cost and then pay salaries." | |
print "\n\n\n" | |
decision = input("Would you like to go back to the main menu? Press 1 for Yes and 2 for No\n\n\n") | |
if decision == 1: | |
start() | |
elif decision == 2: | |
print "Then What do you want to do?" | |
time.sleep(.5) | |
f = raw_input("Press 0 to quit") | |
if f == 0: | |
quit() | |
elif f is not 0: | |
exit() | |
else: | |
print "you win, the winning number is 999887",EGP,"00x34534xx2488. Give this number to me to claim your 10GOLD" | |
elif CE > REA: | |
A = (skill * SM) | |
B = (1 + 2 * (wellness * 0.010)) | |
C = (3 - (CE * RE)) | |
D = (RP) | |
E = (1 + random.randint(1,10)* 0.10)#Generates a random Variable for the Trivia Result. | |
if SM == 2: | |
F = (RMCQ) | |
elif SM == 1: | |
F = (CQ) | |
if C < 1: | |
C = 1 | |
if F <= 0: | |
F = 1 | |
print A | |
print B | |
print C | |
print D | |
print E | |
print F | |
productivity3 = A * B * C * D * E * F | |
#productivity3 = (skill) * (1 + 2 * (wellness/100)) * (1) * (1 + 2/5) * (1/CQ) | |
#productivity4 = productivity3 + ( 3 - (CE/RE)) | |
print "\n" + "Your Company has too many Employees according to Admin Standards" | |
print "Employee Producitivity is" | |
if productivity3 <= 1: | |
print "Your Company Productivity Multiplier is 1 due to over hiring." | |
print productivity3 | |
Units = productivity3/industry | |
EGP = Units * AGP | |
print "\n" + "Employee Makes " | |
print Units | |
print "product per day, and the break even point for this employee is " | |
print EGP | |
print "\n\n\n" | |
decision = input("Would you like to go back to the main menu? Press 1 for Yes and 2 for No\n\n\n") | |
if decision == 1: | |
start() | |
elif decision == 2: | |
print "Then What do you want to do?" | |
time.sleep(.5) | |
f = raw_input("Press 0 to quit") | |
if f == 0: | |
quit() | |
elif f is not 0: | |
exit() | |
else: | |
print "you win, the winning number is 999887",EGP,"00x34534xx2488. Give this number to me to claim your 10GOLD" | |
elif productivity3 > 1: | |
print productivity3 | |
Units = productivity3/industry | |
EGP = Units * AGP | |
print "\n" + "Employee Makes " | |
print Units | |
print "product per day, and the break even point for this employee is " | |
print EGP | |
print "\n\n\n" | |
decision = input("Would you like to go back to the main menu? Press 1 for Yes and 2 for No\n\n\n") | |
if decision == 1: | |
start() | |
elif decision == 2: | |
print "Then What do you want to do?" | |
time.sleep(.5) | |
f = raw_input("Press 0 to quit") | |
if f == 0: | |
quit() | |
elif f is not 0: | |
exit() | |
else: | |
print "you win, the winning number is 999887",EGP,"00x34534xx2488. Give this number to me to claim your 10GOLD" | |
#==================================================================== | |
#======= Calculates an employee's Productivity for the GM =========== | |
#==================================================================== | |
def EmpProd(skill,wellness,CQ,CE,RE,RP,REA,SM,RMCQ): | |
if CE <= REA: | |
A = (skill * SM) | |
B = (1 + (2 * (wellness *0.010)))#Python wasn't interpritting the formula correctly so i have had to change the division slightly to account for decimals | |
C = (1 + (CE * RE)) | |
D = (RP) | |
E = (1 + random.randint(1,10) * 0.10)#Generates a random Variable for the Trivia Result. | |
if SM == 2: | |
F = (RMCQ) | |
elif SM == 1: | |
F = (CQ) | |
if F == 0: | |
F = 1 | |
productivity2 = A * B * C * D * E * F | |
Units = productivity2 / industry | |
return productivity2 | |
return Units | |
#productivity2 = (skill) * (1 + 2 * (wellness/100)) * ( 1 + (CE/RE)) * (1) * (1 + 2/5) * (1/CQ) | |
elif CE > REA: | |
A = (skill * SM) | |
B = (1 + 2 * (wellness * 0.010)) | |
C = (3 - (CE * RE)) | |
D = (RP) | |
E = (1 + random.randint(1,10)* 0.10)#Generates a random Variable for the Trivia Result. | |
if SM == 2: | |
F = (RMCQ) | |
elif SM == 1: | |
F = (CQ) | |
if C < 1: | |
C = 1 | |
if F <= 0: | |
F = 1 | |
productivity3 = A * B * C * D * E * F | |
Units = productivity3 / industry | |
return productivity3 | |
return Units | |
#productivity3 = (skill) * (1 + 2 * (wellness/100)) * (1) * (1 + 2/5) * (1/CQ) | |
#productivity4 = productivity3 + ( 3 - (CE/RE)) | |
#### | |
# - This Section Details the Employer or GM Side of the Calculator. | |
## | |
# Additions to the GM Calc Forms :: | |
# Producity --- Average Employee Productivity per day, and over all Company productivity with min and max etc | |
# Raw Material Use --- Calculate exactly how much RM you need per day with the amount of employeee Productivity you have currently | |
# Profit/Loss --- An Actual Profit loss margin analysis would need a time period to cross reference with but i believe its possible | |
# QuickWiki --- The Full From and Statistics Outputted to a txt for easy Copy and Paste unto the erep Wiki | |
# Analysis/Advice --- A few if statment paragraphs of advice about what to do with your company. Should be fun to write | |
# Pay Analysis --- Tells you if you are paying your employees too much on average | |
# Rec Price, etc | |
# | |
# ADD Company projection analysis. - a.e."you will run out of RMs in 1.23 days, consider purchasing more..." | |
# "you have less than 2 days projected salary in the account, consider investing more..." | |
# | |
# | |
# REMEMBER : Sales revenue - Cost of Goods Sold = Gross Profit - Operating Expenses = Net Income / loss | |
# To add income esq statements a time variable will need to be added. That will take consider time to program and will | |
# require the program to have been run atleast 1 time previously. I am also assuming this will need lists/dictionaries/databases/files/directores/etc | |
# | |
def WGMCalc(): | |
print "\n\n" + "Welcome to the Erepublik Company Analyiser for General Managers\n\ | |
I really dont like that name, but anyway.\n\ | |
In A second you will be able to chose from our\n\ | |
4 different menus of forms and reports. Each Sub-menu\n\ | |
has its own forms within for you to chose from. This is\n\ | |
is because its much easier and faster for you to just\n\ | |
pick exactly what you need instead of having to fill in\n\ | |
all the information everytime.\n\n\ | |
Now, not all of these functions/forms work properly.\n\ | |
Everything is still be tested, and your feedback is\n\ | |
appreciated.\n\n\ | |
As of Right now the program does ask you for a lot\n\ | |
of information depending on the form you chose.\n\ | |
This was not my original intention and I am aiming\n\ | |
to fix this as soon as I am able.\n\n\ | |
The two main ways I will do this is by having the\n\ | |
ability to 'save' and 'load' a company after the info\n\ | |
has been placed previously, and evetually to have the\n\ | |
program sync itself with the erepublik servers." | |
raw_input("\n" + "Press Enter to Continue\n") | |
print """ | |
If this is your first time Using the GM Company Analysis side | |
of the Productivity Calculator then you are required to first | |
fill out all the needed data from your company so they can be | |
applied to all the forms and reports. This ia a recent design | |
change from the previous, but in the long run will be very | |
benefical, as you wont have to type on this data every time | |
you wish to print or view another form or report. The program | |
should check to see if your data file has been created for | |
your company after you input the company name, but it is | |
important that you use the same company name everytime. | |
Thank you """ | |
raw_input("\n" + "Press Enter to Continue\n\n") | |
GMCalc() | |
def GMCalc(): | |
CoID = raw_input(""" | |
What is the Company Name, Prefix, nick, or ID? | |
You may shorten the name if you wish, but this always has to be the same. | |
This number/name will identify your company data for future use, dont forget it :: """) | |
print "\t\t\n\n Your Company ID is ",CoID,"\n\n" | |
c = os.path.isfile("./Company_Data/%s.dat" %CoID) | |
if c is True: | |
print c | |
print "\nThis company is already stored and is being loaded\n" | |
time.sleep(1) | |
LoadCompany(CoID) | |
elif c is False: | |
print "\nThis Company does not yet exist\n Creating File..." | |
time.sleep(1) | |
CreateCompany(CoID) | |
#print "\n an Error Occured, most likely because this file/company ID doesnt' exist. Creating one now" | |
#time.sleep(1) | |
#CreateCompany(CoID) | |
#else: | |
# CreateCompany(CoID) | |
# #print "error",time.sleep(.43),"...",time.sleep(.43),"error",time.sleep(.43),"..." | |
# #print "\n\n\n\n" | |
# #GMCalc() | |
summary = input("\n\n" + "Select your account summary type.\n\n" + \ | |
"Press (1) for A Complete and Detailed Company Analysis Form\n" \ | |
+ "\nPress (2) for Financial Reports\n\n" + "Press (3) for Managment Reports\n\n" + "Press (4) for Special Reports\n" + "\nPress (0) to Go Back to the User Type Selection Menu\n\n\n") | |
### | |
#- Detailed and Basic Summary run the same program, the only difference comes later when it tells how much to print to file, and | |
## how much information to give the user. I found it easier to code it this way, then to double it all like i did for the Employee Calculator | |
### | |
if summary == 1: | |
print"\n\n\nAs of right now the full employee report is undergoing a huge overhaul and will be here for the next version." | |
#FullCoR() | |
Reload() | |
elif summary == 2: | |
FinMenu() | |
elif summary == 3: | |
ManMenu() | |
elif summary == 4: | |
SpeMenu() | |
elif summary == 0: | |
start() | |
#################################################################################### | |
###### Chart of Accounts and Variable Meaning for GM Functions and Formulas ######## | |
#### | |
### @@ Variables @@ | |
### - ProjAnl = Project Analysis | |
### - CoN = Company Name | |
### - CQ = Company Quality | |
### - CE = Company Employees | |
### - RE = Recommended Employee Formula Multiplication Factor | |
### - REA = Recommended Amount of Employees per Industry | |
### - RP = Regional Productivity | |
### - industry = Amount of Productivity "units" or points needed to create one product | |
### - CEH = Skill of the Highest Skilled Active Employee in the Company. | |
### - CEL = Skill of the Lowest Skilled Active Employee in the Company. | |
### - AEA = Estimated Average Employee Activity Percentage (Represented//Input in Decimal Form) | |
### - CoG = Amount of Gold in Company Account | |
### - CoC = Amount of Local Currency in Company Account | |
### - Cos = Amount of Stock/Product the Company has on hand | |
### - CoRM = Amount of Raw Materials the Company has on hand | |
### - CoE = Amount of Company Export Licenses | |
### - CoF = Amount of Foreign Currency in the Company Accounts | |
### - CoLi = Company Liabilities/Debts (either true or false) | |
### - CoLiG = Company Debt in GOLD | |
### - CoLiC = Company Debt in Local Currency | |
### - CQW = Company Quality Worth or the amount spent/needed to upgrade to a specific quality. | |
### - CQRM = Company Quality to Raw Materials Needed Modifier/Variable | |
### | |
### | |
### | |
### @@ Formulas @@ | |
### - CoEnW = Computes Employee Net Worth | |
### - CoDe = Computes Company Depreciation | |
### - CompanyWorthG = Computes Companies Net worth in GOLD | |
### - CoAES = Companies Average Employee Skill | |
### - CoAW = Companies Estimated Average Wellness | |
### - CoEP = Average Employee Estimated Productivity | |
### - CoEP2 = Estimated Company Productivity for one business day with 100 Employee Presense | |
### - CoEP3 = Estimated Company Productivity for one business day with Estimated Employee Activity Averaged in | |
### - CoMRM = Computes the Min amount of Raw Materials Needed per business day to have all employees work | |
### - | |
### | |
def FullCoR(): | |
print "\t\t\t\t\t\tFull Report\n\n" | |
print "You are now about to Create your Company profile. After Completely all the questions asked this file will be used for later\ | |
reference whenever you wish to create a new form.\ | |
It is recommended that you update the data of this file evertime you logon to the program,\ | |
but atm the update function is not currently functional and all the info will need to be entered each time.\n\n" | |
#ProjAnl = input("Would you like Projection Analysis added to this report?\n (1 for yes and 2 for no) \n") | |
print "\n\n\nCompany/Employee Information :: \n" | |
CoN = raw_input("\nPlease type the Company Name Here. :") | |
CQ = input("Company Quality: ") | |
if CQ == 1: | |
CQ = 1 | |
elif CQ == 2: | |
CQ = .50 | |
elif CQ == 3: | |
CQ = .33 | |
elif CQ == 4: | |
CQ = .25 | |
elif CQ == 5: | |
CQ = .20 | |
elif CQ > 5: | |
print "Your Lying...\n" | |
CQ = input("What is the Actual Company Quality: ") | |
if CQ > 5: | |
print "If you do not stop, i swear \n" | |
CQ = input("Now, What is the REAL Company Quality? : ") | |
if CQ > 5: | |
CQ = input("Tell ME THE COMPANY QUALITY!! : ") | |
if CQ > 5: | |
print "die now \n" | |
print "..hrmm.. what number am I thinking of?" | |
z = raw_input(".... its 1 out of 1000") | |
rz = random.randint(100,500) | |
if z is not rz: | |
print "I'm sorry, but you lose..." | |
time.sleep(2) | |
for z in range(0,rz): | |
t = "\t" | |
s = 1 + z | |
if s >= 500: | |
s = 1 | |
ts = t + s | |
print "\n" + ts ,rz,"was the right answer" | |
print "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" | |
start() | |
elif z is rz: | |
print " you are amazing... PM me for your 100 GOLD prize" | |
time.sleep(2) | |
FullCoR() | |
elif CQ == 5: | |
CQ = .20 | |
elif CQ == 5: | |
CQ = .20 | |
elif CQ == 5: | |
CQ = .20 | |
if CQ == 1: | |
CQW = 1 ## Company Quality Worth (as in how much gold it costs to upgrade) | |
CQRM = 1 ## Company Quality Modifier to Calculate the use of Raw Materials | |
RMCQ = 1 ## Raw Material Company Quality Modifier | |
elif CQ == .50: | |
CQW = 20 | |
CQRM = 2 | |
RMCQ = .9 | |
elif CQ == .33: | |
CQW = 50 | |
CQRM = 3 | |
RMCQ = .8 | |
elif CQ == .25: | |
CQW = 100 | |
CQRM = 4 | |
RMCQ = .7 | |
elif CQ == .20: | |
CQW = 200 | |
CQRM = 5 | |
RMCQ = .6 | |
CE = input("Company Employees: ") | |
## Assigns the proper productivity requirements for each industry and | |
## assigns the recommended Employee number. | |
## [Raw Material Industries make everything annoying and complicated] | |
industry1 = raw_input("Company Industry \n(gifts, food, weapons, housing, moving, hospitals, defense,\ | |
diamonds,wood,grain,oil,iron)\n :: ") | |
if industry1 == "gifts": | |
industry = 2.0 | |
RE = .10 | |
REA = 10 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "food": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "weapons": | |
industry = 5.0 | |
RE = .10 | |
REA = 10 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "housing": | |
industry = 200.0 | |
RE = .05 | |
REA = 20 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "moving": | |
industry = 10.0 | |
RE = .10 | |
REA = 10 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "hospitals": | |
industry = 2000.0 | |
RE = .05 | |
REA = 20 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "defense": | |
industry = 2000.0 | |
RE = .05 | |
REA = 20 | |
RP = 1 | |
SM = 1 | |
elif industry1 == "diamonds": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
SM = 2 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "wood": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
SM = 2 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "grain": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
SM = 2 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "oil": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 == "iron": | |
industry = 1.0 | |
RE = .10 | |
REA = 10 | |
SM = 2 | |
RP = input("What is our Regional Productivity? 0.01 = low, 1 = Medium, and 2 = High : ") | |
elif industry1 is not "gifts" or "food" or "weapons" or "housing" or "moving" or "hospitals" or "Defense" or "wood" or "grain" or "oil" or "iron" or "diamonds": | |
print '''\nI'm sorry That wasn't a recognized industry. Please type either\n "gifts" or "food" or "weapons" or "housing" or "moving" or "hospitals" or "Defense" or "wood" or "grain" or "oil" or "iron" or "diamonds"''' | |
time.sleep(2) | |
FullCoR() | |
CEH = input("What is the Skill of the Highest Skilled active worker in the company : ") | |
CEL = input("What is the Skill of the Lowest Skilled active worker in the company : ") | |
AEA = input("Average Employee Activity/presence.\n (In decimal form, aka 1=100%,.25=25%) : ") | |
print "\n\nMoney and Asset Information :: \n" | |
CoG = input("Company Account in GOLD :") | |
CoC = input("Company Account in Local Currency : ") | |
CoS = input("Current Stock of Product : ") | |
CoRM = input("Current Stock of Raw Materials : ") | |
AGP = input("What is the lowest market price for this product? : ") | |
CoE = input("Amount of Company Export Licenses : ") | |
if CoE >= 1: | |
CoF = input(" Current Amount of Foreign Currencies : ") | |
elif CoE <= 0: | |
CoF = 1 | |
CoLi = input("Does the Company have any outstanding debt or loans that need to be paid back?\n (Enter 0 for No, and 1 for Yes)") | |
if CoLi == 1: | |
CoLiG = input(" In GOLD : ") | |
CoLiC = input(" In Local Currency : ") | |
elif CoLi == 0: | |
CoLiG = 0 | |
CoLiC = 0 | |
#CoPs = raw_input("What is the Companies Pay Scale?\n \ | |
#- Minimum :: 2 * skill\n \ | |
#- Productivity :: minimum pay scale wage < Employee Pay < Productivity Break Even Point\n\ | |
#- Mixed :: Some combination of the two\n \ | |
#(Please Note answer is case specific and should be either Minimum, Mixed, or Productivity)\n") | |
# Calculates the Company Quality Worth | |
try: | |
global CoN | |
global CQ | |
global CE | |
global industry | |
global industry1 | |
global RE | |
global REA | |
global RP | |
global CEH | |
global CEL | |
global AEA | |
global CoG | |
global CoC | |
global CoS | |
global CoRM | |
global AGP | |
global CoE | |
global CoF | |
global CoLi | |
global CoLiG | |
global CoLiC | |
global CQW | |
global CQRM | |
global RMCQ | |
global SM | |
except: | |
None | |
# I think thats everything, lol | |
# End of the Full Company Report Function | |
# | |
############################################################### | |
################################################################ | |
################## Menu Functions ############################## | |
############################################################### | |
##############================================================ | |
def FinMenu(): | |
print "Financial Reports Menu" | |
print "\n\n Please Select Your Desired Financial Report, Summary, Estimate,\ | |
Analysis, or Figure. As you can tell the name really doesn't matter.Call it whatever you wnat just pick one" | |
FinRep = input("\n\n\t-Press (1) for Profit/Loss Analysis\n\n\t\ | |
-Press (2) for Pay/Salary Analysis\n\n\t\ | |
-Press (3) for Company Net Worth Estimate\n\n\t-Press (4) for Company Income Projection\n\n\ | |
-Press (0) to go back to the General Manager Main Menu\n") | |
if FinRep == 1: | |
PLAnl() | |
elif FinRep == 2: | |
PSAnl() | |
elif FinRep == 3: | |
CoNW() | |
elif FinRep == 4: | |
CoIProj() | |
elif FinRep == 0: | |
GMCalc() | |
def ManMenu(): | |
print "\nManagement Reports Menu" | |
#time.sleep(.5) | |
#print "..." | |
#time.sleep(.5) Entirely Pointless So I took it out, but basically it just delayed the program to give the effect | |
#print "....." that it was processing the needed data or loading the new menu. | |
#time.sleep(.5) | |
#print "........." | |
print "\n\n Please Select Your Desired Management Form, Report, or what-have-you." | |
print "\n All of the Management forms are here to advise you on what the best\n\ | |
course of action to take in regards to Raw Materials, Employees,\n\ | |
stock, and export licenses.\n\n\ | |
It is important to note that for the beta version of this program\n\ | |
The functionality and information given from these forms is limited\n\ | |
The plan is for these forms to eventually serve an active part in \n\ | |
management of your company,employees, and resources. Thankyou\n" | |
ManRep = input("\n\n\t-Press (1) for Raw Materials Management Form\n\n\t\ | |
-Press (2) for Employee Management Form\n\n\t\ | |
-Press (3) for Stock--Price Management\n\n\ | |
-Press (0) to go back to the General Manager Main Menu\n") | |
if ManRep == 1: | |
RMMf() | |
elif ManRep == 2: | |
EMf() | |
elif ManRep == 3: | |
SPMf() | |
elif ManRep == 0: | |
GMCalc() | |
def SpeMenu(): | |
print "\nSpecial Reports Menu" | |
print "\n\n Please Select your Special Report of Choice." | |
SpeRep = input("\n\n\t-Press (1) for 'EasyWiki' Report\n\n\t\ | |
-Press (2) for the Comparative Analysis Form\n\n\t\ | |
-Press (3) To Re-Enter your Company Data\n\n\ | |
-Press (0) to go back to the General Manager Main Menu\n") | |
if SpeRep == 1: | |
EzWiki() | |
elif SpeRep == 2: | |
CoCAf() | |
elif SpeRep == 3: | |
print "\n\n\n\ | |
I'm working on this atm\n\ | |
for now just go to Company_Data and delete the .dat\n\ | |
file with the company id of the company you want to edit.\n\ | |
Then start the program again." | |
Reload() | |
elif SpeRep == 0: | |
GMCalc() | |
##____________________________________________ | |
###End Of Menus | | |
####========================================== | |
####Start of Individual Function//Forms | |
###Financial Forms/Functions | |
##-------------------------------------------- | |
def PLAnl(): | |
# By Nature a Profit/Loss or Income Statement requires and assumes the passage of time and as such this really wont work right until that has been enabled. | |
print "\nProfit/Loss or Income Analysis" | |
print "\n\nA Note to Everyone:\n The following is the best Income Analysis I am able to give you with the data available.\n\ | |
unfortunatelly, without someway of accounting for the passage of time, and/or\n the different values of all the accounts during\ | |
a specific period. It just\n isn't entirely possible. Again I am doing my best, and I am working on improving this functionality.\n\ | |
For now just use the Company Income Projection Analysis\n ty" | |
time.sleep(.4) | |
raw_input("Enter to Continue\n\n\n") | |
Reload() | |
def PSAnl(): | |
print "\nPay/Salary Analysis" | |
time.sleep(.3) | |
print "\n\nPlease note that the following information are estimated guidlines and to not 100% accurately depict the salaries you\ | |
pay at your company.The estimations are made to the best of my abilities and are still useful for decision and advisory purposes." | |
time.sleep(1.5) | |
CoPs = input("\nWhat is the Companies Pay Scale?\n\n\ | |
- Press (1) for Minimum Business Wage Scale :: 2 * Skill\n\ | |
- Press (2) for Productivity Wage Scale :: Productivity * 40%-80%\n\ | |
- Press (3) for a Custom System :: Pie >< Cake\n\n\ | |
- Press (0) To Go Back\n\n") | |
if CoPs == 1: | |
CoPM() | |
elif CoPs == 2: | |
CoPP() | |
elif CoPs == 3: | |
CoPMi() | |
elif CoPs == 0: | |
FinMenu() | |
Reload() | |
###--------- Sub Functions :: Or Functions of The PSAnl Function ------------### | |
def CoPM(): | |
print "Minimum" | |
print "Please fill out all of the following info to the best of your ability to get the most accurate pay\n\n" | |
CoAES = ((CEH + CEL) / 2)#Companies Average Employee Skill is factoring by taking the Highest Skill in the company averaged with the lowest possible skilled Employee | |
CoAW = ((random.randint(74,99) * CE) / CE)#Estimates the Average Employees Wellness of a Factor between 73 and 98;; not the most accurate form, but suitable. | |
CoEP = EmpProd(CoAES,CoAW,CQ,CE,RE,RP,REA,SM,RMCQ) | |
# for employees in range(0,CE): | |
# x = 1 | |
# z = x + employees | |
# if z >= CE: | |
# z = CE | |
# zx = z | |
# CoAP = CoEP + zx | |
# break | |
CoAP = (CE * CoEP) #Company Average Productivity = CompanyEmployeeProductivity * Company Employees | |
CEHP = CEH * 2 | |
CELP = CEL * 2 | |
CEAP = CoAES * 2 # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< OMG :: that is the reason I was having all this trouble -__-" and i never saw it (It was named CoAP instead of CEAP) | |
CoEAP = (CEHP + CELP + CEAP) / 3.0 | |
Units = ((CoAP) / industry) | |
#CoEPpD = CEHP + CELP + (CoAP * (CE - 2)) ## This was some crazy formula to combat the low CoAP but since that is fixed i took it out | |
CoAPpD = CoEAP * CE | |
StockW = Units * AGP | |
NEarn = StockW - CoAPpD | |
print "\n\n" | |
print "Employee Pay Analysis Using the Minimum Wage Standard\n" | |
print "\n Your Highest Paid Employee Makes \t", CEHP, "USD a Day" | |
print "\n Your Lowest Paid Employee Makes \t", CELP, "USD a Day" | |
print "\n Your Average Paid Employee Makes \t", CEAP, "USD a Day" | |
print "\n Your Total Employee Pay out is \t", CoAPpD, "USD per Day" | |
print "\n\nYour Company Produces an Estimated", Units , industry1, "per Day. With a worth of ", StockW | |
print "\n-Average Employee Productivity is", CoEP, "and Company Average is",CoAP, "\n" | |
print "\nAfter daily salaries your company has a net earning of\n", NEarn | |
print "\nRemember that this number does not reflect cost of RMs purchased." | |
print "\n\nYour information is being written to file now." | |
f = open("%s %s-PayScale-Min.txt" %(FRPath,CoN), "w") | |
f.write("\n"+ str(CoN) + " Q"+str(CQRM)+ str(industry1)+" Company") | |
p = "Pay/Salary Analysis - Minimum" | |
f.write("\n\n" + str(p)) | |
f.write("\n\nHighest Skilled Employee Skill :: " + str(CEH)+"\n\ | |
Lowest Skilled Employee Skill :: " + str(CEL) + "\n\ | |
Average Employee Skill :: " + str(CoAES)) | |
f.write("\n\n\n" + " Your Highest Paid Employee Makes \t"+ str(CEHP)+ "USD a Day") | |
f.write("\n Your Lowest Paid Employee Makes \t"+ str(CELP)+ "USD a Day") | |
f.write("\n Your Average Paid Employee Makes \t"+ str(CEAP)+ "USD a Day") | |
f.write("\n Your Total Employee Pay out is \t"+ str(CoAPpD)+ "USD per Day") | |
f.write("\n\nYour Company Produces an Estimated "+ str(Units) +" "+ str(industry1)+ " per Day. With a worth of "+ str(StockW)) | |
f.write("\nAverage Employee Productivity is "+ str(CoEP)+ " and Company Average Productivity is "+str(CoAP)+ "\n") | |
f.write("\nAfter daily salaries your company has a net earning of\n "+ str(NEarn)) | |
if NEarn <=0: | |
f.write( "Unfortunetally att The Current Market Selling Price You Are Losing Money on each product sold\n") | |
f.write("We advise you to either wait until market conditions improve. (prices raise)") | |
f.write("or lower your employees salaries.") | |
f.write("\nRemember that this number does not reflect cost of RMs purchased.") | |
f.write("\n\n\n\nPlease note that the following information are estimated guidlines and to not 100% accurately depict the salaries you\ | |
pay at your company. Although these estimations are made to the best of my abilities and are still extremely useful, accurate, and good for decision/advisory purposes. They are not 100% percise and are not to be assumed as such.") | |
f.write(str(Version)) | |
f.close() | |
time.sleep(1.5) | |
print "\n\n...Your File is Complete\n" | |
def CoPP(): | |
print "Productivity" | |
print "Please fill out all of the following info to the best of your ability to get the most accurate pay form\n\n" | |
PS = input("What is your productivity to pay ratio? Pick any thing between .05 and 1.0, but recommended is between .40 and .90\n : ") | |
CoAES = ((CEH + CEL) / 2)#Companies Average Employee Skill is factoring by taking the Highest Skill in the company averaged with the lowest possible skilled Employee | |
CoAW = ((random.randint(74,99) * CE) / CE)#Estimates the Average Employees Wellness of a Factor between 73 and 98;; not the most accurate form, but suitable. | |
CoEP = EmpProd(CoAES,CoAW,CQ,CE,RE,RP,REA,SM,RMCQ) | |
CoAP = (CE * CoEP) #Company Average Productivity = CompanyEmployeeProductivity * Company Employees | |
CEHP = EmpProd(CEH,CoAW,CQ,CE,RE,RP,REA,SM,RMCQ) # Calculates highest skilled employees Productivity | |
CEHPp = CEHP / industry | |
CEHPps = ((CEHPp * AGP) * PS) | |
CELP = EmpProd(CEL,CoAW,CQ,CE,RE,RP,REA,SM,RMCQ) # Calculates lowest skilled employees Productivity. | |
CELPp = CELP / industry ### Finds the amount of products they make per day. | |
CELPps = ((CELPp * AGP) * PS) ### Finds out how much they make the company per day. | |
CEAP = EmpProd(CoAES,CoAW,CQ,CE,RE,RP,REA,SM,RMCQ) # Calculates lowest skilled employees Productivity. | |
CEAPp = CEAP / industry ### Finds the amount of products they make per day. | |
CEAPps = ((CEAPp * AGP) * PS) ### Finds out how much they make the company per day. | |
CoEAP = ((CEHPps + CELPps + CEAPps) / 3.0) | |
Units = ((CEHP+CELP+(CEAP *(CE-2))) / industry) | |
#CoEPpD = CEHP + CELP + (CoAP * (CE - 2)) ## This was some crazy formula to combat the low CoAP but since that is fixed i took it out...kinda | |
CoAPpD = CoEAP * CE ### Company Estimated Pay Per Day | |
StockW = Units * AGP ### Worth of Stock produced per day | |
NEarn = StockW - CoAPpD ### Net Earnings from worth of stock after price of goods is removed. | |
print "\n\n" | |
print "Employee Pay Analysis Using the Minimum Wage Standard\n" | |
print "\n Your Highest Paid Employee Has a Productivity of \t", CEHP, " a Day.\n\ | |
Producing ",CEHPp," ", industry1, " a Day. Employee Pay is\t", CEHPps | |
if CEHPps < (CEH * 2): | |
print "\n Warning:: Your Employee is Making Less than Economic Fair Practice Suggests of 2 * Skill at this rate." | |
print "\n Your Lowest Paid Employee Has a Productivity of \t", CELP, " a Day.\n\ | |
Producing ",CELPp," ", industry1, " a Day. Employee Pay is \t", CELPps | |
if CELPps < (CEL * 2): | |
print "\n Warning:: Your Employee is Making Less than Economic Fair Practice Suggests of 2 * Skill at this rate." | |
print "\n Your Average Paid Employee Has a Productivity of \t", CEAP, " a Day.\n\ | |
Producing ",CEAPp," ", industry1, " a Day. Employee Pay is\t", CEAPps | |
if CEAPps < (CoAES * 2): | |
print "\n Warning:: Your Employee(s) is(are) Making Less than Economic Fair Practice Suggests of 2 * Skill at this rate." | |
print "\n Your Total Employee Pay out is \t", CoAPpD, "USD per Day" | |
print "\n\nYour Company Produces an Estimated", Units ," ", industry1, " per Day. With a worth of ", StockW | |
print "\n-Average Employee Productivity is", CoEAP, "and Company Average is",CoAP, "\n" | |
print "\nAfter daily salaries your company has a net earning of\n", NEarn | |
print "\nRemember that this number does not reflect cost of RMs purchased." | |
R = input("Would you like to try a different Productivity to pay ratio before writing the report to file?\nPress (1) for Yes\nPress (2) for no\n,") | |
if R == 1: | |
CoPP() | |
if R == 2: | |
pass | |
print "\n\nYour information is being written to file now." | |
f = open("%s %s-PayScale-Productivity.txt" %(FRPath,CoN), "w") | |
f.write("\n"+ str(CoN) + " Q"+str(CQRM)+ str(industry1)+" Company") | |
p = "Pay/Salary Analysis - Productivity" | |
f.write("\n\n" + str(p)) | |
f.write("\nYour Productivity to Pay ratio is " + str(PS)) | |
f.write( "\nEmployee Pay Analysis Using the Productivity Method\n") | |
f.write("\n\nHighest Skilled Employee Skill :: " + str(CEH)+"\n\ | |
Lowest Skilled Employee Skill :: " + str(CEL) + "\n\ | |
Average Employee Skill :: " + str(CoAES)) | |
f.write( "\n\n\nYour Highest Paid Employee Has a Productivity of \t"+ str(CEHP)+ " a Day.\n\ | |
Producing "+str(CEHPp)+" "+ str(industry1)+ " a Day. Employee Pay is \t"+ str(CEHPps)) | |
if CEHPps < (CEH * 2): | |
f.write( "\n Warning:: Your Employee is Making Less than Economic Fair Practice Suggests of 2 * Skill at this rate.\n") | |
f.write( "\nYour Lowest Paid Employee Has a Productivity of \t"+ str(CELP)+ " a Day.\n\ | |
Producing "+str(CELPp)+" "+ str(industry1)+ " a Day. Employee Pay is \t"+ str(CELPps)) | |
if CELPps < (CEL * 2): | |
f.write( "\n Warning:: Your Employee is Making Less than Economic Fair Practice Suggests of 2 * Skill at this rate.\n") | |
f.write( "\nYour Average Paid Employee(s) Have a Productivity of \t"+ str(CEAP)+ " a Day.\n\ | |
Producing "+str(CEAPp)+" "+ str(industry1)+ " a Day. Employee Pay is \t"+ str(CEAPps)) | |
if CEAPps < (CoAES * 2): | |
f.write( "\n Warning:: Your Employee(s) is(are) Making Less than Economic Fair Practice Suggests of 2 * Skill at this rate.\n") | |
f.write( "\n Your Total Employee Pay out is \t"+ str(CoAPpD)+ "USD per Day") | |
f.write( "\n\nYour Company Produces an Estimated "+ str(Units) +" "+ str(industry1)+ " per Day. With a worth of "+ str(StockW)) | |
f.write( "\nAverage Employee Productivity is "+ str(CoEAP)+ " and Company Average is "+str(CoAP)+ "\n") | |
f.write( "\nAfter daily salaries your company has a net earning of\n "+ str(NEarn)) | |
if NEarn <=0: | |
f.write( "Unfortunetally att The Current Market Selling Price You Are Losing Money on each product sold\n") | |
f.write("We advise you to either wait until market conditions improve. (prices raise)") | |
f.write("or lower your employees salaries.") | |
f.write("\nRemember that this number does not reflect cost of RMs purchased.") | |
f.write("\n\n\n\nPlease note that the following information are estimated guidlines and to not 100% accurately depict the salaries you\ | |
pay at your company. Although these estimations are made to the best of my abilities and are still extremely useful, accurate, and good for decision/advisory purposes. They are not 100% percise and are not to be assumed as such.") | |
f.write(str(Version)) | |
f.close() | |
time.sleep(1.5) | |
print "\n\n...Your File is Complete\n" | |
def CoPMi(): | |
print "Custom Pay Scale" | |
print "Please fill out all of the following info to the best of your ability to get the most accurate pay analysis\n\n" | |
### | |
# Ideas for Company thingy... | |
# Create an additional function to be called every time the Gm wants to add another employee to the spreadsheet. | |
# Have another database file holding the employee pay information for later reference in the program and stuff. | |
# I could also simply add the entries to the original db file I suppose? | |
de = input("Press (2) for an estimate") | |
if de == 1: | |
CoPMi() | |
CEHS = input("What is the Actual Salary of your Highest Skilled Employee? :") | |
CEA = input("What is the next Highest paid employee's salary? :") | |
while employees <= CE-1: | |
AE = input("would you like to add another employee? Press (1) for yes and (2) for no") | |
if AE == 1: | |
x += 1 | |
CE | |
[x] = input("What is the salary of the next highest paid employee? :") | |
CELS = input("What is the Actual Salary of your Lowest Skilled Employee? :") | |
CoAES = ((CEH + CEL) / 2)#Companies Average Employee Skill is factoring by taking the Highest Skill in the company averaged with the lowest possible skilled Employee | |
CoAW = ((random.randint(74,99) * CE) / CE)#Estimates the Average Employees Wellness of a Factor between 73 and 98;; not the most accurate form, but suitable. | |
CoEP = EmpProd(CoAES,CoAW,CQ,CE,RE,RP,REA,SM,RMCQ) | |
#CoAP = (CE * CoEP) #Company Average Productivity = CompanyEmployeeProductivity * Company Employees | |
#CEAP = ((CEHS + CELS) / 2) #Calculates Employee Average pay, but is not needed because of the for loop above | |
#CoEAP = (CEHP + CELP + CEAP) / 3.0 | |
#Units = ((CoAP) / industry) | |
#CoAPpD = CoEAP * CE | |
#StockW = Units * AGP | |
#NEarn = StockW - CoAPpD | |
print CEA | |
print "\n\n" | |
print "Employee Pay Analysis Using the Detailed Custom Wage Standard\n" | |
print "\n Your Highest Paid Employee Makes \t", CEHS, "USD a Day" | |
print "\n Your Lowest Paid Employee Makes \t", CELS, "USD a Day" | |
print "\n Your Average Paid Employee Makes \t", CEAP, "USD a Day" | |
print "\n Your Total Employee Pay out is \t", CoAPpD, "USD per Day" | |
print "\n\nYour Company Produces an Estimated", Units , industry1, "per Day. With a worth of ", StockW | |
print "\n-Average Employee Productivity is", CoEP, "and Company Average is",CoAP, "\n" | |
print "\nAfter daily salaries your company has a net earning of\n", NEarn | |
if NEarn <=0: | |
print "Unfortunetally att The Current Market Selling Price You Are Losing Money on each product sold\n" | |
print "We advise you to either wait until market conditions improve. (prices raise)" | |
print "or lower your employees salaries." | |
print "\nRemember that this number does not reflect cost of RMs purchased." | |
print "\n\nYour information is being written to file now." | |
f = open("%s %s-PayScale-Custom.txt" %(FRPath,CoN), "w") | |
f.write("\n"+ str(CoN) + " Q"+str(CQRM)+ str(industry1)+" Company") | |
p = "Pay/Salary Analysis - Custom:Detailed" | |
f.write("\n\n" + str(p)) | |
f.write("\nHighest Skilled Employee Skill :: " + str(CEH)+"\n\ | |
Lowest Skilled Employee Skill :: " + str(CEL) + "\n\ | |
Average Employee Skill :: " + str(CoAES)) | |
f.write("\n\n\n" + " Your Highest Paid Employee Makes \t"+ str(CEHS)+ "USD a Day") | |
f.write("\n Your Lowest Paid Employee Makes \t"+ str(CELS)+ "USD a Day") | |
f.write("\n Your Average Paid Employee Makes \t"+ str(CEAP)+ "USD a Day") | |
f.write("\n Your Total Employee Pay out is \t"+ str(CoAPpD)+ "USD per Day") | |
f.write("\n\nYour Company Produces an Estimated "+ str(Units) +" "+ str(industry1)+ " per Day. With a worth of "+ str(StockW)) | |
f.write("\nAverage Employee Productivity is "+ str(CoEP)+ " and Company Average Productivity is "+str(CoAP)+ "\n") | |
f.write("\nAfter daily salaries your company has a net earning of\n "+ str(NEarn)) | |
if NEarn <=0: | |
f.write( "Unfortunetally att The Current Market Selling Price You Are Losing Money on each product sold\n") | |
f.write("We advise you to either wait until market conditions improve. (prices raise)") | |
f.write("or lower your employees salaries.") | |
f.write("\nRemember that this number does not reflect cost of RMs purchased.") | |
f.write("\n\nPlease note that the following information are estimated guidlines and to not 100% accurately depict the salaries you\ | |
pay at your company. Although these estimations are made to the best of my abilities and are still extremely useful, accurate, and good for decision/advisory purposes. They are not 100% percise and are not to be assumed as such.") | |
f.write("\n Created with Justinious's Productivity Business Calculator Beta V0.3.5") | |
f.close() | |
time.sleep(1.5) | |
print "\n\n...Your File is Complete\n" | |
elif de == 2: | |
CEHS = input("\nWhat is the Actual Salary of your highest Paid employee? :") | |
CELS = input("What is the Actual Salary of your lowest Paid employee? :") | |
CoAES = ((CEH + CEL) / 2)#Companies Average Employee Skill is factoring by taking the Highest Skill in the company averaged with the lowest possible skilled Employee | |
CoAW = ((random.randint(74,99) * CE) / CE)#Estimates the Average Employees Wellness of a Factor between 73 and 98;; not the most accurate form, but suitable. | |
CoEP = EmpProd(CoAES,CoAW,CQ,CE,RE,RP,REA,SM,RMCQ) | |
CoAP = (CE * CoEP) #Company Average Productivity = CompanyEmployeeProductivity * Company Employees | |
CEAP = ((CEHS + CELS) / 2) ## Calculates Average employee pay | |
CoEAP = ((CEHS + CELS + CEAP) / 3.0) ### Calcs; Estimates Average Employee Pay by averging the average pay with the highest and lowest pay, gives a weighted and more accurate average | |
Units = ((CoAP) / industry) #Units Produced by dividing company productivity industry... | |
#CoEPpD = CEHP + CELP + (CoAP * (CE - 2)) ## This was some crazy formula to combat the low CoAP but since that is fixed i took it out | |
CoAPpD = CoEAP * CE ## Company Average Pay per Day is calculated by multiplying average estimated employee pay per day times the amount of people in the company | |
StockW = Units * AGP ### Stock Worth is computed by taking into account the amount of stock produced per day times the Average Gross Product Price as determined by the Employer | |
NEarn = StockW - CoAPpD ### Net Earnings are computed by subtracting estimated salaries per day from the net worth of the stock produced per day. | |
#^^^ If this is a negative number it is very very bad. | |
print "\n\n" | |
print "Employee Pay Analysis Using the Estimated Custom Wage Standard\n" | |
print "\n Your Highest Paid Employee Makes \t", CEHS, "USD a Day" | |
print "\n Your Lowest Paid Employee Makes \t", CELS, "USD a Day" | |
print "\n Your Average Paid Employee Makes \t", CEAP, "USD a Day" | |
print "\n Your Total Employee Pay out is \t", CoAPpD, "USD per Day" | |
print "\n\nYour Company Produces an Estimated", Units , industry1, "per Day. With a worth of ", StockW | |
print "\n-Average Employee Productivity is", CoEP, "and Company Average is",CoAP, "\n" | |
print "\nAfter daily salaries your company has a net earning of\n", NEarn | |
if NEarn <=0: | |
print "Unfortunetally att The Current Market Selling Price You Are Losing Money on each product sold\n" | |
print "We advise you to either wait until market conditions improve. (prices raise)" | |
print "or lower your employees salaries." | |
print "\nRemember that this number does not reflect cost of RMs purchased." | |
print "\n\nYour information is being written to file now." | |
f = open("%s %s-PayScale-Custom.txt" %(FRPath,CoN), "w") | |
f.write("\n"+ str(CoN) + " Q"+str(CQRM)+ str(industry1)+" Company") | |
p = "Pay/Salary Analysis - Custom:Estimate" | |
f.write("\n\n" + str(p)) | |
f.write("\nHighest Skilled Employee Skill :: " + str(CEH)+"\n\ | |
Lowest Skilled Employee Skill :: " + str(CEL) + "\n\ | |
Average Employee Skill :: " + str(CoAES)) | |
f.write("\n\n\n" + " Your Highest Paid Employee Makes \t"+ str(CEHS)+ "USD a Day") | |
f.write("\n Your Lowest Paid Employee Makes \t"+ str(CELS)+ "USD a Day") | |
f.write("\n Your Average Paid Employee Makes \t"+ str(CEAP)+ "USD a Day") | |
f.write("\n Your Total Employee Pay out is \t"+ str(CoAPpD)+ "USD per Day") | |
f.write("\n\nYour Company Produces an Estimated "+ str(Units) +" "+ str(industry1)+ " per Day. With a worth of "+ str(StockW)) | |
f.write("\nAverage Employee Productivity is "+ str(CoEP)+ " and Company Average Productivity is "+str(CoAP)+ "\n") | |
f.write("\nAfter daily salaries your company has a net earning of\n "+ str(NEarn)) | |
if NEarn <=0: | |
f.write( "Unfortunetally att The Current Market Selling Price You Are Losing Money on each product sold\n") | |
f.write("We advise you to either wait until market conditions improve. (prices raise)") | |
f.write("or lower your employees salaries.") | |
f.write("\nRemember that this number does not reflect cost of RMs purchased.") | |
f.write("\n\nPlease note that the following information are estimated guidlines and to not 100% accurately depict the salaries you\ | |
pay at your company. Although these estimations are made to the best of my abilities and are still extremely useful, accurate, and good for decision/advisory purposes. They are not 100% percise and are not to be assumed as such.") | |
f.write(str(Version)) | |
f.close() | |
time.sleep(1.5) | |
print "\n\n...Your File is Complete\n" | |
###---------------- End of Sub Functions of PSAnl ---------------------------### | |
def CoNW(): | |
print "\nCompany Net Worth\n\n" | |
print "\nUsing the presumably accurate information you have given us we have established a basis for company worth in GOLD.\n\ | |
This number is not supposed to be an appropriate selling price,\n\ | |
but a picture of the success of the company and a GOLD conversion\n\ | |
total of all the assets after Liabilities and Debts have been subtracted.\n" | |
CoDe = CQRM/AEA * CoLiG + ((1-AEA)*CE) #Formula for Calculating Company Depreciation. | |
CoEnW = ((CE * ((CEH - CEL)/CQ)) * AEA) - (CE/REA) | |
#Formula for Computing Company Employee Net Worth | |
CompanyWorthG = CoG + (CoC * .021) + (CoE * 20) + (CoRM * .4) +((CoS * AGP) * .021) + (CoEnW / 1.5) + (CoF * 0.018) + (CQW) - (CoDe + (CoLiC *.021) + CoLiG + (CQW * .11)) | |
#CWG is GOLD + Local Currency + Export Licenses + RM Stock + Stock*averagePrice + Employee worth + Foreign Currency + CompanyQuality + - (Depreciation + Liabilities) | |
# Oddly enough the above formula isn't as "accurate" as the below one. | |
CoFAG = CoG + (CoC * .021) + (CoF * 0.018) #Company Worth from Accounts | |
CoSRMG = (CoRM * .4) +((CoS * AGP) * .021) #Company Worth from Stock and RMs | |
CoRAG = (CoE * 20) + (CoEnW / 1.5) # Random Assest type investments | |
CoEGWG = CoFAG + CoSRMG + CoRAG #TOTALS 4 ASSESTS | |
#--- | |
CoLiTG = ((CoLiC * .021) + CoLiG) | |
CoLii = (1 - AEA) + (CQW * .11) | |
CoETL = CoLiTG + CoLii | |
#--- | |
CoNWG = CoEGWG - CoETL | |
print "\nYour Company Assets\n======================================================================"# | |
print "\n Worth from Financial Accounts in GOLD \t\t", round(CoFAG,3)# | |
print "\n Worth derived from Stock and Raw Materials \t\t", CoSRMG# | |
print "\n Worth derived from Misc. Assets \t\t", round(CoRAG,3)# | |
print " (Export Licenses, Employee Worth, etc)"# | |
print "\n\n Estimated Total Gross Company Worth \t\t", round(CoEGWG,3)# | |
print "\nYour Company Debts and Liabilities\n==================================================================="# | |
print "\n Company Depreciation \t\t-", CoDe# | |
print "\n Company Debts \t\t-", CoLiTG# | |
print "\n Company Liabilities \t\t-", CoLii# | |
print "\n\n Estimated Total Company Liabilites \t\t-", round(CoETL,3)# | |
print "=============================================================================="# | |
print " Company Net Worth is \t", round(CoNWG,3), "GOLD" | |
time.sleep(2.5) | |
print "\n\n\n" | |
print " What this informations means is this.\n\ | |
When your company is in full production and has all the assets it does currently\n\ | |
your company is valued at the above number. A selling price for this company would\n\ | |
assume less than peak operating conditions and/or unfavorable market conditions which\n\ | |
would obviously run down the worth of your company. Think of this figure as an estimate\n\ | |
of how good your company is doing now compared to the past and compared to others."# | |
print "\nSaving..." | |
f = open("%s %s - Company Net Worth.txt" %(FRPath,CoN), "w") | |
f.write("\n"+ str(CoN) + " Q"+str(CQRM)+ str(industry1)+" Company") | |
p = "Estimate of Companies Net Worth by Computing Assests - Liabilities" | |
f.write("\n\n" + str(p)) | |
f.write( "\nYour Company Assets\n==============================================================================") | |
f.write( "\n Worth from Financial Accounts in GOLD \t\t"+ str(round(CoFAG+3))) | |
f.write( "\n Worth derived from Stock and Raw Materials \t\t"+ str(CoSRMG)) | |
f.write( "\n Worth derived from Misc. Assets \t\t"+ str(round(CoRAG+3))) | |
f.write( " \n(Export Licenses, Employee Worth, etc)") | |
f.write( "\n\n Estimated Total Gross Company Worth \t\t"+ str(round(CoEGWG+3))) | |
f.write( "\nYour Company Debts and Liabilities\n=============================================================================") | |
f.write( "\n Company Depreciation \t\t-"+ str(CoDe)) | |
f.write( "\n Company Debts \t\t-"+ str(CoLiTG)) | |
f.write( "\n Company Liabilities \t\t-"+ str(CoLii)) | |
f.write( "\n\n Estimated Total Company Liabilites \t\t-"+ str(round(CoETL+3))) | |
f.write( "\n=============================================================================\n") | |
f.write( " Company Net Worth is \t"+ str(round(CoNWG,3)) + "GOLD") | |
time.sleep(1) | |
f.write( "\n\n\n") | |
f.write( "What this informations means is...\n\ | |
When your company is in full production and has all the assets it does currently\n\ | |
your company is valued at the above number. A selling price for this company would\n\ | |
assume less than peak operating conditions and/or unfavorable market conditions which\n\ | |
would obviously run down the worth of your company. Think of this figure as an estimate\n\ | |
of how good your company is doing now compared to the past and compared to others.") | |
f.write("\n\nPlease note that the following information are estimated guidlines and to not 100% accurately depict the salaries you\ | |
pay at your company. Although these estimations are made to the best of my abilities and are still extremely useful, accurate, and good for decision/advisory purposes. They are not 100% percise and are not to be assumed as such.") | |
f.write(str(Version)) | |
f.close | |
time.sleep(1.5) | |
print "\n Your information has been written to file and saved to disk" | |
def CoIProj(): | |
print "\nCompany Income Projection" | |
print "This Income Projection report gives you an estimate of\n\ | |
the worth of your stock on hand, the amount of stock you produce per day\n\ | |
the amount of stock you produce per week, and per month. This is then\n\ | |
computed along with an estimate of RMs and Salary for the repected day/week/month\n\ | |
This will also give you the break even price of your product and tell you\n\ | |
if you are either losing money or gaining money off of each sale.Suggestions\n\ | |
will also be made as to if you should hold product, clear stock, or export." | |
CoAES = ((CEH + CEL) / 2)#Companies Average Employee Skill is factoring by taking the Highest Skill in the company averaged with the lowest possible skilled Employee | |
CoAW = ((random.randint(74,99) * CE) / CE)#Estimates the Average Employees Wellness of a Factor between 73 and 98;; not the most accurate form, but suitable. | |
CoEP = EmpProd(CoAES,CoAW,CQ,CE,RE,RP,REA,SM,RMCQ) #PRODUCTIVITY | |
CoAP = (CE * CoEP) #Company Average Productivity = CompanyEmployeeProductivity * Company Employees | |
CoAPW = (CoAP * 6.9+(random.randint(1,9) * .01)) #PER WEEK | |
CoAPM = (CoAPW * 3.9+(random.randint(1,9) * .01)) # PER MONTH) | |
CoAPMEA = (CoAPM * AEA) | |
CoRM = ((industry * CQRM))#RAW MATERIAL FORMULA | |
Units = ((CoAP / industry)) # AMOUNT OF UNITS PRODUCEDS PER DAY | |
CoMRM = ((CoRM * Units)) # AMOUNT OF RMS NEEDED PER DAY | |
CoMRMW = (CoMRM * 6.9+(random.randint(1,9) * .01)) # per week | |
CoMRMM = (CoMRMW * 3.9+(random.randint(1,9) * .01)) # per month | |
#Units produced per day and their market worth | |
CoIPD = (Units * AGP) # per day | |
CoUW = (Units * 6.9+(random.randint(1,9) * .01)) #per week | |
CoIPW = (CoUW * AGP) #per week | |
CoUM = (CoUW * 6.9+(random.randint(1,9) * .01)) # per month | |
CoIPM = (CoUM * AGP) #per month | |
CoUMEA = (CoUM * AEA) # with EA | |
CoIPMEA = (CoIPM * AEA) # with EA | |
print CoAES | |
print CoAW | |
print "productivity" | |
print CoEP | |
print CoAP | |
print CoAPW, "per week" | |
print CoAPM | |
print CoAPMEA | |
print "RMs" | |
print CoRM | |
print CoMRM | |
print CoMRMW | |
print CoMRMM | |
print "units preoduced per day, week, month, with Estimated Activity" | |
print Units | |
print CoUW | |
print CoUM | |
print CoUMEA | |
print "pay per day, per week, per month, and with estimated activity" | |
print CoIPD | |
print CoIPW | |
print CoIPM | |
print CoIPMEA | |
Reload() | |
# | |
##___________________________________________ | |
###End of Financial Forms | | |
####========================================== | |
####========================================== | |
###Start of Managerial Forms/Functions | | |
##-------------------------------------------- | |
# | |
def RMMf(): | |
print"\nRaw Materials Management Form" | |
CoAES = ((CEH + CEL) / 2)#Companies Average Employee Skill is factoring by taking the Highest Skill in the company averaged with the lowest possible skilled Employee | |
CoAW = ((random.randint(74,99) * CE) / CE)#Estimates the Average Employees Wellness of a Factor between 73 and 98;; not the most accurate form, but suitable. | |
CoEP = EmpProd(CoAES,CoAW,CQ,CE,RE,RP,REA,SM,RMCQ) #PRODUCTIVITY | |
CoAP = (CE * CoEP) #Company Average Productivity = CompanyEmployeeProductivity * Company Employees | |
CoAPW = (CoAP * 6.9+(random.randint(1,9) * .01)) #PER WEEK | |
CoAPM = (CoAPW * 3.9+(random.randint(1,9) * .01)) # PER MONTH) | |
CoAPMEA = (CoAPM * AEA) | |
CoRM = ((industry * CQRM))#RAW MATERIAL FORMULA | |
Units = ((CoAP / industry)) # AMOUNT OF UNITS PRODUCEDS PER DAY | |
CoMRM = ((CoRM * Units)) # AMOUNT OF RMS NEEDED PER DAY | |
CoMRMW = (CoMRM * 6.9+(random.randint(1,9) * .01)) # per week | |
CoMRMM = (CoMRMW * 3.9+(random.randint(1,9) * .01)) # per month | |
#Units produced per day and their market worth | |
CoIPD = (Units * AGP) # per day | |
CoUW = (Units * 6.9+(random.randint(1,9) * .01)) #per week | |
CoIPW = (CoUW * AGP) #per week | |
CoUM = (CoUW * 6.9+(random.randint(1,9) * .01)) # per month | |
CoIPM = (CoUM * AGP) #per month | |
CoUMEA = (CoUM * AEA) # with EA | |
CoIPMEA = (CoIPM * AEA) # with EA | |
#print CoAES | |
#print CoAW | |
print "\n\t\tProductivity\n" | |
print CoEP, " Average Employee Productivity" | |
print CoAP, " Estimated Copmany Productivity per day" | |
print CoAPW, " per week" | |
print CoAPM, " per month" | |
print CoAPMEA, " per month with employee activity factored in" | |
print "\n\t\tRMs\n" | |
print CoRM, " is the amount of RMs needed per product." | |
print CoMRM, " is the amount of RMs needed per day." | |
print CoMRMW, " is the amount of RMs needed per week." | |
print CoMRMM, " is the amount of RMs needed per month" | |
print "\n\t\tUnits/Product\n" | |
print Units, " average amount of Unites produced per day" | |
print CoUW, " amount of product produced per week" | |
print CoUM, " amount of product produced per month" | |
print CoUMEA, " amount of product produced factoring in employee activity." | |
print "\n\t\tIncome\n" | |
print CoIPD, " amount of income recieved per day if products sold at lowest market price" | |
print CoIPW, " income received per week if products sold at lowest market price" | |
print CoIPM, " income received per month ..." | |
print CoIPMEA, " income recieved per month if all products are sold at lowest market price, and with employee activit/inactivity calculated in" | |
Reload() | |
def EMf(): | |
print"\nEmployee Managment Form" | |
print"\n\ | |
When finished the employee managment form will allow the user to survey their\n\ | |
employees at their company and check on their presence, wellness, and skill\n\ | |
Until the full server scrape function is enabled this function is rather\n\ | |
useless. So now it just prints the basic employee info already know.\n\n" | |
print CE, "Employees currently work for your company" | |
print CEH, "Skill of the Highest Skilled Employee" | |
print CEL, "Skill of the Lowest Skilled Employee" | |
print RP, " Regional Productivity" | |
print REA, "Recommended Amount of Employees for your industry" | |
Reload() | |
def SPMf(): | |
print"\nStock--Price Management Form" | |
RMP = input("\nWhat is the lowest price of a Q1 RM for your industry :") | |
CoRM = ((industry * CQRM))#RAW MATERIAL FORMULA | |
CoRMP = (RMP * CoRM) | |
CoAES = ((CEH + CEL) / 2)#Companies Average Employee Skill is factoring by taking the Highest Skill in the company averaged with the lowest possible skilled Employee | |
CEAP = CoAES * 2 # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< OMG :: that is the reason I was having all this trouble -__-" and i never saw it (It was named CoAP instead of CEAP) | |
CoAW = ((random.randint(74,99) * CE) / CE)#Estimates the Average Employees Wellness of a Factor between 73 and 98;; not the most accurate form, but suitable. | |
CoEP = EmpProd(CoAES,CoAW,CQ,CE,RE,RP,REA,SM,RMCQ) | |
CoEU = CoEP / industry | |
CoPP = ((CEAP / CoEU) + CoRMP) | |
print "\n\ | |
The Stock Price Management Form takes into account all of your data\n\ | |
which involves the use of company stock, employee salary, and average\n\ | |
market price for your product. It then gives you a basic read out of\n\ | |
an optimum selling price." | |
print CoS, " is the amount of stock you have on hand" | |
print CoRM, " is the amount of RMs you have on hand" | |
print AGP, " is the average market price" | |
print CoRM, " is the amount of Raw Materials you need per product you produce" | |
print "\n\nTo sell your product at a breakeven point it will need be sold at\n\ | |
atleast ", CoRMP | |
print "\nUsing a minmum wage scale and an average employee pay of ", CEAP | |
print "\nEach product must be sold at ", CoPP, " to reach the break even point." | |
Reload() | |
# | |
##_________________________________________ | |
###End of Managerial Forms/Functions | | |
####======================================== | |
####======================================== | |
###Start of Special Forms/Functions | | |
##------------------------------------------ | |
# | |
def EzWiki(): | |
print "\nEasy Wiki Form" | |
print "\n\n\ | |
The EasyWiki Form is one of my favorite idea for the program launch\n\ | |
in essence all you need to do is fill out 2-4 small paragraphs\n\ | |
about the company. Either history, agenda, pay scale, etc. Anything\n\ | |
works really. Then when that information is added to the data\n\ | |
already gathered about your company. The program is then able\n\ | |
to output that to a txt in Wiki format. All you will need to do\n\ | |
is Copy and then paste unto the edit page of your Company Wiki\n\ | |
page. This will aid your company in many ways, and make it very\n\ | |
easy for you. \n\ | |
Dont have a Wiki account?\n\ | |
Not a problem. Just PM me with a link to your wiki.txt or email\n\ | |
it to me at [email protected] and I will upload it for you\n." | |
Reload() | |
def CoCAf(): | |
print "\nCompany Comparative Analysis Form" | |
print "\n\n\ | |
When Finished, the comparative analysis Form will allow the user\n\ | |
to take their current company settings and view them side by side\n\ | |
with a list of speculations. This will be a good way for a GM to \n\ | |
make certain company decisions, and will save the the trouble of\n\ | |
making all the calculations manually and without the risking of making\n\ | |
the decision on their own behalf.\n\ | |
A good example of this would be that a company owner could view the \n\ | |
differences in productivity to cost in their company if they upped from\n\ | |
9 employees to 30 employees. They could also see how exporting to\n\ | |
another country compared to seeling their stock domesticly will\n\ | |
improve their overall profit margins\n\ | |
\nTo save time I have cut this function out of the beta version\n\ | |
to save on time. sorry guys" | |
Reload() | |
####===================| | |
###### Misc Functions | | |
####===================| | |
def Reload(): | |
print "\n\n\nI hope you enjoyed using the program and that the reports help your business\n" | |
decision = input("\ | |
Press (1) to Reload Main Menu\n\ | |
Press (2) to Reload GM Menu\n\ | |
- Press (3) to Reload Financial Menu\n\ | |
- Press (4) to Reload Managerial Menu\n\ | |
- Press (5) to Reload Special Opt. Menu\n\ | |
Press (0) to quit") | |
if decision == 1: | |
print "\n\n" | |
start() | |
elif decision == 2: | |
print "\n\n" | |
GMCalc() | |
elif decision == 3: | |
print "\n\n" | |
FinMenu() | |
elif decision == 4: | |
print "\n\n" | |
ManMenu() | |
elif decision == 5: | |
print "\n\n" | |
SpeMenu() | |
elif decision is 0: | |
print "What are you going to do then?...\n" | |
q = input("\n Press (1) or (0) to quit. Press anyother number if you dont want to quit") | |
if q == 1: | |
quit() | |
elif q == 0: | |
Credits() | |
elif q is not 1 or 0: | |
time.sleep(.5) | |
Reload() | |
def Credits(): | |
print """ | |
I'd like to thank the Academy... lol jk | |
No honestly I have been working on this for a long time, but I wouldn't have been able to finish it if it wasn't for all | |
the support I get from my erep friends. All the wisdom Inferno has imparted when i bug him incently about how to program | |
in python and all the tips i've picked up from pirate and pearl. Thank you to everyone who uses this and likes it. Thank | |
you to everyone who donates because of how much they like it, and thanks to the admins for inventing Erep and finding | |
something to do with my time. | |
- Justinious - """ | |
time.sleep(5) | |
q = input("press 1 to quit") | |
if q == 1: | |
quit() | |
elif q is not 1: | |
exit() | |
#_________________________________________ | |
###====================================;;;| | |
###;;;; END OF ALL FUNCTIONS ;;;;;;;;;;;;;| | |
###=======================================| | |
### | |
### | |
####============================================================ | |
###The Main Program Loop ######################################| | |
####============================================================ | |
### | |
start() #Impressive I know | |
###########\\\\\\\\ | |
#*********###The End}}} | |
###########//////// | |
#...that means go. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment