Adehumble

Inventory Management Software for SMEs

May 7th, 2020
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 24.95 KB | None | 0 0
  1. #README
  2. #Title: ScholarNetworkPythonProject
  3. #Project_Title: Inventory Management Software for SMEs
  4. #Author: AdeHumble
  5. #First_Edition: April 29th, 2020
  6. #File name: "project.py". There are other unrelated python project files as well
  7.  
  8. #This program is designed as a back-end software for any SME's (e.g. supermarket) to be used by a customer representative
  9.  
  10. #A lot of Mathematical reasoning was factored into this program. All possible unfavorable real-life scenarios that could arise was considered and duly managed to the best of my knowledge
  11.  
  12. #With the aid of this software, the representative can manage sales inventories and item stocks
  13. #   Can determine if a particular product is available
  14. #   Can edit some information about a particular product(e.g. product name, price and quantity)
  15. #   Can add a new product to the stock
  16. #   Can remove a particular product from the stock
  17.  
  18. #It also allows a customer representative to check out the list of all items purchased by a customer, make payment and generate a receipt with a UNIQUE transacation ID FOR EACH purchase made at the counter
  19. #   In case a customer decides not to make purchase again after adding list of items to his/her cart, the customer representative can simply quit the software without checking out
  20. #   In case the customer representative MISTAKENLY ATTEMOTED TO QUIT THE SOFTWARE WITHIUT CHECKING OUT a customer's purchase, the software will raise an alert to confirm his/her decision
  21.  
  22. #This software is also designed to save changes upon every SUCCESSFUL AND COMPLETED transactions into a file
  23. #   The file will only get updated if a customer make payment for his/her purchase
  24. #   If not, all the transcation history will simply be cleared out of memory
  25.  
  26. #You may still find out other functionalities while you use this software. In case you encountered any difficulty in using this software or you have ideas on how this program can become more efficient, feel free to reach me via +2348122230304. Thanks!
  27.  
  28. #Python Standard Libraries Adopted
  29. import shutil as sh
  30. import random
  31. import string
  32. import datetime
  33.  
  34. #Homepage Design $ Instructions for use[line 11-26]
  35.  
  36. #Line11 will gets the console width/size. It is necessary so as that the center method can properly aligned text to the center of any type of IDE
  37. console_size=sh.get_terminal_size().columns
  38. print(("***"*15).center(console_size))
  39. print("Welcome to ADEHUMBLE SUPERMARKET".center(console_size))
  40. print("Home of Groceries".center(console_size))
  41. print(("***"*15).center(console_size))
  42. print()
  43. #Line18 to Line26 represents the available actions this software can perform
  44. print("A: ||Press 'A' to add new items to the Supermarket stock||")
  45. print("D: ||Press 'D' to remove an item from the list of current stock")
  46. print("L: ||Press 'L' to list all the available stocks||")
  47. print("I: ||Press 'I' to inquire about a particular item||")
  48. print("R: ||Press 'R' to remove purchased items from a customer's cart before checking out||")
  49. print("P: ||Press 'P' to purchase new items from the Supermarket stock||")
  50. print("C: ||Press 'C' to checkout purchased items and make payment||")
  51. print("Q: ||Press 'Q' to quit a transaction||")
  52. print("H: ||Press 'H' to view all available possible actions again||")
  53.  
  54.  
  55. #Parameters Initialisation[line 30-38]
  56. item_unit_price={}
  57. item_description={}
  58. item_unit_stock={}
  59. cart_details_price={}
  60. cart_details_qty={}
  61. cart_items_unit={}
  62. action="y"
  63. total=[]
  64. total_cost=0
  65.  
  66.  
  67. #Function that will generates receipts for every completeded transactions/purchase[line 43-80]
  68.  
  69. def Receipt():
  70.        
  71.     #Generates a unique Transcation ID for every completed transactions[line 46-54]
  72.     transact_ID=[]
  73.     rand_chr=list(str(random.random()*5))
  74.     if '.' in rand_chr:
  75.         rand_chr.remove('.')   
  76.     rand_num_list=list("".join(rand_chr))
  77.     alpha_list=list(string.ascii_uppercase)
  78.     transact_ID.extend(alpha_list)
  79.     transact_ID.extend(rand_num_list)
  80.     transaction_ID="".join(random.sample(transact_ID,10))
  81.    
  82.     #Generates the date and time specifics for each successful transaction[line57]
  83.     purchase_time=datetime.datetime.today()
  84.    
  85.     #Format the receipt output in a unique way[line 60-81]
  86.     print()
  87.     print(("***"*15).center(console_size))
  88.     print("ADEHUMBLE SUPERMARKET".center(console_size))
  89.     print("Home of Groceries".center(console_size))
  90.     print()
  91.     print("BILL PAYMENT".center(console_size))
  92.     print()
  93.     print("Reference Number: ", transaction_ID)
  94.     print("Date of Transaction: ",purchase_time.strftime("%A;%B %d, %Y"))
  95.     print("Time of Transaction: ",purchase_time.strftime("%I:%M:%S %p"))
  96.     print()
  97.     print("Below are the list of items purchased with their respective costs\n")
  98.    
  99.     #Iterates over two different dictionaries instantaneously[line 74&75]
  100.     for (k1,v1), (k2,v2) in zip(cart_details_price.items(),cart_items_unit.items()):
  101.         print("{}units of {} costs ₦{}".format(v2,k1,v1))
  102.        
  103.     print()
  104.     print(f"TOTAL COST = ₦{total_cost}".center(console_size))
  105.     print()
  106.     print("\nThank you for patronizing us. We woud like to see you again Have a nice day!")
  107.     print(("***"*15).center(console_size))
  108.  
  109.  
  110. #Opens up and extracts the text file containing the product information and stores this information in their respective dictionaries as declared above[line 86-112]
  111.  
  112. with open("project.txt","r") as product_details:
  113.    
  114.     #The first line of the text file represents the number of items presently available[line89]
  115.     no_items=int((product_details.readline()).rstrip("\n"))
  116.    
  117.     #Extracts data into the item_unit_price dictionary[line 92-97]
  118.     for i in range(no_items):
  119.         file_line=(product_details.readline()).rstrip("\n")
  120.         a,b=file_line.split(":")
  121.         a=int(a)
  122.         b=float(b)
  123.         item_unit_price.update({a:b})
  124.    
  125.     #Extracts data into the item_description dictionary[line 100-104]
  126.     for i in range(no_items):
  127.         file_line=(product_details.readline()).rstrip("\n")
  128.         a,b=file_line.split(":")
  129.         a=int(a)
  130.         item_description.update({a:b})
  131.    
  132.     #Extracts data into the item_unit_stock dictionary[line 107-112]
  133.     for i in range(no_items):
  134.         file_line=(product_details.readline()).rstrip("\n")
  135.         a,b=file_line.split(":")
  136.         a=int(a)
  137.         b=int(b)
  138.         item_unit_stock.update({a:b})
  139.  
  140.  
  141. #The engine room. The while loop contains codes for all the available/possible actions[line 118-510]
  142.  
  143. #Quit Action Logistics[line 118-176]
  144. while (action!="q" or action!="Q"):
  145.     action=input("What would you like to do? ")
  146.    
  147.     #When a user quits the software without performing any transaction or using any of the service. Nothing should change about the current state of the shop[line 122-124]
  148.     if ((action=="" or action=="q" or action=="Q") and (total_cost==0)):
  149.         print()
  150.         print("Good!\n I trust you had a sweet experience using this software.\nStay Safe...Bye!")
  151.         break
  152.    
  153.     #When a user quits the software without checking out AFTER a purchase[line 128-176]
  154.     elif ((action=="q" or action=="Q" or action=="") and (total_cost>0)):
  155.        
  156.         check=input("Some items have already been purchased into the cart.Do you really want to quit now?\n\n1)Press 'y' for YES If you want to quit now and generate a receipt for this transaction\n2)Press 'n' for NO if you wish to continue\n3)Press 't' to forcefully terminate this transaction\n ")
  157.        
  158.         #if they really want to quit and make purchase[line 133-160]   
  159.         if (check=="y" or check=="Y"):
  160.             for i in cart_items_unit:
  161.                 item_unit_stock[i]-=cart_items_unit[i]
  162.             print("Take your transaction receipt")
  163.             Receipt()
  164.            
  165.             #Reset the customer's cart in case of another different transaction[line 140-143]
  166.             cart_details_qty={}
  167.             cart_details_price={}
  168.             cart_items_unit={}
  169.             total_cost=0
  170.            
  171.             #Update the stock because some items have been purchased. Hence, the quantity/stock of the purchased items should change[line 146-157]
  172.             with open("project.txt", "w") as product_details:
  173.                 no_items=len(item_unit_price)
  174.                 product_details.write(str(no_items)+"\n")
  175.                
  176.                 for j in item_unit_price:
  177.                     product_details.write(str(j)+":"+str(item_unit_price[j])+"\n")
  178.                
  179.                 for j in item_description:
  180.                     product_details.write(str(j)+":"+str(item_description[j])+"\n")
  181.                
  182.                 for j in item_unit_stock:
  183.                     product_details.write(str(j)+":"+str(item_unit_stock[j])+"\n")
  184.            
  185.             print("I trust you had a sweet experience using this software.\nStay Safe...Bye!")
  186.             break
  187.        
  188.         #if a user denounce his/her action as a mistake and would like to continue using the software
  189.         elif (check=="n" or check=="N"):
  190.             print("Okay, Good!. I guessed as much\nPlease, press 'P' to continue to make purchase or press 'C' to check out")
  191.             continue
  192.        
  193.         #if a user wishes to quit without buying for the items in his/her cart.
  194.         if (check=="t" or check=="T"):
  195.             print()
  196.             print("Good! You won't be charged. Your transaction history has been deleted.\n I trust you had a sweet experience using this software.\nStay Safe...Bye!")
  197.             break
  198.        
  199.         #if an unexpected input was entered
  200.         else:
  201.             print("That's a wrong input!")
  202.             print("You may press 'Q' to quit")
  203.    
  204.    
  205.     #The purchase action logistic[line 180-252]  
  206.     elif (action=="p" or action=="P"):
  207.        
  208.         try:
  209.             item_no=abs(int(float(input("Enter the item number you wish to purchase: "))))
  210.            
  211.         except ValueError:
  212.             print()
  213.             print("That was a wrong input! You need to enter a number. Please, try all over again")
  214.             continue
  215.         print()
  216.        
  217.         #if the item to be purchased is available[line 192-252]
  218.         if (item_no in item_description):
  219.             item_name=item_description[item_no]
  220.             print(f"Okay! You wish to purchase {item_name}")
  221.             try:
  222.                 item_unit=int(float(input(f"How many units of {item_name} do you wish to buy? ")))
  223.            
  224.             except ValueError:
  225.                 print()
  226.                 print("That was a wrong input! You need to enter a number. Please, try all over again")
  227.                 continue
  228.             print()
  229.            
  230.             if (item_unit<=0):
  231.                 print("Item unit must be greater than zero")
  232.                 print()
  233.                 continue
  234.             #If there is enough stock to cater for tge units a customer what to buy AND the item is not present in customer cart as of the moment[line 109-246]
  235.             elif ((item_unit_stock[item_no]>=item_unit) and (item_no not in cart_items_unit)):
  236.                
  237.                 a1=item_name       
  238.                 b1=item_unit_price[item_no]*item_unit
  239.                 c1=item_unit
  240.                 d1=item_no
  241.                
  242.                 cart_details_price.update({a1:b1})
  243.                 cart_details_qty.update({a1:c1})
  244.                 cart_items_unit.update({d1:c1})
  245.                 total=cart_details_price[item_name]
  246.                 total_cost+=total
  247.                
  248.                 print(f"{item_unit} units of {item_name} has been added to cart at the cost of ₦{b1}")
  249.                 print(f"Below is a view of your cart information\n{cart_details_qty}")
  250.                 print()
  251.                 print("Press 'P' to purchase more. Would you like to check out? Press 'C' or Press 'Q' to quit")
  252.                 print()
  253.            
  254.             #If the item is already among the list of items in the cart, ready to be bought[line 129-240]
  255.             elif ((item_no in cart_items_unit) and (item_unit+cart_items_unit[item_no]<=(item_unit_stock[item_no]))):      
  256.                 new_price=item_unit_price[item_no]*item_unit
  257.                 cart_items_unit[item_no]+=item_unit
  258.                 cart_details_qty[item_name]+=item_unit
  259.                 cart_details_price[item_name]+=new_price
  260.                 total_cost+=new_price
  261.                
  262.                 print(f"{item_unit} of {item_name} has been added again to cart at the cost of ₦{new_price}")
  263.                 print(f"Below is a view of your cart information\n{cart_details_qty}")
  264.                 print()
  265.                
  266.                 print("Press 'P' to purchase more. Would you like to check out? Press 'C' or Press 'Q' to quit")
  267.                
  268.             else:
  269.                 print(f"There are not enough stocks presently for this order. Kindly persuade the customer to reduce his/her order quantity or contact the manager to add more stocks of {item_name}")
  270.                 print()
  271.                
  272.                 print("Press 'C' if you would like to check out now or Press 'Q' to quit")
  273.                 print()
  274.                        
  275.         else:
  276.             print("Sorry! We currently do not have the item you are requesting to buy")
  277.             print()
  278.             print("Press 'P' to purchase other items or Press 'Q' to quit")
  279.    
  280.    
  281.     #The remove action logistics[line 256-326]
  282.     elif (action=="r" or action=="R"):
  283.        
  284.         #It is not going to do anything beacause the customer has not added any item to his/her cart. So there is nothing to remove[line 259_263]
  285.         if (total_cost==0):
  286.             print("Your cart is currently empty. You have not make any purchase")
  287.             print("Press 'P' to make a purchase or press 'Q' to quit")
  288.             print()
  289.             continue
  290.         else:
  291.             try:
  292.                 item_no_2remove=abs(int(float(input("Enter the item number you wish to remove from the cart: "))))
  293.             except ValueError:
  294.                 print()
  295.                 print("That was a wrong input! You need to enter a number. Please, try all over again")
  296.                 continue
  297.            
  298.         #If the item to remove is among what the customer has added to his/her cart. This block will confirm if the cutstomer really wishes to remove that item and also check whether the number of units a customer wishes to remove from his/her cart is less than or upto what he/she has initially purchased[line 273-326]
  299.         if (item_no_2remove in cart_items_unit):
  300.             item_name=item_description[item_no_2remove]
  301.            
  302.             check=input(f"Are you sure you want to remove {item_name}?.\nPlease, enter 'y' for YES or 'n' for NO: ")
  303.            
  304.             if (check=="y" or check=="Y"):
  305.                 print()
  306.                 remove_unit=int(input("How many unit(s) would you like to remove from the cart? "))
  307.                 if remove_unit<cart_items_unit[item_no_2remove]:
  308.                     unitprice_2remove=item_unit_price[item_no_2remove]
  309.                     totalprice_2remove=unitprice_2remove*remove_unit
  310.                     cart_details_qty[item_name]-=remove_unit
  311.                     cart_details_price[item_name]-=totalprice_2remove
  312.                     cart_items_unit[item_no_2remove]-=remove_unit
  313.                     total_cost-=totalprice_2remove
  314.                     print(f"{item_name} has been successfuly removed from your cart and necessary changes to your total cost")
  315.                     print(f"Below is a view of your cart information\n{cart_details_qty}")
  316.                
  317.                    
  318.                 elif (remove_unit==cart_items_unit[item_no_2remove]):
  319.                     print()
  320.                     unitprice_2remove=item_unit_price[item_no_2remove]
  321.                     totalprice_2remove=unitprice_2remove*remove_unit
  322.                    
  323.                     total_cost-=totalprice_2remove
  324.                    
  325.                     del (cart_items_unit[item_no_2remove])
  326.                     del (cart_details_qty[item_name])
  327.                     del (cart_details_price[item_name])
  328.                    
  329.                     print(f"{item_name} has been successfuly removed from your cart and necessary changes to your total cost")
  330.                     print(f"Below is a view of your cart information\n{cart_details_qty}")
  331.            
  332.                 else:
  333.                     print("Sorry! You have a lesser purchase")
  334.                     print("You can continue by pressing 'P' to make more purchase or press 'C' to check out now")
  335.                        
  336.             elif (check=="n" or check=="N"):
  337.                 print()
  338.                 print("Ok Good!")
  339.                 print("Press 'P' to purchase more. Would you like to check out? Press 'C' or Press 'Q' to quit")
  340.                 print()
  341.                 continue
  342.                
  343.             else:
  344.                 print()
  345.                 print("That's incorrect! Anyway, i'll take that as a NO")
  346.                 print("You can continue by pressing 'P' to make more purchase or press 'C' to check out")
  347.                 print()
  348.                
  349.         else:
  350.             print(f"Oops! You have not purchased any item named {item_name}.")
  351.             print("Would you like to check out now? Press 'C'. You can press 'Q' to quit")
  352.             print()
  353.         #Updates changes to the text file      
  354.         with open("project.txt", "w") as product_details:
  355.             no_items=len(item_unit_price)
  356.             product_details.write(str(no_items)+"\n")
  357.            
  358.             for j in range(no_items):
  359.                 product_details.write(str(j+1)+":"+str(item_unit_price[j+1])+"\n")
  360.            
  361.             for j in range(no_items):
  362.                 product_details.write(str(j+1)+":"+str(item_description[j+1])+"\n")
  363.            
  364.             for j in range(no_items):
  365.                 product_details.write(str(j+1)+":"+str(item_unit_stock[j+1])+"\n")
  366.                
  367.            
  368.     #The check out action logistic[line 343-381]       
  369.     elif (action=="C" or action=="c"):
  370.         print()
  371.        
  372.         #To check out means to pay for the cart items at the counter of a customer representative. Obviously, there a customer cannot check-out/pay for items, if he /she has not added anything to his/her cart. Hence, total cost must me more than zero before a customer can check out
  373.         if (total_cost>0):
  374.             for i in cart_items_unit:
  375.                 item_unit_stock[i]-=cart_items_unit[i]
  376.                
  377.             #This will call the receipt function from [line 43-80]
  378.             Receipt()
  379.            
  380.             print()
  381.             print("Mind you, you can still purchase items after check out, your cart has been reset. To quit press 'Q'")
  382.             print()
  383.            
  384.             #This will set the virtual cart to zero. This is necessary so that another customer wont have to pay for the goods of a previous customer
  385.             cart_details_qty={}
  386.             cart_details_price={}
  387.             cart_items_unit={}
  388.             total_cost=0
  389.            
  390.         else:
  391.             print("You have not make any purchase. Your cart is currently empty")
  392.             print("Press 'P' to make a purchase or press 'Q' to quit")
  393.             print()
  394.        
  395.         #updates the current changes to the stock i.e. into the text file
  396.         with open("project.txt", "w") as product_details:
  397.             no_items=len(item_unit_price)
  398.             product_details.write(str(no_items)+"\n")
  399.            
  400.             for j in item_unit_price:
  401.                 product_details.write(str(j)+":"+str(item_unit_price[j])+"\n")
  402.            
  403.             for j in item_description:
  404.                 product_details.write(str(j)+":"+str(item_description[j])+"\n")
  405.            
  406.             for j in item_unit_stock:
  407.                 product_details.write(str(j)+":"+str(item_unit_stock[j])+"\n")
  408.    
  409.    
  410.     #The add action logistic[line 385-430]
  411.     elif (action=="a" or action=="A"):
  412.         try:
  413.             #Ask for all the details about the item you wish to add
  414.             item_no=abs(int(float(input("Enter the item number you wish to add to stock: "))))
  415.             item_price=float(input("Enter the unit price for new item: "))
  416.             item_stock=abs(int(float(input("How many units of this new item do you wish to add to the stock? "))))
  417.             item_desc=input("Enter the name of this new item: ")
  418.                
  419.         except ValueError:
  420.             print()
  421.             print("That was a wrong input! You need to enter a number. Please, try all over again")
  422.             continue
  423.        
  424.         #One good thing is that if the item number entered already exist, these lines of code will keep iterating, checking the next number until it got a unique number to itself[line 399-403]
  425.         while (item_no in item_unit_stock):
  426.             item_no+=1
  427.            
  428.         print()
  429.         print(f"That item number already exist. Changing value to {item_no}")
  430.        
  431.         if (item_desc in item_description.values()):
  432.             print(f"Oopsss! An item with a name of {item_desc} already exists. Try again by changing the name.")
  433.             print()
  434.             continue
  435.            
  436.         else:
  437.             #Updates the new item information
  438.             item_unit_stock.update({item_no:item_stock})
  439.             item_description.update({item_no:item_desc})
  440.             item_unit_price.update({item_no:item_price})
  441.          
  442.         #writes the current changes to the text file[line 417-427]
  443.         with open("project.txt", "w") as product_details:
  444.             no_items=len(item_unit_price)
  445.             product_details.write(str(no_items)+"\n")
  446.            
  447.             for j in item_unit_price:
  448.                 product_details.write(str(j)+":"+str(item_unit_price[j])+"\n")
  449.            
  450.             for j in item_description:
  451.                 product_details.write(str(j)+":"+str(item_description[j])+"\n")
  452.            
  453.             for j in item_unit_stock:
  454.                 product_details.write(str(j)+":"+str(item_unit_stock[j])+"\n")
  455.        
  456.         print(f"Completed! {item_desc} has successfully been added to the supermarket stock")
  457.      
  458.          
  459.     #The delete action logistic[line 433-477]
  460.     elif (action=="D" or action=="d"):
  461.         try:
  462.             itemno_2del=abs(int(float(input("Enter the item number you wish to delete from the stock: "))))
  463.         except ValueError:
  464.             print()
  465.             print("That is a wrong input! Try again")
  466.             continue
  467.        
  468.         #Will confirm if the item you wish to delete is even among the supermarket stock/goods in the first place. If true, it'll delete all the information about that item[line 443-462] 
  469.         if (itemno_2del in item_unit_stock):
  470.             item_name=item_description[itemno_2del]
  471.             check=input(f" Are you sure you want to delete {item_name}?\nIf YES, press 'y'. But if NO, press 'n':  ")
  472.             if (check=='y' or check=='Y'):
  473.                
  474.                 #updates the new information
  475.                 del (item_unit_stock[itemno_2del])
  476.                 del (item_description[itemno_2del])
  477.                 del (item_unit_price[itemno_2del])
  478.                
  479.             elif (check=="N" or check=="n"):
  480.                 print()
  481.                 print("Okay! That must be a mistake then. You may quit by pressing 'Q'")
  482.                
  483.             else:
  484.                 print()
  485.                 print("That was a wrong.input. Bye!")
  486.         else:
  487.             print()
  488.             print("That item number does not exist in the first place. Thank you!")
  489.                
  490.         #writes the current changes to the text file[line 464-472]     
  491.         with open("project.txt", "w") as product_details:
  492.             no_items=len(item_unit_price)
  493.             product_details.write(str(no_items)+"\n")
  494.             for j in item_unit_price:
  495.                 product_details.write(str(j)+":"+str(item_unit_price[j])+"\n")
  496.             for j in item_description:
  497.                 product_details.write(str(j)+":"+str(item_description[j])+"\n")
  498.             for j in item_unit_stock:
  499.                 product_details.write(str(j)+":"+str(item_unit_stock[j])+"\n")
  500.            
  501.             print()
  502.             print(f"{item_name} has successfully been deleted from the stock")
  503.             print("Would you like to continue using this software? Press any available keys. Otherwise, press 'Q' to quit")
  504.             print()
  505.                    
  506.            
  507.     #The list action logistic[line 482-489]
  508.     elif (action=="L" or action=="l"):
  509.         print("Below is a list of all the current stocks")
  510.         print()
  511.        
  512.         #Iterates over three different dictionaries instantaneously[line 487 & 488]
  513.         for (k1,v1), (k2,v2), (k3,v3) in zip(item_description.items(),item_unit_price.items(), item_unit_stock.items()):
  514.             print("{} represents {}. It remains {}units".format(k1,v1,v3))
  515.         print()
  516.    
  517.    
  518.     #The inquire action logistic[line 493-512]
  519.     elif (action=="I" or action=="i"):
  520.         try:
  521.             itemno_2find=abs(int(float(input("Enter the item number you wish to inquire about: "))))
  522.         except ValueError:
  523.             print()
  524.             print("That is a wrong input! Try again")
  525.             continue
  526.        
  527.         #Checks if the product you want to enquire about is among the supermarket list of items. If true, it will search for and return all its details[line 502-510]      
  528.         if (itemno_2find in item_unit_stock):
  529.             print()
  530.             item_name=item_description[itemno_2find]
  531.            
  532.             #Format the result of your enquiry
  533.             print("{} represents {}\nThere are {} units of {} remaining in stock\n1 unit of {} costs ₦{}".format(itemno_2find, item_description[itemno_2find], item_unit_stock[itemno_2find], item_description[itemno_2find], item_description[itemno_2find], item_unit_price[itemno_2find]))
  534.             print()
  535.             print("You may quit by pressing 'Q'")
  536.             print()
  537.         else:
  538.             print("That item is not available in stock")
  539.             print()
  540.            
  541.        
  542.     #The help action logistic[line 517-532]
  543.     elif (action=="H" or action=="h"):
  544.         print()
  545.        
  546.         #At every point of pressing "H" or "h", the program will prints out the list of all available actions
  547.         print("INSTRUCTIONS FOR USE".center(console_size))
  548.         print("A: ||Press 'A' to add new items to the Supermarket stock||")
  549.         print("D: ||Press 'D' to remove an item from the list of current stock")
  550.         print("R: ||Press 'R' to remove purchased items from a customer's cart before checking out||")
  551.         print("L: ||Press 'L' to list all the available stocks||")
  552.         print("I: ||Press 'I' to inquire about a particular item||")
  553.         print("P: ||Press 'P' to purchase new items from the Supermarket stock||")
  554.         print("C: ||Press 'C' to checkout purchased items and make payment||")
  555.         print("Q: ||Press 'Q' to quit a transaction||")
  556.         print("H: ||Press 'H' to view all available possible actions again||")
  557.    
  558.         print("If you have further questions or concerns, please contact the Manager. You can may press 'Q' to quit")
  559.         print()
  560.    
  561.     else:
  562.         print()
  563.         print("That's a wrong input. Kindly contact the admin for help in case you can't use this software.\nYou can also press 'H' for help on the list of possible inputs.\nThanks!")
  564.         print()
Add Comment
Please, Sign In to add comment