Sorting on MfgDate field in Batchwise Stock Transffer

Discussion in 'Free Source Codes' started by Murari Bajaj, Nov 8, 2020.

    
  1. Murari Bajaj

    Murari Bajaj Member


    Dear Experts

    I have added one more field in Collection for MgfDate in Batchwise Stock Transffer Voucher. I want to sort
    this on MfgDate field but unable to do so.
    have tried...

    Sort : @@Default : $MfdOn

    but no avail. Please suggest something.
    Thanks BatchDateSort.jpg
     


  2. Himanshu-2002

    Himanshu-2002 Active Member


    Sir Please Post a sample Code So, Everyone can Help you
     


  3. Murari Bajaj

    Murari Bajaj Member


    [#Field: VCHBATCH Name]
    Delete:Table
    Add: Table:Active Batches VchExtract1,New Number, Not Applicable : NOT $$IsSysName:#SVGodown


    [Collection: Active Batches VchExtract1]

    Title : $$LocaleString:"List of Active Batches"

    SubTitle : $$LocaleString:"Name", @@ExpirySubTitle, $$LocaleString:"Mfg. Date",$$LocaleString:"Balance"

    Parm Var : pvStockItemName : String : $StockItemName
    Source Collection : Batches VchSrc1
    Fetch : Name, Parent, ExpiryPeriod, ActualQty, ClosingBalance, GodownName, ClosingAsondate, MfdOn
    Format : $Name, 10
    Format : $ExpiryPeriod, 8 : Month Ending
    Format : $MfdOn,8
    Format : $ClosingAsondate,8 : "Base"
    Filter : BelongsToSVGodown
    Client Only : Yes
    Keep Source : ....
    Compute : MfdOn : $MfdOn

    Option : ActiveBatchSrcExpl : (@@IsPhysStock OR @@IsRejIn OR @@IsRejOut)
    Filter : BatchBalZero

    ; Sort : @@SortMfgDtIncr : $$Abs:$MfdOn
    Sor : @@Default : $MfdOn

    [System:Formulae]
    BatchBalZero : $ClosingBalance <> 0


    [Collection: Batches VchSrc1]
    Parm Var : pvStockItemName : String : $StockItemName
    Parm Var : pvRepObjDt : Date : $$ReportObject:$Date
    Type : Batch
    Childof : ##pvStockItemName
    Fetch : Name, Parent, ExpiryPeriod, MfdOn,,ClosingBalance, GodownName, ClosingAsOnDate
    Filter : ExpiryDatesFilter, ZeroItemFilter
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    At present ........ in Tally...... collections can be sorted only on the first COLUMN.

    In Tally Prime, you have all options.

    So, in present Tally, if you want to sort on Mfg Date, do the following........
    1. make Mfg Date your first column
    2. Convert the date to yyyymmdd format

    And then you will be able to sort it.

    Regarding above, the solution already exists in this forum, posted by me. So kindly search and implement the same.
     


  5. Murari Bajaj

    Murari Bajaj Member


    Thanks Amitji

    I have changed the Format and put the MfdOn first and it has changed. but i ma unable to change the format to YYYYMMDD
    here... please tell me how to do this.... i am trying for very long on this...

    And i had just seen the comment by you on the subject in the forum... but the same solution was there
     


  6. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Search for $$YYYYMMDDDateFormat in Developer........... and understand the same and implement it,
     


  7. Murari Bajaj

    Murari Bajaj Member


    Yes have searched this and tried various ways but could not
    Please tell me where to put this...$$YYYYMMDDDateFormat in Collection table.

    I mean where should i put this in my above Code.
     


  8. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    In your collection..........

    Format : ............................................
     


  9. Murari Bajaj

    Murari Bajaj Member


    Thanks sir it Worked

    Format : $$YYYYMMDDDateFormat:$MfdOn:"-",10

    Thank you very much.
     


  10. Murari Bajaj

    Murari Bajaj Member


    Dear Amit sir a new problem arrived in this....
    after amking the MfgDate column First.... the Batch Name field is selection is by Batch name but takes MfgDate as Batch Name value in the field....
    Any solution...
    Set As :...... tried but failed.... if we change Set As: .... still it takes MfgDate....
     

    Attached Files:



  11. Murari Bajaj

    Murari Bajaj Member



  12. Amit Kamdar

    Amit Kamdar Administrator Staff Member



  13. Murari Bajaj

    Murari Bajaj Member


    Dear Amitji

    I tried but its not working.

    Please give another solution.... so that second OR another column of the Table can be
    value for field.

    Thanks
     
    Last edited: Nov 8, 2020


  14. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    How you expect me to check, when there is no code....show your final code, so we can understand.
     


  15. Murari Bajaj

    Murari Bajaj Member


    [#Field: VCHBATCH Name]
    Delete:Table
    Add: Table:Active Batches VchExtract1,New Number, Not Applicable : NOT $$IsSysName:#SVGodown


    [Collection: Active Batches VchExtract1]

    Title : $$LocaleString:"List of Active Batches"

    SubTitle : $$LocaleString:"Name", @@ExpirySubTitle, $$LocaleString:"Mfg. Date",$$LocaleString:"Balance"

    Parm Var : pvStockItemName : String : $StockItemName
    Source Collection : Batches VchSrc1
    Fetch : Name, Parent, ExpiryPeriod, ActualQty, ClosingBalance, GodownName, ClosingAsondate, MfdOn
    Format : $Name, 10
    Format : $ExpiryPeriod, 8 : Month Ending
    Format : $$YYYYMMDDDateFormat:$MfdOn:"-",10
    ;Format : $MfdOn,8
    Format : $ClosingAsondate,8 : "Base"
    Filter : BelongsToSVGodown
    Client Only : Yes
    Keep Source : ....
    Compute : MfdOn : $MfdOn

    Option : ActiveBatchSrcExpl : (@@IsPhysStock OR @@IsRejIn OR @@IsRejOut)
    Filter : BatchBalZero

    ; Sort : @@SortMfgDtIncr : $$Abs:$MfdOn
    Sor : @@Default : $MfdOn

    [System:Formulae]
    BatchBalZero : $ClosingBalance <> 0


    [Collection: Batches VchSrc1]
    Parm Var : pvStockItemName : String : $StockItemName
    Parm Var : pvRepObjDt : Date : $$ReportObject:$Date
    Type : Batch
    Childof : ##pvStockItemName
    Fetch : Name, Parent, ExpiryPeriod, MfdOn,,ClosingBalance, GodownName, ClosingAsOnDate
    Filter : ExpiryDatesFilter, ZeroItemFilter
     


  16. Murari Bajaj

    Murari Bajaj Member


    The above is the final code.
     


  17. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You said earlier, you tried to SET AS and not working............where is that???
     


  18. Murari Bajaj

    Murari Bajaj Member


    Tried but not worked so deleted.
    Changed default fields Set as to $Name but not worked
     


  19. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    in VCHBATCHNAME there are 4 options......... which option is applicable to your data....?? According to that you would have to put your SET AS.

    Also in some of the OPTION there are further OPTIONS based on Order/Godown etc...depends on what features you have activated in your company..........

    According to that, you will have to focus on that relevant field.
     


  20. Murari Bajaj

    Murari Bajaj Member



Share This Page