;; ============================================================
;; Product   : Party Pending Bills Count in Voucher Entry
;; Store     : www.gyanamrittdl.com
;; Support   : WhatsApp +91 79924 46290
;; For       : TallyPrime
;; ============================================================
;; What it does : While making a voucher, shows how many bills of the
;;                selected party are still pending (not fully paid).
;; 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 : GAF38NarrOpt : @@GAF38On

[!Part: GAF38NarrOpt]
    Add : Line : Before : Vch Narrprompt : GAF38 InfoLine

[System: Formula]
    GAF38On : Yes

[Line: GAF38 InfoLine]
    Fields : GAF38 PromptF, GAF38 ValueF
	Local:Field:Default:Color:Blue
[Field: GAF38 PromptF]
    Use    : Name Field
    Set as : "Pending Bills :"
    Width  : 18
    Style  : Small Bold
    Skip   : Yes

[Field: GAF38 ValueF]
    Use        : Number Field
    Set as     : if $$IsEmpty:$PartyLedgerName then ""  else ($$NumItems:GAF38PendBills)
	;Set as:$$NumItems:GAF38PendBills
    Set Always : Yes
    Width      : 8
    Color      : Red
    Style      : Small Bold
    Skip       : Yes
	Background:White
	
[Collection: GAF38 PendBills]
    Type     : Bills
    Child Of : #EIConsignee;$PartyLedgerName
	Fetch:BillDate,Date
    Filter   : GAF38NotZero
	;Select $Date,$BillDate from GAF38PendBills
[System: Formula]
    GAF38NotZero : not $$IsEmpty:$ClosingBalance

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