Print from the command line (Command Line Utility)

Via the PRINT action you can start the Output wizard for the various documents, depending on which Document type you enter.

You have the option of including a number, date and sales contact (for invoices this would be the invoice debtor; for packing slips, the delivery debtor).

If you don’t specify a printer in the Output wizard, Profit uses the default printer. You can specify the printer by going through the Output wizard once and specifying a printer and tray. If no printer is specified in the /Q and /R parameters, the printer last used by the same user for the same order type (set up, for example, by going through the Output wizard) is used again. If the user has not yet gone through the Output wizard, or the last used printer is no longer in use, then the default printer is used.

You do not have to specify a tray for printers that don’t have trays, like PDF printers.

Data

 

Action:

PRINT

General options:

Default.

Extra parameters:

/T“Type”: the document type that you want to print. Uses one of the following values:

  • O = quotation
  • I = purchase order
  • V = sales order
  • P = packing slip
  • F = sales invoice
  • N = purchase invoice
  • G = goods receipt

    /S“Number of days”: date from, optional

    /E“Number of days”: date to, optional

    /N“Number”: number from, optional

    /Y“Number”: number to, optional

    /F“Debtor number from”: debtor number from, optional

    /G“GUID of deviating report”

    /H“Debtor number to": debtor number to, optional

    /W: place document in customer dossier

    /Q“Printer name": Printer, optional, otherwise default printer. Use the name of the printer as shown in Profit (this may be different from the name in the Windows Control Panel).

    /R"Printer tray": Printer tray, optional, otherwise default tray.

Examples:

To print all invoices for invoice debtor 12345 that have not been printed yet:

"C:\Program files (x86)\Profit\AFAS Windows\Kernel\Bin\AFASCMD.EXE"/O"Environment name " /G"Username" /W"Password"/L"C:\logfile.txt" LOGISTICS /P"PRINT" /T"I" /F"12345" /H"12345"

Print all packing slips from today onwards that have not yet been printed on printer PR10, tray 1, and file them in the dossier:

"C:\Program files (x86)\Profit\AFAS Windows\Kernel\Bin\AFASCMD.EXE"/O"Environment name " /G"Username" /W"Password"/L"C:\logfile.txt" LOGISTICS /P"PRINT" /T"P" /S"0" /E"0" /W /Q"PR10" /R"1"

See also