party last sales rate and discount in invoice

Discussion in 'Free Source Codes' started by Vivin, Aug 27, 2020.

    
  1. Vivin

    Vivin New Member


    [Collection: Salesvou]

    Type : Vouchers : VoucherType
    Child Of : $$VchTypeSales
    Belongs To : Yes
    Fetch : Date, VoucherTypeName, LedgerName, Voucher Number, Amount,DISCOUNT, MasterID, LedgerEntries.BillAllocations.*

    [Collection: PartyItemRate]

    Source Collection : Salesvou
    Walk : InventoryEntries
    By : MasterID : $..MasterID
    Compute : LedgerName : $..PartyLedgerName
    Compute : VoucherNumber : $..VoucherNumber
    Compute : Amount : $Amount
    Compute : Rate : $Rate
    Compute : DISCOUNT :$DISCOUNT
    Compute : ItemName : $StockItemName
    Sort : @@Default : -$VoucherNumber
    Search Key : $LedgerName+$ItemName

    ;Select $VoucherNumber, $Rate,$DISCOUNT,$ItemName,$LedgerName from PartyItemRate

    [#Field: VCH batch Rate]
    Delete: Set By Condition
    Delete: Set as
    Delete: Inactive
    add:Set As :($$AsRate:$$CollectionFieldByKey:$Rate:mad:StkPartyRt:partyItemRate)
    StkPartyRt:($LedgerEntries[1].LedgerName+$StockItemName)
    Set Always : yes
    [#Field: VCH batch discount]
    Delete: Set By Condition
    Delete: Set as
    Delete: Inactive
    add:Set As :($$AsRate:$$CollectionFieldByKey:$DISCOUNT:mad:StkPartyRt:partyItemRate)
    StkPartyRt:($LedgerEntries[1].LedgerName+$StockItemName)
    Set Always : yes
     


  2. Murari Bajaj

    Murari Bajaj Member


    Last sale Rate.png error relating to StkPartyRt is coming... please
    and if possible whatsapp me on 9829014051
     
    Last edited: Sep 25, 2020


  3. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Your SET AS is wrong.......... please refer to any CollectionFieldByKey formula and learn how it is to be used.
     


  4. Vivin

    Vivin New Member


    check the code
     

    Attached Files:



  5. Murari Bajaj

    Murari Bajaj Member


    Thank you Vivin. It Worked. It was really long awaited for me.
     


  6. Jijo

    Jijo New Member


    sir not seen anywhere in tally...how this activate..and where did i get this option?
     


  7. ashish9374

    ashish9374 New Member


    not fetch last rate only fetch first rate party wise rate not last rate and discount please correct this tdl
     


  8. udaya

    udaya Active Member


    Excellent .... thanks....
     


  9. ankur daga

    ankur daga Member


    Good code vivin. Thanks for sharing... really helpful
     


  10. Ozair Ahmad

    Ozair Ahmad New Member


    Excellent.
     


Share This Page