Sorting Pending Bills

Discussion in 'Tally Developer' started by Gopal Rajbhandari, Dec 4, 2018.

    

  1. Dear Experts

    I tried to sort pending bill by date wise increasing but I could not success. Please help me

    [#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: @@Increasing : $BillDate
     

    Attached Files:



  2. Jenny

    Jenny Active Member


    this code is right..and its working perfect....
     



  3. Code is working, but pending bills are not sorting datewise. You can see the attached picture, where 14 Nov 2017 is coming after 5 Aug 2018. It should come at first.
     


  4. mpal2311

    mpal2311 Active Member


    It is sorting on Name, please re check.
     


  5. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Sort: @@DateIncr : $BillDate
     



  6. Dear Amit Sir

    Sort: @@DateIncr : $BillDate also not working. I tried on release 4.93 and 5.3.8.
    I have attached a picture and my requirement.
     

    Attached Files:



  7. Jenny

    Jenny Active Member


    update your release...its working in 6.3 and 6.4 also
     



  8. Not working in release 6.4 also
     


  9. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Will not work in any version........ i think the dates are getting converted into strings within the collection. Same with amounts.

    In collections, all values become strings..........
     


  10. Chandan Somani

    Chandan Somani New Member


    not working in my case also

    please recommend a solution for this
     


  11. Jay kumar tailor

    Jay kumar tailor Well-Known Member


    Try
    Sort:mad:@Default:$BillDate
     


  12. 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
     


  13. 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