Where i have gone wrong in coding of last sale history?

Discussion in 'Free Source Codes' started by RAJESH KUMAR JAKKA, Oct 6, 2022.

    
Tags:
  1. RAJESH KUMAR JAKKA

    RAJESH KUMAR JAKKA New Member


    Dear Expert,

    Please let me know where i have gone wrong?

    can any one correct my code to get the last sale date of a particular item sold to particular party ? please ?

    [#Line: EI COLUMNONE]
    Add:Right Fields:Before:VCH QtyTitle:LTSDT
    Use: ClnsalesInfo

    [Field:LTSDT]
    Use:DATE FIELD
    Set as:"LAST SALE DATE"
    Width: 12
    Color: BLUE
    Style: NORMAL BOLD
    Align : Right
    Skip : YES
    Set Always: Yes

    [#Line:ei invinfo]
    Add:Right Fields:Before:VCH BilledQty:LTSDT1

    [#Line:ci invinfo]
    Add:Right Field:before: VCH BilledQty:LTSDT1

    [Field:LTSDT1]

    Use : Uni Date Field
    Set As : $Lastsaledate
    Align : Left
    Width:8
    Format : "DATE"
    Type: Date

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

    [System : Formula]
    MydateFltr : $PartyLedgerName = #EIConsignee AND $StockItemName = #VCHStockItem
    Lastsaledate: $$CollectionField:$Date:1:SALESLastDate

    thanks in advance
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Set As : @@Lastsaledate
     


  3. RAJESH KUMAR JAKKA

    RAJESH KUMAR JAKKA New Member


    Dear Amit sir,

    thank you for the help,

    it is showing the last sale date for a party having only one transaction during a period but it is not showing when there are 2 or more transaction for a particular item

    eg: when apple is sold to Mr.A. on 1.4.2022 then it is showing
    but when apple is sold to Mr.A. again on 15.04.2022 then it is not showing

    please help me in this regard sir

     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Cannot understand clearly your problems ..... but from what i gather and assume...... you need dates for each and every stockitem existing in the voucher.......

    then you need to....... in the collection --- walk the Inventory entries --- by Ledname, by Stockname and by date .........
    then give filter formula..... ledname = vchrledname and stockname = vchstockname ........ and use $$FilterValue to get the desired results.
     


  5. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Always try to give SCREENSHOTS with remarks......... so we can understand better.
     


  6. RAJESH KUMAR JAKKA

    RAJESH KUMAR JAKKA New Member


    Dear Amit sir

    please check the following code sir
    and i attached the screen shot also for your guidance to me


    [Field:LTSDT1]

    Use : Uni Date Field
    Set As : @@Lastsaledate
    Align : Left
    Set Always:Yes
    Skip : Yes
    Width:8
    Format : "DATE"
    Type: Date
    [Collection: SALESLastDate]
    Type : Vouchers : VoucherType
    Child Of : $$VchTypeSales
    Belongs To : Yes
    Walk: InventoryEntries
    By : LedNAme : $LedNAme
    By : StockItemName : $StockItemName
    By : VchDate : $VchDate
    Fetch : Date
    Filter : MydateFltr
    Sort : @@Default : -$Date

    [System : Formula]
    MydateFltr : $$IsLedger = #vchrledname AND $$IsStockItem = #VCHStockItem ;and $date = #vchdate
    Lastsaledate: $$CollectionField:$Date:1:SALESLastDate
     

    Attached Files:



  7. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Code:
    [Collection: SALESLastDateVchr]
    Type : Vouchers : VoucherType
    Child Of : $$VchTypeSales
    Sort : Default : -$Date
    
    [Collection: SALESLastDate]
    source collection : SALESLastDateVchr
    Walk         : Inventory Entries
    by : LedgerName : $PartyLedgerName
    by : StockItemName : $StockItemName
    by : Date : $Date
    Compute : reqdt : $Date
       
    [System : Formula]
    MydateFltr : $LedgerName = #EIConsignee AND $StockItemName = #VCHStockItem
    Lastsaledate: $$FilterValue:$reqdt:SALESLastDate:last:MydateFltr
    
     


  8. RAJESH KUMAR JAKKA

    RAJESH KUMAR JAKKA New Member


    Dear Amit Sir,

    thanks for your coding and with this incident i understood that i need to learn a lot,
     


  9. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You ill learn more, better and faster, if you learn from SAMPLE codes that downloads with the Developer and also study similar type of working codes of default tally.
     


  10. RAJESH KUMAR JAKKA

    RAJESH KUMAR JAKKA New Member


    SURE SIR
    THANK YOU
     


Share This Page