Advertisement
tyler569

accounting thoughts

Apr 15th, 2013
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. Accounting Program plan and pseucdocode anf flow
  2.  
  3.  
  4. FLOW AND BRAINSTORM:
  5.  
  6. Initial thoughts:
  7. Program opens a .txt document containing standard formatted set of business transactions and payroll information
  8. 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,
  9. could be done as either XLS document or HTML wil links and coolness
  10. XLS:
  11. requires added package
  12. could be clearer
  13. language I know
  14. if borders possible, could look better
  15. HTML:
  16. links
  17. need to learn HTML
  18. probably wont be fancy at all
  19. probably better
  20. Finally, it creates an encoded document with all the needed information to picj up where that cycle left off (acct. balences, etc)
  21.  
  22. More specific thoughts:
  23.  
  24. THE GRAMMAR:
  25. my original thoughts as follows,
  26. initially flow indicators (don't do payroll, etc) as %:
  27. %payroll off
  28. %prior /prior.txt ##(This indicates prior doctument)
  29. then variable assignments as @
  30. @overtime 40hrs
  31. @overtimerate 2.0
  32. ## These simply replace system variables immidiatly after creating them, changes in table of constants returned by parser
  33. --- This means the parser should return a table of constants
  34. then business transations in following forms (as examples):
  35. month:July
  36. 4:purchased $400.74 of trains (Transportation Equiptment):check 123
  37. 5:sold $300 of kitchen appliances (Cooking Equiptment):receipt 561385
  38. 6:purchased $19.99 of widgets (Widgets) on account (Egmire Equiptment):invoice 713
  39. 10:paid $400.00 for water (Water Expense):check 94
  40. 14:paid $300.99 to Egmire Equiptment for account:check 843
  41.  
  42. Anexample of the regex for these:
  43.  
  44. b'(\d+)\:[Pp]urchased\s+\$(\d+\.\d{2})\s+of?[\s\w]+\(([\s\w]+)\)\:([\w\s\d]+)' ##the first one
  45.  
  46. DO as variable in loop, ex
  47.  
  48. loop = [[regex 1,needed vars],
  49. [regex 2,vars],
  50. [regex 3,vars]]
  51.  
  52. for line in (lines) - or can use file object:
  53. for i in loop:
  54. reobj = search(i[0],line)
  55. if reobj:
  56. blahblahblah
  57. break
  58. else:
  59. continue (or something along these lines)
  60. And thats what I have there
  61.  
  62. NEXT: PSEUDO / FLOW
  63. program should first open and return text of docukment specified by first argument
  64. function opentext(takes first argument as argument):
  65. return text of document
  66. function parse(takes text as argument)
  67. /*This function wioll do the folowing;
  68. it will go through program as specified about and compile a list of list containing all the needed information about the transcations
  69. and return that as a tuple with all the necessary information pertinant to payroll
  70. */
  71.  
  72. CODE for subfunction (unless re.group has a way to output all as array / tuple)
  73. reobj = regex object
  74. index = 1
  75. output = []
  76. excep = False
  77. while excep = False:
  78. try:
  79. output.append(reobj.group(index))
  80. except IndexError:
  81. excep = True
  82. index += 1
  83. return output
  84.  
  85. return transcations_p,payroll_p
  86. function accounts(takes transactions array as argument):
  87. /*This function will go through the transactions and break them up int o accounts and track the account balences;
  88. it will output in the following form;
  89. {account name:[[date,dr,cr],[date,dr,cr],...,account name:[date,dr,cr],...}
  90. ### --- (unless changed)
  91. this is ripe for the general ledger
  92. */
  93. #Now thought - I need to be able to translate individua l transactions to the leder direct fro the journal - perhaps do this differentyl
  94. #perhaps hash the transaction arrays as an ID and push them through like that
  95. #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