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 @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 @SetExtraQty [!Line:Enable InvWeightInfo] Add : Right Field : At beginning : MKHWeightFLd1,MKHperFld1 Local : Field : VCH Rate : Invisible:yes Add : Right Field : After : VCH BilledQty:ExtraRate [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 @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 @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 : $$AsAmountCalAmt 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 @SetExtraQty [!Line:Enable VchLocColumn] Add : Right Field : Before:EXPINV DiscTitlerintQtyTTL,PrintRateTTL,PrintPErTTL Local : Field : EXPINV RateTitle : Invisible :yes Local : Field : EXPINV RatePerTitle : Invisible :yes [FieldrintQtyTTL] Info : "Quanity 2" Width : 7 Align : Center Style : Small bold Border : Thin LEft [FieldrintRateTTL] Info : "Rate" Width : 7 Align : Center Style : Small bold Border : Thin LEft [FieldrintPErTTL] Info : "Per" Width : 4 Align : Center Style : Small bold Border : Thin LEft [#Line: EXPINV Column2] Add : Option :Enable VchLocColumn2 @SetExtraQty [!Line:Enable VchLocColumn2] Add : Right Field : Before:EXPINV DiscTitle rintQtyTTL1,PrintRateTTL2,PrintPErTTL2 Local : Field :EXPINV RateTitle : Invisible:yes Local : Field :EXPINV RatePerTitle: Invisible:yes [FieldrintQtyTTL1] Width : 7 Align : Center Style : Small bold Border : Thin LEft [FieldrintRateTTL2] Width :7 Align :Center Style :Small bold Border :Thin LEft [FieldrintPErTTL2] Width :4 Align :Center Style :Small bold Border :Thin LEft [#Line: EXPINV Totals] Add : Option: Enable LocTotal @SetExtraQty Local :Field :EXPINV RateTotal : Invisible :yes Local :Field :EXPINV RatePerTotal: Invisible :yes [!Line:Enable LocTotal] Add : Right Field : Before :EXPINV DiscTotalrintQtyTotal, PrintRateTotal,PrintPErTotal [FieldrintRateTotal] Width :7 Align :Center Style :Small bold Border :Thin LEft [FieldrintQtyTotal] Width :7 Align :Center Style :Small bold Border :Thin LEft [FieldrintPErTotal] Width :4 Align :Center Style :Small bold Border :Thin LEft [#Line: EXPINV InvDetails] Add: Option : Enable LocInv @SetExtraQty Local : Field : EXPINV Rate : Invisible : yes Local : Field : EXPINV RatePer : Invisible : yes [!Line:Enable LocInv] Add : Right Field : Before :EXPINV DiscountrintQtyInv,PrintRateInv,PrintPErInv [FieldrintRateInv] Set as :$BatchAllocations.CustmRate Width :7 Align :Right Style :Small Border :Thin LEft [FieldrintQtyInv] Set as :$BatchAllocations.MKHWeightFLd Width :7 Align :Right Style :Small Border :Thin LEft Format : "No Zero,Decimal:2" [FieldrintPErInv] Set as :$BatchAllocations.MKHperFld Width :4 Align :Right Style :Small Border :Thin LEft [#Line:EXPINV AccDetails] Add : Option :Enable LocAcc @SetExtraQty Local :Field : EXPINV AccRate : Invisible :yes Local :Field : EXPINV AccRatePer : Invisible :yes [!Line:Enable LocAcc] Add:Right Field: Before :EXPINV AccDiscountrintQtyAcc,PrintRateAcc,PrintPerAcc [FieldrintQtyAcc] Set as :"" Width :7 Align :Right Style :Small Border :Thin LEft [FieldrintRateAcc] Set as :"" Width :7 Align :Right Style :Small Border :Thin LEft [FieldrintPerAcc] 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