Iniciar sesión con Microsoft
Iniciar sesión o crear una cuenta
Hola:
Seleccione una cuenta diferente.
Tiene varias cuentas
Elija la cuenta con la que desea iniciar sesión.

Descuento en el cargo de producto se asignan a los albaranes de venta no se distribuyen de acuerdo con la opción seleccionada a los movimientos de valor respectivo en Microsoft Dynamics NAV 2009. Siga los pasos descritos en la sección de cambios de código para resolver este problema. Este problema se produce en los siguientes productos:

  • Microsoft Dynamics NAV 2009 R2

  • Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)

Solución

Información de la revisión

Ahora hay una revisión compatible de Microsoft. Sin embargo, sólo se diseñó para corregir el problema que se describe en este artículo. Aplíquela sólo a sistemas que experimenten este problema específico. Esta revisión puede ser sometida a comprobaciones adicionales. Por lo tanto, si no se ve muy afectado por este problema, recomendamos que espere al próximo service pack de Microsoft Dynamics NAV 2009 o la próxima versión de Microsoft Dynamics NAV que contenga esta revisión.

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

Información sobre la instalación

Microsoft proporciona ejemplos de programación únicamente con fines ilustrativos, sin ninguna garantía expresa o implícita. Esto incluye, pero no se limita, a las garantías implícitas de comerciabilidad o idoneidad para un propósito particular. Este artículo asume que está familiarizado con el lenguaje de programación que se muestra y con las herramientas que se utilizan para crear y depurar procedimientos. Los ingenieros de soporte técnico de Microsoft pueden explicarle la funcionalidad de un determinado procedimiento. Sin embargo, no modificarán estos ejemplos para ofrecer mayor funcionalidad ni crearán procedimientos que cumplan sus requisitos específicos.

Nota: Antes de instalar este hotfix, compruebe que todos los usuarios del cliente de Microsoft Dynamics NAV han salido del sistema. Esto incluye los servicios de Microsoft Dynamics NAV Application Server (NAS). Debe ser el único usuario del cliente conectado cuando implemente este hotfix.

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

Recomendamos que la cuenta de usuario en la ventana Conexiones Windows o en la ventana Conexiones base de datos se asigne el identificador de rol "SUPER". Si la cuenta de usuario no se puede asignar el identificador de rol "SUPER", debe comprobar que la cuenta de usuario tiene los permisos siguientes:

  • El permiso de modificación para el objeto que se va a cambiar.

  • El permiso Execute para el objeto System Object ID 5210 y el System Object ID 9015 .

    objeto.

Nota: No es necesario tener derechos para los almacenes de datos a menos que deba realizar reparaciones de datos.

Cambios de código

Nota: Siempre pruebe correcciones de código en un entorno controlado antes de aplicar las revisiones a los equipos de producción.

Para resolver este problema, siga estos pasos:

  1. Cambie el código en las propiedades de la codeunit Sales-Post (80) como sigue:
    Código existente 1

    ...PostJobContractLine(JobTaskSalesLine,TempJnlLineDim2);

    END;

    SalesLine.Type::"Charge (Item)":

    IF Invoice OR ItemChargeAssgntOnly THEN BEGIN

    // Delete the following line.
    ItemJnlRollRndg := FALSE;
    // End of the deleted line.

    ClearItemChargeAssgntFilter;

    TempItemChargeAssgntSales.SETCURRENTKEY("Applies-to Doc. Type");

    TempItemChargeAssgntSales.SETRANGE("Document Line No.",SalesLine."Line No.");

    IF TempItemChargeAssgntSales.FINDSET THEN
    ...

    Código nuevo 1

    ...PostJobContractLine(JobTaskSalesLine,TempJnlLineDim2);

    END;

    SalesLine.Type::"Charge (Item)":

    IF Invoice OR ItemChargeAssgntOnly THEN BEGIN

    // Add the following line.
    ItemJnlRollRndg := TRUE;
    // End of the added line.

    ClearItemChargeAssgntFilter;

    TempItemChargeAssgntSales.SETCURRENTKEY("Applies-to Doc. Type");

    TempItemChargeAssgntSales.SETRANGE("Document Line No.",SalesLine."Line No.");

    IF TempItemChargeAssgntSales.FINDSET THEN
    ...

    Código existente 2

    ...GenJnlLineDocNo := TempItemChargeAssgntSales."Applies-to Doc. No.";

    CASE TempItemChargeAssgntSales."Applies-to Doc. Type" OF

    TempItemChargeAssgntSales."Applies-to Doc. Type"::Shipment:

    BEGIN

    // Delete the following line.
    PostItemChargePerShpt(SalesLine);

    TempItemChargeAssgntSales.MARK(TRUE);

    END;

    TempItemChargeAssgntSales."Applies-to Doc. Type"::"Return Receipt":

    BEGIN
    ...

    Código nuevo 2

    ...GenJnlLineDocNo := TempItemChargeAssgntSales."Applies-to Doc. No.";

    CASE TempItemChargeAssgntSales."Applies-to Doc. Type" OF

    TempItemChargeAssgntSales."Applies-to Doc. Type"::Shipment:

    BEGIN

    // Add the following lines.
    PostItemChargePerShpt(SalesLine,SalesLine."Inv. Discount Amount",

    SalesLine.Quantity,SalesLine."Line Discount Amount",SalesLine."Line Amount");
    // End of the added lines.

    TempItemChargeAssgntSales.MARK(TRUE);

    END;

    TempItemChargeAssgntSales."Applies-to Doc. Type"::"Return Receipt":

    BEGIN
    ...

    Código existente 3

    ...TempItemChargeAssgntSales.MARK(TRUE);

    END;

    TempItemChargeAssgntSales."Applies-to Doc. Type"::"Return Receipt":

    BEGIN

    // Delete the following line.
    PostItemChargePerRetRcpt(SalesLine);

    TempItemChargeAssgntSales.MARK(TRUE);

    END;

    TempItemChargeAssgntSales."Applies-to Doc. Type"::Order,

    TempItemChargeAssgntSales."Applies-to Doc. Type"::Invoice:
    ...

    Código nuevo 3

    ...TempItemChargeAssgntSales.MARK(TRUE);

    END;

    TempItemChargeAssgntSales."Applies-to Doc. Type"::"Return Receipt":

    BEGIN

    // Add the following lines.
    PostItemChargePerRetRcpt(SalesLine,SalesLine."Inv. Discount Amount",

    SalesLine.Quantity,SalesLine."Line Discount Amount",SalesLine."Line Amount");
    // End of the added lines.

    TempItemChargeAssgntSales.MARK(TRUE);

    END;

    TempItemChargeAssgntSales."Applies-to Doc. Type"::Order,

    TempItemChargeAssgntSales."Applies-to Doc. Type"::Invoice:
    ...
  2. Cambie el código en la función PostItemChargePerShpt de la codeunit Sales-Post (80) como sigue:
    Código existente 1

    ...END;

    END;

    END;


    // Delete the following line.
    LOCAL PROCEDURE PostItemChargePerShpt@5807(SalesLine@1000 : Record 37);

    VAR

    SalesShptLine@1003 : Record 111;

    TempItemLedgEntry@1010 : TEMPORARY Record 32;

    ItemTrackingMgt@1009 : Codeunit 6500;
    ...

    Código nuevo 1

    ...END;

    END;

    END;


    // Add the following line.
    LOCAL PROCEDURE PostItemChargePerShpt@5807(SalesLine@1000 : Record 37;VAR TotalInvDiscAmtRemaining@1012 : Decimal;VAR TotalQtyRemaining@1013 : Decimal;VAR TotalLineDiscAmtRemaining@1014 : Decimal;VAR TotalLineAmtRemaining@1015 : Decimal);

    VAR

    SalesShptLine@1003 : Record 111;

    TempItemLedgEntry@1010 : TEMPORARY Record 32;

    ItemTrackingMgt@1009 : Codeunit 6500;
    ...

    Código existente 2

    ...AmountToAssign := ROUND(NonDistrAmountToAssign * Factor,GLSetup."Amount Rounding Precision");

    IF Factor < 1 THEN BEGIN

    PostItemCharge(SalesLine,

    TempItemLedgEntry."Entry No.",ABS(TempItemLedgEntry.Quantity),

    // Delete the following line.
    AmountToAssign,QtyToAssign);

    NonDistrQuantity := NonDistrQuantity - ABS(TempItemLedgEntry.Quantity);

    NonDistrQtyToAssign := NonDistrQtyToAssign - QtyToAssign;

    NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time
    ...

    Código nuevo 2

    ...AmountToAssign := ROUND(NonDistrAmountToAssign * Factor,GLSetup."Amount Rounding Precision");

    IF Factor < 1 THEN BEGIN

    PostItemCharge(SalesLine,

    TempItemLedgEntry."Entry No.",ABS(TempItemLedgEntry.Quantity),

    // Add the following lines.
    AmountToAssign,QtyToAssign,TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);
    // End of the added lines.

    NonDistrQuantity := NonDistrQuantity - ABS(TempItemLedgEntry.Quantity);

    NonDistrQtyToAssign := NonDistrQtyToAssign - QtyToAssign;

    NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time
    ...

    Código existente 3

    ...NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time

    PostItemCharge(SalesLine,

    TempItemLedgEntry."Entry No.",ABS(TempItemLedgEntry.Quantity),

    // Delete the following line.
    NonDistrAmountToAssign,NonDistrQtyToAssign);

    UNTIL TempItemLedgEntry.NEXT = 0;

    END ELSE

    PostItemCharge(SalesLine,

    SalesShptLine."Item Shpt. Entry No.",SalesShptLine."Quantity (Base)",
    ...

    Código nuevo 3

    ...NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time

    PostItemCharge(SalesLine,

    TempItemLedgEntry."Entry No.",ABS(TempItemLedgEntry.Quantity),

    // Add the following lines.
    NonDistrAmountToAssign,NonDistrQtyToAssign,TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);
    // End of the added lines.

    UNTIL TempItemLedgEntry.NEXT = 0;

    END ELSE

    PostItemCharge(SalesLine,

    SalesShptLine."Item Shpt. Entry No.",SalesShptLine."Quantity (Base)",
    ...

    Código existente 4

    ...END ELSE

    PostItemCharge(SalesLine,

    SalesShptLine."Item Shpt. Entry No.",SalesShptLine."Quantity (Base)",

    TempItemChargeAssgntSales."Amount to Assign",

    // Delete the following lines.
    TempItemChargeAssgntSales."Qty. to Assign");

    END;



    LOCAL PROCEDURE PostItemChargePerRetRcpt@5810(SalesLine@1000 : Record 37);
    // End of the deleted lines.

    VAR

    ReturnRcptLine@1002 : Record 6661;

    TempItemLedgEntry@1010 : TEMPORARY Record 32;

    ItemTrackingMgt@1009 : Codeunit 6500;
    ...

    Código nuevo 4

    ...END ELSE

    PostItemCharge(SalesLine,

    SalesShptLine."Item Shpt. Entry No.",SalesShptLine."Quantity (Base)",

    TempItemChargeAssgntSales."Amount to Assign",

    // Add the following lines.
    TempItemChargeAssgntSales."Qty. to Assign",TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);

    END;



    LOCAL PROCEDURE PostItemChargePerRetRcpt@5810(SalesLine@1000 : Record 37;VAR TotalInvDiscAmtRemaining@1012 : Decimal;VAR TotalQtyRemaining@1013 : Decimal;VAR TotalLineDiscAmtRemaining@1014 : Decimal;VAR TotalLineAmtRemaining@1015 : Decimal);
    // End of the added lines.

    VAR

    ReturnRcptLine@1002 : Record 6661;

    TempItemLedgEntry@1010 : TEMPORARY Record 32;

    ItemTrackingMgt@1009 : Codeunit 6500;
    ...
  3. Cambie el código en la función PostItemChargePerRetRcpt de la codeunit Sales-Post (80) como sigue:
    Código existente 1

    ...AmountToAssign := ROUND(NonDistrAmountToAssign * Factor,GLSetup."Amount Rounding Precision");

    IF Factor < 1 THEN BEGIN

    PostItemCharge(SalesLine,

    TempItemLedgEntry."Entry No.",ABS(TempItemLedgEntry.Quantity),

    // Delete the following line.
    AmountToAssign,QtyToAssign);

    NonDistrQuantity := NonDistrQuantity - ABS(TempItemLedgEntry.Quantity);

    NonDistrQtyToAssign := NonDistrQtyToAssign - QtyToAssign;

    NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time
    ...

    Código nuevo 1

    ...AmountToAssign := ROUND(NonDistrAmountToAssign * Factor,GLSetup."Amount Rounding Precision");

    IF Factor < 1 THEN BEGIN

    PostItemCharge(SalesLine,

    TempItemLedgEntry."Entry No.",ABS(TempItemLedgEntry.Quantity),

    // Add the following lines.
    AmountToAssign,QtyToAssign,TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);
    // End of the added lines.

    NonDistrQuantity := NonDistrQuantity - ABS(TempItemLedgEntry.Quantity);

    NonDistrQtyToAssign := NonDistrQtyToAssign - QtyToAssign;

    NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time
    ...

    Código existente 2

    ...NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time

    PostItemCharge(SalesLine,

    TempItemLedgEntry."Entry No.",ABS(TempItemLedgEntry.Quantity),

    // Delete the following line.
    NonDistrAmountToAssign,NonDistrQtyToAssign);

    UNTIL TempItemLedgEntry.NEXT = 0;

    END ELSE

    PostItemCharge(SalesLine,

    ReturnRcptLine."Item Rcpt. Entry No.",ReturnRcptLine."Quantity (Base)",
    ...

    Código nuevo 2

    ...NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time

    PostItemCharge(SalesLine,

    TempItemLedgEntry."Entry No.",ABS(TempItemLedgEntry.Quantity),

    // Add the following lines.
    NonDistrAmountToAssign,NonDistrQtyToAssign,TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);
    // End of the added lines.

    UNTIL TempItemLedgEntry.NEXT = 0;

    END ELSE

    PostItemCharge(SalesLine,

    ReturnRcptLine."Item Rcpt. Entry No.",ReturnRcptLine."Quantity (Base)",
    ...

    Código existente 3

    ...END ELSE

    PostItemCharge(SalesLine,

    ReturnRcptLine."Item Rcpt. Entry No.",ReturnRcptLine."Quantity (Base)",

    TempItemChargeAssgntSales."Amount to Assign",

    // Delete the following line.
    TempItemChargeAssgntSales."Qty. to Assign")

    END;



    LOCAL PROCEDURE PostAssocItemJnlLine@3(QtyToBeShipped@1000 : Decimal;QtyToBeShippedBase@1001 : Decimal) : Integer;

    VAR
    ...

    Código nuevo 3

    ...END ELSE

    PostItemCharge(SalesLine,

    ReturnRcptLine."Item Rcpt. Entry No.",ReturnRcptLine."Quantity (Base)",

    TempItemChargeAssgntSales."Amount to Assign",

    // Add the following lines.
    TempItemChargeAssgntSales."Qty. to Assign",TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining)
    // End of the added lines.

    END;



    LOCAL PROCEDURE PostAssocItemJnlLine@3(QtyToBeShipped@1000 : Decimal;QtyToBeShippedBase@1001 : Decimal) : Integer;

    VAR
    ...
  4. Cambie el código en la función PostItemCharge de la codeunit Sales-Post (80) como sigue:
    Código existente 1

    ...TempValueEntryRelation.DELETEALL;

    END;

    END;


    // Delete the following line.
    PROCEDURE PostItemCharge@42(SalesLine@1005 : Record 37;ItemEntryNo@1004 : Integer;QuantityBase@1003 : Decimal;AmountToAssign@1002 : Decimal;QtyToAssign@1001 : Decimal);

    VAR

    DummyTrackingSpecification@1000 : Record 336;

    BEGIN

    WITH TempItemChargeAssgntSales DO BEGIN
    ...

    Código nuevo 1

    ...TempValueEntryRelation.DELETEALL;

    END;

    END;


    // Add the following line.
    PROCEDURE PostItemCharge@42(SalesLine@1005 : Record 37;ItemEntryNo@1004 : Integer;QuantityBase@1003 : Decimal;AmountToAssign@1002 : Decimal;QtyToAssign@1001 : Decimal;VAR TotalInvDiscAmtRemaining@1006 : Decimal;VAR TotalQtyRemaining@1007 : Decimal;VAR TotalLineDiscAmtRemaining@1008 : Decimal;VAR TotalLineAmtRemaining@1009 : Decimal);

    VAR

    DummyTrackingSpecification@1000 : Record 336;

    BEGIN

    WITH TempItemChargeAssgntSales DO BEGIN
    ...

    Código existente 2

    ...SalesLine.Amount :=

    CurrExchRate.ExchangeAmtFCYToLCY(

    UseDate,SalesHeader."Currency Code",TotalChargeAmt,SalesHeader."Currency Factor");

    SalesLine."Inv. Discount Amount" := ROUND(

    // Delete the following lines.
    SalesLine."Inv. Discount Amount" / SalesLine.Quantity * QtyToAssign,

    GLSetup."Amount Rounding Precision");
    // End of the deleted lines.

    SalesLine.Amount := ROUND(SalesLine.Amount,GLSetup."Amount Rounding Precision") - TotalChargeAmtLCY;

    IF SalesHeader."Currency Code" <> '' THEN

    TotalChargeAmtLCY := TotalChargeAmtLCY + SalesLine.Amount;

    SalesLine."Unit Cost (LCY)" := ROUND(
    ...

    Código nuevo 2

    ...SalesLine.Amount :=

    CurrExchRate.ExchangeAmtFCYToLCY(

    UseDate,SalesHeader."Currency Code",TotalChargeAmt,SalesHeader."Currency Factor");

    SalesLine."Inv. Discount Amount" := ROUND(

    // Add the following lines.
    TotalInvDiscAmtRemaining / TotalQtyRemaining * QtyToAssign,

    GLSetup."Amount Rounding Precision");

    SalesLine."Line Discount Amount" := ROUND(

    TotalLineDiscAmtRemaining / TotalQtyRemaining * QtyToAssign,

    GLSetup."Amount Rounding Precision");

    SalesLine."Line Amount" := ROUND(

    TotalLineAmtRemaining / TotalQtyRemaining * QtyToAssign,

    GLSetup."Amount Rounding Precision");

    TotalInvDiscAmtRemaining := TotalInvDiscAmtRemaining - SalesLine."Inv. Discount Amount";

    TotalLineDiscAmtRemaining := TotalLineDiscAmtRemaining - SalesLine."Line Discount Amount";

    TotalLineAmtRemaining := TotalLineAmtRemaining - SalesLine."Line Amount";

    TotalQtyRemaining := TotalQtyRemaining - QtyToAssign;

    // End of the added lines.

    SalesLine.Amount := ROUND(SalesLine.Amount,GLSetup."Amount Rounding Precision") - TotalChargeAmtLCY;

    IF SalesHeader."Currency Code" <> '' THEN

    TotalChargeAmtLCY := TotalChargeAmtLCY + SalesLine.Amount;

    SalesLine."Unit Cost (LCY)" := ROUND(
    ...
  5. Cambie el código en las propiedades de thePurch.-Post codeunit (90) como sigue:
    Código existente 1

    ...3:

    ERROR(Text015);

    PurchLine.Type::"Charge (Item)":

    IF Invoice OR ItemChargeAssgntOnly THEN BEGIN

    // Delete the following line.
    ItemJnlRollRndg := FALSE;

    ClearItemChargeAssgntFilter;

    TempItemChargeAssgntPurch.SETCURRENTKEY("Applies-to Doc. Type");

    TempItemChargeAssgntPurch.SETRANGE("Document Line No.",PurchLine."Line No.");

    IF TempItemChargeAssgntPurch.FINDSET THEN
    ...

    Código nuevo 1

    ...3:

    ERROR(Text015);

    PurchLine.Type::"Charge (Item)":

    IF Invoice OR ItemChargeAssgntOnly THEN BEGIN

    // Add the following line.
    ItemJnlRollRndg := TRUE;

    ClearItemChargeAssgntFilter;

    TempItemChargeAssgntPurch.SETCURRENTKEY("Applies-to Doc. Type");

    TempItemChargeAssgntPurch.SETRANGE("Document Line No.",PurchLine."Line No.");

    IF TempItemChargeAssgntPurch.FINDSET THEN
    ...

    Código existente 2

    ...GenJnlLineDocNo := TempItemChargeAssgntPurch."Applies-to Doc. No.";

    CASE TempItemChargeAssgntPurch."Applies-to Doc. Type" OF

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::Receipt:

    BEGIN

    // Delete the following line.
    PostItemChargePerRcpt(PurchLine);

    TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Transfer Receipt":

    BEGIN
    ...

    Código nuevo 2

    ...GenJnlLineDocNo := TempItemChargeAssgntPurch."Applies-to Doc. No.";

    CASE TempItemChargeAssgntPurch."Applies-to Doc. Type" OF

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::Receipt:

    BEGIN

    // Add the following lines.
    PostItemChargePerRcpt(PurchLine,PurchLine."Inv. Discount Amount",

    PurchLine.Quantity,PurchLine."Line Discount Amount",PurchLine."Line Amount");
    // End of the added lines.

    TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Transfer Receipt":

    BEGIN
    ...

    Código existente 3

    ...TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Transfer Receipt":

    BEGIN

    // Delete the following line.
    PostItemChargePerTransfer(PurchLine);

    TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Return Shipment":

    BEGIN
    ...

    Código nuevo 3

    ...TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Transfer Receipt":

    BEGIN

    // Add the following lines.
    PostItemChargePerTransfer(PurchLine,PurchLine."Inv. Discount Amount",

    PurchLine.Quantity,PurchLine."Line Discount Amount",PurchLine."Line Amount");
    // End of the added lines.

    TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Return Shipment":

    BEGIN
    ...

    Código existente 4

    ...TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Return Shipment":

    BEGIN

    // Delete the following line.
    PostItemChargePerRetShpt(PurchLine);

    TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Sales Shipment":

    BEGIN
    ...

    Código nuevo 4

    ...TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Return Shipment":

    BEGIN

    // Add the following lines.
    PostItemChargePerRetShpt(PurchLine,PurchLine."Inv. Discount Amount",

    PurchLine.Quantity,PurchLine."Line Discount Amount",PurchLine."Line Amount");
    // End of the added lines.

    TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Sales Shipment":

    BEGIN
    ...

    5 el código existente

    ...TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Sales Shipment":

    BEGIN

    // Delete the following line.
    PostItemChargePerSalesShpt(PurchLine);

    TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Return Receipt":

    BEGIN
    ...

    Código de reemplazo 5

    ...TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Sales Shipment":

    BEGIN

    // Add the following lines.
    PostItemChargePerSalesShpt(PurchLine,PurchLine."Inv. Discount Amount",

    PurchLine.Quantity,PurchLine."Line Discount Amount",PurchLine."Line Amount");
    // End of the added lines.

    TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Return Receipt":

    BEGIN
    ...

    6 el código existente

    ...TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Return Receipt":

    BEGIN

    // Delete the following line.
    PostItemChargePerRetRcpt(PurchLine);

    TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::Order,

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::Invoice:
    ...

    Código de reemplazo 6

    ...TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Return Receipt":

    BEGIN

    // Add the following lines.
    PostItemChargePerRetRcpt(PurchLine,PurchLine."Inv. Discount Amount",

    PurchLine.Quantity,PurchLine."Line Discount Amount",PurchLine."Line Amount");
    // End of the added lines.

    TempItemChargeAssgntPurch.MARK(TRUE);

    END;

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::Order,

    TempItemChargeAssgntPurch."Applies-to Doc. Type"::Invoice:
    ...
  6. Cambie el código de la función PostItemChargePerRcpt en thePurch.-Post codeunit (90) como sigue:
    Código existente 1

    ...END;

    END;

    END;


    // Delete the following line.
    LOCAL PROCEDURE PostItemChargePerRcpt@5807(PurchLine@1000 : Record 39);

    VAR

    PurchRcptLine@1002 : Record 121;

    TempItemLedgEntry@1003 : TEMPORARY Record 32;

    ItemTrackingMgt@1005 : Codeunit 6500;
    ...

    Código nuevo 1

    ...END;

    END;

    END;


    // Add the following line.
    LOCAL PROCEDURE PostItemChargePerRcpt@5807(PurchLine@1000 : Record 39;VAR TotalInvDiscAmtRemaining@1012 : Decimal;VAR TotalQtyRemaining@1013 : Decimal;VAR TotalLineDiscAmtRemaining@1014 : Decimal;VAR TotalLineAmtRemaining@1015 : Decimal);

    VAR

    PurchRcptLine@1002 : Record 121;

    TempItemLedgEntry@1003 : TEMPORARY Record 32;

    ItemTrackingMgt@1005 : Codeunit 6500;
    ...

    Código existente 2

    ...AmountToAssign := ROUND(NonDistrAmountToAssign * Factor,GLSetup."Amount Rounding Precision");

    IF Factor < 1 THEN BEGIN

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Delete the following line.
    AmountToAssign * Sign,QtyToAssign,PurchRcptLine."Indirect Cost %");

    NonDistrQuantity := NonDistrQuantity - TempItemLedgEntry.Quantity;

    NonDistrQtyToAssign := NonDistrQtyToAssign - QtyToAssign;

    NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time
    ...

    Código nuevo 2

    ...AmountToAssign := ROUND(NonDistrAmountToAssign * Factor,GLSetup."Amount Rounding Precision");

    IF Factor < 1 THEN BEGIN

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Add the following lines.
    AmountToAssign * Sign,QtyToAssign,PurchRcptLine."Indirect Cost %",

    TotalInvDiscAmtRemaining,TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);
    // End of the added lines.

    NonDistrQuantity := NonDistrQuantity - TempItemLedgEntry.Quantity;

    NonDistrQtyToAssign := NonDistrQtyToAssign - QtyToAssign;

    NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time
    ...

    Código existente 3

    ...NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Delete the following line.
    NonDistrAmountToAssign * Sign,NonDistrQtyToAssign,PurchRcptLine."Indirect Cost %");

    UNTIL TempItemLedgEntry.NEXT = 0;

    END ELSE

    ERROR(Text042)

    ELSE
    ...

    Código nuevo 3

    ...NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Add the following lines.
    NonDistrAmountToAssign * Sign,NonDistrQtyToAssign,PurchRcptLine."Indirect Cost %",

    TotalInvDiscAmtRemaining,TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);
    // End of the added lines.

    UNTIL TempItemLedgEntry.NEXT = 0;

    END ELSE

    ERROR(Text042)

    ELSE
    ...

    Código existente 4

    ...PostItemCharge(PurchLine,

    PurchRcptLine."Item Rcpt. Entry No.",PurchRcptLine."Quantity (Base)",

    TempItemChargeAssgntPurch."Amount to Assign" * Sign,

    TempItemChargeAssgntPurch."Qty. to Assign",

    // Delete the following lines.
    PurchRcptLine."Indirect Cost %");

    END;



    LOCAL PROCEDURE PostItemChargePerRetShpt@5811(PurchLine@1000 : Record 39);
    // End of the deleted lines.

    VAR

    ReturnShptLine@1002 : Record 6651;

    TempItemLedgEntry@1010 : TEMPORARY Record 32;

    ItemTrackingMgt@1009 : Codeunit 6500;
    ...

    Código nuevo 4

    ...PostItemCharge(PurchLine,

    PurchRcptLine."Item Rcpt. Entry No.",PurchRcptLine."Quantity (Base)",

    TempItemChargeAssgntPurch."Amount to Assign" * Sign,

    TempItemChargeAssgntPurch."Qty. to Assign",

    // Add the following lines.
    PurchRcptLine."Indirect Cost %",TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);

    END;



    LOCAL PROCEDURE PostItemChargePerRetShpt@5811(PurchLine@1000 : Record 39;VAR TotalInvDiscAmtRemaining@1012 : Decimal;VAR TotalQtyRemaining@1013 : Decimal;VAR TotalLineDiscAmtRemaining@1014 : Decimal;VAR TotalLineAmtRemaining@1015 : Decimal);
    // End of the added lines.

    VAR

    ReturnShptLine@1002 : Record 6651;

    TempItemLedgEntry@1010 : TEMPORARY Record 32;

    ItemTrackingMgt@1009 : Codeunit 6500;
    ...
  7. Cambie el código de la función PostItemChargePerRetShpt en thePurch.-Post codeunit (90) como sigue:
    Código existente 1

    ...AmountToAssign := ROUND(NonDistrAmountToAssign * Factor,GLSetup."Amount Rounding Precision");

    IF Factor < 1 THEN BEGIN

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Delete the following line.
    AmountToAssign * Sign,QtyToAssign,ReturnShptLine."Indirect Cost %");

    NonDistrQuantity := NonDistrQuantity - TempItemLedgEntry.Quantity;

    NonDistrQtyToAssign := NonDistrQtyToAssign - QtyToAssign;

    NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time
    ...

    Código nuevo 1

    ...AmountToAssign := ROUND(NonDistrAmountToAssign * Factor,GLSetup."Amount Rounding Precision");

    IF Factor < 1 THEN BEGIN

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Add the following lines.
    AmountToAssign * Sign,QtyToAssign,ReturnShptLine."Indirect Cost %",TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);
    // End of the added lines.

    NonDistrQuantity := NonDistrQuantity - TempItemLedgEntry.Quantity;

    NonDistrQtyToAssign := NonDistrQtyToAssign - QtyToAssign;

    NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time
    ...

    Código existente 2

    ...NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Delete the following line.
    NonDistrAmountToAssign * Sign,NonDistrQtyToAssign,ReturnShptLine."Indirect Cost %");

    UNTIL TempItemLedgEntry.NEXT = 0;

    END ELSE

    ERROR(Text042)

    ELSE
    ...

    Código nuevo 2

    ...NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Add the following lines.
    NonDistrAmountToAssign * Sign,NonDistrQtyToAssign,ReturnShptLine."Indirect Cost %",TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);
    // End of the added lines.

    UNTIL TempItemLedgEntry.NEXT = 0;

    END ELSE

    ERROR(Text042)

    ELSE
    ...

    Código existente 3

    ...PostItemCharge(PurchLine,

    ReturnShptLine."Item Shpt. Entry No.",-ReturnShptLine."Quantity (Base)",

    ABS(TempItemChargeAssgntPurch."Amount to Assign") * Sign,

    TempItemChargeAssgntPurch."Qty. to Assign",

    // Delete the following lines.
    ReturnShptLine."Indirect Cost %");

    END;



    LOCAL PROCEDURE PostItemChargePerTransfer@23(PurchLine@1000 : Record 39);
    // End of the deleted lines.

    VAR

    TransRcptLine@1002 : Record 5747;

    ItemApplnEntry@1003 : Record 339;

    DummyTrackingSpecification@1001 : Record 336;
    ...

    Código nuevo 3

    ...PostItemCharge(PurchLine,

    ReturnShptLine."Item Shpt. Entry No.",-ReturnShptLine."Quantity (Base)",

    ABS(TempItemChargeAssgntPurch."Amount to Assign") * Sign,

    TempItemChargeAssgntPurch."Qty. to Assign",

    // Add the following lines.
    ReturnShptLine."Indirect Cost %",TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);

    END;



    LOCAL PROCEDURE PostItemChargePerTransfer@23(PurchLine@1000 : Record 39;VAR TotalInvDiscAmtRemaining@1016 : Decimal;VAR TotalQtyRemaining@1017 : Decimal;VAR TotalLineDiscAmtRemaining@1018 : Decimal;VAR TotalLineAmtRemaining@1019 : Decimal);
    // End of the added lines.

    VAR

    TransRcptLine@1002 : Record 5747;

    ItemApplnEntry@1003 : Record 339;

    DummyTrackingSpecification@1001 : Record 336;
    ...
  8. Cambie el código de la función PostItemChargePerTransfer en thePurch.-Post codeunit (90) como se indica a continuación
    Código existente

    ...PurchLine."Bin Code" := '';

    PurchLine."Line No." := "Document Line No.";



    IF TransRcptLine."Item Rcpt. Entry No." = 0 THEN

    // Delete the following line.
    PostItemChargePerITTransfer(PurchLine,TransRcptLine)

    ELSE BEGIN

    TotalAmountToPostFCY := "Amount to Assign";

    IF PurchHeader."Currency Code" <> '' THEN

    TotalAmountToPostLCY :=
    ...

    Código de sustitución

    ...PurchLine."Bin Code" := '';

    PurchLine."Line No." := "Document Line No.";



    IF TransRcptLine."Item Rcpt. Entry No." = 0 THEN

    // Add the following lines.
    PostItemChargePerITTransfer(PurchLine,TransRcptLine,TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining)
    // End of the added lines.

    ELSE BEGIN

    TotalAmountToPostFCY := "Amount to Assign";

    IF PurchHeader."Currency Code" <> '' THEN

    TotalAmountToPostLCY :=
    ...
  9. Cambie el código de la función PostItemChargePerITTransfer en thePurch.-Post codeunit (90) como sigue:
    Código existente 1

    ...END;

    END;

    END;


    // Delete the following line.
    LOCAL PROCEDURE PostItemChargePerITTransfer@43(PurchLine@1000 : Record 39;TransRcptLine@1017 : Record 5747);

    VAR

    TempItemLedgEntry@1016 : TEMPORARY Record 32;

    ItemTrackingMgt@1001 : Codeunit 6500;

    Factor@1023 : Decimal;
    ...

    Código nuevo 1

    ...END;

    END;

    END;


    // Add the following line.
    LOCAL PROCEDURE PostItemChargePerITTransfer@43(PurchLine@1000 : Record 39;TransRcptLine@1017 : Record 5747;VAR TotalInvDiscAmtRemaining@1026 : Decimal;VAR TotalQtyRemaining@1024 : Decimal;VAR TotalLineDiscAmtRemaining@1025 : Decimal;VAR TotalLineAmtRemaining@1030 : Decimal);

    VAR

    TempItemLedgEntry@1016 : TEMPORARY Record 32;

    ItemTrackingMgt@1001 : Codeunit 6500;

    Factor@1023 : Decimal;
    ...

    Código existente 2

    ...AmountToAssign := ROUND(NonDistrAmountToAssign * Factor,GLSetup."Amount Rounding Precision");

    IF Factor < 1 THEN BEGIN

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Delete the following line.
    AmountToAssign,QtyToAssign,0);

    NonDistrQuantity := NonDistrQuantity - TempItemLedgEntry.Quantity;

    NonDistrQtyToAssign := NonDistrQtyToAssign - QtyToAssign;

    NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time
    ...

    Código nuevo 2

    ...AmountToAssign := ROUND(NonDistrAmountToAssign * Factor,GLSetup."Amount Rounding Precision");

    IF Factor < 1 THEN BEGIN

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Add the following lines.
    AmountToAssign,QtyToAssign,0,TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);
    // End of the added lines.

    NonDistrQuantity := NonDistrQuantity - TempItemLedgEntry.Quantity;

    NonDistrQtyToAssign := NonDistrQtyToAssign - QtyToAssign;

    NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time
    ...

    Código existente 3

    ...NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Delete the following line.
    NonDistrAmountToAssign,NonDistrQtyToAssign,0);

    UNTIL TempItemLedgEntry.NEXT = 0;

    END ELSE

    ERROR(Text042);

    END;
    ...

    Código nuevo 3

    ...NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Add the following lines.
    NonDistrAmountToAssign,NonDistrQtyToAssign,0,TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);
    // End of the added lines.

    UNTIL TempItemLedgEntry.NEXT = 0;

    END ELSE

    ERROR(Text042);

    END;
    ...
  10. Cambie el código de la función PostItemChargePerSalesShpt en thePurch.-Post codeunit (90) como sigue:
    Código existente 1

    ...ERROR(Text042);

    END;

    END;


    // Delete the following line.
    LOCAL PROCEDURE PostItemChargePerSalesShpt@41(PurchLine@1000 : Record 39);

    VAR

    SalesShptLine@1002 : Record 111;

    TempItemLedgEntry@1010 : TEMPORARY Record 32;

    ItemTrackingMgt@1009 : Codeunit 6500;
    ...

    Código nuevo 1

    ...ERROR(Text042);

    END;

    END;


    // Add the following line.
    LOCAL PROCEDURE PostItemChargePerSalesShpt@41(PurchLine@1000 : Record 39;VAR TotalInvDiscAmtRemaining@1012 : Decimal;VAR TotalQtyRemaining@1013 : Decimal;VAR TotalLineDiscAmtRemaining@1014 : Decimal;VAR TotalLineAmtRemaining@1015 : Decimal);

    VAR

    SalesShptLine@1002 : Record 111;

    TempItemLedgEntry@1010 : TEMPORARY Record 32;

    ItemTrackingMgt@1009 : Codeunit 6500;
    ...

    Código existente 2

    ...AmountToAssign := ROUND(NonDistrAmountToAssign * Factor,GLSetup."Amount Rounding Precision");

    IF Factor < 1 THEN BEGIN

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Delete the following line.
    AmountToAssign * Sign,QtyToAssign,0);

    NonDistrQuantity := NonDistrQuantity - TempItemLedgEntry.Quantity;

    NonDistrQtyToAssign := NonDistrQtyToAssign - QtyToAssign;

    NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time
    ...

    Código nuevo 2

    ...AmountToAssign := ROUND(NonDistrAmountToAssign * Factor,GLSetup."Amount Rounding Precision");

    IF Factor < 1 THEN BEGIN

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Add the following lines.
    AmountToAssign * Sign,QtyToAssign,0,TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);
    // End of the added lines.

    NonDistrQuantity := NonDistrQuantity - TempItemLedgEntry.Quantity;

    NonDistrQtyToAssign := NonDistrQtyToAssign - QtyToAssign;

    NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time
    ...

    Código existente 3

    ...NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Delete the following line.
    NonDistrAmountToAssign * Sign,NonDistrQtyToAssign,0);

    UNTIL TempItemLedgEntry.NEXT = 0;

    END ELSE

    ERROR(Text042)

    ELSE
    ...

    Código nuevo 3

    ...NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Add the following lines.
    NonDistrAmountToAssign * Sign,NonDistrQtyToAssign,0,TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);
    // End of the added lines.

    UNTIL TempItemLedgEntry.NEXT = 0;

    END ELSE

    ERROR(Text042)

    ELSE
    ...

    Código existente 4

    ...ELSE

    PostItemCharge(PurchLine,

    SalesShptLine."Item Shpt. Entry No.",-SalesShptLine."Quantity (Base)",

    TempItemChargeAssgntPurch."Amount to Assign" * Sign,

    // Delete the following lines.
    TempItemChargeAssgntPurch."Qty. to Assign",0)

    END;



    PROCEDURE PostItemChargePerRetRcpt@37(PurchLine@1001 : Record 39);
    // End of the deleted lines.

    VAR

    ReturnRcptLine@1000 : Record 6661;

    TempItemLedgEntry@1011 : TEMPORARY Record 32;

    ItemTrackingMgt@1010 : Codeunit 6500;
    ...

    Código nuevo 4

    ...ELSE

    PostItemCharge(PurchLine,

    SalesShptLine."Item Shpt. Entry No.",-SalesShptLine."Quantity (Base)",

    TempItemChargeAssgntPurch."Amount to Assign" * Sign,

    // Add the following lines.
    TempItemChargeAssgntPurch."Qty. to Assign",0,TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining)

    END;



    PROCEDURE PostItemChargePerRetRcpt@37(PurchLine@1001 : Record 39;VAR TotalInvDiscAmtRemaining@1012 : Decimal;VAR TotalQtyRemaining@1013 : Decimal;VAR TotalLineDiscAmtRemaining@1014 : Decimal;VAR TotalLineAmtRemaining@1015 : Decimal);
    // End of the added lines.

    VAR

    ReturnRcptLine@1000 : Record 6661;

    TempItemLedgEntry@1011 : TEMPORARY Record 32;

    ItemTrackingMgt@1010 : Codeunit 6500;
    ...
  11. Cambie el código de la función PostItemChargePerRetRcpt en thePurch.-Post codeunit (90) como sigue:
    Código existente 1

    ...AmountToAssign := ROUND(NonDistrAmountToAssign * Factor,GLSetup."Amount Rounding Precision");

    IF Factor < 1 THEN BEGIN

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Delete the following line.
    AmountToAssign * Sign,QtyToAssign,0);

    NonDistrQuantity := NonDistrQuantity - TempItemLedgEntry.Quantity;

    NonDistrQtyToAssign := NonDistrQtyToAssign - QtyToAssign;

    NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time
    ...

    Código nuevo 1

    ...AmountToAssign := ROUND(NonDistrAmountToAssign * Factor,GLSetup."Amount Rounding Precision");

    IF Factor < 1 THEN BEGIN

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Add the following lines.
    AmountToAssign * Sign,QtyToAssign,0,TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);
    // End of the added lines.

    NonDistrQuantity := NonDistrQuantity - TempItemLedgEntry.Quantity;

    NonDistrQtyToAssign := NonDistrQtyToAssign - QtyToAssign;

    NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time
    ...

    Código existente 2

    ...NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Delete the following line.
    NonDistrAmountToAssign * Sign,NonDistrQtyToAssign,0);

    UNTIL TempItemLedgEntry.NEXT = 0;

    END ELSE

    ERROR(Text042)

    ELSE
    ...

    Código nuevo 2

    ...NonDistrAmountToAssign := NonDistrAmountToAssign - AmountToAssign;

    END ELSE // the last time

    PostItemCharge(PurchLine,

    TempItemLedgEntry."Entry No.",TempItemLedgEntry.Quantity,

    // Add the following lines.
    NonDistrAmountToAssign * Sign,NonDistrQtyToAssign,0,TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining);
    // End of the added lines.

    UNTIL TempItemLedgEntry.NEXT = 0;

    END ELSE

    ERROR(Text042)

    ELSE
    ...

    Código existente 3

    ...ELSE

    PostItemCharge(PurchLine,

    ReturnRcptLine."Item Rcpt. Entry No.",ReturnRcptLine."Quantity (Base)",

    TempItemChargeAssgntPurch."Amount to Assign" * Sign,

    // Delete the following line.
    TempItemChargeAssgntPurch."Qty. to Assign",0)

    END;



    LOCAL PROCEDURE PostAssocItemJnlLine@3(QtyToBeShipped@1000 : Decimal;QtyToBeShippedBase@1001 : Decimal) : Integer;

    VAR
    ...

    Código nuevo 3

    ...ELSE

    PostItemCharge(PurchLine,

    ReturnRcptLine."Item Rcpt. Entry No.",ReturnRcptLine."Quantity (Base)",

    TempItemChargeAssgntPurch."Amount to Assign" * Sign,

    // Add the following lines.
    TempItemChargeAssgntPurch."Qty. to Assign",0,TotalInvDiscAmtRemaining,

    TotalQtyRemaining,TotalLineDiscAmtRemaining,TotalLineAmtRemaining)
    // End of the added lines.

    END;



    LOCAL PROCEDURE PostAssocItemJnlLine@3(QtyToBeShipped@1000 : Decimal;QtyToBeShippedBase@1001 : Decimal) : Integer;

    VAR
    ...
  12. Cambie el código de la función PostItemCharge en thePurch.-Post codeunit (90) como sigue:
    Código existente 1

    ...TempValueEntryRelation.DELETEALL;

    END;

    END;


    // Delete the following line.
    LOCAL PROCEDURE PostItemCharge@42(PurchLine@1000 : Record 39;ItemEntryNo@1004 : Integer;QuantityBase@1005 : Decimal;AmountToAssign@1006 : Decimal;QtyToAssign@1007 : Decimal;IndirectCostPct@1008 : Decimal);

    VAR

    DummyTrackingSpecification@1001 : Record 336;

    BEGIN

    WITH TempItemChargeAssgntPurch DO BEGIN
    ...

    Código nuevo 1

    ...TempValueEntryRelation.DELETEALL;

    END;

    END;


    // Add the following line.
    LOCAL PROCEDURE PostItemCharge@42(PurchLine@1000 : Record 39;ItemEntryNo@1004 : Integer;QuantityBase@1005 : Decimal;AmountToAssign@1006 : Decimal;QtyToAssign@1007 : Decimal;IndirectCostPct@1008 : Decimal;VAR TotalInvDiscAmtRemaining@1009 : Decimal;VAR TotalQtyRemaining@1010 : Decimal;VAR TotalLineDiscAmtRemaining@1011 : Decimal;VAR TotalLineAmtRemaining@1012 : Decimal);

    VAR

    DummyTrackingSpecification@1001 : Record 336;

    BEGIN

    WITH TempItemChargeAssgntPurch DO BEGIN
    ...

    Código existente 2

    ...ROUND(

    PurchLine.Amount / QuantityBase,GLSetup."Unit-Amount Rounding Precision");



    PurchLine."Inv. Discount Amount" := ROUND(

    // Delete the following lines.
    PurchLine."Inv. Discount Amount" / PurchLine.Quantity * QtyToAssign,

    GLSetup."Amount Rounding Precision");



    PurchLine."Line Discount Amount" := ROUND(

    PurchLine."Line Discount Amount" / PurchLine.Quantity * QtyToAssign,

    GLSetup."Amount Rounding Precision");
    // End of the deleted lines.

    PostItemJnlLine(

    PurchLine,

    0,0,

    QuantityBase,QuantityBase,
    ...

    Código nuevo 2

    ...ROUND(

    PurchLine.Amount / QuantityBase,GLSetup."Unit-Amount Rounding Precision");



    PurchLine."Inv. Discount Amount" := ROUND(

    // Add the following lines.
    TotalInvDiscAmtRemaining / TotalQtyRemaining * QtyToAssign,

    GLSetup."Amount Rounding Precision");



    PurchLine."Line Discount Amount" := ROUND(

    TotalLineDiscAmtRemaining / TotalQtyRemaining * QtyToAssign,

    GLSetup."Amount Rounding Precision");

    PurchLine."Line Amount" := ROUND(

    TotalLineAmtRemaining / TotalQtyRemaining * QtyToAssign,

    GLSetup."Amount Rounding Precision");

    TotalInvDiscAmtRemaining := TotalInvDiscAmtRemaining - PurchLine."Inv. Discount Amount";

    TotalLineDiscAmtRemaining := TotalLineDiscAmtRemaining - PurchLine."Line Discount Amount";

    TotalLineAmtRemaining := TotalLineAmtRemaining - PurchLine."Line Amount";

    TotalQtyRemaining := TotalQtyRemaining - QtyToAssign;
    // End of the added lines.


    PostItemJnlLine(

    PurchLine,

    0,0,

    QuantityBase,QuantityBase,
    ...


Requisitos previos

Debe tener uno de los siguientes productos instalados para aplicar esta revisión:

  • Microsoft Dynamics NAV 2009 R2

  • Microsoft Dynamics NAV 2009 SP1

Información de eliminación

No se puede quitar este hotfix.

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: Es un artículo "Publicación rápida" creado directamente desde dentro de la organización de soporte técnico de Microsoft. La información contenida en este documento se proporciona como está en respuesta a nuevos problemas. Como consecuencia de la velocidad en la puesta a disposición, los materiales pueden incluir errores tipográficos y podrán revisarse en cualquier momento sin previo aviso. Para obtener información adicional, consulte Condiciones de uso.

¿Necesita más ayuda?

¿Quiere más opciones?

Explore las ventajas de las suscripciones, examine los cursos de aprendizaje, aprenda a proteger su dispositivo y mucho más.

Las comunidades le ayudan a formular y responder preguntas, enviar comentarios y leer a expertos con conocimientos extensos.

¿Le ha sido útil esta información?

¿Cuál es tu grado de satisfacción con la calidad del lenguaje?
¿Qué ha afectado a su experiencia?
Si presiona Enviar, sus comentarios se usarán para mejorar los productos y servicios de Microsoft. El administrador de TI podrá recopilar estos datos. Declaración de privacidad.

¡Gracias por sus comentarios!

×