KVSPSAGeneral Functions PSA#
Procedures#
AppendToTextBuilder(TextBuilder, Text, Text) :#
Summary: Add Text with a Delimiter to a TextBuilder. If the TextBuilder is not empty, the Delimiter will be set before the new text
procedure AppendToTextBuilder(var TextBuilderToAppend: TextBuilder; TextToAdd: Text; Delimiter: Text):
Parameters:
TextBuilderToAppend
:TextToAdd
:Delimiter
:
CalcOutStandingPrice(Record KVSPSAJobPSPLine) :#
Summary: Calculate the outstanding sales price for a JobPSPLine based on its invoicing type and other fields. This procedure modifies the JobPSPLine record with the calculated outstanding sales total price. The calculation logic varies based on the invoicing type of the JobPSPLine. The procedure handles different invoicing types such as "without Calc.", "Fixed Price", "on Cost", "Milestone", "POC", "TC Fixed Rate", and "Package Invoice". If the "Line No." of the JobPSPLine is 0, the procedure exits without performing any calculations. The "Outstanding Sales Total Price" field is updated based on the invoicing type and other relevant fields.
procedure CalcOutStandingPrice(var JobPSPLine: Record "KVSPSAJobPSPLine"):
Parameters:
JobPSPLine
: The JobPSPLine record for which the outstanding sales price is to be calculated.
DeleteRecordWithQuestion(Variant) :#
Summary: Delete a record with a confirmation question. This procedure checks if the record is valid and prompts the user for confirmation before deleting it. If the record is a single record, it asks for confirmation to delete that specific record. If the record has multiple entries, it asks for confirmation to delete all records of that table. If the user confirms, the record(s) will be deleted. If the record is not valid or if the user cancels the confirmation, the procedure exits without deleting anything.
procedure DeleteRecordWithQuestion(RecordAsVariant: Variant):
Parameters:
RecordAsVariant
: The record to be deleted, passed as a Variant type.
TestBlocked(Code[20], Code[10], Code[20], Integer) :#
Summary: Test Blocked field in Job Budget Name / Job WBS Header / Job WBS Line
procedure TestBlocked(TestJobNo: Code[20]; TestJobBudgetName: Code[10]; TestVersion: Code[20]; TestLineNo: Integer):
Parameters:
TestJobNo
: Job No. to testTestJobBudgetName
: Job Budget Name to testTestVersion
: Version No. to testTestLineNo
: Line No. to test
TransferPurchInvLedgerFromPurchaseLineToPurchaseLine(Record Purchase Line, Record Purchase Line) :#
Summary: Transfer purchase invoice ledger entries from one purchase line to another. This procedure updates the purchase invoice ledger entries associated with a source purchase line and transfers them to a target purchase line. It retrieves the purchase invoice ledger entries for the source purchase line and modifies them to reflect the target purchase line's document type, document number, and line number. If the source purchase line has no associated purchase invoice ledger entries, this procedure does nothing.
procedure TransferPurchInvLedgerFromPurchaseLineToPurchaseLine(SourcePurchaseLine: Record "Purchase Line"; TargetPurchaseLine: Record "Purchase Line"):
Parameters:
SourcePurchaseLine
: The source Puchase Line to get the document Information.TargetPurchaseLine
: The target Purchase Line to transfer the document Information.
UpdateBudgetFromPSPLines(Code[20], Code[10], Code[20]) :#
Summary: Update the budget values in the Job WBS lines based on the detailed planning values stored in the budget lines. This procedure checks if the budget calculation is enabled for each Job WBS line and updates the total cost, total price, and line discount amounts accordingly. If the values in the Job WBS lines differ from the budget lines, it prompts the user for confirmation to update the WBS lines. If the user confirms, it updates the Job WBS lines with the new values calculated from the budget lines. If the budget calculation is not enabled for a Job WBS line, it skips that line. The procedure also handles the case where the user has opted to confirm the update of WBS lines from differing budget lines amounts.
procedure UpdateBudgetFromPSPLines(JobNo: Code[20]; BudgetName: Code[10]; VersionNo: Code[20]):
Parameters:
JobNo
: The Job No. to update the WBS lines for.BudgetName
: The name of the budget to update from.VersionNo
: The version number of the budget to update from.
UpdatePSP(Record KVSPSAJobPSPHeader) :#
Summary: Update the PSP (Project Structure Plan) for a given JobPSPHeader. This procedure buffers the JobPSPHeader data and updates the work package lines and sum lines based on the temporary global job PSP line records. It calculates the total price for usage and sales, and updates the outstanding sales total price for each work package line. It also updates the subtotal total cost and subtotal total price for each sum line. The procedure iterates through the temporary global job PSP lines and applies the necessary calculations and updates.
procedure UpdatePSP(var JobPSPHeader: Record "KVSPSAJobPSPHeader"):
Parameters:
JobPSPHeader
: The JobPSPHeader record to be updated.
Events#
KVSPSAOnAfterCalcPSPLineUsageFieldsSubtotals(Record KVSPSAJobPSPLine) :#
Obsolete
This Element will be removed or changed with a future Version of the App.
[Obsolete('Use KVSPSAOnBeforeCalcUsageFieldSubtotalModified instead', '22.4')]
[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterCalcPSPLineUsageFieldsSubtotals(var JobPSPLine: Record "KVSPSAJobPSPLine"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAGeneral Functions PSA", 'KVSPSAOnAfterCalcPSPLineUsageFieldsSubtotals', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterCalcPSPLineUsageFieldsSubtotals(var JobPSPLine: Record "KVSPSAJobPSPLine")
begin
end;
KVSPSAOnAfterInitPSPLineUsageFields(Record KVSPSAJobPSPLine) :#
[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterInitPSPLineUsageFields(var JobPSPLine: Record "KVSPSAJobPSPLine"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAGeneral Functions PSA", 'KVSPSAOnAfterInitPSPLineUsageFields', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterInitPSPLineUsageFields(var JobPSPLine: Record "KVSPSAJobPSPLine")
begin
end;
KVSPSAOnBeforeCalcUsageFieldSubtotalJobPSPLineModify(Record KVSPSAJobPSPLine, Record KVSPSAJobPSPLine) :#
[IntegrationEvent(false, false)]
local procedure KVSPSAOnBeforeCalcUsageFieldSubtotalJobPSPLineModify(var JobPSPLine: Record "KVSPSAJobPSPLine"; var JobPSPLine2: Record "KVSPSAJobPSPLine"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAGeneral Functions PSA", 'KVSPSAOnBeforeCalcUsageFieldSubtotalJobPSPLineModify', '', false, false)]
local procedure DoSomethingKVSPSAOnBeforeCalcUsageFieldSubtotalJobPSPLineModify(var JobPSPLine: Record "KVSPSAJobPSPLine"; var JobPSPLine2: Record "KVSPSAJobPSPLine")
begin
end;
KVSPSAOnBeforeCalcUsageFieldSubtotalModified(Record KVSPSAJobPSPLine, Boolean) :#
[IntegrationEvent(false, false)]
local procedure KVSPSAOnBeforeCalcUsageFieldSubtotalModified(var JobPSPLine: Record "KVSPSAJobPSPLine"; var Modified: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAGeneral Functions PSA", 'KVSPSAOnBeforeCalcUsageFieldSubtotalModified', '', false, false)]
local procedure DoSomethingKVSPSAOnBeforeCalcUsageFieldSubtotalModified(var JobPSPLine: Record "KVSPSAJobPSPLine"; var Modified: Boolean)
begin
end;
KVSPSAOnBeforeTestBlocked(Code[20], Code[10], Code[20], Integer, Boolean) :#
[IntegrationEvent(false, false)]
local procedure KVSPSAOnBeforeTestBlocked(TestJobNo: Code[20]; TestJobBudgetName: Code[10]; TestVersion: Code[20]; TestLineNo: Integer; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAGeneral Functions PSA", 'KVSPSAOnBeforeTestBlocked', '', false, false)]
local procedure DoSomethingKVSPSAOnBeforeTestBlocked(TestJobNo: Code[20]; TestJobBudgetName: Code[10]; TestVersion: Code[20]; TestLineNo: Integer; var IsHandled: Boolean)
begin
end;
KVSPSAOnBeforeUpdateBudgetFromPSPLines(Code[20], Code[10], Code[20], Boolean) :#
[IntegrationEvent(false, false)]
local procedure KVSPSAOnBeforeUpdateBudgetFromPSPLines(JobNo: Code[20]; BudgetName: Code[10]; VersionNo: Code[20]; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAGeneral Functions PSA", 'KVSPSAOnBeforeUpdateBudgetFromPSPLines', '', false, false)]
local procedure DoSomethingKVSPSAOnBeforeUpdateBudgetFromPSPLines(JobNo: Code[20]; BudgetName: Code[10]; VersionNo: Code[20]; var IsHandled: Boolean)
begin
end;