บรรทัดใบลดหนี้จะไม่รวมอยู่ในสมุดรายวันอินทราสแทตหลังจากที่คุณลงรายการบัญชีใบลดหนี้ชนิด "ค่าธรรมเนียม (สินค้า)" สําหรับใบแจ้งหนี้ที่สร้างขึ้นสําหรับผู้ขายใน EU ในรอบระยะเวลาอื่นใน Microsoft Dynamics NAV 5.0 Service Pack 1 เวอร์ชันภาษาอิตาลี

นำไปใช้กับ
Microsoft Dynamics NAV 5.0

บทความนี้ใช้กับ Microsoft Dynamics NAV สําหรับภาษาอิตาลี (it)

อาการ

สมมติว่า คุณมีใบแจ้งหนี้ที่สร้างขึ้นสําหรับผู้จัดจําหน่ายสหภาพยุโรป (EU) ใน Microsoft Dynamics NAV 5.0 Service Pack 1 (SP1) เวอร์ชันภาษาอิตาลี เมื่อคุณลงรายการบัญชีบันทึกสินเชื่อชนิด ค่าธรรมเนียม (สินค้า) สําหรับอินวอยซ์ในรอบระยะเวลาอื่น บรรทัดบันทึกสินเชื่อจะไม่ถูกรวมในสมุดรายวันอินทราสแทต

การแก้ปัญหา

ข้อมูลโปรแกรมแก้ไขด่วน

โปรแกรมแก้ไขด่วนที่ได้รับการสนับสนุนจาก Microsoft พร้อมใช้งานแล้ว อย่างไรก็ตาม มีไว้เพื่อแก้ไขปัญหาที่อธิบายไว้ในบทความนี้เท่านั้น นําไปใช้กับระบบที่พบปัญหานี้โดยเฉพาะเท่านั้น โปรแกรมแก้ไขด่วนนี้อาจได้รับการทดสอบเพิ่มเติม ดังนั้น ถ้าคุณไม่ได้รับผลกระทบอย่างร้ายแรงจากปัญหานี้ เราขอแนะนําให้คุณรอ Service Pack ถัดไปของ Microsoft Dynamics NAV หรือ Microsoft Dynamics NAV เวอร์ชันถัดไปที่ประกอบด้วยโปรแกรมแก้ไขด่วนนี้

หมายเหตุ ในกรณีพิเศษ ค่าธรรมเนียมสําหรับการโทรติดต่อฝ่ายสนับสนุนตามปกติอาจถูกยกเลิกถ้าผู้เชี่ยวชาญฝ่ายสนับสนุนทางเทคนิคสําหรับ Microsoft Dynamics และผลิตภัณฑ์ที่เกี่ยวข้องระบุว่าการอัปเดตเฉพาะจะแก้ไขปัญหาของคุณได้ ค่าใช้จ่ายในการสนับสนุนปกติจะใช้กับคําถามและปัญหาการสนับสนุนเพิ่มเติมที่ไม่มีคุณสมบัติสําหรับการอัปเดตเฉพาะที่สงสัย

            
          

ข้อมูลการติดตั้ง

Microsoft แสดงตัวอย่างการเขียนโปรแกรมสําหรับภาพประกอบเท่านั้น โดยไม่มีการรับประกันทั้งโดยชัดแจ้งหรือโดยนัย ซึ่งรวมถึงแต่ไม่จํากัดเพียงการรับประกันโดยนัยถึงความสามารถในเชิงพาณิชย์หรือความเหมาะสมสําหรับวัตถุประสงค์เฉพาะ บทความนี้จะถือว่าคุณคุ้นเคยกับภาษาการเขียนโปรแกรมที่กําลังแสดงอยู่ และมีเครื่องมือที่ใช้สําหรับสร้างและแก้ไขจุดบกพร่องของกระบวนการ วิศวกรฝ่ายสนับสนุนของ Microsoft สามารถช่วยอธิบายฟังก์ชันการทํางานของกระบวนการเฉพาะได้ แต่จะไม่ปรับเปลี่ยนตัวอย่างเหล่านี้เพื่อให้มีฟังก์ชันการทํางานที่เพิ่มขึ้นหรือสร้างขั้นตอนต่างๆ เพื่อตอบสนองความต้องการเฉพาะของคุณ

หมายเหตุ ก่อนที่คุณจะติดตั้งโปรแกรมแก้ไขด่วนนี้ ตรวจสอบว่าผู้ใช้ไคลเอนต์ Microsoft Navision ทั้งหมดออกจากระบบ ซึ่งรวมถึงผู้ใช้ไคลเอนต์ Microsoft Navision Application Services (NAS) คุณควรเป็นผู้ใช้ไคลเอนต์เท่านั้นที่เข้าสู่ระบบเมื่อคุณใช้โปรแกรมแก้ไขด่วนนี้

เมื่อต้องการใช้โปรแกรมแก้ไขด่วนนี้

เราขอแนะนําให้ใช้บัญชีผู้ใช้ในหน้าต่าง ล็อกอินของ Windows หรือในหน้าต่าง ล็อกอินของฐานข้อมูล ถูกกําหนด ID บทบาท "SUPER" หากบัญชีผู้ใช้ไม่สามารถกําหนดรหัสบทบาท "SUPER" ได้ คุณต้องตรวจสอบว่าบัญชีผู้ใช้มีสิทธิ์ต่อไปนี้:

  • สิทธิ์ในการปรับเปลี่ยนสําหรับวัตถุที่คุณจะเปลี่ยนแปลง
  • สิทธิ์ Execute สําหรับวัตถุ System Object ID 5210 และสําหรับวัตถุ System Object ID 9015

                
หมายเหตุ คุณไม่มีสิทธิ์ในที่เก็บข้อมูล เว้นแต่คุณจะต้องดําเนินการซ่อมแซมข้อมูล

การเปลี่ยนแปลงโค้ด

หมายเหตุ ทดสอบการแก้ไขรหัสเสมอในสภาพแวดล้อมที่ควบคุมก่อนที่คุณจะนําการแก้ไขไปใช้กับคอมพิวเตอร์การผลิตของคุณ
เมื่อต้องการแก้ไขปัญหานี้ ให้ทําตามขั้นตอนต่อไปนี้:

  1. เปลี่ยนรหัสในหมายเลขสินค้าข้อมูล 2 ในรายงาน รับรายการบัญชีแยกประเภทสินค้า (594) ดังนี้:
    รหัสที่มีอยู่ 1

    ...
    ELSE
    SETRANGE("Entry Type","Entry Type"::Sale);
    
    IntrastatJnlLine2.SETCURRENTKEY("Source Type","Source Entry No.");
    IntrastatJnlLine2.SETRANGE("Source Type",IntrastatJnlLine2."Source Type"::"Item entry");
    ...
    

    รหัสทดแทน 1

    ...
    ELSE
    SETRANGE("Entry Type","Entry Type"::Sale);
    
    // Add the following line.
    IntrastatJnlLine2.SETRANGE("Journal Batch Name",IntrastatJnlBatch.Name);
    
    IntrastatJnlLine2.SETCURRENTKEY("Source Type","Source Entry No.");
    IntrastatJnlLine2.SETRANGE("Source Type",IntrastatJnlLine2."Source Type"::"Item entry");
    ...
    

    รหัสที่มีอยู่ 2

    ...
    END;
    
    OnAfterGetRecord=VAR
    
    // Delete the following lines.
    SalesShipmentLine@1005 : Record 111;
    ReturnReceiptLine@1004 : Record 6661;
    PurchRcptLine@1003 : Record 121;
    ReturnShipmentLine@1002 : Record 6651;
    ServiceShipmentLine@1001 : Record 5991;
    ServiceCrMemoLine@1000 : Record 5995;
    // End of the lines.
    
    PurchInvLine@1130000 : Record 123;
    PurchCrMemoLine@1130001 : Record 125;
    SalesInvoiceLine@1130002 : Record 113;
    ...
    

    รหัสทดแทน 2

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

    รหัสที่มีอยู่ 3

    ...
    SalesCrMemoHeader@1130005 : Record 114;
    PurchInvHeader@1130006 : Record 122;
    PurchCrMemoHdr@1130007 : Record 124;
    
    // Delete the following line.
    SalesShipmentHeader@1130008 : Record 110;
    
    SalesShipLine@1130019 : Record 111;
    ReturnRcptHeader@1130011 : Record 6660;
    DocItemSum@1130013 : Decimal;
    ...
    

    รหัสทดแทน 3

    ...
    SalesCrMemoHeader@1130005 : Record 114;
    PurchInvHeader@1130006 : Record 122;
    PurchCrMemoHdr@1130007 : Record 124;
    SalesShipLine@1130019 : Record 111;
    ReturnRcptHeader@1130011 : Record 6660;
    DocItemSum@1130013 : Decimal;
    ...
    

    รหัสที่มีอยู่ 4

    ...
    IF IntrastatJnlLine2.FINDFIRST OR (CompanyInfo."Country/Region Code" = "Country/Region Code") THEN
    CurrReport.SKIP;
    
    // Delete the following lines.
    CASE TRUE OF
    "Document Type" = "Document Type"::"Sales Shipment":
    IF SalesShipmentLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(SalesShipmentLine."VAT Bus. Posting Group",SalesShipmentLine."VAT Prod. Posting Group") THEN;
    ("Document Type" = "Document Type"::"Sales Return Receipt") OR ("Document Type" = "Document Type"::"Sales Credit Memo"):
    IF ReturnReceiptLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(ReturnReceiptLine."VAT Bus. Posting Group",ReturnReceiptLine."VAT Prod. Posting Group") THEN;
    "Document Type" = "Document Type"::"Purchase Receipt":
    IF PurchRcptLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(PurchRcptLine."VAT Bus. Posting Group",PurchRcptLine."VAT Prod. Posting Group") THEN;
    ("Document Type" = "Document Type"::"Purchase Return Shipment") OR ("Document Type" = "Document Type"::"Purchase Credit Memo"):
    IF ReturnShipmentLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(ReturnShipmentLine."VAT Bus. Posting Group",ReturnShipmentLine."VAT Prod. Posting Group") THEN;
    "Document Type" = "Document Type"::"Service Shipment":
    IF ServiceShipmentLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(ServiceShipmentLine."VAT Bus. Posting Group",ServiceShipmentLine."VAT Prod. Posting Group") THEN;
    "Document Type" = "Document Type"::"Service Credit Memo":
    IF ServiceCrMemoLine.GET("Document No.","Document Line No.") THEN
    IF VATPostingSetup.GET(ServiceCrMemoLine."VAT Bus. Posting Group",ServiceCrMemoLine."VAT Prod. Posting Group") THEN;
    END;
    IF VATPostingSetup."EU Service" THEN
    CurrReport.SKIP;
    
    IF ("Entry Type" = "Entry Type"::Sale) AND
    (SalesShipmentHeader.GET("Document No.")) AND
    (CompanyInfo."Country/Region Code" = SalesShipmentHeader."Bill-to Country/Region Code")
    THEN
    CurrReport.SKIP;
    // End of the lines.
    
    TotalInvoicedQty := 0;
    TotalAmt := 0;
    ...
    

    รหัสทดแทน 4

    ...
    IF IntrastatJnlLine2.FINDFIRST OR (CompanyInfo."Country/Region Code" = "Country/Region Code") THEN
    CurrReport.SKIP;
    
    // Add the following line.
    TestILE("Item Ledger Entry");
    
    TotalInvoicedQty := 0;
    TotalAmt := 0;
    ...
    
  2. เปลี่ยนรหัสในหมายเลขสินค้าข้อมูล 5 ในรายงาน รับรายการบัญชีแยกประเภทสินค้า (594) ดังนี้:
    รหัสที่มีอยู่

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

    รหัสทดแทน

    ...
    {
    }
    }
    
    // Add the following lines.
    { PROPERTIES
    {
    DataItemTable=Table5802;
    DataItemTableView=SORTING(Entry No.);
    OnPreDataItem=BEGIN
    SETRANGE("Posting Date",StartDate,EndDate);
    SETFILTER("Item Charge No.",'<> %1','');
    "Item Ledger Entry".SETRANGE("Posting Date");
    
    IF IntrastatJnlBatch.Type = IntrastatJnlBatch.Type::Purchases THEN
    SETFILTER("Item Ledger Entry Type",'%1|%2', "Item Ledger Entry Type"::Purchase, "Item Ledger Entry Type"::Transfer)
    ELSE
    SETRANGE("Item Ledger Entry Type","Item Ledger Entry Type"::Sale);
    
    IntrastatJnlLine2.SETRANGE("Journal Batch Name",IntrastatJnlBatch.Name);
    IntrastatJnlLine2.SETCURRENTKEY("Source Type","Source Entry No.");
    IntrastatJnlLine2.SETRANGE("Source Type",IntrastatJnlLine2."Source Type"::"Item entry");
    END;
    
    OnAfterGetRecord=BEGIN
    IntrastatJnlLine2.SETRANGE("Source Entry No.","Item Ledger Entry No.");
    IF IntrastatJnlLine2.FINDFIRST THEN
    CurrReport.SKIP;
    
    IF "Item Ledger Entry".GET("Item Ledger Entry No.") THEN BEGIN
    IF ("Item Ledger Entry"."Posting Date" > StartDate) AND ("Item Ledger Entry"."Posting Date" < EndDate) THEN
    CurrReport.SKIP;
    IF "Country/Region".GET("Item Ledger Entry"."Country/Region Code") THEN
    IF "Country/Region"."EU Country/Region Code" = '' THEN
    CurrReport.SKIP;
    TestILE("Item Ledger Entry");
    
    InsertValueEntryLine;
    END;
    END;
    
    }
    SECTIONS
    {
    { PROPERTIES
    {
    SectionType=Body;
    SectionWidth=12000;
    SectionHeight=846;
    }
    CONTROLS
    {
    }
    }
    }
    }
    // End of the lines.
    
    }
    REQUESTFORM
    {
    ...
    
  3. เปลี่ยนรหัสในเอกสารประกอบในรายงาน รับรายการบัญชีแยกประเภทสินค้า (594) ดังนี้:
    รหัสที่มีอยู่

    ...
    IntrastatJnlBatch2.SETRANGE(Type,IntrastatJnlBatch.Type);
    END;
    
    BEGIN
    
    END.
    }
    RDLDATA
    ...
    

    รหัสทดแทน

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

ข้อกำหนดเบื้องต้น

คุณต้องมี Microsoft Dynamics NAV 5.0 Service Pack 1 รุ่นภาษาอิตาลีติดตั้งอยู่เพื่อใช้โปรแกรมแก้ไขด่วนนี้

ลบข้อมูลออก

คุณไม่สามารถลบโปรแกรมแก้ไขด่วนนี้ได้

สถานะ

Microsoft ได้ยืนยันว่านี่เป็นปัญหาที่เกิดขึ้นกับผลิตภัณฑ์ของ Microsoft ที่แสดงไว้ในส่วน "นำไปใช้กับ"

หมายเหตุ นี่คือบทความ "เผยแพร่อย่างรวดเร็ว" ที่สร้างขึ้นโดยตรงจากภายในองค์กรสนับสนุนของ Microsoft ข้อมูลที่อยู่ในที่นี้มีให้เพื่อตอบสนองต่อปัญหาที่เกิดขึ้นใหม่ เนื่องจากความเร็วในการทําให้พร้อมใช้งานวัสดุอาจรวมถึงข้อผิดพลาดในการพิมพ์และอาจได้รับการแก้ไขได้ตลอดเวลาโดยไม่ต้องแจ้งให้ทราบ ดู ข้อตกลงการใช้งาน สําหรับข้อควรพิจารณาอื่นๆ