ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Event Request - Codeunit Sales Price Calc. Mgt. ( FindJobJnlLinePrice )

Open tejabalusu opened this issue 6 years ago • 1 comments

Hi

Required new events in the below function - FindJobJnlLinePrice -- Codeunit -- Sales Price Calc. Mgt.

[External] FindJobJnlLinePrice(VAR JobJnlLine : Record "Job Journal Line";CalledByFieldNo : Integer)
OnBeforeFindJobJnlLinePrice(JobJnlLine);
WITH JobJnlLine DO BEGIN
  SetCurrency("Currency Code","Currency Factor","Posting Date");
  SetVAT(FALSE,0,0,'');
  SetUoM(ABS(Quantity),"Qty. per Unit of Measure");

  CASE Type OF
    Type::Item:
      BEGIN
        Item.GET("No.");
        TESTFIELD("Qty. per Unit of Measure");
        Job.GET("Job No.");
    FindSalesPrice(
      TempSalesPrice,Job."Bill-to Customer No.",Job."Bill-to Contact No.",
      "Customer Price Group",'',"No.","Variant Code","Unit of Measure Code",
      "Currency Code","Posting Date",FALSE);
    CalcBestUnitPrice(TempSalesPrice);
    IF FoundSalesPrice OR
       NOT ((CalledByFieldNo = FIELDNO(Quantity)) OR
            (CalledByFieldNo = FIELDNO("Variant Code")))
    THEN
      "Unit Price" := TempSalesPrice."Unit Price";
    OnAfterFindJobJnlLinePriceItem(JobJnlLine);  // New Event Request
  END;
Type::Resource:
  BEGIN
    Job.GET("Job No.");
    SetResPrice("No.","Work Type Code","Currency Code");
    CODEUNIT.RUN(CODEUNIT::"Resource-Find Price",ResPrice);
    OnAfterFindJobJnlLineResPrice(JobJnlLine,ResPrice);
    ConvertPriceLCYToFCY(ResPrice."Currency Code",ResPrice."Unit Price");
    "Unit Price" := ResPrice."Unit Price" * "Qty. per Unit of Measure";
    OnAfterFindJobJnlLinePriceResource(JobJnlLine);  // New Event Request
  END;'
  END;
  OnAfterFindJobJnlLinePrice(JobJnlLine);  // New Event Request
END;
JobJnlLineFindJTPrice(JobJnlLine);

image

tejabalusu avatar Dec 27 '19 08:12 tejabalusu

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.

bc-ghost avatar Mar 16 '20 10:03 bc-ghost