Ejemplo n.º 1
0
def to_process(order_id):
	"""
	Put order in process and return a text
	"""
	db = SQLbase(config.db)
	db.to_process(order_id)
	list_order = db.info_request(order_id)
	db.remains(order_id)
	db.close()
	txt_0 = "Данный товар на производстве:"
	txt_1 = txt_order(list_order)
	txt = "{}\n{}".format(txt_0, txt_1)
	return txt
Ejemplo n.º 2
0
def decide_adm(order_id):
	"""
	In_kb with yes or no and text about order 
	"""
	db = SQLbase(config.db)
	list_order = db.info_request(order_id)
	db.close()
	txt_0 = "Вы уверенны что хотите выпустить на производство этот товар:"
	txt_1 = txt_order(list_order)
	txt = "{}\n{}".format(txt_0, txt_1)
	in_kb = types.InlineKeyboardMarkup()
	yes = types.InlineKeyboardButton(text = "Да", callback_data = "adm_yes{}".format(order_id))
	no = types.InlineKeyboardButton(text = "Нет", callback_data = "adm_no")
	in_kb.add(yes, no)
	return in_kb, txt
Ejemplo n.º 3
0
def done_order(id_order):
	"""
	Update status process -> done in Order's db
	"""
	db = SQLbase(config.db)
	db.done_process(id_order)
	info_order = db.info_request(id_order)
	db.close()
	txt_0 = "Вы убрали с произвоства товар №{}: ".format(info_order[0])
	txt_1 = "Наименование товара: {}".format(info_order[1])
	txt_2 = "Вид материала: {}".format(info_order[2])
	txt_3 = "Размер товара: {}".format(info_order[3])
	txt_4 = "Величина п/м: {}".format(info_order[4])
	txt = "{0}\n{1}\n{2}\n{3}\n{4}".format(txt_0, txt_1, txt_2, txt_3, txt_4)
	return txt