Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Accounting Program plan and pseucdocode anf flow
- FLOW AND BRAINSTORM:
- Initial thoughts:
- Program opens a .txt document containing standard formatted set of business transactions and payroll information
- It parses and ID's what they say and acts on them to create a set of financial documents and information for the desired circumstances,
- could be done as either XLS document or HTML wil links and coolness
- XLS:
- requires added package
- could be clearer
- language I know
- if borders possible, could look better
- HTML:
- links
- need to learn HTML
- probably wont be fancy at all
- probably better
- Finally, it creates an encoded document with all the needed information to picj up where that cycle left off (acct. balences, etc)
- More specific thoughts:
- THE GRAMMAR:
- my original thoughts as follows,
- initially flow indicators (don't do payroll, etc) as %:
- %payroll off
- %prior /prior.txt ##(This indicates prior doctument)
- then variable assignments as @
- @overtime 40hrs
- @overtimerate 2.0
- ## These simply replace system variables immidiatly after creating them, changes in table of constants returned by parser
- --- This means the parser should return a table of constants
- then business transations in following forms (as examples):
- month:July
- 4:purchased $400.74 of trains (Transportation Equiptment):check 123
- 5:sold $300 of kitchen appliances (Cooking Equiptment):receipt 561385
- 6:purchased $19.99 of widgets (Widgets) on account (Egmire Equiptment):invoice 713
- 10:paid $400.00 for water (Water Expense):check 94
- 14:paid $300.99 to Egmire Equiptment for account:check 843
- Anexample of the regex for these:
- b'(\d+)\:[Pp]urchased\s+\$(\d+\.\d{2})\s+of?[\s\w]+\(([\s\w]+)\)\:([\w\s\d]+)' ##the first one
- DO as variable in loop, ex
- loop = [[regex 1,needed vars],
- [regex 2,vars],
- [regex 3,vars]]
- for line in (lines) - or can use file object:
- for i in loop:
- reobj = search(i[0],line)
- if reobj:
- blahblahblah
- break
- else:
- continue (or something along these lines)
- And thats what I have there
- NEXT: PSEUDO / FLOW
- program should first open and return text of docukment specified by first argument
- function opentext(takes first argument as argument):
- return text of document
- function parse(takes text as argument)
- /*This function wioll do the folowing;
- it will go through program as specified about and compile a list of list containing all the needed information about the transcations
- and return that as a tuple with all the necessary information pertinant to payroll
- */
- CODE for subfunction (unless re.group has a way to output all as array / tuple)
- reobj = regex object
- index = 1
- output = []
- excep = False
- while excep = False:
- try:
- output.append(reobj.group(index))
- except IndexError:
- excep = True
- index += 1
- return output
- return transcations_p,payroll_p
- function accounts(takes transactions array as argument):
- /*This function will go through the transactions and break them up int o accounts and track the account balences;
- it will output in the following form;
- {account name:[[date,dr,cr],[date,dr,cr],...,account name:[date,dr,cr],...}
- ### --- (unless changed)
- this is ripe for the general ledger
- */
- #Now thought - I need to be able to translate individua l transactions to the leder direct fro the journal - perhaps do this differentyl
- #perhaps hash the transaction arrays as an ID and push them through like that
- #or perhaps make a transation class and make them objects that can stre dates etc ---I like this
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement