Ejemplo n.º 1
0
def new_stocktake_detail(stocktake):
	while True:
		try:
			inputArtNum = int(raw_input("Artikelnummer:			"))
			break
		except:
			print "Bitte nur Ziffern eingeben!"
	
	if check_exists(inputArtNum) is True:
		currentProduct = session.query(Product).filter(Product.artNum == inputArtNum).first()
		writeBuffer, pfandcrates, pfandbottles = edit_write_buffer(inputArtNum, stocktake, currentProduct)
		
		clear_screen()
		
		einheiten = writeBuffer[2] // currentProduct.bottlesPerUnit
		zusFlaschen = writeBuffer[2] % currentProduct.bottlesPerUnit
		
		table = []
		table.append(["Artikelnummer", writeBuffer[1]])
		table.append(["Anzahl Einheiten", einheiten])
		table.append(["Zusaetzlich Fl", zusFlaschen])
		table.append(["Preis pro Einheit", writeBuffer[3]])
		table.append(["Aufschlag pro Fl", writeBuffer[4]])
		
		print tabulate(table, numalign="center")
		if yes_no(
			"\nBitte ueberpruefen Sie ihre Angaben. Bestaetigen?",
			"Angaben akzeptiert, werden am Schluss in der Datenbank gespeichert.",
			"Angaben verworfen!"
			) is True:
			
			raw_input()
			clear_screen()
			
			# TODO: Pfand tracking is not figured out yet
			session.add(
				StockTakeDetail(
					stockTakeID = writeBuffer.pop(0),
					artNum = writeBuffer.pop(0),
					quantity = writeBuffer.pop(0),
					unitCost = writeBuffer.pop(0),
					bottleSurcharge = writeBuffer.pop(0),
					pfandCrates = pfandcrates,
					pfandBottles = pfandbottles
				)
			)
	else:
		print "Artikel existiert noch nicht in der Datenbank!"
		raw_input()
		clear_screen()
		
		write_products()    # imported from add_products
		pass
Ejemplo n.º 2
0
def what_do():	
	table = []
	table.append([0, "Programm schliessen"])
	table.append([1, "Verkauf"],)
	table.append([2, "Neue Lieferung / Inventar Pruefen"],)
	table.append([3, "Sortiment bearbeiten"],)
	table.append([4, "Hilfe"])
	
	while True:
		clear_screen()
		print "Was moechten Sie machen? Bitte eine der folgenden Nummern eingeben:"
		print tabulate(table)

		choice = None
		while choice == None:
			try:
				choice = int(raw_input("> "))
			except ValueError:
				print "Bitte nur Nummern eingeben!"

		if choice == 0:
			clear_screen()
			return 0
		elif choice == 1:
			# link sale.py
			print "not implemented"
		elif choice == 2:
			clear_screen()
			take_stock()
		elif choice == 3:
			clear_screen()
			write_products()
		elif choice == 4:
			# link help.py
			print "not implemented"
		else:
			print "not implemented"