kws = dict(left_on='date', right_on='start', allow_exact_matches=True, by='ID')
mrg = pd.merge_asof(df_b, df_a, **kws).query('date <= end')
grp = mrg.groupby(['start', 'end', 'ID']).amount.sum()
grp.reindex(mux, fill_value=0).reset_index()
Pandas: Add amount in Dataframe based on date ranges and IDs