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)
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)
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)
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)
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)
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)
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)
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)
def update_cost(start_date, end_date): df3 = df2.loc[start_date:end_date] total_cost = df3['Costs'].sum() return thousands(total_cost)
def update_sales(start_date, end_date): df3 = df.loc[start_date:end_date] sales_revenue = df3['Revenue'].sum() return thousands(sales_revenue)