Esempio n. 1
0
def set_leaving_time(staff_id, date_time_str):
    return get_data_xml(
        "SetLeavingTime",
        dict_to_xml(
            {'PARAMS': {
                'STAFF_ID': staff_id,
                'DATE_TIME': date_time_str
            }}))
Esempio n. 2
0
def get_worksheets(staff_id, date):
    return get_data_xml(
        "GetWorksheets",
        dict_to_xml({
            'PARAMS': {
                'STAFF_ID': staff_id,
                'INPUT_DATE': date.toString('dd.MM.yyyy')
            }
        }))
Esempio n. 3
0
def get_staff_by_user(user_id):
    result_xml = get_data_xml("GetStaffByUser",
                              dict_to_xml({'PARAMS': {
                                  'USER_ID': user_id
                              }}))
    staff_id = int(get_xml_field_value(result_xml, 'RESULT'))
    if staff_id is None:
        raise GuiException('Вы не являетесь сотрудником Novelty')
    return staff_id
Esempio n. 4
0
def get_timesheet(staff_id, date_beg, date_end):
    return get_data_xml(
        "GetTimesheet",
        dict_to_xml({
            'PARAMS': {
                'STAFF_ID': staff_id,
                'BEG_DATE': date_beg,
                'END_DATE': date_end
            }
        }))
Esempio n. 5
0
def get_directories_changed_at():
    xml = get_data_xml("GetDirectoriesChangedAt", "")
    result = {}
    result['server_time'] = datetime.strptime(
        get_xml_field_value(xml, 'SERVER_TIME'), REMOTE_DATETIME_FORMAT)
    result['customers_changed_at'] = datetime.strptime(
        get_xml_field_value(xml, 'CUSTOMERS_CHANGED_AT'),
        REMOTE_DATETIME_FORMAT)
    result['task_types_changed_at'] = datetime.strptime(
        get_xml_field_value(xml, 'TASK_TYPES_CHANGED_AT'),
        REMOTE_DATETIME_FORMAT)
    return result
Esempio n. 6
0
def create_ore_replace_dinner_order(menu, salad, first, second):
    return get_data_xml(
        "CreateOrReplaceDinnerOrder",
        dict_to_xml({
            'PARAMS': {
                'MENU': menu,
                'ORDER': {
                    'SALAD': salad,
                    'FIRST': first,
                    'SECOND': second
                }
            }
        }))
Esempio n. 7
0
def set_program_version(version_number):
    vn = int(version_number)
    return get_data_xml("SetAssistantVersion",
                        dict_to_xml({'PARAMS': {
                            'VERSION_NUMBER': vn
                        }}))
Esempio n. 8
0
def get_program_version():
    return int(
        get_xml_field_value(get_data_xml("GetAssistantVersion", ""),
                            'VERSION_NUMBER'))
Esempio n. 9
0
def get_task_types():
    return get_data_xml("GetTaskTypes", "")
Esempio n. 10
0
def get_customers():
    return get_data_xml("GetCustomers", "")
Esempio n. 11
0
def get_dinner_paths():
    return get_xml_field_value(get_data_xml("GetDinnerPaths", ""),
                               'PATHS').split()
Esempio n. 12
0
def get_dinner_order_permissions():
    return get_data_xml("GetDinnerOrderPermissions", "")
Esempio n. 13
0
def get_dinner_order():
    return get_data_xml("GetDinnerOrder", "")
Esempio n. 14
0
def get_new_in_version():
    return get_xml_field_value(
        get_data_xml("GetAssistantVersionDescription", ""),
        'VERSION_DESCRIPTION')
Esempio n. 15
0
def set_worksheet(xml):
    return get_data_xml('SetWorksheets', xml)
Esempio n. 16
0
def set_new_in_version(txt):
    return get_data_xml("SetAssistantVersionDescription",
                        dict_to_xml({'PARAMS': {
                            'VERSION_DESCRIPTION': txt
                        }}))
Esempio n. 17
0
def get_controllable_services():
    return get_data_xml("GetControllableServices", "")