My situation is this:
I have a discount that have Reference Required, that reference is a coupon number that the customer brings to us. When we capture the discount, the POS has to comunicate with an external interface (a Web Service) in order to verify thet the coupon number is valid and does not has been used in other restaurant, if everything is okay, the discount is accepted and recorded in Micros (chk_dtl, trans_dtl, dtl, etc), including the reference number (ref_dtl).
When the check is payd and closed, in that moment we have to comunicate again with Web Service in order to tell it that this coupon number (Reference) has been used, and i have to pass it the coupon number (info that i put as discount reference). So at Final Tender event, i need to have the discount reference(coupon number), and i think that @numdtlt could help.
I can do it calling a Store Procedure, but i ask my self if @Trdtlt could simplify the work.
Or there are a simpliest way to get the check reference (stored in ref_dtl) asociated to dtl table trough trans_dtl and dtl_seq fields ?
Thanks again.