Mensaje de error "No se contabilizan importes por adelantado en el pedido [número]" al registrar envío parcial para un pedido de venta en la versión de Europa oriental de Microsoft Dynamics NAV 2009 R2

Se aplica a
Dynamics NAV 2009

Este artículo se aplica a Microsoft Dynamics NAV para la región Europa oriental (EE).

Síntomas

Al registrar el envío parcial de un pedido de venta en la versión de Europa oriental de Microsoft Dynamics NAV 2009 R2, recibe el siguiente mensaje de error:

Nota

No se contabilizan importes por adelantado en el número de pedido.

Este problema se produce cuando se especifica y procesa un anticipo para el pedido de ventas.

Resolución

Información de revisiones

Una revisión compatible ya está disponible en Microsoft. Sin embargo, solo está pensado para corregir el problema que se describe en este artículo. Aplicarlo solo a los sistemas que experimentan este problema específico. Esta revisión puede recibir pruebas adicionales. Por lo tanto, si no se ve afectado gravemente por este problema, le recomendamos que espere al siguiente Service Pack de Microsoft Dynamics NAV o a la siguiente versión de Microsoft Dynamics NAV que contenga esta revisión.

Nota En casos especiales, los cargos que se incurren normalmente por las llamadas de soporte técnico pueden cancelarse si un profesional de soporte técnico de Microsoft Dynamics y productos relacionados determina que una actualización específica resolverá el problema. Se aplicarán los costos habituales de soporte técnico a las consultas y cuestiones de soporte técnico adicionales que no guarden relación con la actualización en cuestión.

            
          

Información de instalación

Microsoft proporciona ejemplos de programación solo para ilustración, sin garantía expresa o implícita. Esto incluye, entre otras, las garantías implícitas de comerciabilidad o idoneidad para un propósito determinado. En este artículo se supone que está familiarizado con el lenguaje de programación que se muestra y con las herramientas que se usan para crear y depurar procedimientos. Los ingenieros de soporte técnico de Microsoft pueden explicarle la funcionalidad de un determinado procedimiento, pero no modificarán estos ejemplos para ofrecer mayor funcionalidad ni crearán procedimientos adaptados a sus necesidades específicas.

Nota Antes de instalar esta revisión, verifique que todos los usuarios cliente de Microsoft Navision hayan cerrado sesión en el sistema. Esto incluye a los usuarios cliente de Microsoft Navision Application Services (NAS). Usted debe ser el único usuario del cliente que ha iniciado sesión al implementar esta revisión.

Para implementar esta revisión, debe tener una licencia de desarrollador.

Le recomendamos que la cuenta de usuario en la ventana Inicios de sesión de Windows o en la ventana Inicios de sesión de base de datos tenga asignado el id. de rol "SUPER". Si no se puede asignar a la cuenta de usuario el id. de rol "SUPER", debe comprobar que la cuenta de usuario tiene los permisos siguientes:

  • El permiso Modificar para el objeto que va a cambiar.
  • El permiso Execute para el objeto System Object ID 5210 y para el objeto System Object ID 9015.

                
Nota No es necesario tener derechos sobre los almacenes de datos a menos que tenga que realizar una reparación de datos.

Cambios de código

Nota Pruebe siempre las correcciones de código en un entorno controlado antes de aplicar las correcciones a los equipos de producción.
Para resolver este problema, siga estos pasos:

  1. Cambie el código de la función TestSalesPrepayment en la unidad de código de gestión de aprobaciones (439) de la siguiente manera:
    Código existente

    ...
    SalesLines.SETRANGE("Document Type",SalesHeader."Document Type");
    SalesLines.SETRANGE("Document No.",SalesHeader."No.");
    SalesLines.SETFILTER("Prepmt. Line Amount",'<>%1',0);
    ...
    

    Código de reemplazo

    ...
    // Add the following lines.
    IF SalesHeader."Prepayment Type" = SalesHeader."Prepayment Type"::Advance THEN
    EXIT(FALSE);
    // End of the lines. 
    
    SalesLines.SETRANGE("Document Type",SalesHeader."Document Type");
    SalesLines.SETRANGE("Document No.",SalesHeader."No.");
    SalesLines.SETFILTER("Prepmt. Line Amount",'<>%1',0);
    ...
    
  2. Cambie el código de la función TestPurchasePrepayment en la unidad de código de administración de aprobaciones (439) de la siguiente manera:
    Código existente

    ...
    PurchaseLines.SETRANGE("Document Type",PurchaseHeader."Document Type");
    PurchaseLines.SETRANGE("Document No.",PurchaseHeader."No.");
    PurchaseLines.SETFILTER("Prepmt. Line Amount",'<>%1',0);
    ...
    

    Código de reemplazo

    ...
    // Add the following lines.
    IF PurchaseHeader."Prepayment Type" = PurchaseHeader."Prepayment Type"::Advance THEN
    EXIT(FALSE);
    // End of the lines. 
    
    PurchaseLines.SETRANGE("Document Type",PurchaseHeader."Document Type");
    PurchaseLines.SETRANGE("Document No.",PurchaseHeader."No.");
    PurchaseLines.SETFILTER("Prepmt. Line Amount",'<>%1',0);
    ...
    
  3. Cambie el código en el desencadenador OnRun en la unidad de código "Sales-Post" (80) de la siguiente manera:
    Código existente

    ...
    Window.UPDATE(2,LineCount); 
    IF Invoice AND (NOT GLSetup."Allow VAT Date Change in Lines") THEN
    SalesLine."VAT Date" := "VAT Date"; 
    IF SalesLine.Type = SalesLine.Type::"Charge (Item)" THEN BEGIN
    SalesLine.TESTFIELD(Amount);
    SalesLine.TESTFIELD("Job No.",'');
    SalesLine.TESTFIELD("Job Contract Entry No.",0);
    END;
    ...
    

    Código de reemplazo

    ...
    Window.UPDATE(2,LineCount); 
    IF Invoice AND (NOT GLSetup."Allow VAT Date Change in Lines") THEN
    SalesLine."VAT Date" := "VAT Date"; 
    
    // Add the following lines. 
    IF Invoice THEN
    TestPrepmtAmount;
    // End of the lines. 
    
    IF SalesLine.Type = SalesLine.Type::"Charge (Item)" THEN BEGIN
    SalesLine.TESTFIELD(Amount);
    SalesLine.TESTFIELD("Job No.",'');
    SalesLine.TESTFIELD("Job Contract Entry No.",0);
    END;
    ...
    
  4. Cree una nueva función TestPrepmtAmount en la unidad de código "Sales-Post" (80) de la siguiente manera:

    PROCEDURE TestPrepmtAmount@1470003();
    VAR
    AllowedQtyToShip@1470000 : Decimal;
    BEGIN
    WITH SalesLine DO BEGIN
    IF ("Prepmt. Line Amount" = 0) OR (Quantity = 0) THEN
    EXIT;
    
    AllowedQtyToShip :=
    ROUND(
    ("Line Amount" - "Prepmt. Line Amount" + "Prepmt. Amt. Inv.") /
    "Line Amount" * Quantity - "Quantity Invoiced",0.00001);
    IF "Qty. to Ship" > AllowedQtyToShip THEN
    FIELDERROR("Qty. to Ship",STRSUBSTNO(Text047,AllowedQtyToShip));
    END;
    END;
    
  5. Elimine las siguientes variables locales en la función TestPrepmtAmount en la unidad de código "Purch.-Post" (90):

    • RemainingAmount
    • Preguntas restantes
  6. Agrega una nueva variable local en la función TestPrepmtAmount en la unidad de código "Purch.-Post" (90) y luego especifica la variable de la siguiente manera:

    • Nombre: AllowedQtyToReceive
    • Tipo de datos: decimal
  7. Cambie el código de la función TestPrepmtAmount en la unidad de código "Purch.-Post" (90) de la siguiente manera:
    Código existente

    ...
    WITH PurchLine DO BEGIN
    
    // Delete the following lines. 
    IF "Prepmt. Line Amount" = 0 THEN
    EXIT;
    IF NOT PurchHeader.Receive AND ("Qty. to Invoice" = Quantity - "Quantity Invoiced") THEN BEGIN
    IF "Qty. Rcd. Not Invoiced" + "Quantity Received" = Quantity THEN
    RemainingAmount := 0
    ELSE BEGIN
    RemainingQty := "Qty. to Receive";
    RemainingAmount :=
    ROUND(RemainingQty * "Direct Unit Cost" * (1 - "Line Discount %" / 100),Currency."Amount Rounding Precision");
    END;
    END ELSE BEGIN
    IF "Qty. to Invoice" + "Quantity Invoiced" = Quantity THEN
    RemainingAmount := 0
    ELSE BEGIN
    RemainingQty := Quantity - "Qty. to Invoice" - "Quantity Invoiced";
    RemainingAmount :=
    ROUND(RemainingQty * "Direct Unit Cost" * (1 - "Line Discount %" / 100),Currency."Amount Rounding Precision");
    END;
    END;
    IF RemainingAmount < "Prepmt. Line Amount" - "Prepmt Amt to Deduct" - "Prepmt Amt Deducted" THEN
    FIELDERROR("Prepmt. Line Amount",STRSUBSTNO(Text049,"Qty. to Invoice"));
    // End of the lines. 
    
    END;
    ...
    

    Código de reemplazo

    ...
    WITH PurchLine DO BEGIN
    
    // Add the following lines. 
    IF ("Prepmt. Line Amount" = 0) OR (Quantity = 0) THEN
    EXIT;
    
    AllowedQtyToReceive :=
    ROUND(
    ("Line Amount" - "Prepmt. Line Amount" + "Prepmt. Amt. Inv.") /
    "Line Amount" * Quantity - "Quantity Invoiced",0.00001);
    IF "Qty. to Receive" > AllowedQtyToReceive THEN
    FIELDERROR("Qty. to Receive",STRSUBSTNO(Text047,AllowedQtyToReceive));
    // End of the lines. 
    
    END;
    ...
    
  8. Cambie el código del Amt prepmt a Deduct-OnValidate desencadenador en la tabla Línea de ventas (37) de la siguiente manera:
    Código existente

    ...
    IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN
    TESTFIELD("Prepmt Amt to Deduct","Prepmt. Amt. Inv." - "Prepmt Amt Deducted");
    ...
    

    Código de reemplazo

    ...
    IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN
    TESTFIELD("Prepmt Amt to Deduct","Prepmt. Amt. Inv." - "Prepmt Amt Deducted");
    
    // Add the following lines. 
    GetSalesHeader;
    IF SalesHeader."Prepayment Type" = SalesHeader."Prepayment Type"::Advance THEN BEGIN
    VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group");
    IF VATPostingSetup."Adv. Invoice Correction Type" <> 0 THEN
    VATPostingSetup.TESTFIELD("Adv. Invoice Correction Type",VATPostingSetup."Adv. Invoice Correction Type"::Percentage);
    END;
    // End of the lines. 
    ...
    
  9. Elimine las siguientes variables locales en la función CalcPrepaymentToDeduct de la tabla Línea de ventas (37):

    • PrepmtPct
    • AbsoluteAdvCorrection
  10. Cambie el código de la función CalcPrepaymentToDeduct de la tabla Línea de ventas (37) de la siguiente manera:
    Código existente

    ...
    IF SalesHeader."Prepayment Type" = SalesHeader."Prepayment Type"::Advance THEN BEGIN
    VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group");
    
    // Delete the following lines. 
    AbsoluteAdvCorrection :=
    VATPostingSetup."Adv. Invoice Correction Type" = VATPostingSetup."Adv. Invoice Correction Type"::Absolute;
    IF AbsoluteAdvCorrection THEN BEGIN
    PrepmtPct := "Prepayment %";
    "Prepayment %" := 100;
    END;
    END;
    IF SalesHeader."Prices Including VAT" THEN
    "Prepmt Amt to Deduct" :=
    ROUND(
    ROUND(
    ROUND(
    ROUND("Unit Price" * "Qty. to Invoice",Currency."Amount Rounding Precision") *
    (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") *
    ("Prepayment %" / 100) / (1 + ("VAT %" / 100)),Currency."Amount Rounding Precision") *
    (1 + ("VAT %" / 100)),Currency."Amount Rounding Precision")
    ELSE
    "Prepmt Amt to Deduct" :=
    ROUND(
    ROUND(
    ROUND("Unit Price" * "Qty. to Invoice",Currency."Amount Rounding Precision") *
    (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") *
    "Prepayment %" / 100 ,Currency."Amount Rounding Precision");
    IF AbsoluteAdvCorrection THEN BEGIN
    "Prepayment %" := PrepmtPct;
    IF "Prepmt Amt to Deduct" > ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted") THEN
    "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted";
    END;
    // End of the lines.
    
    END ELSE
    "Prepmt Amt to Deduct" := 0
    ...
    

    Código de reemplazo

    ... 
    IF SalesHeader."Prepayment Type" = SalesHeader."Prepayment Type"::Advance THEN BEGIN
    VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group");
    
    // Add the following lines. 
    CASE VATPostingSetup."Adv. Invoice Correction Type" OF
    VATPostingSetup."Adv. Invoice Correction Type"::Percentage:
    "Prepmt Amt to Deduct" :=
    ROUND("Qty. to Invoice" / (Quantity - "Quantity Invoiced") *
    ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted"),Currency."Amount Rounding Precision");
    VATPostingSetup."Adv. Invoice Correction Type"::Absolute:
    BEGIN
    "Prepmt Amt to Deduct" := PrepmtAmtToDeduct(SalesHeader."Prices Including VAT",100);
    IF "Prepmt Amt to Deduct" > ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted") THEN
    "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted";
    END;
    VATPostingSetup."Adv. Invoice Correction Type"::"Fully Invoiced":
    IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN
    "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted"
    ELSE
    "Prepmt Amt to Deduct" := 0;
    END;
    END ELSE 
    "Prepmt Amt to Deduct" := PrepmtAmtToDeduct(SalesHeader."Prices Including VAT","Prepayment %");
    // End of the lines. 
    
    END ELSE
    "Prepmt Amt to Deduct" := 0
    ...
    
  11. Cree una nueva función PrepmtAmtToDeduct en la tabla Línea de ventas (37) de la siguiente manera:

    PROCEDURE PrepmtAmtToDeduct@1470002(PricesIncludingVAT@1470000 : Boolean;PrepaymentPct@1470001 : Decimal) : Decimal;
    VAR
    VATPct@1470002 : Decimal;
    BEGIN
    IF PricesIncludingVAT THEN
    VATPct := "VAT %"
    ELSE
    VATPct := 0;
    EXIT(
    ROUND(
    ROUND(
    ROUND(
    ROUND("Unit Price" * "Qty. to Invoice",Currency."Amount Rounding Precision") *
    (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") *
    (PrepaymentPct / 100) / (1 + (VATPct / 100)),Currency."Amount Rounding Precision") *
    (1 + (VATPct / 100)),Currency."Amount Rounding Precision"));
    END;
    
  12. Cambie el código del Amt prepmt al desencadenador Deduct - OnValidate en la tabla Línea de compra (39) de la siguiente manera:
    Código existente

    ...
    IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN
    TESTFIELD("Prepmt Amt to Deduct","Prepmt. Amt. Inv." - "Prepmt Amt Deducted");
    ...
    

    Código de reemplazo

    ...
    IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN
    TESTFIELD("Prepmt Amt to Deduct","Prepmt. Amt. Inv." - "Prepmt Amt Deducted");
    
    // Add the following lines.
    GetPurchHeader;
    IF PurchHeader."Prepayment Type" = PurchHeader."Prepayment Type"::Advance THEN BEGIN
    VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group");
    IF VATPostingSetup."Adv. Invoice Correction Type" <> 0 THEN
    VATPostingSetup.TESTFIELD("Adv. Invoice Correction Type",VATPostingSetup."Adv. Invoice Correction Type"::Percentage);
    END;
    // End of the lines. 
    ...
    
  13. Elimine las siguientes variables locales en la función CalcPrepaymentToDeduct de la tabla Línea de compra (39):

    • PrepmtPct
    • AbsoluteAdvCorrection
  14. Cambie el código de la función CalcPrepaymentToDeduct en la tabla Línea de compra (39) de la siguiente manera:
    Código existente

    ...
    IF PurchHeader."Prepayment Type" = PurchHeader."Prepayment Type"::Advance THEN BEGIN
    VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group");
    
    // Delete the following lines. 
    AbsoluteAdvCorrection :=
    VATPostingSetup."Adv. Invoice Correction Type" = VATPostingSetup."Adv. Invoice Correction Type"::Absolute;
    IF AbsoluteAdvCorrection THEN BEGIN
    PrepmtPct := "Prepayment %";
    "Prepayment %" := 100;
    END;
    END;
    IF PurchHeader."Prices Including VAT" THEN
    "Prepmt Amt to Deduct" :=
    ROUND(
    ROUND(
    ROUND(
    ROUND("Direct Unit Cost" * "Qty. to Invoice",Currency."Amount Rounding Precision") *
    (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") *
    ("Prepayment %" / 100) / (1 + ("VAT %" / 100)),Currency."Amount Rounding Precision") *
    (1 + ("VAT %" / 100)),Currency."Amount Rounding Precision")
    ELSE
    "Prepmt Amt to Deduct" :=
    ROUND(
    ROUND(
    ROUND("Direct Unit Cost" * "Qty. to Invoice",Currency."Amount Rounding Precision") *
    (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") *
    "Prepayment %" / 100,Currency."Amount Rounding Precision");
    IF AbsoluteAdvCorrection THEN BEGIN
    "Prepayment %" := PrepmtPct;
    IF "Prepmt Amt to Deduct" > ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted") THEN
    "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted";
    END;
    // End of the lines.
    
    END ELSE
    "Prepmt Amt to Deduct" := 0
    ...
    

    Código de reemplazo

    ...
    IF PurchHeader."Prepayment Type" = PurchHeader."Prepayment Type"::Advance THEN BEGIN
    VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group");
    
    // Add the following lines. 
    CASE VATPostingSetup."Adv. Invoice Correction Type" OF
    VATPostingSetup."Adv. Invoice Correction Type"::Percentage:
    "Prepmt Amt to Deduct" :=
    ROUND("Qty. to Invoice" / (Quantity - "Quantity Invoiced") *
    ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted"),Currency."Amount Rounding Precision");
    VATPostingSetup."Adv. Invoice Correction Type"::Absolute:
    BEGIN
    "Prepmt Amt to Deduct" := PrepmtAmtToDeduct(PurchHeader."Prices Including VAT",100);
    IF "Prepmt Amt to Deduct" > ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted") THEN
    "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted";
    END;
    VATPostingSetup."Adv. Invoice Correction Type"::"Fully Invoiced":
    IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN
    "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted"
    ELSE
    "Prepmt Amt to Deduct" := 0;
    END;
    END ELSE
    "Prepmt Amt to Deduct" := PrepmtAmtToDeduct(PurchHeader."Prices Including VAT","Prepayment %");
    // End of the lines. 
    
    END ELSE
    "Prepmt Amt to Deduct" := 0
    ...
    
  15. Cree una nueva función PrepmtAmtToDeduct en la tabla Línea de compra (39) de la siguiente manera:

    PROCEDURE PrepmtAmtToDeduct@1470002(PricesIncludingVAT@1470000 : Boolean;PrepaymentPct@1470001 : Decimal) : Decimal;
    VAR
    VATPct@1470002 : Decimal;
    BEGIN
    IF PricesIncludingVAT THEN
    VATPct := "VAT %"
    ELSE
    VATPct := 0;
    EXIT(
    ROUND(
    ROUND(
    ROUND(
    ROUND("Direct Unit Cost" * "Qty. to Invoice",Currency."Amount Rounding Precision") *
    (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") *
    (PrepaymentPct / 100) / (1 + (VATPct / 100)),Currency."Amount Rounding Precision") *
    (1 + (VATPct / 100)),Currency."Amount Rounding Precision"));
    END;
    

Requisitos previos

Debe tener la versión de Europa oriental de Microsoft Dynamics NAV 2009 R2 instalada para aplicar esta revisión.

Información sobre la eliminación

No puede quitar esta revisión.

Estado

Microsoft ha confirmado que se trata de un problema de los productos de Microsoft que se enumeran en la sección "Aplicable a".

Nota Esto es un artículo "PUBLICACIÓN RÁPIDA" creado directamente desde la organización de soporte técnico de Microsoft. La información contenida se proporciona tal cual en respuesta a nuevos problemas. Como resultado de la rapidez en la publicación, es posible que los materiales incluyan errores tipográficos. Además, se pueden revisar en cualquier momento sin previo aviso. Consulte los Términos de uso para otras consideraciones.