if the order number of the Invoice line item is in the list of online order numbers the order line is online, otherwise offline.
Loyalty points are added only when the client is accepted the agreement. Otherwise it’s not. There could be a situation, today agreed, tomorrow not agreed and the day after tomorrow agreed again. In the before mentioned situation points are calculated on those days when the agreement is accepted.