
/*
Objective(s)  
- 	This code demonstrates the usage of BelongsTo Attribute within Collection
- 	Collection Attribute 'Belongs To' depends on the Child Of Attribute specification. If 
	Child of is Sundry Debtors and BelongsTo Attribute is set to Yes, all the Objects within 
	the Sub Groups of Sundry Debtors will be considered in the Collection.
-	This code displays all the ledgers under the Group Sundry Debtors including the ones under 
	the Sub Groups within Sundry Debtors.
*/

[#Menu: Gateway of Tally]

	Add	: Item	: Before : @@locQuit	: Company Ledger/Sub Group List		: Display	: CAB Ledger List

[Report: CAB Ledger List]

	Form        : CAB Ledger Form
	Title       : "Company Ledger List"

[Form: CAB Ledger Form]

	Use         : DSP Template                ;;;Its a pre defined report containing all the necessary keys, buttons, etc required for reporting purposes
	Parts       : CAB Ledger Part
	Height      : 100% screen                 ;;;defining height of form as 100% sccreen
	Width       : 100% screen                 ;;;defining width of form as 100% sccreen
	Background  : Grey                        ;;;Setting the background color of report to grey
	
[Part: CAB Ledger Part]

	Lines       : CAB Ledger Title, CAB Ledger Line
	Repeat      : CAB Ledger Line	: CAB My Ledgers    ;;;line will repeat on the collection of the ledger
	CommonBorder: Yes
	Scroll      : Vertical

    [Line: CAB Ledger Title]

		Use     : CAB Ledger Line

		Local	: Field	: Default			: Type		: String
		Local	: Field	: Default 			: Align		: Centre
		Local	: Field	: Default 			: Style		: Normal Bold
		
		Local	: Field	: CAB Led No        : Set as    : "Sl. No"
		Local	: Field	: CAB Led Name	    : Set as    : "Ledger Name"
		Local	: Field	: CAB Led address 	: Set as    : "Address"
		Local	: Field	: CAB Led States  	: Set as 	: "State"
		Local	: Field	: CAB Led Pin 		: Set as   	: "PinCode"
		Local	: Field	: CAB Led Cont	    : Set as 	: "Contact Person"
		Local	: Field	: CAB Led Tel 		: Set as 	: "Telephone"
		Local	: Field	: CAB Led Faxno 	: Set as 	: "Fax"
		Local	: Field	: CAB Led emailadd	: Set as 	: "Email"
		Local	: Field	: CAB Led CB		: Set as 	: "Closing Balance"
		Border  : Thin Top Bottom

    [Line: CAB Ledger Line]

		Fields      : CAB Led No, CAB Led Name,CAB Led Address,CAB Led States,CAB Led Pin, CAB Led Cont, CAB Led Tel, CAB Led Faxno, CAB Led emailadd, CAB Led CB
		Repeat      : CAB Led CB
		Option      : AlterOnEnter                        ;;;Alter on enter will open the ledger master of the same ledger on which enter was pressed
	
        [Field: CAB Led No]

			Set as      : $$Line                  ;;;setting the line number to the field
			Width       : 3
			Align       : Centre
			Border      : Thin Right
			Alter       : Ledger
			    
        [Field: CAB Led Name]

			Use         : Name Field
			Set as      : $Name                     ;;;set ledger name to field
			Border      : Thin Right
						
        [Field: CAB LedAddress]

			Set as      : $STPartyFullAdd           ;;;set party address to the field
			Width       : 30
			Border      : Thin Right

        [Field: CAB Led States]

			Set as      : $StateName                ;;;set state name 
			Width       : 10
			Border      : Thin Right

        [Field: CAB Led Pin]

			Set as      : $PinCode                    ;;;set pin code
			Width       : 10
			Border      : Thin Right

        [Field: CAB Led Cont]

			Set as      : $LedgerContact                 ;;;set ledger contact number
			Width       : 10
         	        Border      : Thin Right

        [Field: CAB Led Tel]

			Set as      : $LedgerPhone                  ;;;set phone no.
			Width 	    : 10
	                Border      : Thin Right

        [Field: CAB Led FaxNo]

			Set as      : $LedgerFax                     ;;; set fax no.
			Width       : 10
			Border      : Thin Right

        [Field: CAB Led EmailAdd]

			Set as      : $Email                         ;;set email ID
			Width       : 20
			Border      : Thin Right

        [Field: CAB Led CB]

            Use         : Amount Forex Field           ;;; field of type forex field to display foreign currency
	    Set as      : $ClosingBalance              ;;;set closing balance

[Collection: CAB My Ledgers]

	Type	        : Ledger
	Child of	: $$GroupSundryDebtors                   ;;;Collection will filter all the ledgers of group sundry debtors
	Belongs to	: Yes                                           

;; 'Belongs To' includes the Ledgers pertaining to the subgroups of the group 
;; mentioned in Attribute 'Child Of'.

	Fetch	: Name, STPartyFullAdd, StateName, Pincode, LedgerContact, LedgerPhone, LedgerFax, Email, ClosingBalance

;; Fetch attribute required for remoting 2.0

;; End-of-File
