;; ============================================================
;; Product   : Total Number Qty Show in Invoice Entry
;; Store     : www.gyanamrittdl.com
;; Support   : WhatsApp +91 79924 46290
;; For       : TallyPrime
;; ============================================================
;; What it does : In the invoice, shows the total quantity of all items
;;                above Narration as a plain number. All items are added
;;                even when they have different units (pcs + kg).
;; How to load  : F1 (Help) > TDL & Add-On > Manage Local TDL >
;;                Load TDL on Startup = Yes > give the path of this file
;; ============================================================

;;------------------------- VOUCHER ENTRY ----------------------------
[#Part: DBLLINE Narration]
    Option : GAF65NarrOpt : @@GAF65On

[!Part: GAF65NarrOpt]
    Add : Line : Before : Vch Narrprompt : GAF65 InfoLine

[System: Formula]
    GAF65On : @@IsSales OR @@IsPurchase OR @@IsCreditNote OR @@IsDebitNote

[Line: GAF65 InfoLine]
    Fields : GAF65 PromptF, GAF65 ValueF
	Local:Field:Default:Color:Blue

[Field: GAF65 PromptF]
    Use    : Name Field
    Set as : "Total Qty (Number) :"
    Width  : 18
    Style  : Small Bold
    Skip   : Yes

[Field: GAF65 ValueF]
    Use        : Number Field
    Set as     : $$GAF65NumQty
    Set Always : Yes
    Width      : 10
    Color      : Blue
    Style      : Small Bold
    Skip       : Yes
    Background : White

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

    101  : Set : GAF65Qty : 0
    201A : Walk Collection : InventoryEntries
    207  : Set : GAF65Qty : ##GAF65Qty + $$Number:$BilledQty
    201Z : End Walk
    508  : Return : ##GAF65Qty

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