Commission purchase invoices and vendor payment

Fashion & Management  •  Article  •  11/2/2026  • 

Generating commission purchase invoices is the step that actually pays the salesperson. The system runs the Commission Purchase Invoice Management codeunit, which collects every approved, payable, uninvoiced commission ledger entry, groups the entries by salesperson, and creates one purchase document per salesperson — a purchase invoice when the net amount is positive, or a purchase credit memo when the net amount is negative. Entries from all salesperson levels are combined into a single net amount per salesperson, based on the Converted Commission Amount field value.

There are two ways to launch the run:

  • Schedule it through Job Queue Entries. This is the recommended approach for production.
  • Run it on demand by starting the job queue entry manually when an immediate payout is required.

Before you launch the run, make sure the entries you want to pay are ready:

  • The Approved checkbox is selected on every entry that should be included.
  • The Commission Status field is set to Payable on every entry. Entries with the status Open, Paid, or Closed are skipped.
  • The Commission Invoice No. field is blank. Entries that have already been invoiced are skipped.
  • The salesperson on every approved, payable entry has the Vendor No. field set. Salespersons without a vendor are skipped silently by the run.

The net amount per salesperson determines the outcome:

Net resultOutcome
PositiveA purchase invoice is created and posted for the salesperson's vendor.
NegativeA purchase credit memo is created and posted for the salesperson's vendor, clawing back the negative net commission. The affected entries are stamped with Agent Vendor No. and Commission Invoice No. and are netted and closed by the credit distribution. See Purchase credit memo created by the run.
ZeroNo purchase document is created; all entries are still stamped (the Commission Invoice No. field is set to '-') so they are not reprocessed.

After posting, any credit memo entries in the set are distributed against invoice entries for the same salesperson, oldest entry first, updating the Paid Amount and Commission Status field values on both sides. The invoice entry's Payment Reference No. field value is appended to record which credit memo entry balanced it.

Schedule the run via Job Queue

A job queue entry runs the commission purchase invoice codeunit on a schedule, so the accounts payable team does not have to remember to launch it. A daily or weekly recurrence is typical. Each time the job fires, the codeunit picks up every approved, payable, uninvoiced commission entry, groups by salesperson, and posts one purchase invoice per salesperson with a positive net.

The following procedure outlines how to set up the job queue entry:

  • Select the Search iconSearch icon, enter Job Queue Entries, and then choose the related link.

The Job Queue Entries page opens.

  • On the action bar, select New.

The Job Queue Entry Card page opens.

  • In the Object Type to Run field, select Codeunit.
  • In the Object ID to Run field, enter the ID 73168050 of the Commission Purchase Invoice Management codeunit, or use the lookup and pick CommissionPurchInvMgt190FDW.
  • In the Description field, enter a description such as Run commission purchase invoices.
  • In the Earliest Start Date/Time field, set the next run time.
  • On the Recurrence FastTab, turn on the Recurring Job toggle, and select the days of the week and the time when the job should run. A typical setup is once daily on weekdays at 6:00 AM.
  • In the Maximum No. of Attempts to Run field, enter 1 or 2 so the job retries on transient errors.
  • On the action bar, select Set Status to Ready to activate the job. The status changes to Ready and the entry shows the next planned run.

When the job runs, it operates on whatever entries currently meet the criteria - approved, payable, and uninvoiced. There is no period filter on the run, so the frequency only controls how often the work is done. Daily is a good default; weekly is appropriate when commission entries accumulate slowly.

The following procedure outlines how to monitor the job:

  1. Open Job Queue Entries to see Status, Last Ready State, Last Error Message, and No. of Attempts to Run on each entry.
  2. Open Job Queue Log Entries for a history of every individual run, including successful and failed runs.
  3. Open Commission Ledger Entries after each run to verify the affected entries now carry a value in the Agent Vendor No. and Commission Invoice No. fields.

Run the process on demand

When an immediate payout is required — for example, to clear a backlog before a month-end close — the codeunit can be run manually instead of waiting for the scheduled job.

The following procedure outlines how to run the process on demand:

1.Confirm that the entries to be paid are approved, payable, and uninvoiced.

  1. Select the Search iconSearch icon, enter Job Queue Entries, and then choose the related link. Select the job queue entry configured for codeunit 73168050 (CommissionPurchInvMgt190FDW).
  2. On the action bar, select Run once (foreground) — or set the Earliest Start Date/Time field to the current time and select Set Status to Ready. The codeunit cannot be launched from the Tell Me search, and it runs without a confirmation prompt.

4.Review the posted purchase invoices the run produces and the corresponding updates on the Commission Ledger Entries page.

For each salesperson with a positive net, the run:

  • Closes any negative credit memo entries for that salesperson by netting them against the invoice entries. Each closed credit memo entry contributes its absolute value to the offset that pays down the invoice entries.
  • Marks the invoice entries as Closed if their commission amount is fully covered by the netting offset or Paid if it is partially covered. Any uncovered remainder waits to be paid by a real vendor payment later.
  • Stamps the Agent Vendor No. and Commission Invoice No. field values on every affected entry, so future processes can find them quickly.

Purchase credit memo is created via batch job

When the net commission of a salesperson is negative (more refunds than sales commission), the commission purchase invoice run automatically creates and posts a purchase credit memo against the vendor linked to the salesperson, for the negative net amount. The posted document uses the Commission Posted Purchase Credit Memo Nos. series defined on the Commission Setup page. The affected commission ledger entries are stamped with the Agent Vendor No. and the posted credit memo number, and are then netted and closed by the credit distribution.

An accounts payable user can also manually create a purchase credit memo against the vendor of a salesperson (for example, for an ad-hoc adjustment). The posting number series is swapped automatically to the commission series because the vendor is linked to a salesperson, but such a manually created document does not reconcile against specific commission ledger entries.

When the positive and negative commission entries of a salesperson cancel out exactly, the system does not create a purchase credit memo. Instead, all entries for that salesperson are closed in one pass:

  • The Paid Amount field value is set through the netting, up to the entry's Converted Commission Amount field value.
  • The Paid Date field value is set to the work date.
  • The Agent Vendor No. field value is populated.
  • The status is set to Closed.
  • The Commission Invoice No. field is stamped with '-' because no document was posted, so the entries are not picked up again.

Vendor Payment

The Salesperson Card page includes a Vendor No. field that links a salesperson to a vendor record. Commission processes use the Vendor No. field value to create and pay purchase documents on behalf of the salesperson.

Use the Suggest Vendor Payments action to automatically populate the payment journal with commission purchase invoices and credit memos for the vendor (agent).

The following procedure outlines how to pay a salesperson's commission through the payment journal:

  • Select the Search iconSearch icon, enter Payment Journals, and then choose the related link. The Payment Journal page opens.
  • On the action bar, select the Suggest Vendor Payments action. The Suggest Vendor Payments page opens.
  • In the Last Payment Date field, enter the date up to which payments are included.
  • In the Vendor No. field, select the vendor associated with the salesperson (agent).
  • Turn on the Summarize per Vendor toggle to combine multiple entries for the same vendor into a single payment line.
  • Select the OK button. The system populates the payment journal with the vendor's open purchase documents up to the Last Payment Date, following standard Business Central behavior — commission documents are not filtered by commission ledger entry status.
  • Review the suggested lines and make any required adjustments.
  • On the action bar, select the Post action.

The system distributes the payment across the related commission ledger entries and updates them as follows:

  • The Commission Status field value is set to Paid.
  • The Paid Amount, Paid Date, Payment Reference No., and related audit fields are updated.
  • If the Paid Amount field value equals the Converted Commission Amount field value, the system sets the Commission Status field value to Closed.

Each commission ledger entry reflects its own payment status independently — Paid for a partially paid entry and Closed for a fully settled entry.