Table of Contents

KVSTRDRegisterSalBonusCalc

Summary: Registers the accepted sales bonus calculation lines and creates the sales credit memos for the bonus.

Procedures

OnRun

procedure OnRun(Rec: Record "KVSTRDSalBonusCalcLine")

Events

KVSTRDOnAfterCreateSalesCreditMemoHeader(Record Sales Header, Record KVSTRDSalRegBonusCalcLine) :

Summary: This event is raised after the sales credit memo header for the bonus of a customer was created and modified.

[IntegrationEvent(false, false)]
local procedure KVSTRDOnAfterCreateSalesCreditMemoHeader(var SalesHeader: Record "Sales Header"; TempSalRegBonusCalcLine: Record "KVSTRDSalRegBonusCalcLine" temporary): 

Parameters:

  • SalesHeader: The created sales credit memo header.
  • TempSalRegBonusCalcLine: The first registered sales bonus calculation line of the customer for which the credit memo is created.

KVSTRDOnBeforeInsertTotalSalesLine(Record Sales Line, Record KVSTRDSalRegBonusCalcLine, Boolean) :

Summary: This event is raised after the description, the unit price and the VAT posting groups of the bonus credit memo line are set and before the line is inserted. It can be used to change the description or other fields of the line. The fields "Credit Memo No." and "Credit Memo Line No." of the registered sales bonus calculation lines are not set yet at this point.

[IntegrationEvent(false, false)]
local procedure KVSTRDOnBeforeInsertTotalSalesLine(var SalesLine: Record "Sales Line"; var TempSalRegBonusCalcLine: Record "KVSTRDSalRegBonusCalcLine" temporary; IsCompressed: Boolean): 

Parameters:

  • SalesLine: The bonus credit memo line that is inserted.
  • TempSalRegBonusCalcLine: The registered sales bonus calculation lines of the credit memo line, filtered by customer, bonus agreement, VAT posting groups and, if the lines are not compressed, bonus agreement line.
  • IsCompressed: Specifies whether several registered sales bonus calculation lines are compressed into this credit memo line.

KVSTRDOnAfterInsertTotalSalesLine(Record Sales Header, Record Sales Line, Record KVSTRDSalRegBonusCalcLine, Boolean) :

Summary: This event is raised after the bonus credit memo line was inserted. It can be used to insert additional lines, for example comment lines, because the line no. of the next line is determined from the last line of the credit memo. The fields "Credit Memo No." and "Credit Memo Line No." of the registered sales bonus calculation lines are not set yet at this point.

[IntegrationEvent(false, false)]
local procedure KVSTRDOnAfterInsertTotalSalesLine(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; var TempSalRegBonusCalcLine: Record "KVSTRDSalRegBonusCalcLine" temporary; IsCompressed: Boolean): 

Parameters:

  • SalesHeader: The sales credit memo header.
  • SalesLine: The inserted bonus credit memo line.
  • TempSalRegBonusCalcLine: The registered sales bonus calculation lines of the credit memo line, filtered by customer, bonus agreement, VAT posting groups and, if the lines are not compressed, bonus agreement line.
  • IsCompressed: Specifies whether several registered sales bonus calculation lines are compressed into this credit memo line.