La riga delle registrazioni intrastat non è corretta quando si registra una fattura nella versione spagnola di Microsoft Dynamics NAV

Si applica a
Dynamics NAV 2009 Microsoft Dynamics NAV 5.0

Gli articoli pubblicati rapidamente forniscono informazioni direttamente dall'organizzazione del supporto tecnico Microsoft. Le informazioni contenute nel presente documento vengono create in risposta ad argomenti emergenti o univoci o hanno lo scopo di integrare altre informazioni della Knowledge Base.
 Microsoft Business Solutions-Navision 4.0 e Microsoft Navision 4.0 fanno ora parte di Microsoft Dynamics NAV 4.0. Tutti i riferimenti a Microsoft Business Solutions-Navision o a Microsoft Navision 4.0 riguardano Microsoft Dynamics NAV.

Questo articolo si applica a Microsoft Dynamics NAV 5.0 per le impostazioni locali della lingua spagnola (es).

Sintomi

Quando si registra una fattura con una riga articolo e una riga di addebito articolo nella versione spagnola di Microsoft Dynamics NAV, la riga delle registrazioni intrastat non è corretta. Questo problema si verifica se vengono utilizzati uno sconto fattura e uno sconto pagamento.

Questo problema si verifica nei prodotti seguenti:

  • La versione spagnola di Microsoft Dynamics NAV 2009

  • La versione spagnola di Microsoft Dynamics NAV 5.0

  • La versione spagnola di Microsoft Dynamics NAV 4.0

Causa

Questo problema si verifica perché Microsoft Dynamics NAV non considera lo sconto nell'addebito articolo applicato alla riga articolo.

Risoluzione

Informazioni sull'aggiornamento rapido

È ora disponibile un hotfix supportato da Microsoft. Tuttavia, è destinato solo a correggere il problema descritto in questo articolo. Applicala solo ai sistemi che stanno riscontrando questo problema specifico. Questo hotfix potrebbe ricevere ulteriori test. Pertanto, se non si è gravemente colpiti da questo problema, è consigliabile attendere il prossimo Service Pack di Microsoft Dynamics NAV o la prossima versione di Microsoft Dynamics NAV che contiene questo hotfix.

Nota In casi speciali, gli addebiti normalmente sostenuti per le chiamate al supporto tecnico possono essere annullati se un professionista del supporto tecnico per Microsoft Dynamics e i prodotti correlati determinano che un aggiornamento specifico risolverà il problema. I soliti costi del supporto verranno applicati a domande e problemi di supporto aggiuntivi che non sono idonei per l'aggiornamento specifico in questione.

            
          

Informazioni sull'installazione

Microsoft fornisce esempi di programmazione a titolo puramente illustrativo, senza alcuna garanzia espressa o implicita. Ciò include, a titolo esemplificativo e non esaustivo, le garanzie implicite di commerciabilità o idoneità a uno scopo particolare. Questo articolo presuppone che si abbia familiarità con il linguaggio di programmazione oggetto della dimostrazione e con gli strumenti utilizzati per la creazione e il debug delle procedure. I tecnici del supporto Tecnico Microsoft possono spiegare le funzionalità di una particolare procedura, ma non modificarli per fornire funzionalità aggiuntive o creare procedure in base a specifici requisiti.

Nota Prima di installare questo hotfix, verificare che tutti gli utenti client di Microsoft Navision siano disconnessi dal sistema. Sono inclusi gli utenti client di Microsoft Navision Application Services (NAS). Dovresti essere l'unico utente client connesso quando implementi questo hotfix.

Per implementare questo hotfix, è necessario disporre di una licenza per sviluppatori.

È consigliabile assegnare l'ID ruolo "SUPER" all'account utente nella finestra Accessi di Windows o nella finestra Accessi database. Se all'account utente non è possibile assegnare l'ID ruolo "SUPER", è necessario verificare che l'account utente disponga delle autorizzazioni seguenti:

  • Autorizzazione modifica per l'oggetto che si desidera modificare.
  • Autorizzazione Execute per l'oggetto System Object ID 5210 e per l'oggetto System Object ID 9015.

                
Nota: non è necessario disporre dei diritti per gli archivi dati a meno che non sia necessario eseguire il ripristino dei dati.

Modifiche al codice

Nota Verifica sempre le correzioni del codice in un ambiente controllato prima di applicare le correzioni ai computer di produzione.
Per applicare questo hotfix, attenersi alla seguente procedura:

  1. Modificare il codice nel trigger UpdateVATOnLines nella tabella Riga vendite (37) come segue:
    Codice esistente

    ...
            END;
            InitOutstanding;
            MODIFY;
            RecRef.GETTABLE(SalesLine);
    ...
    
    

    Codice sostitutivo

    ...
            END;
            InitOutstanding;
    
    // Add the following lines.
            IF Type = Type::"Charge (Item)" THEN 
              UpdateItemChargeAssgnt; 
    // End of the added lines.
    
            MODIFY;
            RecRef.GETTABLE(SalesLine);
    ...
    
    
  2. Modificare il codice nel trigger UpdateVATOnLines nella tabella Riga acquisto (39) come segue:
    Codice esistente

    ...
              UpdateUnitCost;
            END;
            MODIFY;
            RecRef.GETTABLE(PurchLine);
    ...
    
    

    Codice sostitutivo

    ...
              UpdateUnitCost;
            END;
    
    // Add the following lines.
            IF Type = Type::"Charge (Item)" THEN  
              UpdateItemChargeAssgnt;
    // End of the added lines.
    
            MODIFY;
            RecRef.GETTABLE(PurchLine);
    ...
    
    
  3. Modificare il codice nel trigger InitValueEntry nella codeunit di riga Jnl.-Post elemento (22) come segue:
    Codice esistente 1

    ...
          IF GLSetup."Additional Reporting Currency" <> '' THEN
            ValueEntry."Cost per Unit (ACY)" := RetrieveCostPerUnitACY(ValueEntry."Cost per Unit");
    
    // Delete the following lines.
          IF (ValueEntry."Valued Quantity" > 0) AND  
             (ValueEntry."Item Ledger Entry Type" = ValueEntry."Item Ledger Entry Type"::Purchase) AND
    // End of the deleted lines.
    
             (ValueEntry."Entry Type" = ValueEntry."Entry Type"::"Direct Cost")
          THEN BEGIN
            IF Item."Costing Method" = Item."Costing Method"::Standard THEN
    ...
    
    

    Codice di sostituzione 1

    ...
          IF GLSetup."Additional Reporting Currency" <> '' THEN
            ValueEntry."Cost per Unit (ACY)" := RetrieveCostPerUnitACY(ValueEntry."Cost per Unit");
    // Add the following line.
          IF (ValueEntry."Item Ledger Entry Type" = ValueEntry."Item Ledger Entry Type"::Purchase) AND
    
             (ValueEntry."Entry Type" = ValueEntry."Entry Type"::"Direct Cost")
          THEN BEGIN
            IF Item."Costing Method" = Item."Costing Method"::Standard THEN
    ...
    
    

    Codice esistente 2

    ...
              END;
            ValueEntry."Cost Amount (Actual)" := CostAmt;
            ValueEntry."Cost Amount (Actual) (ACY)" := CostAmtACY;
    
    // Delete the following lines.
            IF (GLSetup."Payment Discount Type" = GLSetup."Payment Discount Type"::"Calc. Pmt. Disc. on Lines") THEN  
              IF (ValueEntry."Discount Amount" <> 0) AND (ItemJnlLine."Item Charge No." <> '') THEN BEGIN 
                ValueEntry."Cost Amount (Actual)" := ValueEntry."Cost Amount (Actual)" - "Discount Amount"; 
                ValueEntry."Purchase Amount (Actual)" := ValueEntry."Purchase Amount (Actual)" - "Discount Amount"; 
              END; 
    // End of the deleted lines.
    
          END;
        (ValueEntry."Expected Cost" = TRUE) AND (ValueEntry.Inventoriable = TRUE):
    ...
    
    

    Codice di sostituzione 2

    ...
              END;
            ValueEntry."Cost Amount (Actual)" := CostAmt;
            ValueEntry."Cost Amount (Actual) (ACY)" := CostAmtACY;
    
          END;
        (ValueEntry."Expected Cost" = TRUE) AND (ValueEntry.Inventoriable = TRUE):
    ...
    
    

    Codice esistente 3

    ...
              ValueEntry."Cost Amount (Non-Invtbl.)(ACY)" := CostAmtACY;
            END;
          END;
      END;
    
    
      RoundAmtValueEntry(ValueEntry);
    ...
    
    

    Codice di sostituzione 3

    ...
              ValueEntry."Cost Amount (Non-Invtbl.)(ACY)" := CostAmtACY;
            END;
          END;
      END;
    
    // Add the following lines.
      IF (GLSetup."Payment Discount Type" = GLSetup."Payment Discount Type"::"Calc. Pmt. Disc. on Lines") THEN BEGIN
        IF (ValueEntry."Discount Amount" <> 0) AND (ItemJnlLine."Item Charge No." <> '') THEN BEGIN
          CASE "Entry Type" OF
            "Entry Type"::Sale: 
             ValueEntry."Sales Amount (Actual)" := ValueEntry."Sales Amount (Actual)" - ItemJnlLine."Pmt. Discount Amount";
            "Entry Type"::Purchase:
            BEGIN  
              ValueEntry."Cost Amount (Actual)" := CostAmt - ItemJnlLine."Pmt. Discount Amount"; 
              ValueEntry."Purchase Amount (Actual)" := ValueEntry."Purchase Amount (Actual)" - ItemJnlLine."Pmt. Discount Amount";
            END;
          END;
        END; 
      END;
    // End of the added lines.
    
      RoundAmtValueEntry(ValueEntry);
    ...
    
    
  4. Modificare il codice nel trigger PostItemChargePerOrder nell'Sales-Post codeunit (80) come segue:
    Codice esistente

    ...
      IF SalesHeader."Currency Code" <> '' THEN
        ItemJnlLine2."Discount Amount" := ROUND(
          CurrExchRate.ExchangeAmtFCYToLCY(
            UseDate,SalesHeader."Currency Code",
    
    // Delete the following line.
            (ItemChargeSalesLine."Inv. Discount Amount" + ItemChargeSalesLine."Pmt. Disc. Given Amount") * 
    
             ItemJnlLine2."Invoiced Qty. (Base)" /
             ItemChargeSalesLine."Quantity (Base)" * "Qty. to Assign"  / QtyToInvoice,
             SalesHeader."Currency Factor"),GLSetup."Amount Rounding Precision")
      ELSE
        ItemJnlLine2."Discount Amount" := ROUND(
    
    // Delete the following line.
          (ItemChargeSalesLine."Inv. Discount Amount" + ItemChargeSalesLine."Pmt. Disc. Given Amount") *
    
           ItemChargeSalesLine."Quantity (Base)" * "Qty. to Assign" / QtyToInvoice,
           GLSetup."Amount Rounding Precision");
    // Delete the following lines.
      IF "Document Type" IN ["Document Type"::"Return Order","Document Type"::"Credit Memo"] THEN
        ItemJnlLine2."Discount Amount" := -ItemJnlLine2."Discount Amount";
    // End of the added lines.
    
      ItemJnlLine2."Shortcut Dimension 1 Code" := ItemChargeSalesLine."Shortcut Dimension 1 Code";
    ...
    
    

    Codice sostitutivo

    ...
      IF SalesHeader."Currency Code" <> '' THEN
        ItemJnlLine2."Discount Amount" := ROUND(
          CurrExchRate.ExchangeAmtFCYToLCY(
            UseDate,SalesHeader."Currency Code",
    
    // Add the following lines.
            (ItemChargeSalesLine."Line Discount Amount" +
            ItemChargeSalesLine."Inv. Discount Amount" + ItemChargeSalesLine."Pmt. Disc. Given Amount") * 
    // End of the added lines.
    
             ItemJnlLine2."Invoiced Qty. (Base)" /
             ItemChargeSalesLine."Quantity (Base)" * "Qty. to Assign"  / QtyToInvoice,
             SalesHeader."Currency Factor"),GLSetup."Amount Rounding Precision")
      ELSE
        ItemJnlLine2."Discount Amount" := ROUND(
    
    // Add the following lines.
          (ItemChargeSalesLine."Line Discount Amount" +
          ItemChargeSalesLine."Inv. Discount Amount" + ItemChargeSalesLine."Pmt. Disc. Given Amount") *
    // End of the added lines.
    
           ItemJnlLine2."Invoiced Qty. (Base)" /
           ItemChargeSalesLine."Quantity (Base)" * "Qty. to Assign" / QtyToInvoice,
           GLSetup."Amount Rounding Precision");
    // Add the following lines.
        ItemJnlLine2."Pmt. Discount Amount" := ItemChargeSalesLine."Pmt. Disc. Given Amount" *  
          ItemJnlLine2."Invoiced Qty. (Base)" / ItemChargeSalesLine."Quantity (Base)" * 
            "Qty. to Assign"  / QtyToInvoice; 
        IF "Document Type" IN ["Document Type"::"Return Order","Document Type"::"Credit Memo"] THEN BEGIN 
          ItemJnlLine2."Discount Amount" := -ItemJnlLine2."Discount Amount";
          ItemJnlLine2."Pmt. Discount Amount" := -ItemJnlLine2."Pmt. Discount Amount";
        END;
    // End of the added lines.
    
      ItemJnlLine2."Shortcut Dimension 1 Code" := ItemChargeSalesLine."Shortcut Dimension 1 Code";
    ...
    
    
  5. Modificare il codice nel trigger PostItemChargePerOrder nella codeunit Purch.-Post (90) come segue:
    Codice esistente

    ...
          ItemChargePurchLine."Quantity (Base)" * "Qty. to Assign" / QtyToInvoice,
          GLSetup."Amount Rounding Precision");
    
    
      ItemJnlLine2."Shortcut Dimension 1 Code" := ItemChargePurchLine."Shortcut Dimension 1 Code";
      ItemJnlLine2."Shortcut Dimension 2 Code" := ItemChargePurchLine."Shortcut Dimension 2 Code";
    ...
    
    

    Codice sostitutivo

    ...
          ItemChargePurchLine."Quantity (Base)" * "Qty. to Assign" / QtyToInvoice,
          GLSetup."Amount Rounding Precision");
    
    // Add the following lines.
       ItemJnlLine2."Pmt. Discount Amount" := ItemChargePurchLine."Pmt. Disc. Rcd. Amount" * 
         ItemJnlLine2."Invoiced Qty. (Base)" / ItemChargePurchLine."Quantity (Base)" *
           "Qty. to Assign" / QtyToInvoice; 
       IF "Document Type" IN ["Document Type"::"Return Order","Document Type"::"Credit Memo"] THEN BEGIN
         ItemJnlLine2."Discount Amount" := -ItemJnlLine2."Discount Amount";
         ItemJnlLine2."Pmt. Discount Amount" := -ItemJnlLine2."Pmt. Discount Amount";
       END;
    // End of the added lines.
    
      ItemJnlLine2."Shortcut Dimension 1 Code" := ItemChargePurchLine."Shortcut Dimension 1 Code";
    ...
    
    

Prerequisiti

Per applicare questo hotfix, è necessario che sia installato uno dei prodotti seguenti:

  • Versione spagnola di Microsoft Dynamics NAV 2009 Service Pack 1
  • La versione spagnola di Microsoft Dynamics NAV 2009
  • La versione spagnola di Microsoft Dynamics NAV 5.0 Service Pack 1
  • La versione spagnola di Microsoft Dynamics NAV 4.0 Service Pack 3

              

Informazioni sulla rimozione

Non è possibile rimuovere questo hotfix.

Stato

Microsoft ha confermato che si tratta di un problema relativo ai prodotti elencati nella sezione "Si applica a".

MICROSOFT E/O I SUOI FORNITORI NON RILASCIANO DICHIARAZIONI O GARANZIE CIRCA L'IDONEITÀ, L'AFFIDABILITÀ O L'ACCURATEZZA DELLE INFORMAZIONI CONTENUTE NEI DOCUMENTI E NEGLI ELEMENTI GRAFICI CORRELATI PUBBLICATI SU QUESTO SITO WEB (I "MATERIALI") PER QUALSIASI SCOPO.

I MATERIALI POSSONO INCLUDERE IMPRECISIONI TECNICHE O ERRORI TIPOGRAFICI E POSSONO ESSERE MODIFICATI IN QUALSIASI MOMENTO SENZA PREAVVISO. NELLA MISURA MASSIMA CONSENTITA DALLA LEGGE APPLICABILE, MICROSOFT E/O I SUOI FORNITORI ESCLUDONO ED ESCLUDONO TUTTE LE RAPPRESENTAZIONI, LE GARANZIE E LE CONDIZIONI ESPRESSE, IMPLICITE O DI LEGGE, COMPRESE, TRA LE ALTRE, LE RAPPRESENTAZIONI, LE GARANZIE O LE CONDIZIONI DI TITOLO, NON VIOLAZIONE DI DIRITTI ALTRUI, CONDIZIONI O QUALITÀ SODDISFACENTI, COMMERCIABILITÀ E IDONEITÀ PER UNO SCOPO SPECIFICO, RELATIVAMENTE AI MATERIALI.