Exemplo n.º 1
0
def get_category_group_value(range):
    book = xwu.get_book_from_range(range)
    sheet = xwu.get_sheet_from_range(range)
    row_no = range.row
    category_group_col_no = xwu.find_col_by_multi_metakey(['CategoryGroup'],
                                                          sheet)
    category_group_value = sheet.range(row_no, category_group_col_no).value
    return category_group_value
Exemplo n.º 2
0
 def get_sales_order_params_by_range_legacy_tool(self, range):
     sheet = xwu.get_sheet_from_range(range)
     row = range.row
     column = range.column
     sales_order_params = {}
     partner_name_row_num = xwu.find_row_by_metakey(sheet, "PartnerName")
     sales_order_params[
         "OrderRowId"] = self.get_order_row_id_by_row_no_legacy(sheet, row)
     sales_order_params["Partner"] = sheet.range(partner_name_row_num,
                                                 column).value
     return sales_order_params
Exemplo n.º 3
0
def validate_size(size_dict, range):
    sheet = xwu.get_sheet_from_range(range)
    size_range = str(
        sheet.range(range.row, xwu.find_col_by_metakey("SizeRange",
                                                       sheet)).value)
    size_metakey = xwu.find_size_metakey_by_col(range.column, sheet)

    range_length = 0
    try:
        range_length = len(size_dict[size_range].split(';'))
    except KeyError:
        range_length = len(size_dict[float(size_range)].split(';'))

    if (size_metakey > range_length):
        return False
    else:
        return True
Exemplo n.º 4
0
def get_hub_level_budget_value_gbp(range):
    budget_sheet = xwu.get_sheet_from_range(range)
    row = range.row
    budget_value_gbp_col_no = xwu.find_col_by_multi_metakey(
        [c.HUB_LEVEL_BUDGET_VALUE_GBP_METAKEY], budget_sheet, col_start=7)
    return budget_sheet.range(row, budget_value_gbp_col_no).value
Exemplo n.º 5
0
def get_hub_level_ly_actual_gbp(range):
    budget_sheet = xwu.get_sheet_from_range(range)
    row = range.row
    ly_actual_gbp_col_no = xwu.find_col_by_multi_metakey(
        [c.HUB_LEVEL_LY_ACTUAL_GBP_METAKEY], budget_sheet, col_start=7)
    return budget_sheet.range(row, ly_actual_gbp_col_no).value
Exemplo n.º 6
0
def get_hub_level_partner_business_unit(range):
    budget_sheet = xwu.get_sheet_from_range(range)
    row = range.row
    partner_business_unit_col_no = xwu.find_col_by_multi_metakey(
        [c.HUB_LEVEL_PARTNER_BUSINESS_UNIT_METAKEY], budget_sheet)
    return budget_sheet.range(row, partner_business_unit_col_no).value
Exemplo n.º 7
0
def get_hub_level_sub_category(range):
    budget_sheet = xwu.get_sheet_from_range(range)
    row = range.row
    sub_category_col_no = xwu.find_col_by_multi_metakey(
        [c.HUB_LEVEL_SUB_CATEGORY_METAKEY], budget_sheet)
    return budget_sheet.range(row, sub_category_col_no).value
Exemplo n.º 8
0
def get_hub_level_partner_season(range):
    budget_sheet = xwu.get_sheet_from_range(range)
    row = range.row
    partner_season_col_no = xwu.find_col_by_multi_metakey(
        [c.HUB_LEVEL_PARTNER_SEASON_METAKEY], budget_sheet)
    return budget_sheet.range(row, partner_season_col_no).value
Exemplo n.º 9
0
def get_brand_level_arcadia_season(range):
    budget_sheet = xwu.get_sheet_from_range(range)
    row = range.row
    arcadia_season_col_no = xwu.find_col_by_multi_metakey(
        [c.BRAND_LEVEL_ARCADIA_SEASON_METAKEY], budget_sheet)
    return budget_sheet.range(row, arcadia_season_col_no).value
Exemplo n.º 10
0
def get_brand_level_budget_value_gbp(range):
    budget_sheet = xwu.get_sheet_from_range(range)
    row = range.row
    budget_value_gbp_no = xwu.find_col_by_multi_metakey(
        [c.BRAND_LEVEL_BUDGET_VALUE_GBP_METAKEY], budget_sheet)
    return budget_sheet.range(row, budget_value_gbp_no).value
Exemplo n.º 11
0
def get_brand_level_budget_month(range):
    budget_sheet = xwu.get_sheet_from_range(range)
    row = range.row
    budget_month_col_no = xwu.find_col_by_multi_metakey(
        [c.BRAND_LEVEL_BUDGET_MONTH_METAKEY], budget_sheet)
    return budget_sheet.range(row, budget_month_col_no).value
Exemplo n.º 12
0
def get_brand_level_department(range):
    budget_sheet = xwu.get_sheet_from_range(range)
    row = range.row
    department_col_no = xwu.find_col_by_multi_metakey(
        [c.BRAND_LEVEL_DEPARTMENT_METAKEY], budget_sheet)
    return budget_sheet.range(row, department_col_no).value