Schedule MacroRIS-SM-1026 – SendOpenOrderPrintToVirtualPrinter

Send Open Order Print to Virtual Printer

Automatically print invoices for open orders by applying template mapping based on shipping service and sending them to a virtual printer.

Overview

The RIS-SM-1026 – SendOpenOrderPrintToVirtualPrinter macro automates invoice printing by sending order documents directly to a configured virtual printer.

It filters eligible orders, selects the correct invoice template based on shipping service, and prints invoices without manual intervention.

Ensure the virtual printer is online and invoice templates are correctly configured before running this macro.

Purpose

This macro:

  • Filters orders using identifiers
  • Maps shipping services to invoice templates
  • Sends invoices to a virtual printer
  • Automates document printing

👉 In short:
Automatically print invoices for selected orders.

When It Runs

Used for invoice printing automation

Typically runs:

  • Scheduled execution
  • Manually triggered
  • After order import or processing

Parameters

path
virtualPrinterNamestring
Required

Name of the virtual printer.

path
identifierstring
Required

Order identifiers used to filter eligible orders.

path
shippingServiceNamesstring
Required

Shipping services used for template mapping.

path
invoiceTemplatesstring
Required

Invoice templates mapped to shipping services.

path
defualtInvoiceTemplatestring
Required

Default invoice template if no match is found.

Example:
Identifier → "Express,Priority"
Shipping Service → "Royal Mail,DPD"
Templates → "RM Invoice,DPD Invoice"

Meaning:
Each shipping service is mapped to a corresponding invoice template.

How It Works

Fetch Open Orders

Retrieve open orders from the last 8 days.

Filter Eligible Orders

Select orders that:

  • Do not have shipping labels printed
  • Match the provided identifiers

Retrieve Printers & Templates

Fetch available invoice templates and virtual printers.
Validate that the target printer is online.

Process Orders

Loop through each filtered order.

Map Template

Match order shipping service with configured list and assign template.
Use default template if no match is found.

Print Invoice

Generate invoice PDF and send it to the virtual printer.

Log Results

Record successful prints and log any failures.

Final Result

  • Orders filtered and processed automatically
  • Correct invoice templates applied
  • Invoices printed via virtual printer
  • Execution logs available

Usefulness

This macro is highly beneficial for:

  • Automating invoice printing workflows
  • Reducing manual printing effort
  • Ensuring correct template usage
  • Improving warehouse efficiency
  • Supporting high-volume order processing

Important Notes

  • Works only if the virtual printer is online
  • Template names must match exactly
  • Identifier must exist on orders
  • Processes only orders from the last 8 days
  • Uses default template if no match is found
  • Does not print if template is missing

Example Scenario

Key Insight

By combining intelligent filtering, template mapping, and automated printing, this macro ensures fast, accurate, and scalable invoice processing in warehouse operations.