Codeunit 444 Purchase-Post Prepayments

Base Application, Microsoft.Purchases.Posting

src/Layers/W1/BaseApp/Purchases/Posting/PurchasePostPrepayments.Codeunit.al51 procedures and triggers, in source order. Copyright (c) Microsoft Corporation. MIT

OnRun line 46, trigger

  1. 50callsCodeunit 9500 Sequence No. Mgt. SetPreviewMode
  2. 51callsExecute

Execute line 104, local

  1. 108callsInvoice
  2. 110callsCreditMemo

Invoice line 114

  1. 118raisesOnBeforeInvoice
  2. 120callsCode

CreditMemo line 123

  1. 127raisesOnBeforeCreditMemo
  2. 129callsCode

Code line 132, local

  1. 161raisesOnBeforePostPrepayments
  2. 164callsTable 98 General Ledger Setup GetRecordOnce
  3. 167callsCodeunit 8703 Feature Telemetry LogUptake
  4. 168callsCodeunit 8703 Feature Telemetry LogUsage
  5. 169callsCheckPrepmtDoc
  6. 171callsUpdateDocNos
  7. 174writesTable 38 Purchase Header Modify
  8. 179raisesOnCodeOnBeforeWindowOpen
  9. 204callsInsertPurchInvHeader
  10. 214callsGetCalcPmtDiscOnCrMemos
  11. 215callsInsertPurchCrMemoHeader
  12. 226callsGetPurchLinesToDeduct
  13. 228callsCalcVATAmountLines
  14. 231writesTable 461 Prepayment Inv. Line Buffer DeleteAll
  15. 232callsCalcVATAmountLines
  16. 233callsTable 290 VAT Amount Line DeductVATAmountLine
  17. 234callsUpdateVATOnLines
  18. 235callsBuildInvLineBuffer
  19. 237callsCreateLinesFromBuffer
  20. 243callsCopyLineCommentLinesCompressedPrepayment
  21. 245callsCopyLineCommentLinesCompressedPrepayment
  22. 248raisesOnAfterCreateLinesOnBeforeGLPosting
  23. 252callsTable 461 Prepayment Inv. Line Buffer CompressBuffer
  24. 257callsTable 461 Prepayment Inv. Line Buffer ReverseAmounts
  25. 258callsRoundAmounts
  26. 260callsAdjustInvLineBuffers
  27. 263callsAdjustInvLineBuffers
  28. 264writesTable 461 Prepayment Inv. Line Buffer Modify
  29. 277callsTable 461 Prepayment Inv. Line Buffer UpdateVATAmounts
  30. 279callsPostPrepmtInvLineBuffer
  31. 285raisesOnCodeOnBeforePostVendorEntry
  32. 286callsPostVendorEntry
  33. 290callsUpdatePostedPurchaseDocument
  34. 292callsPurchaseAssertPrepmtAmountNotMoreThanDocAmount
  35. 296raisesOnCodeOnBeforePostBalancingEntry
  36. 297callsPostBalancingEntry
  37. 302callsUpdatePurchaseDocument
  38. 303callsSetStatusPendingPrepayment
  39. 304writesTable 38 Purchase Header Modify
  40. 306raisesOnCodeOnAfterUpdateHeaderAndLines
  41. 312callsCodeunit 19 Gen. Jnl.-Post Preview ThrowError
  42. 315raisesOnAfterPostPrepayments

PurchaseAssertPrepmtAmountNotMoreThanDocAmount line 318, local

  1. 324raisesOnBeforePurchaseAssertPrepmtAmountNotMoreThanDocAmountIsHandled
  2. 331callsCodeunit 441 Prepayment Mgt. AssertPrepmtAmountNotMoreThanDocAmount

CreateLinesFromBuffer line 336, local

  1. 343raisesOnBeforeCreateLinesFromBufferIsHandled
  2. 356callsInsertPurchInvLine
  3. 361callsInsertPurchCrMemoLine
  4. 366callsInsertExtendedText

SetStatusPendingPrepayment line 371, local

  1. 376raisesOnBeforeSetStatusPendingPrepaymentIsHandled
  2. 380callsTable 38 Purchase Header TestStatusIsNotPendingPrepayment

CheckPrepmtDoc line 384

  1. 393raisesOnBeforeCheckPrepmtDoc
  2. 399callsTable 98 General Ledger Setup GetRecordOnce
  3. 403callsCodeunit 28 Error Message Management PushContext
  4. 404callsCodeunit 11 Gen. Jnl.-Check Line DateNotAllowed
  5. 405callsCodeunit 28 Error Message Management LogContextFieldError
  6. 407callsCodeunit 28 Error Message Management GetFieldNo
  7. 408callsCodeunit 1431 Forward Link Mgt. GetHelpCodeForAllowedPostingDate
  8. 410callsCheckOpenPrepaymentLines
  9. 411callsCodeunit 9070 Document Errors Mgt. GetNothingToPostErrorMsg
  10. 412callsCodeunit 481 Check Dimensions CheckPurchPrepmtDim
  11. 414callsTable 38 Purchase Header CheckPurchasePostRestrictions
  12. 416callsTable 23 Vendor CheckBlockedVendOnDocs
  13. 419callsTable 23 Vendor CheckBlockedVendOnDocs
  14. 421raisesOnAfterCheckPrepmtDoc
  15. 422callsCodeunit 28 Error Message Management Finish

UpdateDocNos line 425, local

  1. 430raisesOnBeforeUpdateDocNosIsHandled
  2. 441callsUpdateInvoiceDocNos
  3. 452callsUpdateCrMemoDocNos

UpdateInvoiceDocNos line 464, local

  1. 475callsCodeunit 310 No. Series GetNextNo
  2. 480callsCodeunit 28 Error Message Management PushContext
  3. 482callsCodeunit 28 Error Message Management LogContextFieldError
  4. 485callsCodeunit 28 Error Message Management Finish
  5. 490callsCodeunit 310 No. Series GetNextNo

UpdateCrMemoDocNos line 495, local

  1. 501raisesOnBeforeUpdateCrMemoDocNos
  2. 508callsCodeunit 310 No. Series GetNextNo
  3. 513callsCodeunit 28 Error Message Management PushContext
  4. 515callsCodeunit 28 Error Message Management LogContextFieldError
  5. 518callsCodeunit 28 Error Message Management Finish
  6. 524callsCodeunit 310 No. Series GetNextNo
  7. 527raisesOnAfterUpdateCrMemoDocNos

CheckOpenPrepaymentLines line 530

  1. 534raisesOnBeforeCheckOpenPrepaymentLines
  2. 536callsApplyFilter
  3. 540callsPrepmtAmount
  4. 542callsTable 39 Purchase Line UpdatePrepmtSetupFields
  5. 543writesTable 39 Purchase Line Modify
  6. 547raisesOnAfterCheckOpenPrepaymentLines

RoundAmounts line 551, local

  1. 555callsTable 461 Prepayment Inv. Line Buffer IncrAmounts
  2. 560callsAmountToLCY
  3. 562callsAmountToLCY
  4. 569callsAmountToLCY
  5. 573raisesOnRoundAmountsOnBeforeIncrAmoutns
  6. 574callsTable 461 Prepayment Inv. Line Buffer IncrAmounts
  7. 576raisesOnAfterRoundAmounts

AmountToLCY line 579, local

  1. 586callsTable 330 Currency Exchange Rate ExchangeAmtFCYToLCY

AdjustInvLineBuffers line 590, local

  1. 595callsCalcPrepmtAmtInvLCYInLines
  2. 597callsInsertCorrInvLineBuffer
  3. 600callsTable 461 Prepayment Inv. Line Buffer AdjustVATBase
  4. 601callsTable 461 Prepayment Inv. Line Buffer AdjustVATBase

CalcPrepmtAmtInvLCYInLines line 605, local

  1. 616callsTable 461 Prepayment Inv. Line Buffer AmountsToArray
  2. 618callsReverseDecArray
  3. 620callsTable 461 Prepayment Inv. Line Buffer SetFilterOnPKey
  4. 622callsTable 461 Prepayment Inv. Line Buffer AmountsToArray
  5. 630callsTable 461 Prepayment Inv. Line Buffer AmountsToArray
  6. 632callsCalcRoundedAmount
  7. 634callsCalcRoundedAmount
  8. 646writesTable 39 Purchase Line Modify
  9. 648writesTable 461 Prepayment Inv. Line Buffer DeleteAll
  10. 649callsReverseDecArray

InsertCorrInvLineBuffer line 669, local

  1. 682callsTable 461 Prepayment Inv. Line Buffer FillAdjInvLineBuffer
  2. 684callsGetPrepmtAccNo
  3. 686callsTable 461 Prepayment Inv. Line Buffer InsertInvLineBuffer
  4. 688callsTable 461 Prepayment Inv. Line Buffer FillAdjInvLineBuffer
  5. 690callsGetCorrBalAccNo
  6. 692callsTable 461 Prepayment Inv. Line Buffer InsertInvLineBuffer

GetPrepmtAccNo line 697, local

  1. 703callsTable 252 General Posting Setup GetPurchPrepmtAccount
  2. 704raisesOnAfterGetPrepmtAccNo

GetCorrBalAccNo line 708

  1. 713callsGetInvRoundingAccNo
  2. 715callsGetGainLossGLAcc

GetInvRoundingAccNo line 719

  1. 725callsTable 93 Vendor Posting Group GetInvRoundingAccount

GetGainLossGLAcc line 729, local

  1. 735callsTable 4 Currency GetRealizedGainsAccount
  2. 736callsTable 4 Currency GetRealizedLossesAccount

GetCurrencyAmountRoundingPrecision line 739, local

  1. 743callsTable 4 Currency Initialize

UpdateVATOnLines line 748

  1. 762callsTable 4 Currency Initialize
  2. 764callsApplyFilter
  3. 770callsPrepmtAmount
  4. 772callsFindVATAmountLine
  5. 773raisesOnUpdateVATOnLinesOnAfterVATAmountLineGet
  6. 776callsFindVATAmountLine
  7. 777raisesOnUpdateVATOnLinesOnAfterGetRemainder
  8. 781writesTable 290 VAT Amount Line Insert
  9. 847raisesOnUpdateVATOnLinesOnBeforePurchLineModify
  10. 848writesTable 39 Purchase Line Modify
  11. 855writesTable 290 VAT Amount Line Modify
  12. 861raisesOnAfterUpdateVATOnLines

CalcVATAmountLines line 864

  1. 870callsTable 4 Currency Initialize
  2. 872writesTable 290 VAT Amount Line DeleteAll
  3. 874callsApplyFilter
  4. 877callsPrepmtAmount
  5. 886callsFindVATAmountLine
  6. 887callsInsertVATAmountLine
  7. 890callsPrepmtVATDiffAmount
  8. 895writesTable 290 VAT Amount Line Modify
  9. 900callsTable 290 VAT Amount Line UpdateLines
  10. 904raisesOnAfterCalcVATAmountLines

FindVATAmountLine line 907, local

  1. 915raisesOnFindVATAmountLineOnAfterSetFilters

InsertVATAmountLine line 919, local

  1. 929raisesOnInsertVATAmountOnBeforeInsert
  2. 930writesTable 290 VAT Amount Line Insert

SumPrepmt line 933

  1. 941callsCalcVATAmountLines
  2. 942callsUpdateVATOnLines
  3. 943callsBuildInvLineBuffer
  4. 945callsTable 461 Prepayment Inv. Line Buffer GetVATPct
  5. 947callsRoundAmounts
  6. 948callsTable 461 Prepayment Inv. Line Buffer GetVATPct

GetPurchLines line 960

  1. 970raisesOnBeforeGetPurchLinesIsHandled
  2. 974callsApplyFilter
  3. 978writesTable 39 Purchase Line Insert
  4. 983callsCalcVATAmountLines
  5. 984callsUpdateVATOnLines
  6. 988callsInitInvoiceRoundingLine
  7. 1003writesTable 39 Purchase Line Insert

BuildInvLineBuffer line 1009, local

  1. 1016writesTable 461 Prepayment Inv. Line Buffer DeleteAll
  2. 1018writesTable 39 Purchase Line DeleteAll
  3. 1020callsApplyFilter
  4. 1023callsPrepmtAmount
  5. 1024callsFillInvLineBuffer
  6. 1026callsTable 461 Prepayment Inv. Line Buffer CopyWithLineNo
  7. 1027callsTable 461 Prepayment Inv. Line Buffer InsertInvLineBuffer
  8. 1029callsRoundAmounts
  9. 1032writesTable 39 Purchase Line Insert
  10. 1035raisesOnBuildInvLineBufferOnPrepmtAmountZero
  11. 1038callsInsertInvoiceRounding
  12. 1041callsTable 461 Prepayment Inv. Line Buffer InsertInvLineBuffer
  13. 1042callsCodeunit 28 Error Message Management FinishTopContext

FillInvLineBuffer line 1050

  1. 1053raisesOnFillInvLineBufferOnAfterInit
  2. 1055callsGetPrepmtAccNo
  3. 1062callsTable 461 Prepayment Inv. Line Buffer CopyFromPurchLine
  4. 1063callsTable 461 Prepayment Inv. Line Buffer FillFromGLAcc
  5. 1065callsTable 461 Prepayment Inv. Line Buffer SetAmounts
  6. 1075raisesOnAfterFillInvLineBuffer

InsertInvoiceRounding line 1078, local

  1. 1082callsInitInvoiceRoundingLine
  2. 1083callsCreateDimensions
  3. 1090callsTable 461 Prepayment Inv. Line Buffer CopyFromPurchLine
  4. 1092callsTable 461 Prepayment Inv. Line Buffer SetAmounts
  5. 1101raisesOnAfterInsertInvoiceRounding

InitInvoiceRoundingLine line 1104, local

  1. 1109callsTable 4 Currency Initialize
  2. 1117callsTable 4 Currency InvoiceRoundingDirection
  3. 1127validatesTable 39 Purchase Line No.
  4. 1127callsGetInvRoundingAccNo
  5. 1128validatesTable 39 Purchase Line Quantity
  6. 1130validatesTable 39 Purchase Line Direct Unit Cost
  7. 1132validatesTable 39 Purchase Line Direct Unit Cost
  8. 1139validatesTable 39 Purchase Line Amount Including VAT

ApplyFilter line 1143, local

  1. 1154raisesOnAfterApplyFilter

CopyHeaderCommentLines line 1169, local

  1. 1178callsTable 43 Purch. Comment Line CopyHeaderComments
  2. 1181callsTable 43 Purch. Comment Line CopyHeaderComments

CopyLineCommentLines line 1186, local

  1. 1195callsTable 43 Purch. Comment Line CopyLineComments
  2. 1198callsTable 43 Purch. Comment Line CopyLineComments

CopyLineCommentLinesCompressedPrepayment line 1203, local

  1. 1212callsTable 43 Purch. Comment Line CopyLineCommentsFromPurchaseLines
  2. 1215callsTable 43 Purch. Comment Line CopyLineCommentsFromPurchaseLines

InsertExtendedText line 1220, local

  1. 1230raisesOnBeforeInsertExtendedTextIsHandled
  2. 1234callsCodeunit 378 Transfer Extended Text PrepmtGetAnyExtText
  3. 1245writesTable 123 Purch. Inv. Line Insert
  4. 1253writesTable 125 Purch. Cr. Memo Line Insert

PostPrepmtInvLineBuffer line 1262, local

  1. 1266callsTable 81 Gen. Journal Line InitNewLine
  2. 1271callsTable 81 Gen. Journal Line CopyDocumentFields
  3. 1272callsTable 81 Gen. Journal Line CopyFromPurchHeaderPrepmt
  4. 1273callsTable 81 Gen. Journal Line CopyFromPrepmtInvoiceBuffer
  5. 1282raisesOnBeforePostPrepmtInvLineBuffer
  6. 1283callsRunGenJnlPostLine
  7. 1284raisesOnAfterPostPrepmtInvLineBuffer

PostVendorEntry line 1287, local

  1. 1293raisesOnBeforePostVendorEntryProcedureIsHandled
  2. 1297callsTable 81 Gen. Journal Line InitNewLine
  3. 1301raisesOnPostVendorEntryOnAfterInitNewLine
  4. 1303callsTable 81 Gen. Journal Line CopyDocumentFields
  5. 1305callsTable 81 Gen. Journal Line CopyFromPurchHeaderPrepmtPost
  6. 1321raisesOnBeforePostVendorEntry
  7. 1322callsCodeunit 12 Gen. Jnl.-Post Line RunWithCheck
  8. 1323raisesOnAfterPostVendorEntry

PostBalancingEntry line 1326, local

  1. 1330callsTable 81 Gen. Journal Line InitNewLine
  2. 1336callsTable 81 Gen. Journal Line CopyDocumentFields
  3. 1338callsTable 81 Gen. Journal Line CopyDocumentFields
  4. 1340callsTable 81 Gen. Journal Line CopyFromPurchHeaderPrepmtPost
  5. 1365raisesOnBeforePostBalancingEntry
  6. 1366callsCodeunit 12 Gen. Jnl.-Post Line RunWithCheck
  7. 1367raisesOnAfterPostBalancingEntry

RunGenJnlPostLine line 1370, local

  1. 1372raisesOnBeforeRunGenJnlPostLine
  2. 1373callsCodeunit 12 Gen. Jnl.-Post Line RunWithCheck

UpdatePrepmtAmountOnPurchLines line 1376

  1. 1388raisesOnBeforeUpdatePrepmtAmountOnPurchLinesIsHandled
  2. 1392callsTable 4 Currency Initialize
  3. 1399raisesOnUpdatePrepmtAmountOnPurchLinesOnAfterSetFilters
  4. 1409raisesOnUpdatePrepmtAmountOnPurchLinesOnBeforeErrorIfLinesNotFound
  5. 1421validatesTable 39 Purchase Line Prepmt. Line Amount
  6. 1427validatesTable 39 Purchase Line Prepmt. Line Amount
  7. 1429raisesOnUpdatePrepmtAmountOnPurchLinesOnBeforeModify
  8. 1430writesTable 39 Purchase Line Modify

CreateDimensions line 1434, local

  1. 1441callsCodeunit 408 DimensionManagement AddDimSource
  2. 1442callsCodeunit 408 DimensionManagement AddDimSource
  3. 1443callsCodeunit 408 DimensionManagement AddDimSource
  4. 1444raisesOnCreateDimensionsOnAfterAddDimSources
  5. 1449callsCodeunit 408 DimensionManagement GetRecDefaultDimID
  6. 1453raisesOnAfterCreateDimensionsProcedure

GetPurchLinesToDeduct line 1456

  1. 1460callsApplyFilter
  2. 1463callsPrepmtAmount
  3. 1463callsPrepmtAmount
  4. 1466writesTable 39 Purchase Line Insert

UpdatePurchaseDocument line 1483, local

  1. 1497callsTable 39 Purchase Line CalcPrepaymentToDeduct
  2. 1501raisesOnUpdatePurchaseDocumentOnBeforeModifyInvoicePurchLine
  3. 1502writesTable 39 Purchase Line Modify
  4. 1509raisesOnUpdatePurchaseDocumentOnBeforeFindSetCrMemoPurchLine
  5. 1519callsGetCurrencyAmountRoundingPrecision
  6. 1525raisesOnUpdatePurchaseDocumentOnBeforeModifyCrMemoPurchLine
  7. 1526writesTable 39 Purchase Line Modify

UpdatePostedPurchaseDocument line 1531, local

  1. 1539raisesOnBeforeUpdatePostedPurchaseDocumentIsHandled
  2. 1551writesTable 122 Purch. Inv. Header Modify
  3. 1560writesTable 124 Purch. Cr. Memo Hdr. Modify
  4. 1564raisesOnAfterUpdatePostedPurchDocument

InsertPurchInvHeader line 1567, local

  1. 1585raisesOnBeforePurchInvHeaderInsert
  2. 1586writesTable 122 Purch. Inv. Header Insert
  3. 1587callsCopyHeaderCommentLines
  4. 1588raisesOnAfterPurchInvHeaderInsert

InsertPurchCrMemoHeader line 1591, local

  1. 1613raisesOnBeforePurchCrMemoHeaderInsert
  2. 1614writesTable 124 Purch. Cr. Memo Hdr. Insert
  3. 1615callsCopyHeaderCommentLines
  4. 1616raisesOnAfterPurchCrMemoHeaderInsert

InsertPurchInvLine line 1629, local

  1. 1669raisesOnBeforePurchInvLineInsert
  2. 1670writesTable 123 Purch. Inv. Line Insert
  3. 1672callsCopyLineCommentLines
  4. 1674raisesOnAfterPurchInvLineInsert

InsertPurchCrMemoLine line 1677, local

  1. 1715raisesOnBeforePurchCrMemoLineInsert
  2. 1716writesTable 125 Purch. Cr. Memo Line Insert
  3. 1718callsCopyLineCommentLines
  4. 1720raisesOnAfterPurchCrMemoLineInsert