Skip to content

KVSKBAOrderFlowLib#

Procedures#

SalesLineUpdByOrderRelease(Record Sales Line, Record Sales Header) :#

Summary: For the SalesLine a new record "KVSKBAOrderFlowEntry" will be created with the fields: OrderFlowEntry."Curr. Order Entry" = TRUE OrderFlowEntry.Quantity, OrderFlowEntry."Remaing Qty. To Invoice" = the not invoiced quantity of the SalesLine

         Note, that by using CU 5048873 (Over-/Underdelivery of one Line), the calling function
         have to make sure, that this single line is to bring back to the former status after changing the fields in the line.
procedure SalesLineUpdByOrderRelease(SalesLine: Record "Sales Line"; SalesHeader: Record "Sales Header"): 

Parameters:

  • SalesLine:
  • SalesHeader:

SalesLineUpdByOrderReopen(Record Sales Line, Record Sales Header) :#

Summary: The function will to use in Sales for documents "Sales Orders" and "Sales Return Orders" when the document get the Status::Open. All existing orderFlowEntryLoc of the document Line with orderFlowEntryLoc."Curr. Order Entry" = TRUE will be negated by inserting new Entries

         The function also will to use, when one salesline over-/underdelivered (see CU 5048873, 5048756). In this case the
         calling function must to make sure, that this single line will bring back to the former status.
procedure SalesLineUpdByOrderReopen(SalesLine: Record "Sales Line"; SalesHeader: Record "Sales Header"): 

Parameters:

  • SalesLine:
  • SalesHeader:

DecrOrderFlowEntryOfCurrOrder(Record KVSKBAOrderFlowEntry, Decimal, Enum KVSKBAOrdFlowEntrySource, Date) :#

Summary: A existing orderFlowEntry with "Curr. Order Entry" = TRUE will be drecrease by inserting a new Entry

procedure DecrOrderFlowEntryOfCurrOrder(OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; QtyToDecrease: Decimal; NewEntrySource: Enum "KVSKBAOrdFlowEntrySource"; CalcEntryDate: Date): 

Parameters:

  • OrderFlowEntry:
  • QtyToDecrease:
  • NewEntrySource:
  • CalcEntryDate:

GetNextEntryNo() : Integer#

procedure GetNextEntryNo(): Integer

CalcFlowEntryPricesAndQtyBase(Record KVSKBAOrderFlowEntry, Date) :#

Summary: For a orderFlowEntry some fields will be calculated on the base of the significant fields

procedure CalcFlowEntryPricesAndQtyBase(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; CalcEntryDate: Date): 

Parameters:

  • OrderFlowEntry:
  • CalcEntryDate:

Events#

OnAfterSalesHeaderUpdByOrderDelete(Record Sales Header) :#

[IntegrationEvent(false, false)]
local procedure OnAfterSalesHeaderUpdByOrderDelete(SalesHeader: Record "Sales Header"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnAfterSalesHeaderUpdByOrderDelete', '', false, false)]
local procedure DoSomethingOnAfterSalesHeaderUpdByOrderDelete(SalesHeader: Record "Sales Header")
begin
end;

OnAfterSalesHeaderUpdByOrderRelease(Record Sales Header) :#

[IntegrationEvent(false, false)]
local procedure OnAfterSalesHeaderUpdByOrderRelease(SalesHeader: Record "Sales Header"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnAfterSalesHeaderUpdByOrderRelease', '', false, false)]
local procedure DoSomethingOnAfterSalesHeaderUpdByOrderRelease(SalesHeader: Record "Sales Header")
begin
end;

OnAfterSalesHeaderUpdByOrderReopen(Record Sales Header) :#

[IntegrationEvent(false, false)]
local procedure OnAfterSalesHeaderUpdByOrderReopen(SalesHeader: Record "Sales Header"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnAfterSalesHeaderUpdByOrderReopen', '', false, false)]
local procedure DoSomethingOnAfterSalesHeaderUpdByOrderReopen(SalesHeader: Record "Sales Header")
begin
end;

OnSalesLineUpdByOrderReleaseOnAfterOrderFlowEntryInsert(Record KVSKBAOrderFlowEntry, Record Sales Header, Record Sales Line) :#

[IntegrationEvent(false, false)]
local procedure OnSalesLineUpdByOrderReleaseOnAfterOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnSalesLineUpdByOrderReleaseOnAfterOrderFlowEntryInsert', '', false, false)]
local procedure DoSomethingOnSalesLineUpdByOrderReleaseOnAfterOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line")
begin
end;

OnSalesLineUpdByOrderReleaseOnBeforeOrderFlowEntryInsert(Record KVSKBAOrderFlowEntry, Record Sales Header, Record Sales Line) :#

[IntegrationEvent(false, false)]
local procedure OnSalesLineUpdByOrderReleaseOnBeforeOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnSalesLineUpdByOrderReleaseOnBeforeOrderFlowEntryInsert', '', false, false)]
local procedure DoSomethingOnSalesLineUpdByOrderReleaseOnBeforeOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line")
begin
end;

OnUpdByPostingAInvoiceLineOnAfterOrderFlowEntryInsert(Record KVSKBAOrderFlowEntry, Record Sales Invoice Header, Record Sales Invoice Line) :#

[IntegrationEvent(false, false)]
local procedure OnUpdByPostingAInvoiceLineOnAfterOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesInvoiceHeader: Record "Sales Invoice Header"; SalesInvoiceLine: Record "Sales Invoice Line"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnUpdByPostingAInvoiceLineOnAfterOrderFlowEntryInsert', '', false, false)]
local procedure DoSomethingOnUpdByPostingAInvoiceLineOnAfterOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesInvoiceHeader: Record "Sales Invoice Header"; SalesInvoiceLine: Record "Sales Invoice Line")
begin
end;

OnUpdByPostingAInvoiceLineOnBeforeOrderFlowEntryInsert(Record KVSKBAOrderFlowEntry, Record Sales Invoice Header, Record Sales Invoice Line) :#

[IntegrationEvent(false, false)]
local procedure OnUpdByPostingAInvoiceLineOnBeforeOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesInvoiceHeader: Record "Sales Invoice Header"; SalesInvoiceLine: Record "Sales Invoice Line"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnUpdByPostingAInvoiceLineOnBeforeOrderFlowEntryInsert', '', false, false)]
local procedure DoSomethingOnUpdByPostingAInvoiceLineOnBeforeOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesInvoiceHeader: Record "Sales Invoice Header"; SalesInvoiceLine: Record "Sales Invoice Line")
begin
end;

OnUpdByPostingACrMemoLineOnAfterOrderFlowEntryInsert(Record KVSKBAOrderFlowEntry, Record Sales Cr.Memo Header, Record Sales Cr.Memo Line) :#

[IntegrationEvent(false, false)]
local procedure OnUpdByPostingACrMemoLineOnAfterOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesCrMemoLine: Record "Sales Cr.Memo Line"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnUpdByPostingACrMemoLineOnAfterOrderFlowEntryInsert', '', false, false)]
local procedure DoSomethingOnUpdByPostingACrMemoLineOnAfterOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesCrMemoLine: Record "Sales Cr.Memo Line")
begin
end;

OnUpdByPostingACrMemoLineOnBeforeOrderFlowEntryInsert(Record KVSKBAOrderFlowEntry, Record Sales Cr.Memo Header, Record Sales Cr.Memo Line) :#

[IntegrationEvent(false, false)]
local procedure OnUpdByPostingACrMemoLineOnBeforeOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesCrMemoLine: Record "Sales Cr.Memo Line"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnUpdByPostingACrMemoLineOnBeforeOrderFlowEntryInsert', '', false, false)]
local procedure DoSomethingOnUpdByPostingACrMemoLineOnBeforeOrderFlowEntryInsert(var OrderFlowEntry: Record "KVSKBAOrderFlowEntry"; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesCrMemoLine: Record "Sales Cr.Memo Line")
begin
end;

OnBeforeCheckDocumentType(Record Sales Header, Record Sales & Receivables Setup, Boolean) :#

[IntegrationEvent(false, false)]
local procedure OnBeforeCheckDocumentType(SalesHeader: Record "Sales Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnBeforeCheckDocumentType', '', false, false)]
local procedure DoSomethingOnBeforeCheckDocumentType(SalesHeader: Record "Sales Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var IsHandled: Boolean)
begin
end;

OnBeforeUpdByPostingACrMemoLine(Record Sales Cr.Memo Header, Record Sales Cr.Memo Line, Boolean) :#

[IntegrationEvent(false, false)]
local procedure OnBeforeUpdByPostingACrMemoLine(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesCrMemoLine: Record "Sales Cr.Memo Line"; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnBeforeUpdByPostingACrMemoLine', '', false, false)]
local procedure DoSomethingOnBeforeUpdByPostingACrMemoLine(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesCrMemoLine: Record "Sales Cr.Memo Line"; var IsHandled: Boolean)
begin
end;

OnBeforeUpdByPostingAInvoiceLine(Record Sales Invoice Header, Record Sales Invoice Line, Boolean) :#

[IntegrationEvent(false, false)]
local procedure OnBeforeUpdByPostingAInvoiceLine(SalesInvoiceHeader: Record "Sales Invoice Header"; SalesInvoiceLine: Record "Sales Invoice Line"; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnBeforeUpdByPostingAInvoiceLine', '', false, false)]
local procedure DoSomethingOnBeforeUpdByPostingAInvoiceLine(SalesInvoiceHeader: Record "Sales Invoice Header"; SalesInvoiceLine: Record "Sales Invoice Line"; var IsHandled: Boolean)
begin
end;

OnAfterSalesLineSetFilter(Record Sales Header, Record Sales & Receivables Setup, Record Sales Line) :#

[IntegrationEvent(false, false)]
local procedure OnAfterSalesLineSetFilter(SalesHeader: Record "Sales Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var SalesLine: Record "Sales Line"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnAfterSalesLineSetFilter', '', false, false)]
local procedure DoSomethingOnAfterSalesLineSetFilter(SalesHeader: Record "Sales Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var SalesLine: Record "Sales Line")
begin
end;

OnSalesLineUpdByOrderReleaseOnAfterCalcQtyNotInvoiced(Record Sales Line, Decimal) :#

[IntegrationEvent(false, false)]
local procedure OnSalesLineUpdByOrderReleaseOnAfterCalcQtyNotInvoiced(SalesLine: Record "Sales Line"; var QtyNotInvoiced: Decimal): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnSalesLineUpdByOrderReleaseOnAfterCalcQtyNotInvoiced', '', false, false)]
local procedure DoSomethingOnSalesLineUpdByOrderReleaseOnAfterCalcQtyNotInvoiced(SalesLine: Record "Sales Line"; var QtyNotInvoiced: Decimal)
begin
end;

OnSalesLineUpdByOrderReleaseOnSetOrderFlowEntrySourceDocument(Record Sales Line, Record KVSKBAOrderFlowEntry) :#

[IntegrationEvent(false, false)]
local procedure OnSalesLineUpdByOrderReleaseOnSetOrderFlowEntrySourceDocument(SalesLine: Record "Sales Line"; var KVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnSalesLineUpdByOrderReleaseOnSetOrderFlowEntrySourceDocument', '', false, false)]
local procedure DoSomethingOnSalesLineUpdByOrderReleaseOnSetOrderFlowEntrySourceDocument(SalesLine: Record "Sales Line"; var KVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry")
begin
end;

OnUpdByPostingAInvoiceLineOnBeforeGetDocumentInfoSalesInvLine(Record Sales Invoice Line, Record Sales Invoice Header, Record Sales & Receivables Setup, Integer, Integer, Code[20], Integer, Integer, Enum KVSKBAOrdFlowSourceDocument, Boolean) :#

[IntegrationEvent(false, false)]
local procedure OnUpdByPostingAInvoiceLineOnBeforeGetDocumentInfoSalesInvLine(SalesInvoiceLine: Record "Sales Invoice Line"; SalesInvoiceHeader: Record "Sales Invoice Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var OrderTableNo: Integer; var OrderDocType: Integer; var OrderDocNo: Code[20]; var OrderDocLineNo: Integer; var OrderDocSubLineNo: Integer; var KVSKBAOrdFlowSourceDocument: Enum "KVSKBAOrdFlowSourceDocument"; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnUpdByPostingAInvoiceLineOnBeforeGetDocumentInfoSalesInvLine', '', false, false)]
local procedure DoSomethingOnUpdByPostingAInvoiceLineOnBeforeGetDocumentInfoSalesInvLine(SalesInvoiceLine: Record "Sales Invoice Line"; SalesInvoiceHeader: Record "Sales Invoice Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var OrderTableNo: Integer; var OrderDocType: Integer; var OrderDocNo: Code[20]; var OrderDocLineNo: Integer; var OrderDocSubLineNo: Integer; var KVSKBAOrdFlowSourceDocument: Enum "KVSKBAOrdFlowSourceDocument"; var IsHandled: Boolean)
begin
end;

OnUpdByPostingACrMemoLineOnBeforeGetDocumentInfoSalesCrMemoLine(Record Sales Cr.Memo Line, Record Sales Cr.Memo Header, Record Sales & Receivables Setup, Integer, Integer, Code[20], Integer, Integer, Enum KVSKBAOrdFlowSourceDocument, Boolean) :#

[IntegrationEvent(false, false)]
local procedure OnUpdByPostingACrMemoLineOnBeforeGetDocumentInfoSalesCrMemoLine(SalesCrMemoLine: Record "Sales Cr.Memo Line"; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var OrderTableNo: Integer; var OrderDocType: Integer; var OrderDocNo: Code[20]; var OrderDocLineNo: Integer; var OrderDocSubLineNo: Integer; var KVSKBAOrdFlowSourceDocument: Enum "KVSKBAOrdFlowSourceDocument"; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnUpdByPostingACrMemoLineOnBeforeGetDocumentInfoSalesCrMemoLine', '', false, false)]
local procedure DoSomethingOnUpdByPostingACrMemoLineOnBeforeGetDocumentInfoSalesCrMemoLine(SalesCrMemoLine: Record "Sales Cr.Memo Line"; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var OrderTableNo: Integer; var OrderDocType: Integer; var OrderDocNo: Code[20]; var OrderDocLineNo: Integer; var OrderDocSubLineNo: Integer; var KVSKBAOrdFlowSourceDocument: Enum "KVSKBAOrdFlowSourceDocument"; var IsHandled: Boolean)
begin
end;

OnBeforeDecrOrderFlowEntryOfCurrOrder(Record KVSKBAOrderFlowEntry, Decimal, Enum KVSKBAOrdFlowEntrySource, Date, Boolean) :#

[IntegrationEvent(false, false)]
local procedure OnBeforeDecrOrderFlowEntryOfCurrOrder(KVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; QtyToDecrease: Decimal; NewKVSKBAOrderFlowEntrySource: Enum "KVSKBAOrdFlowEntrySource"; CalcEntryDate: Date; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnBeforeDecrOrderFlowEntryOfCurrOrder', '', false, false)]
local procedure DoSomethingOnBeforeDecrOrderFlowEntryOfCurrOrder(KVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; QtyToDecrease: Decimal; NewKVSKBAOrderFlowEntrySource: Enum "KVSKBAOrdFlowEntrySource"; CalcEntryDate: Date; var IsHandled: Boolean)
begin
end;

OnDecrOrderFlowEntryOfCurrOrderOnBeforeInsertNewOrderFlowEntry(Record KVSKBAOrderFlowEntry, Record KVSKBAOrderFlowEntry, Decimal, Enum KVSKBAOrdFlowEntrySource, Date) :#

[IntegrationEvent(false, false)]
local procedure OnDecrOrderFlowEntryOfCurrOrderOnBeforeInsertNewOrderFlowEntry(var NewKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; OldKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; QtyToDecrease: Decimal; NewKVSKBAOrderFlowEntrySource: Enum "KVSKBAOrdFlowEntrySource"; CalcEntryDate: Date): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnDecrOrderFlowEntryOfCurrOrderOnBeforeInsertNewOrderFlowEntry', '', false, false)]
local procedure DoSomethingOnDecrOrderFlowEntryOfCurrOrderOnBeforeInsertNewOrderFlowEntry(var NewKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; OldKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; QtyToDecrease: Decimal; NewKVSKBAOrderFlowEntrySource: Enum "KVSKBAOrdFlowEntrySource"; CalcEntryDate: Date)
begin
end;

OnDecrOrderFlowEntryOfCurrOrderOnBeforeModifyOrderFlowEntry(Record KVSKBAOrderFlowEntry, Record KVSKBAOrderFlowEntry, Decimal, Enum KVSKBAOrdFlowEntrySource, Date) :#

[IntegrationEvent(false, false)]
local procedure OnDecrOrderFlowEntryOfCurrOrderOnBeforeModifyOrderFlowEntry(NewKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; var OldKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; QtyToDecrease: Decimal; NewKVSKBAOrderFlowEntrySource: Enum "KVSKBAOrdFlowEntrySource"; CalcEntryDate: Date): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAOrderFlowLib", 'OnDecrOrderFlowEntryOfCurrOrderOnBeforeModifyOrderFlowEntry', '', false, false)]
local procedure DoSomethingOnDecrOrderFlowEntryOfCurrOrderOnBeforeModifyOrderFlowEntry(NewKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; var OldKVSKBAOrderFlowEntry: Record "KVSKBAOrderFlowEntry"; QtyToDecrease: Decimal; NewKVSKBAOrderFlowEntrySource: Enum "KVSKBAOrdFlowEntrySource"; CalcEntryDate: Date)
begin
end;