Help on Sort command not working in "Pending Bills Collection" (Bill Wise Collection)

Discussion in 'Tally Developer' started by kishan_raval, May 4, 2019.

    
  1. kishan_raval

    kishan_raval Member


    Dear Developers,
    I want closing balance wise sorting, i have added the sort command but nothing happened, even i tried with $BillDate wise & $$Name wise also, they all not working,
    please help, thanks in advance
    the code is below

    [#Collection: Pending Bills]

    Title : $$LocaleString:"Pending Bills"
    Sub Title : $$LocaleString:"Name", $$LocaleString:"Date", $$LocaleString:"Balance"
    Source Collection : Pending Bills SRC
    Fetch : Name, BillDate, BillCreditPeriod, OpeningBalance, BaseOpening, BaseClosing, FinalBalance
    Unique : $$Name
    Format : $$Name, 14
    Format : $BillDate, 8 : Universal Date
    Format : $BaseClosing : "AllSymbols, DrCr"
    Client Only : Yes
    Keep Source : ... ;; Keep the source at Bill allocations subform Level

    Sort : @@Default : $BaseClosing
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Sort won't work for Amount/Date in Collections. (all except strings)
     


  3. kishan_raval

    kishan_raval Member


    but $billdate wise also not working, can you do something about that, please
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You must read my remarks carefully..... I had said "Sort won't work for Amount/Date in Collections. (all except strings)" , So obviously date is also covered under my remarks.

    There is a workaround solution.......... you can convert date into "yyyymmdd" string format and then sort.........
     


  5. kishan_raval

    kishan_raval Member


    i wanted to write $$Name wise also not working, but instead i wrote $BillDate, sorry for that
    as you are saying only strings type sort will work, $$Name is string type, but it's not working,
    in collection it shows current year's bills first & then prev year's, but i want prev year's bills first & then the new one,
    so, please do you how i can do that
     


  6. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    For your information....... note the double $$ ..... which means it is a function............. not a Name......

    Long before I knew TDL.......... i used to apply simple logic................ In all bill references I started with 2015/001, 2015/002 and so on.... in this manner I always got it chronological order.
     


  7. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Put this in the collection..........then sort it by billdate

    Add : Format : $$YYYYMMDDDateFormat:$BillDate:"-", 10 : Universal Date
     


  8. Jenny

    Jenny Active Member


    [#Collection: Pending Bills]
    Sub Title: $$LocaleString:"Name", $$LocaleString:"Date", $$LocaleString:"Balance"
    Delete : Format
    FullHeight : Yes
    Add : Format : $$Name, 30
    Add : Format : $BillDate, 10 : Universal Date
    Add : Format : $BaseClosing,12 : "AllSymbols, DrCr"
    Delete: Sort
    Sort: @@DateIncr : $BillDate
     


  9. kishan_raval

    kishan_raval Member


    thanks for the reply, but
    none of the above solution is working, please do check at your side & give me another solution if you have
     


  10. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    It is working fine........... If not working for you, obviously you have done something wrong somewhere...........

    See below photos of..... before and after..........

    1Capture.PNG

    2Capture.PNG
     


  11. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    It is working fine........... If not working for you, obviously you have done something wrong somewhere...........

    See below photos of..... before and after..........

    View attachment 5082

    View attachment 5083
     


  12. Chandan Somani

    Chandan Somani New Member


    according to this photo i added date earlier before Name of voucher (ref)
    but after pressing enter on selecting bill it returns date value and not the voucher name (ref)
     


  13. Chandan Somani

    Chandan Somani New Member


    is there any way to return second field of the collection?
     


  14. RajbhandariGopal

    RajbhandariGopal New Member


    Yes, I also want to return second field from the sorted collection.
     


  15. hiteshhkj

    hiteshhkj Member



    use
    Sort : @@Default : $$Date:$BillDate
     


  16. hiteshhkj

    hiteshhkj Member



    Sort : @@Default : $$Date:$BillDate
     


  17. hiteshhkj

    hiteshhkj Member



    try this (this will done finally)

    [#Collection: Pending Bills]
    Sub Title: $$LocaleString:"Name", $$LocaleString:"Date", $$LocaleString:"Balance", $$LocaleString:"Date Number"

    Delete : Format
    FullHeight : Yes
    Align : Right
    Add: Format : $$Name, 14
    Add: Format : $BillDate, 8 : Universal Date
    Add: Format : $BaseClosing : "AllSymbols, DrCr"
    Add: Format : $FinalDateNumbers



    [system : formula]
    FormulaMonth : If $$MonthOfDate:$BillDate <=2 then $$MonthOfDate:$BillDate+13 else $$MonthOfDate:$BillDate+1
    FormulaYear : If $$MonthOfDate:$BillDate <=2 then $$YearOfDate:$BillDate-1 else $$YearOfDate:$BillDate
    FormulaDay : $$DayOfDate:$BillDate
    FormulaDateToNum : (1461*$FormulaYear)/4+(153*$FormulaMonth)/5+$FormulaDay ;;;(146097*$FormulaYear)/400+(153*$FormulaMonth+8)/5+$FormulaDay
    FinalDateNumbers : $$Round:$FormulaDateToNum:1


    [#Line: VCHBILL MainLine]
    Add : Field : Before : VCHBILL Name : VCHBILL NameTemp

    [Field : VCHBILL NameTemp]
    Use : Name field
    Set As : If not $$InCreateMode Then $$Table:VCHBILLNameTemp:$Name else $$Value
    Table : MyNewBillColl : $$InCreateMode
    Table : MyNewBillColl, BillRefBlankColl : not $$InCreateMode
    Show Table : Always
    Set Always : Yes
    Dynamic : ""
    Width : @@VCHShortNameWidth




    [#Field: VCHBILL Name]
    Set As : If not $$IsEmpty:#VCHBILLNameTemp then $$Table:VCHBILLNameTemp:$Name else $$ExclEvaluate:$$FnSetBillName



    [Collection : BillRefBlankColl]
    Title : "Blank"
    List Name : " "


    [Collection : MyNewBillColl]
    Use : Pending Bills
    Delete : Sub Title
    Add : Sub Title: $$LocaleString:"Date Number", $$LocaleString:"Name", $$LocaleString:"Date", $$LocaleString:"Balance"
    Delete : Format
    FullHeight : Yes
    Add : Format : $FinalDateNumbers, 10 ;;FinalDateNumbers, 10
    Add : Format : $$Name, 14
    Add : Format : $BillDate, 8 : Universal Date
    Add : Format : $BaseClosing : "AllSymbols, DrCr"
    Client Only : Yes
    Keep Source : ...

    Option : ShowBillFnlBlnc : ##VchShowBillFnlBlnc

    Delete : Sort
    Add : Sort : @@default : $FinalDateNumbers, $$Number:$Name





    [#Line: VCHBILL CTLineOne]
    Local : Field : VCH ShortTitle : Width : @@VCHShortNameWidth*2


    [#Line: VCHBILL CTLineTwo]
    Local : Field : VCH ShortTitle : Width : @@VCHShortNameWidth*2


    [#Line: VCHBILL CTLineThree]
    Local : Field : VCH ShortTitle : Width : @@VCHShortNameWidth*2
     


Share This Page