Dear Team, Please help me to get Total of extra quanity

Discussion in 'Tally Developer' started by Dilip S H, Dec 5, 2023.

    
  1. Dilip S H

    Dilip S H Member


    Dear Team,
    Please find the below code, and requets you to kindly help me to get total qty of Quanity2

    [#Line: EI ColumnOne]
    Option :Enable WeightDetails :mad:@SetExtraQty

    [!Line:Enable WeightDetails]
    Add : Right Field : At beginning : WeightTTL,MKHPErTTL
    Local : Field : VCH RateTitle : Invisible :yes
    Add : Right Field : After : VCH QtyTitle :ExtraRateTTL

    [Field:WeightTTL]
    Info : "Quanity 2"
    Width : 10
    Style : Small bold

    [Field:MKHPErTTL]
    Info : "Per"
    Width : 5
    Style : Small bold



    [Field:ExtraRateTTL]
    Info : "Rate"
    Width : 10
    Style : Small bold
    Align : Center

    ;;================================================
    [#Line:EI InvInfo]
    Option : Enable InvWeightInfo :mad:@SetExtraQty

    [!Line:Enable InvWeightInfo]
    Add : Right Field : At beginning : MKHWeightFLd1,MKHperFld1
    Local : Field : VCH Rate : Invisible:yes
    Add : Right Field : After : VCH BilledQty:ExtraRate upload_2023-12-5_1-49-36.png

    [Field:MKHWeightFLd]
    Use : Number Field
    Type : Number
    Storage : MKHWeightFLd
    Width : 10
    Style : Small bold
    Format :"No Zero,Decimal:3"


    [Field:MKHWeightFLd1]
    Use : Number Field
    Set as : $$CollectionField:$MKHWeightFLd:1:BatchAllocations
    Set Always : yes
    Style : Small bold
    Width : 10
    Align : LEft
    Format : "No Zero,Decimal:2"
    Skip : yes

    ;Background :Green
    ;;============================================


    [#Line: VCHBATCH ColumnOne]
    Option : Enable VchDiscBoxTTL : @@SetExtraQty

    [!Line:Enable VchDiscBoxTTL]
    Add : Right Field : After: VCH QtyTitle :WeightTTL,CustmRateTTL,MKHPErTTL,

    [Field:CustmRateTTL]
    Info : "Rate"
    Style : Small bold
    Width : 10

    [#Line: STKVCH Batch2]
    Option : Enable STKVCHBoxDisv :mad:@SetExtraQty

    [!Line:Enable STKVCHBoxDisv]
    Add : Right Field : After: VCHBATCH BilledQty: MKHWeightFLd,CustmRateFld,MKHperFld,

    [Field:CustmRateFld]
    Use : Number Field
    Storage : CustmRate
    Set as : $$CurrentValue:$StandardPrice:StockItem:$StockItemName
    Set Always : yes
    Style : Small
    Width : 10
    Format : "No Zero,Decimal:2"
    Inactive : $$IsEnd:$BilledQty

    On : Accept : Yes : Field Accept
    On : Accept : Yes : Call :WeightQtyRate

    ;;====================================================
    [#Field: VCHBATCH Rate]
    Option : Enable ExtraRate :mad:@SetExtraQty

    [!Field:Enable ExtraRate]
    Delete : Set Always
    Delete : Set By Condition
    Skip : yes
    Skip : yes
    Format : "No Zero,Decimal:3"
    Inactive : $$IsEnd:$BilledQty


    [Field:MKHperFld]
    Use : NAme Field
    Storage : MKHperFld
    Width : 5
    Inactive : $$IsEnd:$BilledQty


    [Field:MKHperFld1]
    Use : NAme Field
    ;Set as : $$CollectionField:BatchAllocations:1:$MKHperFld
    Set as : $$CollectionField:$MKHperFld:1:BatchAllocations
    Set Always : yes
    Width : 5
    Skip : yes



    [Field:ExtraRate]
    Use : Number Field
    Set as : $$CollectionField:$CustmRate:1:BatchAllocations
    Set Always : yes
    Style : Small bold
    Width : 10
    Align : Right
    Format : "No Zero,Decimal:2"
    Skip : yes

    [Function:WeightQtyRate]
    Parameter : BatchRate : Number:$BatchRate
    Parameter : Amount : Amount:$Amount
    ;Local Formula : CalAmt : if $$Number:$MKHWeightFLd < 1 then $$Number:$MKHWeightFLd * $$Number:$CustmRate else $$Number:$BilledQty *$$Number:$CustmRate ;$$Number:$BatchRate ;;+ if $$Number:$MKHWeightFLd > 1 then $$Number:$MKHWeightFLd * $$Number:$CustmRate else $BilledQty * $$Number:$CustmRate
    ;Local Formula : CalAmt : if ($$Number:$MKHWeightFLd < 1 AND $$Number:$MKHWeightFLd >0) then 1 Else 2
    ;Local Formula : CalAmt : if ($$Number:$MKHWeightFLd < 1 AND $$Number:$MKHWeightFLd >0) then $$Number:$MKHWeightFLd * $$Number:$CustmRate else $$Number:$BilledQty *$$Number:$CustmRate
    Local Formula : CalAmt : if ($$Number:$MKHWeightFLd > 1 AND $$Number:$MKHWeightFLd >0)OR ($$Number:$MKHWeightFLd < 1 AND $$Number:$MKHWeightFLd >0) then $$Number:$MKHWeightFLd * $$Number:$CustmRate Else $$Number:$BilledQty *$$Number:$CustmRate

    000 : Log : @CalAmt


    O30 : Set Value : Amount : $$AsAmount:mad:CalAmt
    040 : Set Value : BatchRate : $$TgtObject:$Amount/$$TgtObject:$BilledQty
    050 : Set Value : Rate : $$TgtObject:$Amount/$$TgtObject:$BilledQty






    [System:UDF]
    MKHWeightFLd : Number : 2003
    ExtraQty : Number : 2006
    CustmRate : Number : 2009
    MKHperFld : String : 2011


    ;;==========Print========================================
    [#Line: EXPINV Column1]
    Add : Option : Enable VchLocColumn :mad:@SetExtraQty

    [!Line:Enable VchLocColumn]
    Add : Right Field : Before:EXPINV DiscTitle:printQtyTTL,PrintRateTTL,PrintPErTTL
    Local : Field : EXPINV RateTitle : Invisible :yes
    Local : Field : EXPINV RatePerTitle : Invisible :yes

    [Field:printQtyTTL]
    Info : "Quanity 2"
    Width : 7
    Align : Center
    Style : Small bold
    Border : Thin LEft

    [Field:printRateTTL]
    Info : "Rate"
    Width : 7
    Align : Center
    Style : Small bold
    Border : Thin LEft

    [Field:printPErTTL]
    Info : "Per"
    Width : 4
    Align : Center
    Style : Small bold
    Border : Thin LEft

    [#Line: EXPINV Column2]
    Add : Option :Enable VchLocColumn2 :mad:@SetExtraQty

    [!Line:Enable VchLocColumn2]
    Add : Right Field : Before:EXPINV DiscTitle :printQtyTTL1,PrintRateTTL2,PrintPErTTL2
    Local : Field :EXPINV RateTitle : Invisible:yes
    Local : Field :EXPINV RatePerTitle: Invisible:yes

    [Field:printQtyTTL1]
    Width : 7
    Align : Center
    Style : Small bold
    Border : Thin LEft


    [Field:printRateTTL2]
    Width :7
    Align :Center
    Style :Small bold
    Border :Thin LEft

    [Field:printPErTTL2]
    Width :4
    Align :Center
    Style :Small bold
    Border :Thin LEft


    [#Line: EXPINV Totals]
    Add : Option: Enable LocTotal :mad:@SetExtraQty
    Local :Field :EXPINV RateTotal : Invisible :yes
    Local :Field :EXPINV RatePerTotal: Invisible :yes

    [!Line:Enable LocTotal]
    Add : Right Field : Before :EXPINV DiscTotal:printQtyTotal, PrintRateTotal,PrintPErTotal

    [Field:printRateTotal]
    Width :7
    Align :Center
    Style :Small bold
    Border :Thin LEft

    [Field:printQtyTotal]
    Width :7
    Align :Center
    Style :Small bold
    Border :Thin LEft

    [Field:printPErTotal]
    Width :4
    Align :Center
    Style :Small bold
    Border :Thin LEft


    [#Line: EXPINV InvDetails]
    Add: Option : Enable LocInv :mad:@SetExtraQty
    Local : Field : EXPINV Rate : Invisible : yes
    Local : Field : EXPINV RatePer : Invisible : yes

    [!Line:Enable LocInv]
    Add : Right Field : Before :EXPINV Discount:printQtyInv,PrintRateInv,PrintPErInv

    [Field:printRateInv]
    Set as :$BatchAllocations.CustmRate
    Width :7
    Align :Right
    Style :Small
    Border :Thin LEft

    [Field:printQtyInv]
    Set as :$BatchAllocations.MKHWeightFLd
    Width :7
    Align :Right
    Style :Small
    Border :Thin LEft
    Format : "No Zero,Decimal:2"


    [Field:printPErInv]
    Set as :$BatchAllocations.MKHperFld
    Width :4
    Align :Right
    Style :Small
    Border :Thin LEft



    [#Line:EXPINV AccDetails]
    Add : Option :Enable LocAcc :mad:@SetExtraQty
    Local :Field : EXPINV AccRate : Invisible :yes
    Local :Field : EXPINV AccRatePer : Invisible :yes
    [!Line:Enable LocAcc]
    Add:Right Field: Before :EXPINV AccDiscount:printQtyAcc,PrintRateAcc,PrintPerAcc

    [Field:printQtyAcc]
    Set as :""
    Width :7
    Align :Right
    Style :Small
    Border :Thin LEft


    [Field:printRateAcc]
    Set as :""
    Width :7
    Align :Right
    Style :Small
    Border :Thin LEft

    [Field:printPerAcc]
    Set as :""
    Width :4
    Align :Right
    Style :Small
    Border :Thin LEft


    ;;==============================================
    [#Part: VTYP BehaviourMain]
    Add : Line : VTYP Custom ExportInv,

    [Line:VTYP Custom ExportInv]
    Field : Long PRompt , VTYP Custom ExportInv,
    Local : Field : Long Prompt : Info : "Set Extra Qty"
    Local : Field : Long Prompt : Width : 17
    Invisible : Not $$IsSales:$Parent And Not $$IsPurchase:$Parent

    [Field:VTYP Custom ExportInv]
    Use : Logical Field
    Style : Small Bold
    Storage : SetExtraQty
    Set as : No
    Set Always : Yes
    Show Table : Always

    [System:UDF]
    SetExtraQty : Logical :10000

    [System:Formula]
    SetExtraQty :$SetExtraQty:VoucherType:$VoucherTypeName

    ;[#Form: Comprehensive Invoice]
    ;Empty : $$Machinedate>=$$Date:"17-11-2023"


    [#Field:EI QTYTotal]
    Add:Field:Before:EIBilledQTYTotal:LWcommonTotal
    [Field:LWcommonTotal]
    Use : Number Field
    Set as:$$Total:MKHWeightFLd1
    Set Always:Yes
    skip:yes
    Border:Total
     


  2. vishnu joshi

    vishnu joshi Member


    Set Following Value for Bottom Total Fields

    Set As : $$CollNumtotal:InventoryEntries:$MKHWeightFLd
     


Share This Page