Codeunit 131332 Library - Cash Flow Helper

Application Test Library

src/Layers/W1/Tests/ApplicationTestLibrary/LibraryCashFlowHelper.Codeunit.al93 procedures and triggers, in source order. Copyright (c) Microsoft Corporation. MIT

AddAndPostSOPrepaymentInvoice line 28

  1. 30callsAddSOPrepayment
  2. 31callsPostSOPrepaymentInvoice

AddSOPrepayment line 34

  1. 36validatesTable 36 Sales Header Prepayment %
  2. 37writesTable 36 Sales Header Modify(true)

PostSOPrepaymentInvoice line 40

  1. 44callsCodeunit 442 Sales-Post Prepayments Invoice

AddAndPostPOPrepaymentInvoice line 48

  1. 50callsAddPOPrepayment
  2. 51callsPostPOPrepaymentInvoice

AddPOPrepayment line 54

  1. 56validatesTable 38 Purchase Header Prepayment %
  2. 57writesTable 38 Purchase Header Modify(true)

PostPOPrepaymentInvoice line 60

  1. 64callsCodeunit 444 Purchase-Post Prepayments Invoice

AssignCFPaymentTermToCustomer line 68

  1. 71validatesTable 18 Customer Cash Flow Payment Terms Code
  2. 71callsGetPaymentTermsCode
  3. 72writesTable 18 Customer Modify(true)

AssignPaymentTermToCustomer line 75

  1. 78validatesTable 18 Customer Payment Terms Code
  2. 78callsGetPaymentTermsCode
  3. 79writesTable 18 Customer Modify(true)

AssignCFPaymentTermToVendor line 82

  1. 85validatesTable 23 Vendor Cash Flow Payment Terms Code
  2. 85callsGetPaymentTermsCode
  3. 86writesTable 23 Vendor Modify(true)

AssignPaymentTermToVendor line 89

  1. 92validatesTable 23 Vendor Payment Terms Code
  2. 92callsGetPaymentTermsCode
  3. 93writesTable 23 Vendor Modify(true)

ApplyInvoicePayment line 96

  1. 100callsSelectAndClearGenJournalBatch
  2. 101callsCodeunit 131300 Library - ERM CreateGeneralJnlLine
  3. 106validatesTable 81 Gen. Journal Line Applies-to Doc. Type
  4. 107validatesTable 81 Gen. Journal Line Applies-to Doc. No.
  5. 108writesTable 81 Gen. Journal Line Modify(true)
  6. 109callsCodeunit 131300 Library - ERM PostGeneralJnlLine

CalcDiscAmtFromGenJnlLine line 112

  1. 116callsCalculateDiscountAmount

CalcCustDiscAmtLCY line 119

  1. 122callsCalcCustDiscAmt
  2. 122callsCodeunit 131300 Library - ERM GetAmountRoundingPrecision

CalcVendDiscAmtLCY line 125

  1. 128callsCalcVendDiscAmt
  2. 128callsCodeunit 131300 Library - ERM GetAmountRoundingPrecision

CalcCustDiscAmt line 131

  1. 134callsCodeunit 131300 Library - ERM GetAmountRoundingPrecision

CalcVendDiscAmt line 137

  1. 140callsCodeunit 131300 Library - ERM GetAmountRoundingPrecision

CalcSalesExpectedPrepmtAmounts line 143

  1. 147callsGetTotalSalesAmount
  2. 151callsCalculateDiscountAmount
  3. 152callsCalculateDiscountAmount

CalcPurchExpectedPrepmtAmounts line 156

  1. 160callsGetTotalPurchaseAmount
  2. 164callsCalculateDiscountAmount
  3. 165callsCalculateDiscountAmount

CalculateDiscountAmount line 169

  1. 171callsCodeunit 131300 Library - ERM GetAmountRoundingPrecision

ChangeWorkdateByDateFormula line 174

  1. 176callsChangeWorkdate
  2. 176callsGenerateDateFromFormulas

CreateLedgerEntry line 185

  1. 189callsSelectAndClearGenJournalBatch
  2. 190callsCodeunit 131300 Library - ERM CreateGeneralJnlLine
  3. 193callsCodeunit 131300 Library - ERM PostGeneralJnlLine

CreateAndApplySalesInvPayment line 196

  1. 201callsGenerateDateFromFormulas
  2. 202callsSelectAndClearGenJournalBatch
  3. 203callsCodeunit 131300 Library - ERM CreateGeneralJnlLine
  4. 206callsCodeunit 131300 Library - ERM CreateGeneralJnlLine
  5. 209validatesTable 81 Gen. Journal Line Posting Date
  6. 210validatesTable 81 Gen. Journal Line Document Date
  7. 211validatesTable 81 Gen. Journal Line Applies-to Doc. Type
  8. 212validatesTable 81 Gen. Journal Line Applies-to Doc. No.
  9. 213writesTable 81 Gen. Journal Line Modify(true)
  10. 214callsCodeunit 131300 Library - ERM PostGeneralJnlLine

CreateAndApplyVendorInvPmt line 217

  1. 222callsGenerateDateFromFormulas
  2. 223callsSelectAndClearGenJournalBatch
  3. 224callsCodeunit 131300 Library - ERM CreateGeneralJnlLine
  4. 227callsCodeunit 131300 Library - ERM CreateGeneralJnlLine
  5. 230validatesTable 81 Gen. Journal Line Posting Date
  6. 231validatesTable 81 Gen. Journal Line Document Date
  7. 232validatesTable 81 Gen. Journal Line Applies-to Doc. Type
  8. 233validatesTable 81 Gen. Journal Line Applies-to Doc. No.
  9. 234writesTable 81 Gen. Journal Line Modify(true)
  10. 235callsCodeunit 131300 Library - ERM PostGeneralJnlLine

CreateBudgetEntry line 238

  1. 244callsCodeunit 131300 Library - ERM CreateGLBudgetName
  2. 245callsFindCFBudgetAccount
  3. 246callsFindFirstGLAccFromCFAcc
  4. 247callsCodeunit 131300 Library - ERM CreateGLBudgetEntry
  5. 248validatesTable 96 G/L Budget Entry Amount
  6. 248callsCodeunit 130440 Library - Random RandDec
  7. 249writesTable 96 G/L Budget Entry Modify(true)

CreateDefaultPaymentTerms line 252

  1. 254callsCodeunit 131300 Library - ERM CreatePaymentTerms
  2. 257validatesTable 3 Payment Terms Discount %
  3. 258writesTable 3 Payment Terms Modify(true)

CreateCustWithCFDsctPmtTerm line 261

  1. 263callsCodeunit 130509 Library - Sales CreateCustomer
  2. 264callsCodeunit 131300 Library - ERM GetDiscountPaymentTerm
  3. 265callsAssignCFPaymentTermToCustomer

CreateVendorWithCFDsctPmtTerm line 268

  1. 270callsCodeunit 130512 Library - Purchase CreateVendor
  2. 271callsCodeunit 131300 Library - ERM GetDiscountPaymentTerm
  3. 272callsAssignCFPaymentTermToVendor

CreateFixedAssetForInvestment line 275

  1. 284callsCodeunit 131330 Library - Fixed Asset CreateFixedAsset
  2. 285validatesTable 5600 Fixed Asset Budgeted Asset
  3. 286writesTable 5600 Fixed Asset Modify(true)
  4. 287callsCodeunit 131330 Library - Fixed Asset CreateFADepreciationBook
  5. 289callsCodeunit 131330 Library - Fixed Asset FindFAJournalTemplate
  6. 290callsCodeunit 131330 Library - Fixed Asset CreateFAJournalBatch
  7. 291validatesTable 5620 FA Journal Batch No. Series
  8. 291callsCodeunit 131000 Library - Utility GetGlobalNoSeriesCode
  9. 292writesTable 5620 FA Journal Batch Modify(true)
  10. 293callsCodeunit 131330 Library - Fixed Asset CreateFAJournalLine
  11. 296validatesTable 5621 FA Journal Line Document No.
  12. 296callsCodeunit 310 No. Series PeekNextNo
  13. 297validatesTable 5621 FA Journal Line FA No.
  14. 298validatesTable 5621 FA Journal Line Depreciation Book Code
  15. 299validatesTable 5621 FA Journal Line Amount
  16. 300validatesTable 5621 FA Journal Line FA Posting Date
  17. 301writesTable 5621 FA Journal Line Modify(true)
  18. 302callsCodeunit 131330 Library - Fixed Asset PostFAJournalLine

CreateFixedAssetForDisposal line 305

  1. 309callsCodeunit 131330 Library - Fixed Asset CreateFixedAsset
  2. 310callsCodeunit 131330 Library - Fixed Asset CreateFADepreciationBook
  3. 315writesTable 5612 FA Depreciation Book Modify(true)

CreateManualPayment line 318

  1. 322callsCodeunit 131331 Library - Cash Flow CreateCashFlowAccount
  2. 323callsCodeunit 131331 Library - Cash Flow CreateManualLinePayment
  3. 327validatesTable 850 Cash Flow Manual Expense Amount
  4. 327callsCodeunit 130440 Library - Random RandInt
  5. 328writesTable 850 Cash Flow Manual Expense Modify(true)

CreateManualRevenue line 331

  1. 335callsCodeunit 131331 Library - Cash Flow CreateCashFlowAccount
  2. 336callsCodeunit 131331 Library - Cash Flow CreateManualLineRevenue
  3. 340validatesTable 849 Cash Flow Manual Revenue Amount
  4. 340callsCodeunit 130440 Library - Random RandInt
  5. 341writesTable 849 Cash Flow Manual Revenue Modify(true)

CreateRandomDateFormula line 344

  1. 346callsCodeunit 130440 Library - Random RandInt

CreateSpecificCashFlowCard line 349

  1. 351callsCodeunit 131331 Library - Cash Flow CreateCashFlowCard
  2. 353validatesTable 840 Cash Flow Forecast Consider Discount
  3. 354validatesTable 840 Cash Flow Forecast Consider CF Payment Terms
  4. 355writesTable 840 Cash Flow Forecast Modify(true)

CreateCashFlowForecastDefault line 358

  1. 360callsCreateSpecificCashFlowCard

CreateCashFlowForecastConsiderDiscount line 363

  1. 365callsCreateSpecificCashFlowCard

CreateCashFlowForecastConsiderCFPmtTerms line 368

  1. 370callsCreateSpecificCashFlowCard

CreateCashFlowForecastConsiderDiscountAndCFPmtTerms line 373

  1. 375callsCreateSpecificCashFlowCard

CreateSalesOrder line 378

  1. 383callsCodeunit 130509 Library - Sales CreateCustomerWithBusPostingGroups
  2. 385callsAssignPaymentTermToCustomer
  3. 386callsAssignCFPaymentTermToCustomer
  4. 388callsCodeunit 130509 Library - Sales CreateSalesHeader
  5. 390callsCreateSalesLine
  6. 391callsCreateSalesLine
  7. 392callsCreateSalesLine

CreateSpecificSalesOrder line 395

  1. 399callsCodeunit 131300 Library - ERM CreateGLAccountWithSalesSetup
  2. 400callsCreateSalesOrder

CreateDefaultSalesOrder line 403

  1. 405callsCreateSpecificSalesOrder

CreatePrepmtSalesOrder line 408

  1. 413callsCodeunit 130509 Library - Sales CreatePrepaymentVATSetup
  2. 414callsCreateSalesOrder

CreateSalesLine line 417

  1. 429callsCodeunit 131300 Library - ERM CreateGLAccountWithVATPostingSetup
  2. 431callsCodeunit 130509 Library - Sales CreateSalesLine
  3. 432callsCodeunit 130440 Library - Random RandInt
  4. 433validatesTable 37 Sales Line Unit Price
  5. 433callsCodeunit 130440 Library - Random RandInt
  6. 434writesTable 37 Sales Line Modify(true)

CreatePurchaseOrder line 437

  1. 442callsCodeunit 130512 Library - Purchase CreateVendorWithBusPostingGroups
  2. 444callsAssignPaymentTermToVendor
  3. 445callsAssignCFPaymentTermToVendor
  4. 447callsCodeunit 130512 Library - Purchase CreatePurchHeader
  5. 449callsCreatePurchaseLine
  6. 450callsCreatePurchaseLine
  7. 451callsCreatePurchaseLine

CreateSpecificPurchaseOrder line 454

  1. 458callsCodeunit 131300 Library - ERM CreateGLAccountWithPurchSetup
  2. 459callsCreatePurchaseOrder

CreateDefaultPurchaseOrder line 462

  1. 464callsCreateSpecificPurchaseOrder

CreatePrepmtPurchaseOrder line 467

  1. 472callsCodeunit 130512 Library - Purchase CreatePrepaymentVATSetup
  2. 473callsCreatePurchaseOrder

CreatePurchaseLine line 476

  1. 483raisesOnBeforeCreatePurchaseLine
  2. 489callsCodeunit 131300 Library - ERM CreateVATPostingSetupWithAccounts
  3. 490callsCodeunit 130440 Library - Random RandIntInRange
  4. 492writesTable 325 VAT Posting Setup Insert
  5. 493callsCodeunit 131300 Library - ERM CreateGLAccountWithVATPostingSetup
  6. 495callsCodeunit 130512 Library - Purchase CreatePurchaseLine
  7. 496callsCodeunit 130440 Library - Random RandInt
  8. 497validatesTable 39 Purchase Line Direct Unit Cost
  9. 497callsCodeunit 130440 Library - Random RandInt
  10. 498writesTable 39 Purchase Line Modify(true)
  11. 500raisesOnAfterCreatePurchaseLine

CreateSpecificServiceOrder line 505

  1. 509callsCodeunit 131902 Library - Service CreateSpecificServiceOrder

CreateDefaultServiceOrder line 515

  1. 518callsCreateSpecificServiceOrder

CreateServiceLines line 525

  1. 529callsCodeunit 131902 Library - Service CreateServiceLines

CreatePrepaymentAccount line 533

  1. 537callsCodeunit 131300 Library - ERM CreateGLAccount
  2. 538validatesTable 15 G/L Account Gen. Bus. Posting Group
  3. 539validatesTable 15 G/L Account Gen. Prod. Posting Group
  4. 540validatesTable 15 G/L Account VAT Bus. Posting Group
  5. 541validatesTable 15 G/L Account VAT Prod. Posting Group
  6. 542writesTable 15 G/L Account Modify(true)

CreateDefaultJob line 546

  1. 551callsCodeunit 131920 Library - Job CreateJob
  2. 552callsCodeunit 131920 Library - Job CreateJobTask
  3. 554callsCreateDefaultJobPlanningLine
  4. 555callsCreateDefaultJobPlanningLine
  5. 556callsCreateDefaultJobPlanningLine

CreateDefaultJobForCustomer line 559

  1. 564callsCodeunit 131920 Library - Job CreateJob
  2. 565callsCodeunit 131920 Library - Job CreateJobTask
  3. 567callsCreateDefaultJobPlanningLine
  4. 568callsCreateDefaultJobPlanningLine
  5. 569callsCreateDefaultJobPlanningLine

CreateJobPlanningLine line 572

  1. 578callsCreateDefaultJobPlanningLine

CreateDefaultJobPlanningLine line 581, local

  1. 583callsCodeunit 131920 Library - Job CreateJobPlanningLine

FillJournal line 586

  1. 588callsCodeunit 131331 Library - Cash Flow ClearJournal
  2. 589callsCodeunit 131331 Library - Cash Flow FillJournal

FillJnlOnCertDateFormulas line 592

  1. 596callsGenerateDateFromFormulas
  2. 597callsFillJournalOnCertainDate

FillJournalOnCertainDate line 600

  1. 604callsChangeWorkdate
  2. 605callsFillJournal

FindCFLiquidFundAccount line 621

  1. 623callsFindFirstCFAccWithGLIntegration

FindCFBudgetAccount line 626

  1. 628callsFindFirstCFAccWithGLIntegration

GetDifferentDsctPaymentTerms line 708

  1. 713callsCodeunit 131300 Library - ERM CreatePaymentTerms
  2. 716validatesTable 3 Payment Terms Discount %
  3. 717writesTable 3 Payment Terms Modify(true)

GetTotalSalesAmount line 720

  1. 737callsCalculateDiscountAmount

GetTotalPurchaseAmount line 742

  1. 758callsCalculateDiscountAmount

GetTotalServiceAmount line 763

  1. 780callsCalculateDiscountAmount

GetTotalAmountForSalesOrderWithCashFlowPaymentTermsDiscount line 786

  1. 805callsCalculateDiscountAmount

GetTotalAmountForPurchaseOrderWithCashFlowPaymentTermsDiscount line 810

  1. 829callsCalculateDiscountAmount

GetTotalAmountForServiceOrderWithCashFlowPaymentTermsDiscount line 834

  1. 853callsCalculateDiscountAmount

GetTotalTaxAmount line 885

  1. 898callsTable 843 Cash Flow Setup GetTaxPeriodStartEndDates

GetPaymentTermsCode line 926, local

  1. 932callsCreateDefaultPaymentTerms

InsertCFLedgerEntry line 948

  1. 963callsGetCFAccountNo
  2. 965validatesTable 847 Cash Flow Forecast Entry Amount (LCY)
  3. 966writesTable 847 Cash Flow Forecast Entry Insert

SelectAndClearGenJournalBatch line 969

  1. 971callsCodeunit 131300 Library - ERM SelectGenJnlBatch
  2. 972callsCodeunit 131300 Library - ERM ClearGenJournalLines

SetExpectedDsctAPmtTermValues line 975

  1. 988callsFindCustomerCFPaymentTerms
  2. 989callsGetTotalSalesAmount
  3. 994callsFindCustomerCFPaymentTerms
  4. 995callsGetTotalServiceAmount
  5. 1002callsGetTotalPurchaseAmount
  6. 1010callsCalculateDiscountAmount

SetDefaultDepreciationBook line 1020

  1. 1026validatesTable 5603 FA Setup Default Depr. Book
  2. 1027writesTable 5603 FA Setup Modify(true)

SetPmtToleranceOptionsOnCashFlowForecast line 1030

  1. 1032validatesTable 840 Cash Flow Forecast Consider Pmt. Disc. Tol. Date
  2. 1033validatesTable 840 Cash Flow Forecast Consider Pmt. Tol. Amount
  3. 1034writesTable 840 Cash Flow Forecast Modify(true)

SetupPmtDsctGracePeriod line 1037

  1. 1042validatesTable 98 General Ledger Setup Payment Discount Grace Period
  2. 1043writesTable 98 General Ledger Setup Modify(true)

SetupPmtTolPercentage line 1046

  1. 1051validatesTable 98 General Ledger Setup Payment Tolerance %
  2. 1052writesTable 98 General Ledger Setup Modify(true)

SetupPmtTolAmount line 1055

  1. 1060validatesTable 98 General Ledger Setup Max. Payment Tolerance Amount
  2. 1061writesTable 98 General Ledger Setup Modify(true)

SetupCustomerPmtTolAmtTestCase line 1064

  1. 1066callsCodeunit 130509 Library - Sales CreateCustomer
  2. 1067callsSetupPmtTolAmtTestCase

SetupVendorPmtTolAmtTestCase line 1070

  1. 1072callsCodeunit 130512 Library - Purchase CreateVendor
  2. 1073callsSetupPmtTolAmtTestCase

SetupPmtTolAmtTestCase line 1076, local

  1. 1078callsCreateCashFlowForecastDefault
  2. 1079callsSetPmtToleranceOptionsOnCashFlowForecast
  3. 1080callsCodeunit 130440 Library - Random RandInt
  4. 1081callsSetupPmtTolPercentage
  5. 1082callsSetupPmtTolAmount

SetupPmtDsctTolCustLETest line 1085

  1. 1087callsCreateCashFlowForecastConsiderDiscountAndCFPmtTerms
  2. 1088callsSetPmtToleranceOptionsOnCashFlowForecast
  3. 1089callsSetupPmtDsctGracePeriod
  4. 1090callsCreateCustWithCFDsctPmtTerm
  5. 1091callsCodeunit 130440 Library - Random RandDec
  6. 1092callsCalculateDiscountAmount

SetupPmtDsctTolVendorLETest line 1095

  1. 1097callsCreateCashFlowForecastConsiderDiscountAndCFPmtTerms
  2. 1098callsSetPmtToleranceOptionsOnCashFlowForecast
  3. 1099callsSetupPmtDsctGracePeriod
  4. 1100callsCreateVendorWithCFDsctPmtTerm
  5. 1101callsCodeunit 130440 Library - Random RandDec
  6. 1102callsCalculateDiscountAmount

SetupDsctPmtTermsCustLETest line 1105

  1. 1107callsCreateCashFlowForecastConsiderDiscountAndCFPmtTerms
  2. 1108callsCreateCustWithCFDsctPmtTerm
  3. 1109callsCodeunit 130440 Library - Random RandDec
  4. 1110callsCalculateDiscountAmount

VerifyCFDateOnCFJnlLine line 1113

  1. 1115callsCodeunit 130000 Assert AreEqual

VerifyExpectedCFAmount line 1118

  1. 1120callsCodeunit 130000 Assert AreEqual

VerifyExpectedCFAmtNearlyEqual line 1123

  1. 1125callsCodeunit 130000 Assert AreNearlyEqual

VerifyCFDataOnSnglJnlLine line 1128

  1. 1130callsVerifyCFDataOnSnglJnlLineWithDates

VerifyCFDataOnSnglJnlLineWithDates line 1134

  1. 1136callsFilterSingleJournalLine
  2. 1144callsVerifyExpectedCFAmtNearlyEqual
  3. 1144callsCodeunit 131300 Library - ERM GetAmountRoundingPrecision
  4. 1145callsVerifyCFDateOnCFJnlLine

UpdateDueDateOnCustomerLedgerEntry line 1148

  1. 1150validatesTable 21 Cust. Ledger Entry Due Date
  2. 1150callsGetAnyDateAfter
  3. 1151writesTable 21 Cust. Ledger Entry Modify(true)

UpdatePmtDiscountDateOnCustomerLedgerEntry line 1154

  1. 1156validatesTable 21 Cust. Ledger Entry Pmt. Discount Date
  2. 1156callsGetAnyDateAfter
  3. 1157writesTable 21 Cust. Ledger Entry Modify(true)

UpdateDueDateOnVendorLedgerEntry line 1160

  1. 1162validatesTable 25 Vendor Ledger Entry Due Date
  2. 1162callsGetAnyDateAfter
  3. 1163writesTable 25 Vendor Ledger Entry Modify(true)

UpdatePmtDiscountDateOnVendorLedgerEntry line 1166

  1. 1168validatesTable 25 Vendor Ledger Entry Pmt. Discount Date
  2. 1168callsGetAnyDateAfter
  3. 1169writesTable 25 Vendor Ledger Entry Modify(true)

GetAnyDateAfter line 1172, local

  1. 1176callsCodeunit 130440 Library - Random RandInt