Skip to content

KVSKBAComLib#

Procedures#

FindCommissionRate(Option, Code[20], Code[20], Code[10], Code[10], Code[10], Enum Sales Line Type, Code[20], Date, Record KVSKBAComRate) : Integer#

procedure FindCommissionRate(CalculationFor: Option; SalesPersonCode: Code[20]; CustomerNo: Code[20]; CustomerCommissionGroupCode: Code[10]; ProductCommissionGroupCode: Code[10]; ResponsibilityCenter: Code[10]; LineType: Enum "Sales Line Type"; LineNo: Code[20]; CommissionDate: Date; var TempComRate: Record "KVSKBAComRate" temporary): Integer

CreateNewJnlLineToEntryCancel(Record KVSKBACommissionJournalLine, Record KVSKBACommissionEntry, Code[10], Code[10], Integer) :#

Summary: Creates a commission journal line to cancel a specific commission entry by copying all relevant data and setting correction flags with negative amounts.

procedure CreateNewJnlLineToEntryCancel(var CommissionJournalLine: Record "KVSKBACommissionJournalLine"; CommissionEntry: Record "KVSKBACommissionEntry"; JnlTemplateName: Code[10]; JnlBatchName: Code[10]; JnlLineNo: Integer): 

Parameters:

  • CommissionJournalLine: The commission journal line record that will be created for cancellation.
  • CommissionEntry: The commission entry record to be canceled.
  • JnlTemplateName: The journal template name to use for the cancellation entry.
  • JnlBatchName: The journal batch name to use for the cancellation entry.
  • JnlLineNo: The line number to assign to the cancellation journal line.

Remarks: This procedure copies all fields from the commission entry to create a corrective journal line. It sets the Correction flag to true, references the original entry number, and negates the amounts to create a cancellation entry that will reverse the original commission calculation.

Events#

OnAfterCreateNewJnlLineToCrMemoLine(Record KVSKBACommissionJournalLine, Code[10], Code[10], Integer, Record Sales Cr.Memo Header, Record Sales Cr.Memo Line) :#

Summary: Integration Event that is raised after creating a commission journal line from a sales credit memo line. Use this event to perform additional processing or modify the journal line data.

[IntegrationEvent(false, false)]
local procedure OnAfterCreateNewJnlLineToCrMemoLine(var CommissionJournalLine: Record "KVSKBACommissionJournalLine"; JnlTemplName: Code[10]; JnlBatchName: Code[10]; JnlLineNo: Integer; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesCrMemoLine: Record "Sales Cr.Memo Line"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAComLib", 'OnAfterCreateNewJnlLineToCrMemoLine', '', false, false)]
local procedure DoSomethingOnAfterCreateNewJnlLineToCrMemoLine(var CommissionJournalLine: Record "KVSKBACommissionJournalLine"; JnlTemplName: Code[10]; JnlBatchName: Code[10]; JnlLineNo: Integer; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesCrMemoLine: Record "Sales Cr.Memo Line")
begin
end;

Parameters:

  • CommissionJournalLine: The commission journal line that was created from the credit memo line.
  • JnlTemplName: The journal template name used for the journal line.
  • JnlBatchName: The journal batch name used for the journal line.
  • JnlLineNo: The line number assigned to the journal line.
  • SalesCrMemoHeader: The sales credit memo header that was the source of the journal line.
  • SalesCrMemoLine: The sales credit memo line that was the source of the journal line.

Remarks: This event allows external extensions to customize commission journal line creation from credit memos or perform additional operations after the standard line creation process is completed.

OnAfterCreateNewJnlLineToEntryCancel(Record KVSKBACommissionJournalLine, Record KVSKBACommissionEntry, Code[10], Code[10], Integer) :#

Summary: Integration Event that is raised after creating a commission journal line for entry cancellation. Use this event to perform additional processing or modify the cancellation journal line data.

[IntegrationEvent(false, false)]
local procedure OnAfterCreateNewJnlLineToEntryCancel(var CommissionJournalLine: Record "KVSKBACommissionJournalLine"; CommissionEntry: Record "KVSKBACommissionEntry"; JnlTemplName: Code[10]; JnlBatchName: Code[10]; JnlLineNo: Integer): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAComLib", 'OnAfterCreateNewJnlLineToEntryCancel', '', false, false)]
local procedure DoSomethingOnAfterCreateNewJnlLineToEntryCancel(var CommissionJournalLine: Record "KVSKBACommissionJournalLine"; CommissionEntry: Record "KVSKBACommissionEntry"; JnlTemplName: Code[10]; JnlBatchName: Code[10]; JnlLineNo: Integer)
begin
end;

Parameters:

  • CommissionJournalLine: The commission journal line created for canceling the entry.
  • CommissionEntry: The original commission entry being canceled.
  • JnlTemplName: The journal template name used for the cancellation line.
  • JnlBatchName: The journal batch name used for the cancellation line.
  • JnlLineNo: The line number assigned to the cancellation journal line.

Remarks: This event allows external extensions to customize commission entry cancellation logic or perform additional operations after the standard cancellation line creation process.

OnAfterCreateNewJnlLineToInvLine(Record KVSKBACommissionJournalLine, Code[10], Code[10], Integer, Record Sales Invoice Header, Record Sales Invoice Line) :#

Summary: Integration Event that is raised after creating a commission journal line from a sales invoice line. Use this event to perform additional processing or modify the journal line data.

[IntegrationEvent(false, false)]
local procedure OnAfterCreateNewJnlLineToInvLine(var CommissionJournalLine: Record "KVSKBACommissionJournalLine"; JnlTemplName: Code[10]; JnlBatchName: Code[10]; JnlLineNo: Integer; SalesInvoiceHeader: Record "Sales Invoice Header"; SalesInvoiceLine: Record "Sales Invoice Line"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAComLib", 'OnAfterCreateNewJnlLineToInvLine', '', false, false)]
local procedure DoSomethingOnAfterCreateNewJnlLineToInvLine(var CommissionJournalLine: Record "KVSKBACommissionJournalLine"; JnlTemplName: Code[10]; JnlBatchName: Code[10]; JnlLineNo: Integer; SalesInvoiceHeader: Record "Sales Invoice Header"; SalesInvoiceLine: Record "Sales Invoice Line")
begin
end;

Parameters:

  • CommissionJournalLine: The commission journal line that was created from the invoice line.
  • JnlTemplName: The journal template name used for the journal line.
  • JnlBatchName: The journal batch name used for the journal line.
  • JnlLineNo: The line number assigned to the journal line.
  • SalesInvoiceHeader: The sales invoice header that was the source of the journal line.
  • SalesInvoiceLine: The sales invoice line that was the source of the journal line.

Remarks: This event allows external extensions to customize commission journal line creation from invoices or perform additional operations after the standard line creation process is completed.

OnBeforeFindCommissionRate2(Option, Code[20], Code[20], Code[10], Code[10], Code[10], Enum Sales Line Type, Code[20], Date, Record KVSKBAComRate, Integer, Boolean) :#

[IntegrationEvent(false, false)]
local procedure OnBeforeFindCommissionRate2(CalculationFor: Option; SalesPersonCode: Code[20]; CustomerCode: Code[20]; CustComGrpCode: Code[10]; ProdComGrpCode: Code[10]; ResponsCenter: Code[10]; LineType: Enum "Sales Line Type"; lineNoPar: Code[20]; CommDate: Date; var TempToKVSKBAComRate: Record "KVSKBAComRate" temporary; var CounterRetValue: Integer; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAComLib", 'OnBeforeFindCommissionRate2', '', false, false)]
local procedure DoSomethingOnBeforeFindCommissionRate2(CalculationFor: Option; SalesPersonCode: Code[20]; CustomerCode: Code[20]; CustComGrpCode: Code[10]; ProdComGrpCode: Code[10]; ResponsCenter: Code[10]; LineType: Enum "Sales Line Type"; lineNoPar: Code[20]; CommDate: Date; var TempToKVSKBAComRate: Record "KVSKBAComRate" temporary; var CounterRetValue: Integer; var IsHandled: Boolean)
begin
end;