i have transaction data where the total amount(excluding comps(discounts)) for the particular check(order) is calculated , i have another table with reasons for the comps and there ids , is there anyway i can figureout which comp is been used for which check ,and i want to have a flag for checks with comp and checks without comp.
i think this can be done by checking the relation between comps ,ItemSales,Payment
please find the attached excel with sample data and codes for comps.
gwassenaarswuehlkush141087maxgrorwunderlichstalwar1sorrakis01anonymousmby