Beispiel #1
0
def update_total_cups_sold(start_date, end_date, select_type_2):
    select_type_2 = select_type_2 if isinstance(select_type_2,
                                                list) else [select_type_2]
    df3 = df.loc[start_date:end_date]
    filt = df3.loc[df3['Item'].isin(select_type_2)]
    cups_sold = filt['Qty'].sum()
    #cups_sold = df3.loc[filt, 'Qty'].sum()
    #cups_sold = df3.groupby([df3['Item'].isin(select_type_2)])['Qty'].sum()
    return thousands(cups_sold)
Beispiel #2
0
def update_total_product_revenues(start_date, end_date, select_type_2):
    select_type_2 = select_type_2 if isinstance(select_type_2,
                                                list) else [select_type_2]
    df3 = df.loc[start_date:end_date]
    filt = df3.loc[df3['Item'].isin(select_type_2)]
    sales_revenue = filt['Revenue'].sum()
    #sales_revenue = df3.loc[filt, 'Revenue'].sum()
    #sales_revenue = df3.groupby([df3['Item'].isin(select_type_2)])['Revenue'].sum()
    return thousands(sales_revenue)
Beispiel #3
0
def update_fixed(start_date, end_date):
    df3 = df2.loc[start_date:end_date]
    filt = (df3['Type'] == 'Fixed Cost')
    total_fixed_costs = df3.loc[filt, 'Costs'].sum()
    return thousands(total_fixed_costs)
Beispiel #4
0
def update_marketing(start_date, end_date):
    df3 = df2.loc[start_date:end_date]
    filt = (df3['Type'] == 'Marketing')
    total_marketing_costs = df3.loc[filt, 'Costs'].sum()
    return thousands(total_marketing_costs)
Beispiel #5
0
def update_variable(start_date, end_date):
    df3 = df2.loc[start_date:end_date]
    filt = (df3['Type'] == 'Variable Cost')
    total_variable_costs = df3.loc[filt, 'Costs'].sum()
    return thousands(total_variable_costs)
Beispiel #6
0
def update_ingredients(start_date, end_date):
    df3 = df2.loc[start_date:end_date]
    filt = (df3['Type'] == 'Ingredients')
    total_ingredients_costs = df3.loc[filt, 'Costs'].sum()
    return thousands(total_ingredients_costs)
Beispiel #7
0
def update_profit(start_date, end_date):
    df3 = df.loc[start_date:end_date]
    df4 = df2.loc[start_date:end_date]
    total_profit = (df3['Revenue'].sum() - df4['Costs'].sum())
    return thousands(total_profit)
Beispiel #8
0
def update_cups(start_date, end_date):
    df3 = df.loc[start_date:end_date]
    total_cups_sold = df3['Qty'].sum()
    return thousands(total_cups_sold)
Beispiel #9
0
def update_cost(start_date, end_date):
    df3 = df2.loc[start_date:end_date]
    total_cost = df3['Costs'].sum()
    return thousands(total_cost)
Beispiel #10
0
def update_sales(start_date, end_date):
    df3 = df.loc[start_date:end_date]
    sales_revenue = df3['Revenue'].sum()
    return thousands(sales_revenue)