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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to show Pick Up Check Screen using Simphony Extensibility C# Code

Status
Not open for further replies.

Vikram Singh

Programmer
Jan 3, 2018
39
KW
Hello everyone,

how can I show the below screen (Pick Up Check)using Simphony Extensibility C# Code and get the selected
check number
?

Capture_qmc0gc.png
 
This was actually a bit fun, because there is not a built-in function that fits this in a good way.

Below assumes that you want the check number of the selected check, and not actually pick up the check.

So, the approach I took was:
[ol 1]
[li] Execute a PickUpCheckFromListRvcIndex command on the OpsContext[/li]
[li] Listen for the OpsPickUpCheckEventPreview event[/li]
[li] Read the check number from the OpsPickUpCheckEventArgs (the actual check number is internal, so a bit of reflection was needed)[/li]
[li] Abort the check pickup operation with EventProcessingInstruction.AbortEvent[/li]
[/ol]

I have a small project on Github that shows the implementation, it will not win any awards, but it is probably something you can develop further.

I haven't checked if having the check open on another workstation causes problems, it will depend on if Simphony does the validation before or after the OpsPickUpCheckEventPreview event, but this is something you can test.

Project at GitHub
 
Thank you very much Martn for the sample code. But I'm getting RVC not found error when I call SelectCheck function.

Capture2_rjmgom.png


below is my code please advise what I'm doing wrong

Code:
[ExtensibilityMethod]
        public void ReprinteInvoice2()
        {
            [b]SelectCheck([highlight #FCE94F]OpsContext.RvcNumber.ToString()[/highlight]);[/b]

        }

private void SelectCheck(string rvcNumberString)
        {
            if (!int.TryParse(rvcNumberString, out var rvcNumber))
                throw new Exception("Please specify the RVC number as argument on the function call");

            _selectCheckInProgress = true;

            OpsContext.ProcessCommand(new OpsCommand { Command = OpsCommandType.PickUpCheckFromListRvcIndex, Index = rvcNumber });
                        
            _selectCheckInProgress = false;

            if (_selectedCheckNumber != 0)
            {
                OpsContext.ShowMessage($"Check number {_selectedCheckNumber} was selected");
                _selectedCheckNumber = 0;
            }
        }
 
I would guess that the index you pass to the OpsCommand is not a valid RVC index.

I cannot see from your code snip where it comes from - in my sample I sat the RVC index as an argument on the button (so calling the variable rvcNumber, in my code, is actually misleading).

Remember that it is not the rvc number, it is the index, as configured on the Workstation.
 
How we can get the Index I can see below related to RVC in OpsContext.

Capture3_wlhzgb.png
 
The reason for the index is for you to pickup up checks from other RVC's.

If you only need to select checks from the current RVC, you can use OpsCommandType.PickUpCheckFromList, and leave out the index property.

Code:
private void SelectCheckTest()
{
    _selectCheckInProgress = true;

    OpsContext.ProcessCommand(new OpsCommand { Command = OpsCommandType.PickUpCheckFromList });

    _selectCheckInProgress = false;

    if (_selectedCheckNumber != 0)
    {
        OpsContext.ShowMessage($"Check number {_selectedCheckNumber} was selected");
        _selectedCheckNumber = 0;
    }
}
 
When I changed to PickUpCheckFromList it start showing the Pick-Up Check screen. But it is showing 0 checks. Please refer to the below 2 screenshots.

This when executes PickUpCheckFromList
Capture5_yqbqiv.png


This when clicking Reprint Closed Checks
Capture4_q829yz.png
 
Ah, you did not mention that it was closed checks [glasses]

PickUpCheckFromList is for currently open checks, to trigger the reopen closed checks dialogue, you need ReopenClosedCheckFromList - but this requires that the employee has the rights to do so.

Also, then you need to use the OpsReopenClosedCheckEventPreview event to abort the pickup.

However, the OpsReopenClosedCheckEventArgs does not contain the check number, so this will not give you the result you want.

----

Maybe you could describe what you want to achieve overall? - then maybe other than me can bring suggestions on a solution.

I guess from your screenshot, its something about reprinting invoices...
 
Yes Martin, I want to get the closing checklist to reprint the guest with a QR code. Sorry for the misleading description of my requirement. My requirement is below.

Fetch the list of Closed checks from the above list, employees will choose a check which will be sent to a third-party system. The third-party system will provide some dynamic string values that need to convert to a QRcode which and print on the guest check.

 
Ok, so something like this?

1. select closed check from a list
2. send check details to 3rd party system and get QR code data back
3. re-print the printed check with the QR code at the bottom

Did you manage to print the QR code? - I saw you made an earlier post, where POSKitchen hinted that the QRCodePrinterHelper from an Oracle fiscal solution maybe could be of use.

I looked at the helper and it seems to do what it says, but I have not tested it.
 
Yes, Martin, this is exactly my requirement. But this requirement has 2 phases in the first phase I have to reopen the closed check and send the check details to the 3rd party system and get a coupon code to print the same on the check trailer. In the second phase, they will send a JSON chunk which we need to convert to QR code and print on the check trailer instead of the Coupon code.

Yes, POSKitchen gave me QRCodePrinterHelper but I didn't try because the priority is phase1.


Please advise me if you have any alternate solution to show the closing checklist and get the selected check number.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top