Report Problem

vijay_gvijay_g Member Posts: 884
Check "Applies-to Doc. No." in "Return Receipt Line" and "Sales Cr.Memo Line" for those posted sales invoice if there are any return in both table then Quantity should be Quantity- Sales Return Quantity.

Comments

  • mkpjsrmkpjsr Member Posts: 587
    edited 2010-09-08
    .
  • mkpjsrmkpjsr Member Posts: 587
    vijay_g wrote:
    Check "Applies-to Doc. No." in "Return Receipt Line" and "Sales Cr.Memo Line" for those posted sales invoice if there are any return in both table then Quantity should be Quantity- Sales Return Quantity.


    There is no reference of "Applies-to Doc. No." in either "Return Receipt Line" or "Sales Cr.Memo Line", so i had written that code.
  • mkpjsrmkpjsr Member Posts: 587
    Hi all,

    I want to design a report to have sales data with the following fields.
    =======================================================
    Item No. Description Quantity Rate Excise Sales TAX Total

    I have designed a report using Sales Invoice Header and Line table and its working also but,
    in case, if we post any Sales return then also the report is showing the Sales return data.
    now i want to modify this report in such a way, so that the report contains only those quantity for which there is no sales return, i.e Quantity should be Quantity- Sales Return Quantity
    .
    Can any body tell me how should i work with Sales Credit Memo to subtract the Sales Return Quantity or should i follow other logic.
  • alok_didaalok_dida Member Posts: 73
    You can do one thing ...
    If you do not want to display record for which Sales Return Quantity is greater than 0 then put this condition on aftergetrecord and just skip this record...
  • mkpjsrmkpjsr Member Posts: 587
    alok_dida wrote:
    You can do one thing ...
    If you do not want to display record for which Sales Return Quantity is greater than 0 then put this condition on aftergetrecord and just skip this record...

    hi, thanx for the reply, actually i do not want to skip the record,
    Suppose I create a Sales Invoice for 10 items and, say 5 items are returned back then the report should show the details of only those 5 Quantity that is not returned back, i.e- Excise Details,Sales tax details , etc.

    I have written the below mentioned code but it is showing some negative value:
    SalesCreditMemoHeader.RESET;
    SalesCreditMemoHeader.SETRANGE(SalesCreditMemoHeader."Applies-to Doc. No.","Document No.");
    IF SalesCreditMemoHeader.FINDFIRST THEN 
       SalesCreditMemoLine.RESET;
       SalesCreditMemoLine.SETRANGE(SalesCreditMemoLine."Document No.",SalesCreditMemoHeader."No.");
        IF SalesCreditMemoLine.FINDFIRST THEN
        SalesCreditMemoLine.SETRANGE(SalesCreditMemoLine."No.","No.");
        
            IF SalesCreditMemoLine.Quantity=Quantity THEN
            CurrReport.SKIP;
            IF SalesCreditMemoLine.FINDFIRST THEN
            BEGIN
            IF Quantity <>  SalesCreditMemoLine.Quantity THEN
            
            FinalQty:=Quantity-SalesCreditMemoLine.Quantity;
            FinalAmount:=Amount-SalesCreditMemoLine.Amount ;
            END
            ELSE
            BEGIN
            FinalQty:=Quantity;
            FinalAmount:=Amount;
            END;
    

    Here i am trying to show the quantity and rate, if for any item there is sales return then the Quantity=Quantity-Sales Return Quantity, otherwise
    Quantity=Quantity

    what is wrong with the code.
  • krikikriki Member, Moderator Posts: 9,086
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • mkpjsrmkpjsr Member Posts: 587
    any suggestion
Sign In or Register to comment.