;; ============================================================
;; Product   : Total Quantity Show in Day Book
;; Store     : www.gyanamrittdl.com
;; Support   : WhatsApp +91 79924 46290
;; For       : TallyPrime
;; ============================================================
;; What it does :
;;   Adds a TOTAL QTY column in Day Book. It shows the total billed
;;   quantity (number total) of all items in the voucher. Blank for vouchers
;;   without items.
;; How to load  : Tally > F1 Help > TDL & Add-On > Manage Local TDL
;;                > Load TDL on Startup = Yes > give the path of this file
;; ============================================================
[#Form:DayBook]
Local:Collection:Default:Fetch:GAF46Qty

[#Object:Voucher]
GAF46Qty:@@GAF46Qty

[Field: GAF46TotQty]
    Use      : Number Field
    Set as   : $GAF46Qty
    Width    : 10
    Align    : Right
    Color    : Blue
    Style    : Small Bold
    Border   : Thin Right
	Format:"No Zero"

[System: Formula]
    GAF46Qty : $$GAF46NumQty

;; Adds the quantity number of every item line
;; (works even when items have different units)
[Function: GAF46NumQty]
    Returns  : Number
    Variable : GAF46Q : Number

    01 : Set         : GAF46Q : 0
    02 : Walk Collection : InventoryEntries
    03 :   Set       : GAF46Q : ##GAF46Q + $$Number:$BilledQty
    04 : End Walk
    05 : Return      : ##GAF46Q

;----------------------------- DAY BOOK ------------------------------
[#Line: DBTitle1]
    Add   : Field : At Beginning : GAF46TotQty
    Local : Field : GAF46TotQty : Set as : "TOTAL QTY"

[#Line: DBTitle2]
    Add   : Field : At Beginning : GAF46TotQty
    Local : Field : GAF46TotQty : Set as : ""

[#Line: DSP VchDetail]
    Add   : Field : At Beginning : GAF46TotQty

;============================ END ====================================
