Kreditnota tas inte med i intrastatjournalen när du har bokfört en kreditnota av typen Debitering (artikel) för en faktura som har skapats för en EU-leverantör under en annan period i den italienska versionen av Microsoft Dynamics NAV 2009

Gäller för
Dynamics NAV 2009 Service Pack 1 Microsoft Dynamics NAV 5.0 Service Pack 1

Den här artikeln gäller Microsoft Dynamics NAV för språkspråket italienska (it).

Symptom

Anta att du har en faktura som har skapats för en LEVERANTÖR av Europeiska unionen (EU) i den italienska versionen av Microsoft Dynamics NAV 2009. När du bokför en debitering (artikel) skriver du kreditnota för fakturan under en annan period inkluderas inte kreditnotaraden i intrastatjournalen.
Det här problemet uppstår i följande produkter:

  • Den italienska versionen av Microsoft Dynamics NAV 2009 R2
  • Den italienska versionen av Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)
  • Den italienska versionen av Microsoft Dynamics NAV 5.0 Service Pack 1 (SP1)

Lösning

Snabbkorrigeringsinformation

En snabbkorrigering som stöds är nu tillgänglig från Microsoft. Det är dock bara avsett att åtgärda problemet som beskrivs i den här artikeln. Använd den bara på system som har det här specifika problemet. Den här snabbkorrigeringen kan få ytterligare tester. Om du inte drabbas hårt av det här problemet rekommenderar vi därför att du väntar på nästa Microsoft Dynamics NAV Service Pack eller nästa Microsoft Dynamics NAV-version som innehåller den här snabbkorrigeringen.

Obs! I särskilda fall kan avgifter som vanligtvis uppkommer för supportsamtal avbrytas om en teknisk supporttekniker för Microsoft Dynamics och relaterade produkter fastställer att en specifik uppdatering löser problemet. De vanliga supportkostnaderna gäller för ytterligare supportfrågor och problem som inte är berättigade till den aktuella uppdateringen.

            
          

Installationsinformation

Microsoft tillhandahåller endast programmeringsexempel i visningssyfte, utan att någon form av garanti uttrycks eller är underförstådd. Detta omfattar men är inte begränsat till underförstådda garantier för säljbarhet eller lämplighet för ett visst ändamål. Den här artikeln förutsätter att du är bekant med programmeringsspråket som demonstreras och med de verktyg som används för att skapa och felsöka procedurer. Microsofts supporttekniker kan hjälpa till att förklara funktionaliteten i en viss procedur, men de ändrar inte de här exemplen för att tillhandahålla ytterligare funktioner eller konstruera procedurer för att uppfylla dina specifika krav.

Obs! Innan du installerar den här snabbkorrigeringen kontrollerar du att alla Microsoft Navision-klientanvändare loggas ut från systemet. Detta omfattar användare av Microsoft Navision Application Services (NAS). Du bör vara den enda klientanvändare som är inloggad när du implementerar snabbkorrigeringen.

Om du vill implementera den här snabbkorrigeringen måste du ha en utvecklarlicens.

Vi rekommenderar att användarkontot i fönstret Windows-inloggningar eller i fönstret Databasinloggningar tilldelas roll-ID:t "SUPER". Om användarkontot inte kan tilldelas superroll-ID måste du kontrollera att användarkontot har följande behörigheter:

  • Behörigheten Ändra för det objekt som du kommer att ändra.
  • Körbehörigheten för systemobjekt-ID 5210-objektet och för 9015-objektet Systemobjekt-ID.

                
Obs! Du behöver inte ha rättigheter till datakällorna om du inte behöver utföra datareparation.

Kodändringar

Obs! Testa alltid korrigeringar av kod i en kontrollerad miljö innan du tillämpar korrigeringarna på produktionsdatorerna.
Lös problemet genom att följa de här stegen:

  1. Ändra koden i dataartikelnumret 2 i rapporten Hämta artikeltransaktioner (594) enligt följande:
    Befintlig kod 1

    ...
    SETRANGE("Country/Region Code",'');
    END;
    
    IntrastatJnlLine2.SETCURRENTKEY("Source Type","Source Entry No.");
    IntrastatJnlLine2.SETRANGE("Source Type",IntrastatJnlLine2."Source Type"::"Item entry");
    ...
    

    Ersättningskod 1

    ...
    SETRANGE("Country/Region Code",'');
    END;
    
    // Add the following line.
    IntrastatJnlLine2.SETRANGE("Journal Batch Name",IntrastatJnlBatch.Name);
    
    IntrastatJnlLine2.SETCURRENTKEY("Source Type","Source Entry No.");
    IntrastatJnlLine2.SETRANGE("Source Type",IntrastatJnlLine2."Source Type"::"Item entry");
    ...
    

    Befintlig kod 2

    ...
    WITH ValueEntry DO BEGIN
    SETCURRENTKEY("Item Ledger Entry No.");
    
    // Delete the following line.
    SETRANGE("Valuation Date",StartDate,EndDate);
    
    SETRANGE("Entry Type","Entry Type"::"Direct Cost");
    SETFILTER("Invoiced Quantity",'<>%1', 0);
    SETFILTER(
    ...
    

    Ersättningskod 2

    ...
    WITH ValueEntry DO BEGIN
    SETCURRENTKEY("Item Ledger Entry No.");
    
    // Add the following line.
    SETRANGE("Posting Date",StartDate,EndDate);
    
    SETRANGE("Entry Type","Entry Type"::"Direct Cost");
    SETFILTER("Invoiced Quantity",'<>%1', 0);
    SETFILTER(
    ...
    

    Befintlig kod 3

    ...
    END;
    
    OnAfterGetRecord=VAR
    
    // Delete the following lines.
    Location@1000 : Record 14;
    ItemLedgEntry@1001 : Record 32;
    SalesShipmentLine@1010 : Record 111;
    ReturnReceiptLine@1009 : Record 6661;
    PurchRcptLine@1008 : Record 121;
    ReturnShipmentLine@1007 : Record 6651;
    ServiceShipmentLine@1004 : Record 5991;
    ServiceCrMemoLine@1003 : Record 5995;
    Include@1002 : Boolean;
    // End of the lines.
    
    PurchInvLine@1130000 : Record 123;
    PurchCrMemoLine@1130001 : Record 125;
    SalesInvoiceLine@1130002 : Record 113;
    ...
    

    Ersättningskod 3

    ...
    END;
    
    OnAfterGetRecord=VAR
    
    // Add the following line.
    PurchRcptLine@1008 : Record 121;
    
    PurchInvLine@1130000 : Record 123;
    PurchCrMemoLine@1130001 : Record 125;
    SalesInvoiceLine@1130002 : Record 113;
    ...
    

    Befintlig kod 4

    ...
    IF IntrastatJnlLine2.FINDFIRST THEN
    CurrReport.SKIP;
    
    // Delete the following lines.
    CASE TRUE OF
    "Drop Shipment":
    BEGIN
    IF ("Country/Region Code" = CompanyInfo."Country/Region Code") OR
    ("Country/Region Code" = '')
    THEN
    CurrReport.SKIP;
    IF "Applies-to Entry" = 0 THEN BEGIN
    ItemLedgEntry.SETCURRENTKEY("Item No.","Posting Date");
    ItemLedgEntry.SETRANGE("Item No.","Item No.");
    ItemLedgEntry.SETRANGE("Posting Date","Posting Date");
    ItemLedgEntry.SETRANGE("Applies-to Entry","Entry No.");
    ItemLedgEntry.FINDFIRST;
    END ELSE
    ItemLedgEntry.GET("Applies-to Entry");
    IF (ItemLedgEntry."Country/Region Code" <> CompanyInfo."Country/Region Code") AND
    (ItemLedgEntry."Country/Region Code" <> '')
    THEN
    CurrReport.SKIP;
    END;
    "Entry Type" = "Entry Type"::Transfer:
    BEGIN
    IF ("Country/Region Code" = CompanyInfo."Country/Region Code") OR
    ("Country/Region Code" = '')
    THEN
    CurrReport.SKIP;
    IF "Transfer Order No." = '' THEN BEGIN
    Location.GET("Location Code");
    IF (Location."Country/Region Code" <> '') AND
    (Location."Country/Region Code" <> CompanyInfo."Country/Region Code")
    THEN
    CurrReport.SKIP;
    END ELSE BEGIN
    ItemLedgEntry.SETRANGE("Transfer Order No.","Transfer Order No.");
    ItemLedgEntry.SETFILTER("Country/Region Code",'%1 | %2','',CompanyInfo."Country/Region Code");
    IF ItemLedgEntry.FINDSET THEN
    REPEAT
    Location.GET(ItemLedgEntry."Location Code");
    IF Location."Use As In-Transit" THEN
    Include := TRUE;
    UNTIL Include OR (ItemLedgEntry.NEXT = 0);
    IF NOT Include THEN
    CurrReport.SKIP;
    END;
    END;
    "Location Code" <> '':
    BEGIN
    Location.GET("Location Code");
    CheckILE(Location."Country/Region Code");
    END
    ELSE BEGIN
    IF "Entry Type" = "Entry Type"::Purchase THEN
    CheckILE(CompanyInfo."Ship-to Country/Region Code");
    IF "Entry Type" = "Entry Type"::Sale THEN
    CheckILE(CompanyInfo."Country/Region Code");
    END;
    END;
    
    CASE TRUE OF
    "Document Type" = "Document Type"::"Sales Shipment":
    IF SalesShipmentLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(SalesShipmentLine."VAT Bus. Posting Group",SalesShipmentLine."VAT Prod. Posting Group") THEN;
    ("Document Type" = "Document Type"::"Sales Return Receipt") OR ("Document Type" = "Document Type"::"Sales Credit Memo"):
    IF ReturnReceiptLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(ReturnReceiptLine."VAT Bus. Posting Group",ReturnReceiptLine."VAT Prod. Posting Group") THEN;
    "Document Type" = "Document Type"::"Purchase Receipt":
    IF PurchRcptLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(PurchRcptLine."VAT Bus. Posting Group",PurchRcptLine."VAT Prod. Posting Group") THEN;
    ("Document Type" = "Document Type"::"Purchase Return Shipment") OR ("Document Type" = "Document Type"::"Purchase Credit Memo"):
    IF ReturnShipmentLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(ReturnShipmentLine."VAT Bus. Posting Group",ReturnShipmentLine."VAT Prod. Posting Group") THEN;
    "Document Type" = "Document Type"::"Service Shipment":
    IF ServiceShipmentLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(ServiceShipmentLine."VAT Bus. Posting Group",ServiceShipmentLine."VAT Prod. Posting Group") THEN;
    "Document Type" = "Document Type"::"Service Credit Memo":
    IF ServiceCrMemoLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(ServiceCrMemoLine."VAT Bus. Posting Group",ServiceCrMemoLine."VAT Prod. Posting Group") THEN;
    END;
    IF VATPostingSetup."EU Service" THEN
    CurrReport.SKIP;
    
    IF ("Entry Type" = "Entry Type"::Sale) AND
    (SalesShipmentHeader.GET("Document No.")) AND
    (CompanyInfo."Country/Region Code" = SalesShipmentHeader."Bill-to Country/Region Code")
    THEN
    CurrReport.SKIP;
    // End of the lines.
    
    TotalInvoicedQty := 0;
    TotalAmt := 0;
    ...
    

    Ersättningskod 4

    ...
    IF IntrastatJnlLine2.FINDFIRST THEN
    CurrReport.SKIP;
    
    // Add the following line.
    TestILE("Item Ledger Entry");
    
    TotalInvoicedQty := 0;
    TotalAmt := 0;
    
  2. Ändra koden i dataartikelnumret 5 i rapporten Hämta artikeltransaktioner (594) enligt följande:
    Befintlig kod

    ...
    {
    }
    }
    }
    REQUESTFORM
    {
    ...
    

    Ersättningskod

    ...
    {
    }
    }
    
    // Add the following lines.
    { PROPERTIES
    {
    DataItemTable=Table5802;
    DataItemTableView=SORTING(Entry No.);
    OnPreDataItem=BEGIN
    SETRANGE("Posting Date",StartDate,EndDate);
    SETFILTER("Item Charge No.",'<> %1','');
    "Item Ledger Entry".SETRANGE("Posting Date");
    
    IF IntrastatJnlBatch.Type = IntrastatJnlBatch.Type::Purchases THEN
    SETFILTER("Item Ledger Entry Type",'%1|%2', "Item Ledger Entry Type"::Purchase, "Item Ledger Entry Type"::Transfer)
    ELSE
    SETRANGE("Item Ledger Entry Type","Item Ledger Entry Type"::Sale);
    
    IntrastatJnlLine2.SETRANGE("Journal Batch Name",IntrastatJnlBatch.Name);
    IntrastatJnlLine2.SETCURRENTKEY("Source Type","Source Entry No.");
    IntrastatJnlLine2.SETRANGE("Source Type",IntrastatJnlLine2."Source Type"::"Item entry");
    END;
    
    OnAfterGetRecord=BEGIN
    IntrastatJnlLine2.SETRANGE("Source Entry No.","Item Ledger Entry No.");
    IF IntrastatJnlLine2.FINDFIRST THEN
    CurrReport.SKIP;
    
    IF "Item Ledger Entry".GET("Item Ledger Entry No.") THEN BEGIN
    IF ("Item Ledger Entry"."Posting Date" > StartDate) AND ("Item Ledger Entry"."Posting Date" < EndDate) THEN
    CurrReport.SKIP;
    IF "Country/Region".GET("Item Ledger Entry"."Country/Region Code") THEN
    IF "Country/Region"."EU Country/Region Code" = '' THEN
    CurrReport.SKIP;
    TestILE("Item Ledger Entry");
    
    InsertValueEntryLine;
    END;
    END;
    
    }
    SECTIONS
    {
    { PROPERTIES
    {
    SectionType=Body;
    SectionWidth=12000;
    SectionHeight=846;
    }
    CONTROLS
    {
    }
    }
    }
    }
    // End of the lines.
    
    }
    REQUESTFORM
    {
    ...
    
  3. Ändra koden i dokumentationen i rapporten Hämta artikeltransaktioner (594) enligt följande:
    Befintlig kod

    ...
    IntrastatJnlBatch2.SETRANGE(Type,IntrastatJnlBatch.Type);
    END;
    
    // Delete the following line.
    BEGIN
    
    END.
    }
    RDLDATA
    ...
    

    Ersättningskod

    ...
    IntrastatJnlBatch2.SETRANGE(Type,IntrastatJnlBatch.Type);
    END;
    
    // Add the following lines.
    PROCEDURE TestILE@1130001(ItemLedgEntry@1130000 : Record 32);
    VAR
    Location@1130001 : Record 14;
    ItemLedgEntry2@1130002 : Record 32;
    Include@1130003 : Boolean;
    SalesShipmentHeader@1130004 : Record 110;
    SalesShipmentLine@1130005 : Record 111;
    PurchRcptLine@1130006 : Record 121;
    ReturnReceiptLine@1130007 : Record 6661;
    ReturnShipmentLine@1130008 : Record 6651;
    ServiceShipmentLine@1130009 : Record 5991;
    ServiceCrMemoLine@1130010 : Record 5995;
    BEGIN
    WITH ItemLedgEntry DO BEGIN
    CASE TRUE OF
    "Drop Shipment":
    BEGIN
    IF ("Country/Region Code" = CompanyInfo."Country/Region Code") OR
    ("Country/Region Code" = '')
    THEN
    CurrReport.SKIP;
    IF "Applies-to Entry" = 0 THEN BEGIN
    ItemLedgEntry2.SETCURRENTKEY("Item No.","Posting Date");
    ItemLedgEntry2.SETRANGE("Item No.","Item No.");
    ItemLedgEntry2.SETRANGE("Posting Date","Posting Date");
    ItemLedgEntry2.SETRANGE("Applies-to Entry","Entry No.");
    ItemLedgEntry2.FINDFIRST;
    END ELSE
    ItemLedgEntry2.GET("Applies-to Entry");
    IF (ItemLedgEntry2."Country/Region Code" <> CompanyInfo."Country/Region Code") AND
    (ItemLedgEntry2."Country/Region Code" <> '')
    THEN
    CurrReport.SKIP;
    END;
    "Entry Type" = "Entry Type"::Transfer:
    BEGIN
    IF ("Country/Region Code" = CompanyInfo."Country/Region Code") OR
    ("Country/Region Code" = '')
    THEN
    CurrReport.SKIP;
    IF "Transfer Order No." = '' THEN BEGIN
    Location.GET("Location Code");
    IF (Location."Country/Region Code" <> '') AND
    (Location."Country/Region Code" <> CompanyInfo."Country/Region Code")
    THEN
    CurrReport.SKIP;
    END ELSE BEGIN
    ItemLedgEntry2.SETRANGE("Transfer Order No.","Transfer Order No.");
    ItemLedgEntry2.SETFILTER("Country/Region Code",'%1 | %2','',CompanyInfo."Country/Region Code");
    IF ItemLedgEntry2.FINDSET THEN
    REPEAT
    Location.GET(ItemLedgEntry2."Location Code");
    IF Location."Use As In-Transit" THEN
    Include := TRUE;
    UNTIL Include OR (ItemLedgEntry2.NEXT = 0);
    IF NOT Include THEN
    CurrReport.SKIP;
    END;
    END;
    "Location Code" <> '':
    BEGIN
    Location.GET("Location Code");
    CheckILE(Location."Country/Region Code");
    END;
    ELSE BEGIN
    IF "Entry Type" = "Entry Type"::Purchase THEN
    CheckILE(CompanyInfo."Ship-to Country/Region Code");
    IF "Entry Type" = "Entry Type"::Sale THEN
    CheckILE(CompanyInfo."Country/Region Code");
    END;
    END;
    
    CASE TRUE OF
    "Document Type" = "Document Type"::"Sales Shipment":
    IF SalesShipmentLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(SalesShipmentLine."VAT Bus. Posting Group",SalesShipmentLine."VAT Prod. Posting Group") THEN;
    ("Document Type" = "Document Type"::"Sales Return Receipt") OR ("Document Type" = "Document Type"::"Sales Credit Memo"):
    IF ReturnReceiptLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(ReturnReceiptLine."VAT Bus. Posting Group",ReturnReceiptLine."VAT Prod. Posting Group") THEN;
    "Document Type" = "Document Type"::"Purchase Receipt":
    IF PurchRcptLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(PurchRcptLine."VAT Bus. Posting Group",PurchRcptLine."VAT Prod. Posting Group") THEN;
    ("Document Type" = "Document Type"::"Purchase Return Shipment") OR ("Document Type" = "Document Type"::"Purchase Credit Memo"):
    IF ReturnShipmentLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(ReturnShipmentLine."VAT Bus. Posting Group",ReturnShipmentLine."VAT Prod. Posting Group") THEN;
    "Document Type" = "Document Type"::"Service Shipment":
    IF ServiceShipmentLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(ServiceShipmentLine."VAT Bus. Posting Group",ServiceShipmentLine."VAT Prod. Posting Group") THEN;
    "Document Type" = "Document Type"::"Service Credit Memo":
    IF ServiceCrMemoLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(ServiceCrMemoLine."VAT Bus. Posting Group",ServiceCrMemoLine."VAT Prod. Posting Group") THEN;
    END;
    IF VATPostingSetup."EU Service" THEN
    CurrReport.SKIP;
    
    IF ("Entry Type" = "Entry Type"::Sale) AND
    (SalesShipmentHeader.GET("Document No.")) AND
    (CompanyInfo."Country/Region Code" = SalesShipmentHeader."Bill-to Country/Region Code")
    THEN
    CurrReport.SKIP;
    END;
    END;
    
    PROCEDURE InsertValueEntryLine@1130002();
    VAR
    Location@1130000 : Record 14;
    BEGIN
    GetGLSetup;
    WITH IntrastatJnlLine DO BEGIN
    INIT;
    "Line No." := "Line No." + 10000;
    Date := "Value Entry"."Posting Date";
    "Country/Region Code" := "Item Ledger Entry"."Country/Region Code";
    "Transaction Type" := "Item Ledger Entry"."Transaction Type";
    "Transport Method" := "Item Ledger Entry"."Transport Method";
    "Source Entry No." := "Item Ledger Entry"."Entry No.";
    Quantity := "Item Ledger Entry".Quantity;
    "Document No." := "Value Entry"."Document No.";
    "Item No." := "Item Ledger Entry"."Item No.";
    "Entry/Exit Point" := "Item Ledger Entry"."Entry/Exit Point";
    Area := "Item Ledger Entry".Area;
    "Transaction Specification" := "Item Ledger Entry"."Transaction Specification";
    Amount := ROUND(ABS("Value Entry"."Sales Amount (Actual)"),1);
    
    IF Quantity < 0 THEN
    Type := Type::Shipment
    ELSE
    Type := Type::Receipt;
    
    IF ("Country/Region Code" = '') OR
    ("Country/Region Code" = CompanyInfo."Country/Region Code")
    THEN BEGIN
    IF "Item Ledger Entry"."Location Code" = '' THEN
    "Country/Region Code" := CompanyInfo."Ship-to Country/Region Code"
    ELSE BEGIN
    Location.GET("Item Ledger Entry"."Location Code");
    "Country/Region Code" := Location."Country/Region Code"
    END;
    END;
    
    VALIDATE("Item No.");
    "Source Type" := "Source Type"::"Item entry";
    VALIDATE(Quantity,ROUND(ABS(Quantity),0.00001));
    VALIDATE("Cost Regulation %",IndirectCostPctReq);
    
    INSERT;
    END;
    END;
    // End of the lines.
    
    BEGIN
    END.
    }
    RDLDATA
    ...
    

Krav

Du måste ha någon av följande produkter installerad för att kunna använda den här snabbkorrigeringen:

  • Den italienska versionen av Microsoft Dynamics NAV 2009 R2
  • Den italienska versionen av Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)
  • Den italienska versionen av Microsoft Dynamics NAV 5.0 Service Pack 1 (SP1)

Information om borttagning

Du kan inte ta bort den här snabbkorrigeringen.

Status

Microsoft har bekräftat att detta är ett problem i de Microsoft-produkter som anges i avsnittet "Gäller".

Obs! Det här är en "FAST PUBLISH"-artikel som skapats direkt från Microsofts supportorganisation. Den information som finns häri tillhandahålls i befintligt format som svar på framväxande problem. Till följd av hur snabbt materialet blir tillgängligt kan materialet innehålla typografiska fel och kan komma att revideras när som helst utan föregående meddelande. Se användningsvillkor för andra överväganden.