Skip to content

[Event Request] Codeunit 22 "Item Jnl.-Post Line" - Function PostOutput() #29284

Description

Why do you need this change?

We need to create Prod. Orders for Items not in inventory ("Inventory Value Zero" = true) because they are not items to be sold. The customer creates this items for testing purposes and they don't want to have that extra value on inventory. Therefore, we need to avoid the TestField statement.

Describe the request

In codeunit 22, function PostOutput(), new event before "Inventory Value Zero" TestField.

local procedure PostOutput()
var
   (...)
begin
    
    (...)

    if ItemJnlLine.Subcontracting then
        ValuedQty := ItemJnlLine."Invoiced Quantity"
    else
        ValuedQty := CalcCapQty();

NEW CODE ---->
IsHandled := false;
OnPostOutputOnBeforeGetItem(ItemJnlLine, IsHandled);
if not IsHandled then
NEW CODE <----

    if GetItem(ItemJnlLine."Item No.", false) then
        if not CalledFromAdjustment then
            Item.TestField("Inventory Value Zero", false);

    if ItemJnlLine."Item Shpt. Entry No." <> 0 then
        CapLedgEntry.Get(ItemJnlLine."Item Shpt. Entry No.")
    else
        PostOutputForProdOrder(ProdOrder, ProdOrderLine, CapLedgEntry, ValuedQty, LastOperation);

    CalcDirAndIndirCostAmts(DirCostAmt, IndirCostAmt, ValuedQty, ItemJnlLine);

Internal work item: AB#610210

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an eventships-in-future-updateFix ships in a future update

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions