All type of units total in invoice (compound, simple and alternative)

Discussion in 'Tally Developer' started by ujwlgrg, Jun 3, 2021.

    
  1. ujwlgrg

    ujwlgrg Member


    hello everyone

    I am unit compound units in my invoice and now i want its total quantity on my invoice

    can anyone help??

    Annotation 2021-06-03 182001.jpg

    Now on my invoice i want :
    total number of carton, buckets, drum in one line
    and total KGs and total LTR in other line

    can anyone help what should i write in
    [field: ]
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Not possible...... unless all Items Units are same.........if different, it will not calculate.

    However still possible to total up....but that would be meaningless........ 20Kgs + 5Nos + 50Ltrs = 75 (but no units name)...is totally wrong.

    But you can write a function to total up the different qty and present it in a TEXT format. Sadly Funtions are way out of my league.
     
    ujwlgrg likes this.


  3. balajimg

    balajimg Active Member


    write two collections, one for base unit and another for secondary units
    eg :
    [Collection : MyInvBaseUnit]
    Source Collection : .
    Walk : AllInventoryEntries
    By : BaseUnit : $BaseUnits:StockItem:$StockItemName
    Aggr Compute: Qty : Sum : $BilledQty

    [Collection : MyInvBaseUnitColl]
    Source Collection: MyInvBaseUnit
    Source Var : MyUnt : String : $BaseUnit
    Source Var : Qty : Number : $Qty
    Compute : QtyStr : $$String:##Qty + $$String:" " + $$String:##MyUnt

    [Field : My Base Unit Totals]
    Use : Name Field
    Setas : "No. of Items in units : " + $$LocaleString:$$FullList:MyInvBaseUnitColl:$QtyStr
     
    ujwlgrg likes this.


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    I think he wants.........
    Total No. of Items :- "10Kgs, 55 Ltrs, 12 Doz, 100 Mtrs" or in a seperate line.
    Sum total of all Items in a Invoice ... sorted and totalled unit-wise.
     
    ujwlgrg likes this.


  5. balajimg

    balajimg Active Member


    ;;for base units

    [Collection : MyInvBaseUnit]
    Source Collection : .
    Walk : AllInventoryEntries
    By : BaseUnit : $BaseUnits:StockItem:$StockItemName
    Aggr Compute: Qty : Sum : $BilledQty

    [Collection : MyInvBaseUnitColl]
    Source Collection: MyInvBaseUnit
    Source Var : MyUnt : String : $BaseUnit
    Source Var : Qty : Number : $Qty
    Compute : QtyStr : $$String:##Qty + $$String:" " + $$String:##MyUnt

    ;;==================================================

    ;;for alternate units

    [Collection : MyInvAltUnit]
    Source Collection : .
    Walk : AllInventoryEntries
    By : AltUnit : $AdditionalUnits:StockItem:$StockItemName
    Aggr Compute: Qty : Sum : $BilledQty

    [Collection : MyInvAltUnitColl]
    Source Collection: MyInvAltUnit
    Source Var : MyUnt : String : $AltUnit
    Source Var : Qty : Number : $Qty
    Compute : QtyStr : $$String:##Qty + $$String:" " + $$String:##MyUnt

    ;;==================================================

    ;;for base unit totals

    [Field : My Base Unit Totals]
    Use : Name Field
    Setas : "No. of Items in base units : " + $$LocaleString:$$FullList:MyInvBaseUnitColl:$QtyStr

    ;;for alternate unit totals

    [Field : My Alt Unit Totals]
    Use : Name Field
    Setas : "No. of Items in alternate units : " + $$LocaleString:$$FullList:MyInvAltUnitColl:$QtyStr
     
    Moinuddin, ujwlgrg and Amit Kamdar like this.


  6. balajimg

    balajimg Active Member


    Yes it works the same way
     
    ujwlgrg likes this.


  7. balajimg

    balajimg Active Member



  8. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    That is nice concept..... I have done it in manual mode a year back. (looks inefficient :confused::confused:)

    [System: Formulae]
    NosFilter : $BaseUnits:StockItem:$StockItemName="Nos"
    KgsFilter : $BaseUnits:StockItem:$StockItemName="Kgs"
    DozFilter : $BaseUnits:StockItem:$StockItemName="Dz"
    BagFilter : $BaseUnits:StockItem:$StockItemName="Bag"
    GmsFilter : $BaseUnits:StockItem:$StockItemName="Gms"
    LtrFilter : $BaseUnits:StockItem:$StockItemName="Ltrs"
    MtrFilter : $BaseUnits:StockItem:$StockItemName="Mtr"
    AllQtyTotal : $$String:mad:@QtyTotNos + " " + $$String:mad:@QtyTotKgs + " " + $$String:mad:@QtyTotDoz + " " + $$String:mad:@QtyTotBag + " " + +
    $$String:mad:@QtyTotGms + " " + $$String:mad:@QtyTotLtr + " " + $$String:mad:@QtyTotMtr

    QtyTotNos : If $$IsEmpty:$$FilterQtyTotal:InventoryEntries:NosFilter:$BilledQty Then "" Else $$FilterQtyTotal:InventoryEntries:NosFilter:$BilledQty
    QtyTotKgs : If $$IsEmpty:$$FilterQtyTotal:InventoryEntries:KgsFilter:$BilledQty Then "" Else $$FilterQtyTotal:InventoryEntries:KgsFilter:$BilledQty
    QtyTotDoz : If $$IsEmpty:$$FilterQtyTotal:InventoryEntries:DozFilter:$BilledQty Then "" Else $$FilterQtyTotal:InventoryEntries:DozFilter:$BilledQty
    QtyTotBag : If $$IsEmpty:$$FilterQtyTotal:InventoryEntries:BagFilter:$BilledQty Then "" Else $$FilterQtyTotal:InventoryEntries:BagFilter:$BilledQty
    QtyTotGms : If $$IsEmpty:$$FilterQtyTotal:InventoryEntries:GmsFilter:$BilledQty Then "" Else $$FilterQtyTotal:InventoryEntries:GmsFilter:$BilledQty
    QtyTotLtr : If $$IsEmpty:$$FilterQtyTotal:InventoryEntries:LtrFilter:$BilledQty Then "" Else $$FilterQtyTotal:InventoryEntries:LtrFilter:$BilledQty
    QtyTotMtr : If $$IsEmpty:$$FilterQtyTotal:InventoryEntries:MtrFilter:$BilledQty Then "" Else $$FilterQtyTotal:InventoryEntries:MtrFilter:$BilledQty
    ;QtyTotHrl : If $$IsEmpty:$$FilterQtyTotal:InventoryEntries:HrlFilter:$BilledQty Then "" Else $$FilterQtyTotal:InventoryEntries:HrlFilter:$BilledQty
    ;QtyTotHrlA : If $$IsEmpty:$$FilterQtyTotal:InventoryEntries:HrlFilterA:$BilledQty Then "" Else $$FilterQtyTotal:InventoryEntries:HrlFilterA:$BilledQty
    ;QtyTotQrl : If $$IsEmpty:$$FilterQtyTotal:InventoryEntries:QrlFilter:$BilledQty Then "" Else $$FilterQtyTotal:InventoryEntries:QrlFilter:$BilledQty
     
    ujwlgrg likes this.


  9. balajimg

    balajimg Active Member


    even i used to do the same, one of the customer challenged to have dynamic totals... so came with this concept

    customer is the ultimate teacher ...
     


  10. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Lovely... earlier in LEARN phase, I was more hardcoded ... now I try to implement dynamic, the way Tally does and Experts also do.
     
    ujwlgrg and Devendra_Rawat like this.


  11. Devendra_Rawat

    Devendra_Rawat Well-Known Member

    ujwlgrg likes this.


  12. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Now, when I go through my earlier codes, they make me smile.. "Same smile, which our primary school teacher used to give us ...
    when we used to try to solve maths questions in class.
    o_Oo_O
     
    ujwlgrg and Amit Kamdar like this.


  13. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    LOL.... you might not remember, but I got my first scolding from you in this Forum.....

    Remember the Depreciation code... I had sent to you, you replied back to me to remove non-essential code and being new did not understand, what it means. But after your rectification to my codes, I learned the importance of dynamic code building...... which led me to further improvement on my depreciation code....my first full fledged code..... :p:p:confused::confused:
     
    ujwlgrg and Devendra_Rawat like this.


  14. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    ha ha..

    Scolding ??:):)

    It was not a scolding boss, it was just a request, I didn't know at that time that you were new, otherwise !!!:D:D

    Yes I remember, Later you turned that piece of code into a Master Piece. You know I also appreciate the coding skills, as far as scolding is concerned, it comes from my sincere feelings of improvement in the skills, nothing else. Today I also got the scolding from Rajesh Bhanushali, just after the forum placed me into the category of "Well-Known Member". :rolleyes::rolleyes::D:D
     
    ujwlgrg and Amit Kamdar like this.


  15. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    :cool::cool::cool: With Great Power comes Great Responsibility" - Spiderman's Uncle :D:D:D
     
    Last edited: Jun 4, 2021
    ujwlgrg likes this.


  16. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Yes...I know.........
    A great teacher knows that for each student they teach, they have a petname / nickname ........... Still they persists.....

    ....And so shall we all............;);)
     
    ujwlgrg and Devendra_Rawat like this.


  17. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You, KnSivam, Mauulik, and few others are my inspirations.......

    A few months after that code...I became ADMIN and have been helping others, same as I was helped.

    Of course, I can help only to the limit of my knowledge and also not possible to help all, as too many requests and queries.

    Keep rocking guys........
     
    Bipin Damania likes this.


  18. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    I consider myself as learner only,
    As admin, I note that you have been very helpful to all the members.. In past as you mentioned , Jobimon John, Kurian also have been helpful, presently Teja Verma is doing fantastic job, Taufeeq is also helpful.

    Such members come and go, we would also disappear, new Ones will appear..

    but spirit to help each other and impart your understanding of the subject to others must continue.. at the same time new members should also enhance skills from inside out..

    As my childhood hero Vivekananda points out:

    "You have to grow from the inside out. None can teach you, none can make you spiritual. There is no other teacher but your own soul."
     


  19. Bipin Damania

    Bipin Damania Active Member


    Dear Amitji & Devendraji
    Thanks a lot for your polite conversation...
    We Learn something else other than Tally TDL...
    Really Appreciate All members who devote their Precious Time to Help new comers...

    All the BEST and Stay Safe...
     
    ujwlgrg likes this.


  20. ujwlgrg

    ujwlgrg Member


    Yes sir you are right.
     


  21. ujwlgrg

    ujwlgrg Member



    Indeed : Customer is the ultimate teacher
     


  22. ujwlgrg

    ujwlgrg Member





    Thank you so much sir,
    with your help i m finally able to get all the details.
    But sir this is not giving the correct answers while using Compound unit.

    Please check the image of corrections
     

    Attached Files:



  23. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    For compound Units.... use the Dynamic method thru Collection as given by Mr. Balaji.

    I think that will work.
     
    ujwlgrg likes this.


  24. ujwlgrg

    ujwlgrg Member


    Sir I m not getting the correct values by this

    And I don't know how to use dynamic method
     


  25. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    The solution is given in above post by @balajimg ....you do not need to do anything.
     


Share This Page