Subcontracting app suppresses the output warehouse journal line even when Legacy Subcontracting is enabled

Aperta Adatta ai principianti
#13,723 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Ambito
backend

Direzione di ricerca

Leggi SubcInvtPutAwayExt.Codeunit.al e confronta il subscriber indicato con i controlli del feature flag nei subscriber vicini. Riproduci il flusso legacy descritto nell’issue e verifica se la registrazione crea la riga del giornale di magazzino in uscita e il movimento di magazzino. Il comportamento previsto secondo l’issue è che il subscriber termini quando IsSubcontractingEnabled() è false; conferma quindi che il put-away può essere registrato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Team: SCM

Repo: microsoft/BCApps Area: Subcontracting app (W1) Type: Bug

Subcontracting app suppresses the output warehouse journal line even when Legacy Subcontracting is enabled

Describe the issue

Subc. Inventory Put-away Ext. (codeunit SubcInvtPutAwayExt.Codeunit.al) contains one subscriber that is not guarded by Subc. Feature Flag Handler.IsSubcontractingEnabled():

// Warehouse put-away posting creates the required per-bin entries for subcontracting output.
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Mfg. Item Jnl.-Post Line", OnPostOutputOnBeforeCreateWhseJnlLine, '', false, false)]
local procedure SuppressAutoWhseJnlForSubcOutput_OnPostOutputOnBeforeCreateWhseJnlLine(var ItemJournalLine: Record "Item Journal Line"; var PostWhseJnlLine: Boolean)
begin
    if not ItemJournalLine.Subcontracting then
        exit;
    Location.SetLoadFields("Require Put-away");
    if not Location.Get(ItemJournalLine."Location Code") then
        exit;
    if Location."Require Put-away" then
        PostWhseJnlLine := false;
end;

Every other feature-dependent subscriber in the app starts with

#if not CLEAN29
    if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
        exit;
#endif

As a result, when Manufacturing Setup."Legacy Subcontracting" = true (the app is installed but the Base App legacy flow is still in use), the subcontracting output posting no longer creates the warehouse journal line on bin-mandatory locations with Require Put-away. In the legacy flow nothing else writes that bin content (the Base App's purchase/warehouse receipt posting deliberately skips the warehouse journal for Subcontracting item journal lines), so the output ends up with an item ledger entry but no warehouse entry. Registering the put-away created from the warehouse receipt then fails with

Quantity (Base) Available must not be less than 816 in Bin Content Location Code='…',Bin Code='…',Item No.='…'

Versions

  • Base Application 29.0.54011.57244, Subcontracting app 29.0 (W1 source releases/29.0 and main show the same code).

To reproduce (legacy flow)

  1. Manufacturing Setup."Legacy Subcontracting" = true (Subcontracting app installed).
  2. Location with Bin Mandatory, Require Receive, Require Put-away; Work Center with Subcontractor No. and that location.
  3. Released production order with a subcontracted operation; Subcontracting Worksheet → create purchase order; purchase line bin = receipt bin.
  4. Create and post a warehouse receipt for the purchase line.
  5. Observe: output item ledger entry exists, no warehouse entry in the receipt bin; registering the put-away errors as above.

Expected

The subscriber should respect the feature flag like its siblings, i.e. exit when IsSubcontractingEnabled() is false, so the legacy flow keeps creating the output's warehouse journal line:

#if not CLEAN29
#pragma warning disable AL0432
    if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
#pragma warning restore AL0432
        exit;
#endif

Additional context

The sibling SkipReceiptWarehouseJournalForSubcontracting_OnPostWhseJnlLineOnAfterInsertWhseItemEntryRelation in SubcWhsePostReceiptExt.Codeunit.al is guarded, which is why legacy environments end up with neither posting writing the receipt-bin content.

Lingua principale
AL
Stelle
720
Fork
488
Merge medio
2g 17h
PR unite (30g)
568

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/BCApps

Tutte le issue di microsoft/BCApps

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.