I want to add ID variable in this data. If receipt_ids are sequenced numbers, then those have same IDs.
CUST_NO_ID receipt_id dollar 12 29
Had a similar notion to @Psidom, but he beat me to the punch with cumsum. Here's a dplyr solution. Adding in group_by can give you added flexibility if you want to restart ids by customer number.
cumsum
dplyr
group_by
df %>% mutate(id = cumsum(c(TRUE, diff(receipt_id) != 1)))