Virtual Work Periods and Emailing WP Report

When virtual work periods are enabled, will the closing/opening of the new virtual work period trigger any rules related to the event “Work Period Ended”?

Also, is it safe to assume that SambaPOS needs to be running for any of the above to run?

Virtual workperiods never close they are one continuous period that uses the last active ticket as end point and the start point you defined for reports but it never actualy ends a work period. You need to end work period to do stock takes etc.

So no it won’t trigger any rules that have to do with work period ends.

It will auto start a wp based on the hour you set though if you ended a wp.

Thanks, Jesse!


So sorry pulling this up, do we have a way to auto email reports at a specific time when using Virtual Workperiods?

Yes you can do that.

Could you give me a basic idea how to achieve that Jesse?

Trying to look around but still couldn’t find a way to trigger a rule to send the reports out at a specific time of a day. Need your advices everyone.

Had to delete my last posts because I misread.

  1. Set Trigger
  2. Create Save Report to File Action
  3. Create Send Email Action
  4. Rule


Save Report Action

Send Email Action

Rule (not mine, but should work) I convert mine to PDF

C:\Program Files (x86)\SambaPOS5\Reports\WP_[=Helper.GetUniqueString().substr(4,2)][=Helper.GetUniqueString().substr(6,2)]_[=Helper.GetUniqueString().substr(0,4)].xps

You could also look at Data Export for CSV format. Mine is based on:


Hi, thank you for your kindness Joe, the guide is detail. Yeah, I’m sending reports, not database backups. However, I understood just fine the general idea from your previous posts. I put the system into a test run tonight, will get back for the result on next days. Thank you so much! :smile:


As per JTRTech

On my server SambaPOS is running but not logged in, just on login screen.
Mapping the rule to the server only was to ensure the resulting script was only run once by the server avoiding chance of double running on other terminal (if that is possible or not am not sure but wanted to be safe).
As I understand it trigger is a global event so would trigger the rule on every machine open to triggers at that time.

I didn’t leave the Samba client open on the server last night so it didn’t send. Mapped it and left it open this morning. Worked fine.

1 Like

I’m looking into XPS converter, do we need to put something like delay for few seconds between XPS creation - XPS converter - PDF sending email?

My converter seems not work correctly, I wonder if something like [=Helper.GetUniqueString().substr(4,2)] will work or not.




To add a delay you need to split the rule in to seperate rules for the steps and add execute automation command with a delay action and command name for next rule.

1 Like

Yes you need to add a delay. Create an execute automate command action with a 3 second delay after creating the report. I added this later compared to my screenshots above.

Is the report creating successfully? If not, it’s likely security settings to the reports folder. Why would you want to write it to C:\ ?

I created a reports folder in the SambaPOS5 directory and I didn’t have to make any security changes.

1 Like

Thanks, I’ll try to put the delay in today, still blurry how to do that. Actually, the reports are in C:\SambaPOS5\Reports\ and I made it shorter for screenshot purpose. Oh, and I can create XPS just fine, PDF convert not work through SambaPOS yet.

Okay, not home right now, but I’ll send my screens when I get in. Its generally:

  1. Rule - Trigger/Automation Command Rule (your choice to start the process)
  2. Action - Save Report to File Action (Create XPS)
  3. Action - Execute Automation Command (add delay, select a name for the command)
  4. Rule - Automation Command Executed (whatever you named in #3)
  5. Action - Execute Ghostscript conversion
  6. Action - Email action

I have mine running every two hours to watch for any issues right now.

1 Like

Here’s how my is temporarily setup. I will obviously be setting my report to be execute prior to the close of my virtual work period and when the business is no longer executing orders.

  1. Trigger (Set to your liking)

  2. Action - Save Report to File

  3. Action - Execute Automation Command

  4. Rule - Save Report, Execute Automation Command


C:\Program Files (x86)\SambaPOS5\Reports\WP_[=Helper.GetUniqueString().substr(4,2)][=Helper.GetUniqueString().substr(6,2)]_[=Helper.GetUniqueString().substr(0,4)].xps

  1. Action - Start Process

  2. Action - Send Email (set to your needs)

  3. Rule - Automate Command Executed


“C:\Program Files (x86)\SambaPOS5\Reports\WP_[=Helper.GetUniqueString().substr(4,2)][=Helper.GetUniqueString().substr(6,2)][=Helper.GetUniqueString().substr(0,4)].xps" "C:\Program Files (x86)\SambaPOS5\Reports\WP[=Helper.GetUniqueString().substr(4,2)][=Helper.GetUniqueString().substr(6,2)]_[=Helper.GetUniqueString().substr(0,4)].pdf”


C:\Program Files (x86)\SambaPOS5\Reports\WP_[=Helper.GetUniqueString().substr(4,2)][=Helper.GetUniqueString().substr(6,2)]_[=Helper.GetUniqueString().substr(0,4)].pdf

1 Like

Thanks! I’m trying now. What is your Retry Count & Retry Minutes? Do we need them in our case?


1 Like

I left these blank. I haven’t had any issues with my SMTP server. Worse case scenario I could VPN to the server and grab the report.

Keep in mind, if you’re trying to use GMail SMTP server you might need to grant additional access to devices. I had to do this with my network printer for scanning purposes.

See - Other Setup Options - Use the Gmail SMTP Server:

1 Like

Can I have a look at your XPS to PDF batch file? I think I’m having issue there, still can’t convert XPS to PDF. :confounded: