Skip to content

KVSPSAJobBankAccountMgt#

Procedures#

CalculateBankAccountCodeForPurchaseDocumentByPurchaseLines(Record Purchase Header, Boolean, Code[20], Text) : Boolean#

Summary: The CalculateBankAccountCodeForPurchaseDocumentByPurchaseLines function calculates the bank account code for a purchase document based on its purchase lines. It checks for job bank accounts associated with the purchase lines and returns the first found account or a list of conflicting accounts if multiple accounts are found. If CalcOwnBankAccounts is true, it will look for own accounts; otherwise, it will look for vendor accounts. If no job bank accounts are found, it returns false.

procedure CalculateBankAccountCodeForPurchaseDocumentByPurchaseLines(PurchaseHeader: Record "Purchase Header"; CalcOwnBankAccounts: Boolean; var BankAccountCode: Code[20]; var ConflictingAccounts: Text): Boolean

Parameters:

  • PurchaseHeader: Purchase Header record containing the document details.
  • CalcOwnBankAccounts: Boolean indicating whether to calculate own bank accounts or vendor accounts.
  • BankAccountCode: Output parameter that will contain the bank account code if found.
  • ConflictingAccounts: Output parameter that will contain a comma-separated list of conflicting bank account codes if multiple accounts are found.

Returns: Returns true if a bank account code is found, otherwise false.

CalculateBankAccountCodeForSalesDocumentBySalesLines(Record Sales Header, Boolean, Code[20], Text) : Boolean#

Summary: The CalculateBankAccountCodeForSalesDocumentBySalesLines function calculates the bank account code for a sales document based on its sales lines. It checks for job bank accounts associated with the sales lines and returns the first found account or a list of conflicting accounts if multiple accounts are found.

procedure CalculateBankAccountCodeForSalesDocumentBySalesLines(SalesHeader: Record "Sales Header"; CalcOwnBankAccounts: Boolean; var BankAccountCode: Code[20]; var ConflictingAccounts: Text): Boolean

Parameters:

  • SalesHeader: Sales Header record containing the document details.
  • CalcOwnBankAccounts: Boolean indicating whether to calculate own bank accounts or customer accounts.
  • BankAccountCode: Output parameter that will contain the bank account code if found.
  • ConflictingAccounts: Output parameter that will contain a comma-separated list of conflicting bank account codes if multiple accounts are found.

Returns: Returns true if a bank account code is found, otherwise false.

FindJobBankAccount(Enum KVSPSAJobBankAccountType, Code[20], Code[20], Code[20], Code[20], Code[20], Code[20], Integer, Record KVSPSAJobBankAccount) : Boolean#

Summary: The FindJobBankAccount function searches for a job bank account based on the provided parameters. It looks for a job bank account with the specified type, customer/vendor number, job number, work package code, phase code, task code, step code, and budget line number.

procedure FindJobBankAccount(Type: Enum "KVSPSAJobBankAccountType"; CustomerVendorNo: Code[20]; JobNo: Code[20]; WorkPackageCode: Code[20]; PhaseCode: Code[20]; TaskCode: Code[20]; StepCode: Code[20]; BudgetLineNo: Integer; var JobBankAccount: Record "KVSPSAJobBankAccount"): Boolean

Parameters:

  • Type: Parameter of type Enum KVSPSAJobBankAccountType indicating the type of job bank account to search for.
  • CustomerVendorNo: Code[20] representing the customer or vendor number associated with the job bank account.
  • JobNo: Code[20] representing the job number associated with the job bank account.
  • WorkPackageCode: Code[20] representing the work package code associated with the job bank account.
  • PhaseCode: Code[20] representing the phase code associated with the job bank account.
  • TaskCode: Code[20] representing the task code associated with the job bank account.
  • StepCode: Code[20] representing the step code associated with the job bank account.
  • BudgetLineNo: Integer representing the budget line number associated with the job bank account.
  • JobBankAccount: Record KVSPSAJobBankAccount that will be filled with the found job bank account details.

Returns: Returns true if a job bank account is found, otherwise false.

Events#

KVSPSAOnAfterCalculateBankAccountCodeForPurchaseDocumentByPurchaseLines(Record Purchase Header, Boolean, Code[20], Text) :#

[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterCalculateBankAccountCodeForPurchaseDocumentByPurchaseLines(PurchaseHeader: Record "Purchase Header"; CalcOwnBankAccounts: Boolean; var BankAccountCode: Code[20]; var ConflictingAccounts: Text): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAJobBankAccountMgt", 'KVSPSAOnAfterCalculateBankAccountCodeForPurchaseDocumentByPurchaseLines', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterCalculateBankAccountCodeForPurchaseDocumentByPurchaseLines(PurchaseHeader: Record "Purchase Header"; CalcOwnBankAccounts: Boolean; var BankAccountCode: Code[20]; var ConflictingAccounts: Text)
begin
end;

KVSPSAOnAfterCalculateBankAccountCodeForSalesDocumentBySalesLines(Record Sales Header, Boolean, Code[20], Text) :#

[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterCalculateBankAccountCodeForSalesDocumentBySalesLines(SalesHeader: Record "Sales Header"; CalcOwnBankAccounts: Boolean; var BankAccountCode: Code[20]; var ConflictingAccounts: Text): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAJobBankAccountMgt", 'KVSPSAOnAfterCalculateBankAccountCodeForSalesDocumentBySalesLines', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterCalculateBankAccountCodeForSalesDocumentBySalesLines(SalesHeader: Record "Sales Header"; CalcOwnBankAccounts: Boolean; var BankAccountCode: Code[20]; var ConflictingAccounts: Text)
begin
end;

KVSPSAOnBeforeCalculateBankAccountCodeForPurchaseDocumentByPurchaseLines(Record Purchase Header, Boolean, Code[20], Text, Boolean) :#

[IntegrationEvent(false, false)]
local procedure KVSPSAOnBeforeCalculateBankAccountCodeForPurchaseDocumentByPurchaseLines(PurchaseHeader: Record "Purchase Header"; CalcOwnBankAccounts: Boolean; var BankAccountCode: Code[20]; var ConflictingAccounts: Text; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAJobBankAccountMgt", 'KVSPSAOnBeforeCalculateBankAccountCodeForPurchaseDocumentByPurchaseLines', '', false, false)]
local procedure DoSomethingKVSPSAOnBeforeCalculateBankAccountCodeForPurchaseDocumentByPurchaseLines(PurchaseHeader: Record "Purchase Header"; CalcOwnBankAccounts: Boolean; var BankAccountCode: Code[20]; var ConflictingAccounts: Text; var IsHandled: Boolean)
begin
end;

KVSPSAOnBeforeCalculateBankAccountCodeForSalesDocumentBySalesLines(Record Sales Header, Boolean, Code[20], Text, Boolean) :#

[IntegrationEvent(false, false)]
local procedure KVSPSAOnBeforeCalculateBankAccountCodeForSalesDocumentBySalesLines(SalesHeader: Record "Sales Header"; CalcOwnBankAccounts: Boolean; var BankAccountCode: Code[20]; var ConflictingAccounts: Text; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAJobBankAccountMgt", 'KVSPSAOnBeforeCalculateBankAccountCodeForSalesDocumentBySalesLines', '', false, false)]
local procedure DoSomethingKVSPSAOnBeforeCalculateBankAccountCodeForSalesDocumentBySalesLines(SalesHeader: Record "Sales Header"; CalcOwnBankAccounts: Boolean; var BankAccountCode: Code[20]; var ConflictingAccounts: Text; var IsHandled: Boolean)
begin
end;

KVSPSAOnCalcSalesHeaderTotalAmountOnAddJobBankAccountDocumentTextForSalesHeader(Record Sales Header, Decimal) :#

[IntegrationEvent(false, false)]
local procedure KVSPSAOnCalcSalesHeaderTotalAmountOnAddJobBankAccountDocumentTextForSalesHeader(var SalesHeader: Record "Sales Header"; var AmountIncludingVAT: Decimal): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAJobBankAccountMgt", 'KVSPSAOnCalcSalesHeaderTotalAmountOnAddJobBankAccountDocumentTextForSalesHeader', '', false, false)]
local procedure DoSomethingKVSPSAOnCalcSalesHeaderTotalAmountOnAddJobBankAccountDocumentTextForSalesHeader(var SalesHeader: Record "Sales Header"; var AmountIncludingVAT: Decimal)
begin
end;