|
|
|
@ -89,7 +89,8 @@ messages_notification = {
|
|
|
|
|
<b>Описание заказа:</b> |
|
|
|
|
#{orders.desc_field} |
|
|
|
|
|
|
|
|
|
Оплатите заказ и прикрепите чек об оплате к заказу. Для этого проследуйте по пути "Главное меню"->"Заказы"->"Загрузить чек по оплате моего заказа"''', |
|
|
|
|
Оплатите заказ и прикрепите чек об оплате к заказу. Для этого проследуйте по пути "Главное меню"->"Заказы"->"Загрузить чек по оплате моего заказа" |
|
|
|
|
Или воспользуйтесь кнопкой:''', |
|
|
|
|
mod_table_operate.NotificationMessage(orders.OrderStatus.ADDRESS): f'''Статус заказа "#{orders.name_field}" изменён на - Заказ ожидает указания адреса доставки. |
|
|
|
|
|
|
|
|
|
<b>Описание заказа:</b> |
|
|
|
@ -152,8 +153,28 @@ class ModuleAllOrders(orders.ModuleOrders):
|
|
|
|
|
n, k, a = super().GetButtonNameAndKeyValueAndAccess(a_Item) |
|
|
|
|
return str(a_Item[key_field_id]) + ":" + n + "," + str(a_Item[user_field_id]), k, a |
|
|
|
|
|
|
|
|
|
def GetPayInlineKeyboardFunc(self, a_ItemID): |
|
|
|
|
def PayInlineKeyboard(a_Message, a_UserGroups): |
|
|
|
|
print('PayInlineKeyboard', a_Message, a_UserGroups, a_ItemID) |
|
|
|
|
cur_buttons = [] |
|
|
|
|
|
|
|
|
|
orders_mod = self.GetModule(orders.module_name) |
|
|
|
|
dst = bd_table.TableFieldDestiny.PHOTO_PAY |
|
|
|
|
if orders_mod: |
|
|
|
|
prefix = orders_mod.m_EditPrefix.get(dst, None) |
|
|
|
|
if prefix: |
|
|
|
|
access = orders_mod.GetAccessForEditKeyboardButtons(orders_mod.m_Table.GetFieldByDestiny(dst)) |
|
|
|
|
cur_buttons += [ |
|
|
|
|
keyboard.InlineButtonWithAccess(orders_mod.GetButton(mod_table_operate.EditButton(dst)), prefix, a_ItemID, orders_mod.GetAccess(), access), |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
print('cur_buttons', cur_buttons, a_Message, a_UserGroups, a_ItemID) |
|
|
|
|
return keyboard.MakeInlineKeyboardButtons(self.m_Bot, cur_buttons, a_UserGroups) |
|
|
|
|
return PayInlineKeyboard |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def OnChangeField(self, a_Field, a_ItemID, a_ItemData, a_EditUserID): |
|
|
|
|
super().OnChangeField(a_Field, a_ItemID, a_ItemData, a_EditUserID) |
|
|
|
|
await super().OnChangeField(a_Field, a_ItemID, a_ItemData, a_EditUserID) |
|
|
|
|
if a_Field.m_Destiny == bd_table.TableFieldDestiny.STATUS: |
|
|
|
|
key_field = self.m_Table.GetFieldNameByDestiny(bd_table.TableFieldDestiny.KEY) |
|
|
|
|
item = bd_item.GetBDItemsTemplate(self.m_Bot, self.m_Table.GetName(), key_field)(a_ItemID) |
|
|
|
@ -181,7 +202,12 @@ class ModuleAllOrders(orders.ModuleOrders):
|
|
|
|
|
self.m_Log.Error(f'Не удалось оповестить по заказу №{a_ItemID}. Пустое сообщение для нового статуса {new_status}') |
|
|
|
|
return |
|
|
|
|
msg = self.UpdateMessage(msg, None, item) |
|
|
|
|
await self.SendMessageToUser(msg, owner_id) |
|
|
|
|
inline_keyboard = None |
|
|
|
|
print('new_status', str(orders.OrderStatus.PAY), new_status) |
|
|
|
|
if new_status == str(orders.OrderStatus.PAY): |
|
|
|
|
inline_keyboard = self.GetPayInlineKeyboardFunc(a_ItemID) |
|
|
|
|
|
|
|
|
|
await self.SendMessageToUser(msg, owner_id, a_GetInlineButtonsFunc = inline_keyboard) |
|
|
|
|
|
|
|
|
|
def GetStartButtons(self, a_Message, a_UserGroups): |
|
|
|
|
return [ |
|
|
|
@ -203,7 +229,7 @@ class ModuleAllOrders(orders.ModuleOrders):
|
|
|
|
|
user_id = cur_item[user_id_field_index] |
|
|
|
|
|
|
|
|
|
if not user_id: |
|
|
|
|
return None |
|
|
|
|
return keyboard.MakeInlineKeyboardButtons(self.m_Bot, [], a_UserGroups) |
|
|
|
|
|
|
|
|
|
cur_buttons = [] |
|
|
|
|
|
|
|
|
@ -213,7 +239,7 @@ class ModuleAllOrders(orders.ModuleOrders):
|
|
|
|
|
prefix = self.m_EditPrefix.get(dst, None) |
|
|
|
|
if prefix: |
|
|
|
|
cur_buttons += [ |
|
|
|
|
keyboard.InlineButtonWithAccess(self.GetButton(btn), prefix, cur_item[key_field_index], access, user_access.AccessMode.EDIT), |
|
|
|
|
keyboard.InlineButtonWithAccess(self.GetButton(btn), prefix, cur_item[key_field_index], self.GetAccess(), access), |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
user_message_mod = self.GetModule(user_message.module_name) |
|
|
|
@ -222,13 +248,11 @@ class ModuleAllOrders(orders.ModuleOrders):
|
|
|
|
|
keyboard.InlineButtonWithAccess(self.GetButton(ButtonNames.SEND_USER_MESSAGE), user_message_mod.GetAddPrefix(), user_id, user_message_mod.GetAccess(), user_access.AccessMode.ADD), |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
users_mod = self.GetModule(users.module_name) |
|
|
|
|
if users_mod: |
|
|
|
|
cur_buttons += [ |
|
|
|
|
keyboard.InlineButtonWithAccess(self.GetButton(ButtonNames.SHOW_USER_INFO), users_mod.GetShowPrefix(), user_id, users_mod.GetAccess(), user_access.AccessMode.VIEW), |
|
|
|
|
] |
|
|
|
|
#users_mod = self.GetModule(users.module_name) |
|
|
|
|
#if users_mod: |
|
|
|
|
# cur_buttons += [ |
|
|
|
|
# keyboard.InlineButtonWithAccess(self.GetButton(ButtonNames.SHOW_USER_INFO), users_mod.GetShowPrefix(), user_id, users_mod.GetAccess(), user_access.AccessMode.VIEW), |
|
|
|
|
# ] |
|
|
|
|
|
|
|
|
|
if len(cur_buttons) == 0: |
|
|
|
|
return None |
|
|
|
|
return keyboard.MakeInlineKeyboardButtons(self.m_Bot, cur_buttons, a_UserGroups) |
|
|
|
|
|
|
|
|
|