KVSPSAREPurchaseDocumentMgt#
Procedures#
GetOrderNoFromPurchaseHeader(Record Purchase Header) : Code[20]#
Summary: Returns the primary Order No. related to a Purchase Document
procedure GetOrderNoFromPurchaseHeader(PurchaseHeader: Record "Purchase Header"): Code[20]
Parameters:
PurchaseHeader
: The Purchase Document to calculate
Returns: The Order No. related to the Purchase Document. If no Order is found an empty string will be returned
GetAllOrderNosFilterFromPurchaseHeader(Record Purchase Header) : Text#
Summary: Returns all Order Nos. related to a Purchase Document as a filter string
procedure GetAllOrderNosFilterFromPurchaseHeader(PurchaseHeader: Record "Purchase Header"): Text
Parameters:
PurchaseHeader
: The Purchase Document to calculate
Returns: The Order Nos. related to the Purchase Document as a filter string. If no Order is found an empty string will be returned
GetOrderNoFromPurchaseInvHeader(Record Purch. Inv. Header) : Code[20]#
Summary: Returns the primary Order No. related to a posted Purchase Invoice
procedure GetOrderNoFromPurchaseInvHeader(PurchaseInvHeader: Record "Purch. Inv. Header"): Code[20]
Parameters:
PurchaseInvHeader
: The Purchase Invoice to calculate
Returns: The Order No. related to the Purchase Document. If no Order is found an empty string will be returned
GetOrderLineForInvoiceLine(Record Purchase Line, Record Purchase Line) : Boolean#
Summary: Returns the Order No. related to a Purchase Invoice Line
procedure GetOrderLineForInvoiceLine(InvoiceLine: Record "Purchase Line"; var OrderLine: Record "Purchase Line"): Boolean
Parameters:
InvoiceLine
: The Purchase Invoice Line to considerOrderLine
: The Order Line related to the Invoice Line
Returns: Specifies whether an Order Line has been found
Events#
KVSPSAREOnAfterCheckTransferPurchaseOrderToMainOrderAllowed(Record Purchase Header) :#
[IntegrationEvent(false, false)]
local procedure KVSPSAREOnAfterCheckTransferPurchaseOrderToMainOrderAllowed(var FromPurchaseHeader: Record "Purchase Header"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAREPurchaseDocumentMgt", 'KVSPSAREOnAfterCheckTransferPurchaseOrderToMainOrderAllowed', '', false, false)]
local procedure DoSomethingKVSPSAREOnAfterCheckTransferPurchaseOrderToMainOrderAllowed(var FromPurchaseHeader: Record "Purchase Header")
begin
end;
KVSPSAREOnAfterTransferPurchaseOrderToMainOrder(Record Purchase Header, Record Purchase Header) :#
[IntegrationEvent(false, false)]
local procedure KVSPSAREOnAfterTransferPurchaseOrderToMainOrder(var FromPurchaseHeader: Record "Purchase Header"; ToPurchaseHeader: Record "Purchase Header"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAREPurchaseDocumentMgt", 'KVSPSAREOnAfterTransferPurchaseOrderToMainOrder', '', false, false)]
local procedure DoSomethingKVSPSAREOnAfterTransferPurchaseOrderToMainOrder(var FromPurchaseHeader: Record "Purchase Header"; ToPurchaseHeader: Record "Purchase Header")
begin
end;
KVSPSAREOnBeforeApplyWorkPackageAccountForDocumentLine(Record Purchase Line, Code[20], Boolean) :#
[IntegrationEvent(false, false)]
local procedure KVSPSAREOnBeforeApplyWorkPackageAccountForDocumentLine(var PurchaseLine: Record "Purchase Line"; var PrevWorkPackageCode: Code[20]; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAREPurchaseDocumentMgt", 'KVSPSAREOnBeforeApplyWorkPackageAccountForDocumentLine', '', false, false)]
local procedure DoSomethingKVSPSAREOnBeforeApplyWorkPackageAccountForDocumentLine(var PurchaseLine: Record "Purchase Line"; var PrevWorkPackageCode: Code[20]; var IsHandled: Boolean)
begin
end;
KVSPSAREOnBeforeTransferPurchaseOrderToMainOrder(Record Purchase Header, Boolean) :#
[IntegrationEvent(false, false)]
local procedure KVSPSAREOnBeforeTransferPurchaseOrderToMainOrder(var FromPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAREPurchaseDocumentMgt", 'KVSPSAREOnBeforeTransferPurchaseOrderToMainOrder', '', false, false)]
local procedure DoSomethingKVSPSAREOnBeforeTransferPurchaseOrderToMainOrder(var FromPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
begin
end;
KVSPSAREOnExecuteTransferPurchaseOrderToMainOrderBeforeCopyLines(Record Purchase Header, Record Purchase Header, Codeunit Copy Document Mgt., Integer) :#
[IntegrationEvent(false, false)]
local procedure KVSPSAREOnExecuteTransferPurchaseOrderToMainOrderBeforeCopyLines(var FromPurchaseHeader: Record "Purchase Header"; var ToPurchaseHeader: Record "Purchase Header"; CopyDocumentMgt: Codeunit "Copy Document Mgt."; var LastLineNo: Integer):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAREPurchaseDocumentMgt", 'KVSPSAREOnExecuteTransferPurchaseOrderToMainOrderBeforeCopyLines', '', false, false)]
local procedure DoSomethingKVSPSAREOnExecuteTransferPurchaseOrderToMainOrderBeforeCopyLines(var FromPurchaseHeader: Record "Purchase Header"; var ToPurchaseHeader: Record "Purchase Header"; CopyDocumentMgt: Codeunit "Copy Document Mgt."; var LastLineNo: Integer)
begin
end;
KVSPSAREOnExecuteTransferPurchaseOrderToMainOrderBeforeShowCreatedOrder(Record Purchase Header, Record Purchase Header, Integer, Boolean) :#
[IntegrationEvent(false, false)]
local procedure KVSPSAREOnExecuteTransferPurchaseOrderToMainOrderBeforeShowCreatedOrder(var FromPurchaseHeader: Record "Purchase Header"; var ToPurchaseHeader: Record "Purchase Header"; LinesNotCopied: Integer; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAREPurchaseDocumentMgt", 'KVSPSAREOnExecuteTransferPurchaseOrderToMainOrderBeforeShowCreatedOrder', '', false, false)]
local procedure DoSomethingKVSPSAREOnExecuteTransferPurchaseOrderToMainOrderBeforeShowCreatedOrder(var FromPurchaseHeader: Record "Purchase Header"; var ToPurchaseHeader: Record "Purchase Header"; LinesNotCopied: Integer; var IsHandled: Boolean)
begin
end;
KVSPSAREOnReopenTargetPurchaseHeaderIfNecessaryStatusElse(Record Purchase Header) :#
[IntegrationEvent(false, false)]
local procedure KVSPSAREOnReopenTargetPurchaseHeaderIfNecessaryStatusElse(var ToPurchaseHeader: Record "Purchase Header"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAREPurchaseDocumentMgt", 'KVSPSAREOnReopenTargetPurchaseHeaderIfNecessaryStatusElse', '', false, false)]
local procedure DoSomethingKVSPSAREOnReopenTargetPurchaseHeaderIfNecessaryStatusElse(var ToPurchaseHeader: Record "Purchase Header")
begin
end;
KVSPSAREOnSelectTargetForTransferPurchaseOrderToMainOrderAfterSetFiltersForSelecablePurchaseHeaders(Record Purchase Header, Record Purchase Header) :#
[IntegrationEvent(false, false)]
local procedure KVSPSAREOnSelectTargetForTransferPurchaseOrderToMainOrderAfterSetFiltersForSelecablePurchaseHeaders(FromPurchaseHeader: Record "Purchase Header"; var ToPurchaseHeader: Record "Purchase Header"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAREPurchaseDocumentMgt", 'KVSPSAREOnSelectTargetForTransferPurchaseOrderToMainOrderAfterSetFiltersForSelecablePurchaseHeaders', '', false, false)]
local procedure DoSomethingKVSPSAREOnSelectTargetForTransferPurchaseOrderToMainOrderAfterSetFiltersForSelecablePurchaseHeaders(FromPurchaseHeader: Record "Purchase Header"; var ToPurchaseHeader: Record "Purchase Header")
begin
end;
KVSPSAREOnGetOrderNoFromPurchaseHeader(Record Purchase Header, Code[20]) :#
Summary: This event is triggered when the primary Order No. related to a Purchase Document is calculated. Use this event to overwrite the Order No. found by default.
[IntegrationEvent(false, false)]
local procedure KVSPSAREOnGetOrderNoFromPurchaseHeader(PurchaseHeader: Record "Purchase Header"; var OrderNo: Code[20]):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAREPurchaseDocumentMgt", 'KVSPSAREOnGetOrderNoFromPurchaseHeader', '', false, false)]
local procedure DoSomethingKVSPSAREOnGetOrderNoFromPurchaseHeader(PurchaseHeader: Record "Purchase Header"; var OrderNo: Code[20])
begin
end;
Parameters:
PurchaseHeader
: The Purchase Document a Order is searched forOrderNo
: The calculated Order No
KVSPSAREOnGetAllOrderNosFilterFromPurchaseHeader(Record Purchase Header, Text) :#
Summary: This event is triggered when all Order Nos. related to a Purchase Document are calculated. Use this event to overwrite the Order Nos. found by default.
[IntegrationEvent(false, false)]
local procedure KVSPSAREOnGetAllOrderNosFilterFromPurchaseHeader(PurchaseHeader: Record "Purchase Header"; var Filter: Text):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAREPurchaseDocumentMgt", 'KVSPSAREOnGetAllOrderNosFilterFromPurchaseHeader', '', false, false)]
local procedure DoSomethingKVSPSAREOnGetAllOrderNosFilterFromPurchaseHeader(PurchaseHeader: Record "Purchase Header"; var Filter: Text)
begin
end;
Parameters:
PurchaseHeader
: The Purchase Document am Order is searched forFilter
: The calculated Order Nos
KVSPSAREOnBeforeGetOrderLineForInvoiceLine(Record Purchase Line, Record Purchase Line, Boolean, Boolean) :#
Summary: This event is triggered when the Order No. related to a Purchase Invoice Line is calculated. Use this event to overwrite the Order No. found by default.
[IntegrationEvent(false, false)]
local procedure KVSPSAREOnBeforeGetOrderLineForInvoiceLine(InvoiceLine: Record "Purchase Line"; var OrderLine: Record "Purchase Line"; var OrderLineFound: Boolean; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAREPurchaseDocumentMgt", 'KVSPSAREOnBeforeGetOrderLineForInvoiceLine', '', false, false)]
local procedure DoSomethingKVSPSAREOnBeforeGetOrderLineForInvoiceLine(InvoiceLine: Record "Purchase Line"; var OrderLine: Record "Purchase Line"; var OrderLineFound: Boolean; var IsHandled: Boolean)
begin
end;
Parameters:
InvoiceLine
: The Invoice Line an Order is searched forOrderLine
: The found Order LineOrderLineFound
: Specifies whether an Order Line has been foundIsHandled
: If set to true the default search for an Order No. will be skipped
KVSPSAREOnCheckOrderAmountDoesNotSurpassJobBudgetOnCalculateBudgetForPSPLine(Record KVSPSAJobPSPLine, Decimal) :#
Summary: This event is triggered when the remaining budget of a PSP Line available to be used in Purchase Documents is being calculated. Use this event to modify the calculated Amount.
[IntegrationEvent(false, false)]
local procedure KVSPSAREOnCheckOrderAmountDoesNotSurpassJobBudgetOnCalculateBudgetForPSPLine(PSPLine: Record "KVSPSAJobPSPLine"; var PSPBudget: Decimal):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAREPurchaseDocumentMgt", 'KVSPSAREOnCheckOrderAmountDoesNotSurpassJobBudgetOnCalculateBudgetForPSPLine', '', false, false)]
local procedure DoSomethingKVSPSAREOnCheckOrderAmountDoesNotSurpassJobBudgetOnCalculateBudgetForPSPLine(PSPLine: Record "KVSPSAJobPSPLine"; var PSPBudget: Decimal)
begin
end;
Parameters:
PSPLine
: The PSP Line which's budget is being calculatedPSPBudget
: The calculated Budget Amount
KVSPSAREOnBeforeIsPaymentCorrectionTooLowForPurchaseHeader(Record Purchase Header, Boolean, Boolean) :#
Summary: This event is triggered when the Payment Correction of a Purchase Header is being checked of being sufficient. Use this event to overrule this check.
[IntegrationEvent(false, false)]
local procedure KVSPSAREOnBeforeIsPaymentCorrectionTooLowForPurchaseHeader(var PurchaseHeader: Record "Purchase Header"; var IsTooLow: Boolean; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAREPurchaseDocumentMgt", 'KVSPSAREOnBeforeIsPaymentCorrectionTooLowForPurchaseHeader', '', false, false)]
local procedure DoSomethingKVSPSAREOnBeforeIsPaymentCorrectionTooLowForPurchaseHeader(var PurchaseHeader: Record "Purchase Header"; var IsTooLow: Boolean; var IsHandled: Boolean)
begin
end;
Parameters:
PurchaseHeader
: The Purchase Header being checkedIsTooLow
: Specifies whether the Payment Correction is considered too lowIsHandled
: Set to true to skip the default calculation and return the value "IsTooLow"