Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Micros 3700 - Get individual payments for a ticket 1

Status
Not open for further replies.

alaughlin

Programmer
Dec 29, 2014
6
US
Hey all,

I see that in the table micros.dtl, a record with a dtl_type of 'T' is inserted when a ticket is paid off and closed, with the tender type and final amount.

However, I'm looking to grab all the individual payments on a ticket and can't seem to find that anywhere. Can someone point me in the right direction?

Thanks!
 
Individual payments, are you meaning the different type of tenders used on a check?

Type Description
I Check Information Detail
M Menu Item
D Discount
S Service Charge
T Tender/Media
R Reference Number
C CA Detail
 
I suppose that's what I need?

But even a more detailed breakdown probably

Basically if there's 3 payments applied to a check:

1. Cash, $5.00, $2.00 tip
2. Cash, $7.50, $3.00 tip
3. Visa, $5.00, $3.00 tip

I need those 3 separate records
 
ok. Give me a few minutes and I will get you a simple script for this that's put into an array. From there you can do with it what you wish.
 
Here you go.

The code below will go through the check and grab any @DTL_TYPE of T = Tender/Media and put it into an array, then display the array.

Please note this was scripted on a 9700 System.
Code:
event inq : 18   // Test Event
  // VARIABLES
  var ii : n3                     //
  var aTenderMedia[10]  : A32     // Array for Storing Tender/Media Information currently on the check; [10] = Array Size, A32 = 32 Characters in length (Alphanumeric)
  var count : N4                  // Counter for Array
  var arrString : A32             /// Array String
  
  // ## END VARIABLES
  
  count = 1
    
  for ii = 1 to @NUMDTLT
    if @DTL_TYPE[ii] = "T"     // T = Tender/Media; D = Discount; M= Menu Item     
      // Format Information into a String
      format arrString as "[", @DTL_OBJNUM[ii],"] ",trim(@DTL_NAME[ii]), " - Total: ", @DTL_TTL[ii]
      
      // Add item to the Array
      aTenderMedia[count] = arrString
      count = count + 1   // Increase count for next Array entry
      
    endif
    
  endfor

  // Display Tender/Media Results, Via Window/Display Function
  window 14,50, "Tender/Media Results"
  windowclear
    displayinverse 1, @CENTER, "--------------------------------------------------"{=(@WCOLS)}
    displayinverse 2, @CENTER,"Tender/Media Found on Check"{=(@WCOLS)}
    displayinverse 3, @CENTER, "__________________________________________________"{=(@WCOLS)}
    ListDisplay 4, 2, arraysize(aTenderMedia), aTenderMedia        // 
    displayinverse 14,@CENTER,"=================================================="{=(@WCOLS)}
  
    waitforclear      // Wait for the Clear button to be pressed
  
endevent

If you wanted to offer a selection to the End User you can use ListInput.
Code:
event inq : 18   // Test Event
  // VARIABLES
  var ii : n3                     //
  var aTenderMedia[10]  : A32     // Array for Storing Tender/Media Information currently on the check; [10] = Array Size, A32 = 32 Characters in length (Alphanumeric)
  var count : N4                  // Counter for Array
  var arrString : A32             // Array String
  var Item_Selected : n16         // Used with ListInput
  
  // ## END VARIABLES
  
  count = 1
    
  for ii = 1 to @NUMDTLT
    if @DTL_TYPE[ii] = "T"     // T = Tender/Media; D = Discount; M= Menu Item
      // 
      format arrString as "[", @DTL_OBJNUM[ii],"] ",trim(@DTL_NAME[ii]), " - Total: ", @DTL_TTL[ii]
      
      // Add item to the Array
      aTenderMedia[count] = arrString
      count = count + 1   // Increase count for next Array entry
      
    endif
    
  endfor
  
  //infomessage "Total Discounts on Check: ", iDiscNum
  
  // Display Tender/Media Results, Via Window/Display Function
  window 14,50, "Tender/Media Results"
  windowclear
    displayinverse 1, @CENTER, "--------------------------------------------------"{=(@WCOLS)}
    displayinverse 2, @CENTER,"Tender/Media Found on Check"{=(@WCOLS)}
    displayinverse 3, @CENTER, "__________________________________________________"{=(@WCOLS)}
    ListInput 4, 2, arraysize(aTenderMedia), aTenderMedia, Item_Selected, "Make your Selection..."
    //ListDisplay 4, 2, arraysize(aTenderMedia), aTenderMedia        // 
    displayinverse 14,@CENTER,"=================================================="{=(@WCOLS)}
  
    //waitforclear      // Wait for the Clear button to be pressed
  
  infomessage "Selected: ", aTenderMedia[Item_Selected]       // Displays what was selected
  
endevent

The array I created was only for an Array with 10 items, if you need more you will need to create a 2nd page. However, I honestly do not come by or see more than 10 tenders used on a single check.

Let me know if you have any questions.
 
FYI

Forgot to comment in the code. When using the ListDisplay method, you need waitforclear, otherwise the window won't be seen as it is pasted over to quickly.
 
** I wish there was an edit function

Also, where you see @DTL_TYPE[ii] = "T", you can change that to any of the "Type Descriptions" I posted earlier and it will look for those on the check.

So if you wanted to see Discounts, use @DTL_TYPE[ii] = "D".
Menu Items use @DTL_TYPE[ii] = "M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top