Bug Drop Shipment 5.01?

BeliasBelias Member Posts: 2,998
CODEUNIT 414
IF Status = Status::Released THEN
  EXIT;

IF "Document Type" = "Document Type"::Quote THEN
  IF CheckCustomerCreated(TRUE) THEN
    GET("Document Type"::Quote,"No.")
  ELSE
    EXIT;

TESTFIELD("Sell-to Customer No.");

SalesLine.SETRANGE("Document Type","Document Type");
SalesLine.SETRANGE("Document No.","No.");
SalesLine.SETFILTER(Type,'>0');
SalesLine.SETFILTER(Quantity,'<>0');
IF SalesLine.ISEMPTY THEN
  ERROR(Text001,"Document Type","No.");
InvtSetup.GET;
IF InvtSetup."Location Mandatory" THEN BEGIN
  SalesLine.SETRANGE(Type,SalesLine.Type::Item);
  IF SalesLine.FINDSET THEN
    REPEAT
      SalesLine.TESTFIELD("Location Code");
    UNTIL SalesLine.NEXT = 0;
  SalesLine.SETFILTER(Type,'>0');
END;
SalesLine.SETRANGE("Drop Shipment",FALSE);
NotOnlyDropShipment := SalesLine.FINDFIRST;  //if there are only drop shpmt, no records are found
SalesLine.RESET;

SalesSetup.GET;
IF SalesSetup."Calc. Inv. Discount" THEN BEGIN //Note that this happens only with this flag active
  MODIFY;
  CODEUNIT.RUN(CODEUNIT::"Sales-Calc. Discount",SalesLine); //uninitialized SalesLine will be passed to the codeunit below
  GET("Document Type","No.");
END;

IF TestPrepayment(Rec) AND ("Document Type" = "Document Type"::Order) THEN
  Status := Status::"Pending Prepayment"
ELSE
  Status := Status::Released;

SalesLine.SetSalesHeader(Rec);
SalesLine.CalcVATAmountLines(0,Rec,SalesLine,TempVATAmountLine0);
SalesLine.CalcVATAmountLines(1,Rec,SalesLine,TempVATAmountLine1);
SalesLine.UpdateVATOnLines(0,Rec,SalesLine,TempVATAmountLine0);
SalesLine.UpdateVATOnLines(1,Rec,SalesLine,TempVATAmountLine1);

MODIFY(TRUE);

IF NotOnlyDropShipment THEN
  IF "Document Type" IN ["Document Type"::Order,"Document Type"::"Return Order"] THEN
    WhseSalesRelease.Release(Rec);


CODEUNIT 60
SalesLine.COPY(Rec);

TempSalesHeader.GET("Document Type","Document No."); //Error: The Sales Header does not exist. Identification fields and values: Document Type='Quote',No.=''
TemporaryHeader := FALSE;
CalculateInvoiceDiscount(TempSalesHeader,TempSalesLine);

Rec := SalesLine;

AM I MISSING SOMETHING? (sorry for the bad layout of the post...find '//' to see where I commented :mrgreen: )
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog

Answers

  • BeliasBelias Member Posts: 2,998
    Got the :bug: ...it was in 5.00, not 5.01...
    they substituted this line
    IF SalesLine.ISEMPTY THEN
    
    whit this line
    IF SalesLine.FIND('-') THEN
    
    and with solution we are all very happy! =D>
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • AdunAdun Member Posts: 19
    Actually it was replaced with this line:
    IF NOT SalesLine.FIND('-') THEN
    
    Described in MS support article 940425.
Sign In or Register to comment.