Bỏ qua để tới nội dung chính
Đăng nhập với Microsoft
Đăng nhập hoặc tạo một tài khoản.
Xin chào,
Chọn một tài khoản khác.
Bạn có nhiều tài khoản
Chọn tài khoản bạn muốn đăng nhập.

Giảm giá phí mục được gán cho bán hàng không được cung cấp theo lựa chọn đã chọn mục nhập giá trị tương ứng trong Microsoft Dynamics NAV 2009. Làm theo các bước trong phần thay đổi mã để giải quyết vấn đề này. Sự cố này xảy ra trong các sản phẩm sau:

  • Microsoft Dynamics NAV 2009 R2

  • Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)

Giải pháp

Thông tin về cập nhật nóng

Microsoft hiện đã cung cấp bản cập nhật nóng được hỗ trợ. Tuy nhiên, nó chỉ được dùng để khắc phục sự cố được mô tả trong bài viết này. Áp dụng cho các hệ thống đang gặp sự cố cụ thể này. Hotfix này có thể được kiểm tra thêm. Vì vậy, nếu bạn không bị ảnh hưởng bởi sự cố này, chúng tôi khuyến nghị bạn đợi cho gói dịch vụ tiếp theo của Microsoft Dynamics NAV 2009 hoặc phiên bản Microsoft Dynamics NAV tiếp theo có chứa hotfix này.

Lưu ý Trong trường hợp đặc biệt, chi phí thường phát sinh để hỗ trợ cuộc gọi có thể được hủy bỏ nếu chuyên viên hỗ trợ kỹ thuật cho Microsoft Dynamics và sản phẩm liên quan xác định rằng một Cập Nhật cụ thể sẽ giải quyết vấn đề của bạn. Chi phí hỗ trợ thông thường sẽ áp dụng cho các vấn đề không phù hợp với bản Cập Nhật cụ thể trong câu hỏi và câu hỏi hỗ trợ bổ sung.

Thông tin cài đặt

Microsoft cung cấp mô hình lập trình để minh hoạ, không bảo hành hoặc rõ ràng hay ngụ ý. Điều này bao gồm, nhưng không giới hạn ở các bảo đảm cho một mục đích cụ thể hoặc sự. Bài viết này giả định rằng bạn đã quen với ngôn ngữ lập trình đang được giải thích và các công cụ được sử dụng để tạo và quy trình gỡ lỗi. Các kỹ sư hỗ trợ Microsoft có thể giúp giải thích các chức năng của một quy trình cụ thể. Tuy nhiên, họ sẽ không sửa đổi các ví dụ để cung cấp thêm chức năng hoặc xây dựng quy trình nhằm đáp ứng các yêu cầu cụ thể của bạn.

Lưu ý Trước khi cài đặt hotfix này, xác minh rằng tất cả người dùng máy khách Microsoft Dynamics NAV đã đăng xuất hệ thống. Điều này bao gồm dịch vụ Microsoft Dynamics NAV ứng dụng máy chủ (NAS). Bạn nên khách hàng chỉ người được đăng nhập khi bạn áp dụng hotfix này.

Để áp dụng hotfix này, bạn phải có giấy phép nhà phát triển.

Chúng tôi khuyên bạn nên tài khoản người dùng trong cửa sổ thông tin đăng nhập Windows hoặc trong cửa sổ thông tin đăng nhập cơ sở dữ liệu được gán vai trò "Siêu" của bạn. Nếu tài khoản người dùng không thể gán vai trò "SUPER" ID, bạn phải xác minh rằng tài khoản người dùng có các quyền sau đây:

  • Thay đổi quyền cho các đối tượng mà bạn sẽ thay đổi.

  • Quyền thực thi các đối tượng hệ thống đối tượng ID 5210 và hệ thống đối tượng ID 9015

    đối tượng.

Lưu ý Bạn không cần phải có quyền để lưu trữ dữ liệu nếu bạn phải tiến hành sửa chữa dữ liệu.

Thay đổi mã

Lưu ý Luôn kiểm tra mã khắc phục trong một môi trường được kiểm soát trước khi bạn áp dụng bản vá để sản xuất máy tính của bạn.

Để khắc phục sự cố này, hãy làm theo các bước sau:

  1. Thay đổi mã trong thuộc tính trong codeunit bán hàng bài (80) như sau:
    Hiện có mã 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
    ...

    Thay thế mã 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
    ...

    Hiện có mã 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
    ...

    Thay thế mã 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
    ...

    Mã hiện 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:
    ...

    Thay thế mã 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. Thay đổi mã trong hàm PostItemChargePerShpt codeunit bán hàng bài (80) như sau:
    Hiện có mã 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;
    ...

    Thay thế mã 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;
    ...

    Hiện có mã 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
    ...

    Thay thế mã 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
    ...

    Mã hiện 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)",
    ...

    Thay thế mã 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)",
    ...

    Mã hiện 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;
    ...

    Thay thế mã 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. Thay đổi mã trong hàm PostItemChargePerRetRcpt codeunit bán hàng bài (80) như sau:
    Hiện có mã 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
    ...

    Thay thế mã 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
    ...

    Hiện có mã 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)",
    ...

    Thay thế mã 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)",
    ...

    Mã hiện 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
    ...

    Thay thế mã 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. Thay đổi mã trong hàm PostItemCharge codeunit bán hàng bài (80) như sau:
    Hiện có mã 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
    ...

    Thay thế mã 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
    ...

    Hiện có mã 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(
    ...

    Thay thế mã 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. Thay đổi mã trong thuộc tính trong thePurch-đăng codeunit (90) như sau:
    Hiện có mã 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
    ...

    Thay thế mã 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
    ...

    Hiện có mã 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
    ...

    Thay thế mã 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
    ...

    Mã hiện 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
    ...

    Thay thế mã 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
    ...

    Mã hiện 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
    ...

    Thay thế mã 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
    ...

    Hiện có mã 5

    ...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
    ...

    Thay thế mã 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
    ...

    Mã hiện 6

    ...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:
    ...

    Thay thế mã 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. Thay đổi mã trong hàm PostItemChargePerRcpt thePurch.-đăng codeunit (90) như sau:
    Hiện có mã 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;
    ...

    Thay thế mã 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;
    ...

    Hiện có mã 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
    ...

    Thay thế mã 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
    ...

    Mã hiện 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
    ...

    Thay thế mã 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
    ...

    Mã hiện 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;
    ...

    Thay thế mã 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. Thay đổi mã trong hàm PostItemChargePerRetShpt thePurch.-đăng codeunit (90) như sau:
    Hiện có mã 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
    ...

    Thay thế mã 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
    ...

    Hiện có mã 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
    ...

    Thay thế mã 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
    ...

    Mã hiện 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;
    ...

    Thay thế mã 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. Thay đổi mã trong hàm PostItemChargePerTransfer thePurch.-đăng codeunit (90) như sau
    Mã hiện tại

    ...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 :=
    ...

    Thay thế mã

    ...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. Thay đổi mã trong hàm PostItemChargePerITTransfer thePurch.-đăng codeunit (90) như sau:
    Hiện có mã 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;
    ...

    Thay thế mã 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;
    ...

    Hiện có mã 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
    ...

    Thay thế mã 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
    ...

    Mã hiện 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;
    ...

    Thay thế mã 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. Thay đổi mã trong hàm PostItemChargePerSalesShpt thePurch.-đăng codeunit (90) như sau:
    Hiện có mã 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;
    ...

    Thay thế mã 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;
    ...

    Hiện có mã 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
    ...

    Thay thế mã 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
    ...

    Mã hiện 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
    ...

    Thay thế mã 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
    ...

    Mã hiện 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;
    ...

    Thay thế mã 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. Thay đổi mã trong hàm PostItemChargePerRetRcpt thePurch.-đăng codeunit (90) như sau:
    Hiện có mã 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
    ...

    Thay thế mã 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
    ...

    Hiện có mã 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
    ...

    Thay thế mã 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
    ...

    Mã hiện 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
    ...

    Thay thế mã 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. Thay đổi mã trong hàm PostItemCharge thePurch.-đăng codeunit (90) như sau:
    Hiện có mã 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
    ...

    Thay thế mã 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
    ...

    Hiện có mã 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,
    ...

    Thay thế mã 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,
    ...


Điều kiện tiên quyết

Bạn phải có một trong các sản phẩm được cài đặt để áp dụng hotfix này:

  • Microsoft Dynamics NAV 2009 R2

  • Microsoft Dynamics NAV 2009 SP1

Thông tin về việc loại bỏ

Bạn không thể xoá hotfix này.

Trạng thái

Microsoft đã xác nhận rằng đây là sự cố trong sản phẩm của Microsoft được liệt kê trong phần "Áp dụng cho".

Lưu ý Đây là một bài viết "XUẤT BẢN NHANH" được tạo trực tiếp từ trung tâm hỗ trợ của Microsoft. Thông tin này được cung cấp-trả lời cho các vấn đề mới xuất hiện. Vì nhanh chóng có sẵn, các tài liệu có thể bao gồm lỗi và có thể được sửa đổi bất kỳ lúc nào mà không cần thông báo. Xem Điều khoản sử dụngđể xem xét khác.

Bạn cần thêm trợ giúp?

Bạn muốn xem các tùy chọn khác?

Khám phá các lợi ích của gói đăng ký, xem qua các khóa đào tạo, tìm hiểu cách bảo mật thiết bị của bạn và hơn thế nữa.

Cộng đồng giúp bạn đặt và trả lời các câu hỏi, cung cấp phản hồi và lắng nghe ý kiến từ các chuyên gia có kiến thức phong phú.

Thông tin này có hữu ích không?

Bạn hài lòng đến đâu với chất lượng dịch thuật?
Điều gì ảnh hưởng đến trải nghiệm của bạn?
Khi nhấn gửi, phản hồi của bạn sẽ được sử dụng để cải thiện các sản phẩm và dịch vụ của Microsoft. Người quản trị CNTT của bạn sẽ có thể thu thập dữ liệu này. Điều khoản về quyền riêng tư.

Cảm ơn phản hồi của bạn!

×