How to Get Last Sales Date in Report.

Discussion in 'Free Source Codes' started by VISHNU RATHI, Jun 12, 2021.

    
  1. VISHNU RATHI

    VISHNU RATHI Member


    Dear Members,

    I am new to coding world,
    Made a report in which i need last sales date of respective ledgers,

    Regards

    Code is

    [#Menu:Gateway of Tally]
    Add:Item:Before:mad:@locquit:partywise Last Sales Date:Display:LastSalesMyParty

    [Report:LastSalesMyParty]
    Form:LastSalesMyParty

    [Form:LastSalesMyParty]
    Part:LastSalesMyParty
    Width:100% screen
    Height:100% screen

    [Part:LastSalesMyParty]
    Line:LastSalesMyPartyt,LastSalesMyParty
    Repeat:LastSalesMyParty:mysalescollnew
    Scroll:Vertical

    [Line:LastSalesMyPartyt]
    Use:LastSalesMyParty
    Local:Field:LastSalesMyPartysno:Info:"S. No."
    Local:Field:LastSalesMyParty:Info:"Party Name"
    Local:Field:LastSalesMyPartydate:Info:"Last Sales Date"

    [Line:LastSalesMyParty]
    Field:LastSalesMyPartysno,LastSalesMyParty,LastSalesMyPartydate
    Local:Field:default:Border:thin box

    [Field:LastSalesMyPartyDate]
    Use:Uni Date Field
    Set as: "";;;;;Here Need to get last sales voucher date for party.
    Width:10% Screen

    [Field:LastSalesMyPartysno]
    Use: Number Field
    Set as:$$Line

    [Field:LastSalesMyParty]
    Use:Name Field
    Width:25% Screen
    Set as:$Name

    [Collection:mysalescollnew]
    Type : Ledger
    Belongs To:Yes
    Child Of:$$GroupSundryDebtors
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Similar query already solved before.........

    Search for Last Purchase Date and Last Receipt date and follow the same exmaple.
     


  3. VISHNU RATHI

    VISHNU RATHI Member


    I have searched for that sir,
    but primary collection in that is voucher, and mine is Ledger.
    your guidance will help sir.
    I will try to see again those similar quires and try.

    Regards
    Vishnu
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Primary has to be LEDGER ---- your collection is correct.

    Secondary has to be Voucher Collection to compute the required value i.e. date....
    Secondary collection will collect all vouchers of sales.... walk through the entries and extract the DATE.

    If you care to see the above two referred solution, you will understand.
     


  5. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    To extract the value, you need to use CollectionField or CollectionFieldByKey functions..........

    Just find the threads, where the solutions has been provided and learn from that...how it has been used. You need to do the same thing.
     


  6. VISHNU RATHI

    VISHNU RATHI Member


    Got It sir,
    Thankyou for your guidance.


    [Collection: PurchaseLastDate]
    Type : Vouchers : VoucherType
    Child Of : $$VchTypeSales
    Belongs To : Yes
    Fetch : Date
    Filter : MyPartyFltr
    Sort : Default : -$Date

    [System : Formula]
    MyPartyFltr : $PartyLedgerName = #LastSalesMyParty
    LastRecdate: $$CollectionField:$Date:1:purchaseLastDate

    This worked.
     


  7. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    very good.... and hope you learned from this..........
     
    VISHNU RATHI likes this.


Share This Page