Dear sir, Here i have two problems 1. date of entry not work i am enter date in form but entry pass in 31-03-2021 2.how to fetch depreciation amount in function please ! help me
Hi Gaurang, Wish I could help, but with regards to function I cannot........ however still i will try and see.
hi all members and admin sir, I have short out many problem in this tdl but only dep amount not fetch in this please any one give suggestion new code i am sharing here
[System : Formula] IsEnableDepreciation : Yes;$EnableDepreciation:Company:##SVCurrentCompany [System: UDF] DepRate : Number : 21005 grdepamount : Amount : 21006 grdepdate : Date : 21105 deledgerselect : String :21007 [#Part: Led Other Details] Add : Line: FSDepRateChart,; DepRate [Line : FSDepRateChart] Field: Medium Prompt , DepRate Local: Field: Medium Prompt: Set as: "Depriciation Rate" ; Explode : FSDepRateChart : Yes /*[Part : FSDepRateChart] Line : DepRate Scroll : Vertical [Line: DepRate] Field: Medium Prompt, DepRate Local: Field: Medium Prompt: Set as: "rate" Local: Field: Medium Prompt: Align : Right ; Invisible : Not @@IsEnableDepreciation */ Invisible: not $$IsBelongsTo:$$GroupFixedAssets [Field: DepRate] Use : Number Field Storage : DepRate Invisible : Not @@IsEnableDepreciation Format : "Percentage" Align : Right [#Menu : DisplayMenu] Option : FS Depreciation Gateway @IsEnableDepreciation [!Menu : FS Depreciation Gateway] Add : Key Item : After : @@locStatementsofAccounts : Depreciation Chart : H : Display : Dep Report : NOT $$IsEmpty:$$SelectedCmps [Report : Dep Report] Title: "Depreciation Report " ;Use : DSP Template Variable : SVFromDate, SVToDate Set : SVFromDate : $$FinYearBeg:##StartDate:$StartingFrom:Company:##SVCurrentCompany Set : SVToDate : $$FinYearEnd:##StartDate:$StartingFrom:Company:##SVCurrentCompany Print Set : Report Title : "Depriciation Chart" Form : Dep Form Object : ledger [Form : Dep Form] Use : DSP Template Height : 100% Screen Width : 100% Screen BackGround : White Space Top : If $$InPrintMode Then 0.5 Else 0 inches Button : PrintButton, ExportButton,F2 ChangePeriod,depentry Parts : DSPAccTitles, DepinfoReport ;Dep Tit, [Part : Dep Tit] Space Bottom : 0.2 inch Line : Dep Tit Line,DepDate [Line : Dep Tit Line] Field : Dep Tit Field [Field : Dep Tit Field] Use : Name Field Set as : "DEPRECIATION CHART" Align : Center Full Width : Yes Style : Large Bold [Line : DepDate] Space Top: 1% page Field : DepFromdt,ToField,DepTodt [Field : DepFromdt] Use : Uni Date Field Set as : ##SVCurrentdate Width : 45% Screen Align : Center Style : Normal [Field : ToField] Use : Name Field Set as : "To" Width : 4% Screen Align : Center Style : Normal [Field : DepTodt] Use : Uni Date Field Set as : ##SVToDate Width : 45% Screen Align : Center Style : Normal [Part : DepInfoReport] Line : FSDepcolumnTitles, FSDepInfo Repeat : FSDepInfo : FSDepCollection Scroll : Vertical Common Border : Yes Float : Yes ;Border : Thin Box Bottom Line : FSDepColTotals Total : FSDepOpBal,FSDepAddition1Half,FSDepAddition2Half,FSDepSale,FSDepTotal,FSDepDepreciation,FSDepClosingBal [Line : FSDepColumnTitles] Line : FSDepColumnTitles1, FSDepColumnTitles2 [Line : FSDepColumnTitles1] Border : Thin Top left right Use : FSDepInfo ; Fields : FSDepSerialNo,FSDepParticulars,FSDepDepRate,FSDepOpBal,FSDepAddition1Half,FSDepAddition2Half,FSDepSale,FSDepTotal,FSDepDepreciation,FSDepClosing Bal Local : Field : Default : Style : Small Bold Local : Field : Default : Align : Center Local : Field : Default : Line : 0 Local : Field : Default : Delete : Border Local : Field : FSDepSerialNo : Info : "SNo." Local : Field : FSGroupName : Info : "Group Name" Local : Field : FSDepParticulars : Info : "Particulars" Local : Field : FSDepDepRate : Info : "Dep Rate" Local : Field : FSDepOpBal : Info : "Opening" Local : Field : FSDepAddition : Info : "Addition" Local : Field : FSDepAddition : Delete : Field Local : Field : FSDepAddition : Sub Title : Yes Local : Field : FSDepSale : Info : "Sales/" Local : Field : FSDepTotal : Info : "Total" Local : Field : FSDepDepreciation : Info : "Depreciation" Local : Field : FSDepClosing Bal : Info : "W.D.V" [Line : FSDepColumnTitles2] Border : Thin left right Bottom Use : FSDepInfo ; Fields : FSDepSerialNo,FSDepParticulars,FSDepDepRate,FSDepOpBal,FSDepAddition1Half,FSDepAddition2Half,FSDepSale,FSDepTotal,FSDepDepreciation,FSDepClosing Bal Local : Field : Default : Style : Small Bold Local : Field : Default : Align : Center Local : Field : Default : Line : 0 Local : Field : Default : Delete : Border Local : Field : FSDepSerialNo : Info : "" Local : Field : FSGroupName : Info : "" Local : Field : FSDepParticulars : Info : "" Local : Field : FSDepDepRate : Info : "" Local : Field : FSDepOpBal : Info : "Balance" Local : Field : FSDepAddition1Half : Info : "1st Half" Local : Field : FSDepAddition2Half : Info : "2nd Half" Local : Field : FSDepSale : Info : "Transfer" Local : Field : FSDepTotal : Info : "" Local : Field : FSDepDepreciation : Info : "" Local : Field : FSDepClosing Bal : Info : "" Local : Field : FSDepAddition : Border : Thin Top [Line : FSDepInfo] Fields : FSDepSerialNo, FSGroupName, FSDepParticulars, Right Field : FSDepDepRate, FSDepOpBal, FSDepAddition, FSDepSale, FSDepTotal, FSDepDepreciation, FSDepClosing Bal Option : FSAlterOnAltEnter Option : DisplayOnEnter Border: thin bottom : not $$line<1 [!Line: FSAlterOnAltEnter] Key : FSLine Object AltEnter Alter, Line Click Object Enter Alter [Key : FSLine Object AltEnter Alter] Key : Alt + Enter Action : Alter Object Mode : Display [Field : FSDepSerialNo] Use : Number Field Set as : $$Line ; Width : 4% Screen Style : Normal Align : Center Border: thin left ;FSGroupName [Field : FSGroupName] Use : Name Field Set as : $Parent Width : 15 ; Width : 25% Screen Style : Normal Border : Thin Left [Field : FSDepParticulars] Use : Name Field Set as : $Name Full Width : Yes ; Width : 25% Screen Style : Normal Border : Thin Left Variable: LedgerName Modifies: LedgerName Alter : Ledger Display : Ledger Vouchers Line:0 [Field : FSDepDepRate] Use : Number Field Set as : $DepRate Width: 14 Style : Normal Border : Thin Left Format : "Percentage" Align : Right [Field : FSDepOpBal] Use : Amount Field Set as : $BSOpening ;Width : 0 Style : Normal Border : Thin Left Right [Field : FSDepAddition] ; Use : Name Field Field : FSDepAddition1Half, FSDepAddition2Half, Width : @@AmountWidth*2 [Field : FSDepAddition1Half] Use : Amount Field Set as : $$FromValueFSStartDate:$$ToValueFSMidDate:$BSDebits FSStartDate : $$Date:##SVFromDate FSMidDate : $$Date:##SVFromDate+182 FSMidPeriod : $$Date:##SVFromDate+183 FSEndDate : $$Date:##SVToDate ; Width : 10% Screen Style : Normal ; Border : Thin Left [Field : FSDepAddition2Half] Use : Amount Field Set as : $$FromValueFSMidPeriod:$$ToValueFSEndDate:$BSDebits FSStartDate : $$Date:##SVFromDate FSMidDate : $$Date:##SVFromDate+182 FSMidPeriod : $$Date:##SVFromDate+183 FSEndDate : $$Date:##SVToDate ; Width : 10% Screen Style : Normal Border : Thin Left [Field : FSDepSale] Use : Amount Field Set as : $BSCredits ; Width : 10% Screen Style : Normal Border : Thin Left [Field : FSDepTotal] Use : Amount Field Set as : $$AsAmountMainDepTotal FirstDepTotal : $$AmountAdd:#FSDepOpBal:#FSDepAddition1Half SecondDepTotal : $$AmountAddFirstDepTotal:#FSDepAddition2Half FirstDepSubTotal: @FirstDepTotal-#FSDepSale ThirdDepTotal : If #FSDepSale < @FirstDepTotal Then @FirstDepTotal-#FSDepSale Else @SecondDepTotal-#FSDepSale MainDepTotal : If #FSDepSale < @FirstDepTotal Then $$AmountAddFirstDepSubTotal:#FSDepAddition2Half Else @SecondDepTotal-#FSDepSale FSFirstDepValue : (@FirstDepSubTotal * $DepRate)/100 FSSecondDepValue: (#FSDepAddition2Half * $DepRate)/100/2 FSDepValue : $$AmountAddFSFirstDepValueFSSecondDepValue ; Set as : ($BSOpening + $BSDebits) - $BSCredits ; Width : 12% Screen Style : Normal Border : Thin Left [Field : FSDepDepreciation] Use : Amount Field ;Set as : $$FilterAmtTotal:FSDepriciationVchColl:IsFSLedExist:$FSTotalDrDepAmt Set as : $$AsAmount$$RoundFSDepValue:1) ;;;;;;;;;;;;;;;;;; FirstDepTotal : $$AmountAdd:#FSDepOpBal:#FSDepAddition1Half SecondDepTotal : $$AmountAddFirstDepTotal:#FSDepAddition2Half FirstDepSubTotal: @FirstDepTotal-#FSDepSale ThirdDepTotal : If #FSDepSale < @FirstDepTotal Then @FirstDepTotal-#FSDepSale Else @SecondDepTotal-#FSDepSale MainDepTotal : If #FSDepSale < @FirstDepTotal Then $$AmountAddFirstDepSubTotal:#FSDepAddition2Half Else @SecondDepTotal-#FSDepSale FSFirstDepValue : (@FirstDepSubTotal * $DepRate)/100 FSSecondDepValue: (#FSDepAddition2Half * $DepRate)/100/2 FSDepValue : $$AmountAddFSFirstDepValueFSSecondDepValue Storage: grdepamount ;depvalue:if @@depfilter then 0 else $$AsAmount$$RoundFSDepValue:1) ; Width : 12% Screen Style : Normal Border : Thin Left [Field : FSDepClosing Bal] Use : Amount Field Set as : #FSDepTotal - #FSDepDepreciation ; Width : 12% Screen Style : Normal Border : Thin Left right [Line: FSDepColTotals] Use : FSDepInfo Border : Column Titles Local : Field : Default : Style : Normal Bold Local : Field : FSDepSerialNo : Info : "" Local : Field : FSDepParticulars : Info : "Grand Total" Local : Field : FSDepDepRate : Info : "" Local : Field : FSDepOpBal : Set as : $$Total:FSDepOpBal Local : Field : FSDepAddition1Half : Set as : $$Total:FSDepAddition1Half Local : Field : FSDepAddition2Half : Set as : $$Total:FSDepAddition2Half Local : Field : FSDepTotal : Set as : $$Total:FSDepTotal Local : Field : FSDepSale : Set as : $$Total:FSDepSale Local : Field : FSDepDepreciation : Set as : $$Total:FSDepDepreciation Local : Field : FSDepClosing Bal : Set as : $$Total:FSDepClosingBal [Collection : FSDepcollection] Type : Ledger Child Of : $$GroupFixedAssets Belongs To : Yes Fetch : DepRate,grdepamount Filter : FixedAssetsFilter Sort : @@Default : $DepRate [Collection : deselectledger] Title :$$LocaleString:"Select Depriciation Ledger " Type : Ledger Child Of : $$GroupIndirectExpenses Belongs To : Yes Format : $Name, 20 [Collection : FSDepcollection01] Type : Ledger Child Of : $$GroupFixedAssets Belongs To : Yes Fetch : DepRate,grdepamount Filter : FixedAssetsFilter ;Sort : @@Default : $DepRate [System: Formula] FixedAssetsFilter: $OpeningBalance > 0 Or $CreditTotals> 0 or $DebitTotals >0 ;depfilter : $name:ledgervoucher:$ledgername = "depriciation exp" [Collection : FSDepriciationVchColl] Parm Var : pvLedgerName : String : "Depreciation" Parm Var : pvDSPNameStyle : String : "Name Only" Type : Vouchers : Ledger Child Of : ##pvLedgerName Belongs To : Yes Fetch : Date, VoucherTypeName, VoucherNumber, Narration, MasterID Fetch : IsOptional Fetch : AllLedgerEntries.BankAllocations.* Fetch : AllLedgerEntries.BillAllocations.* Fetch : AllLedgerEntries.LedgerName, AllLedgerEntries.Amount Fetch : AllLedgerEntries.LedgerName, AllLedgerEntries.Narration, AllLedgerEntries.IsDeemedPositive ;;to get the narration in condensed mode. Compute : TotalLedDrVchAmt : $$OrigVchLedDrTotal:#pvLedgerName$$SysName:AcctgVchView) Compute : TotalLedCrVchAmt : $$OrigVchLedCrTotal:#pvLedgerName$$SysName:AcctgVchView) Compute : VchLedName : $$FuncDSPLedAccName:"No":##pvDSPNameStyle Compute : FirstContraAccount : $$FirstContraAcc:$$IsDr@TotalLedVchAmt Compute : TotalLedVchAmt : If $$InPrintMode Then $$OrigVchLedTotal:#pvLedgerName Else $$OrigVchLedTotal:##pvLedgerName ; Compute : DSPNameStyle : ##DSPNameStyle Compute : FSTotalDrDepAmt : $$OrigVchLedDrTotal:##pvLedgerName Compute : FSTotalCrDepAmt : $$OrigVchLedCrTotal:##pvLedgerName Compute : AllocCCLedName : If $$IsEmpty:##pvLedgerName then "" else $$FuncDSPAccName:##pvLedgerName ; Filter : IsFSLedExist [System: Formula] IsFSLedExist : $$IsLedOFGrp:$LedgerName:"Fixed Assets";#FSDepParticulars [Button:depentry] Title: "Depriciation entry" Key: alt+5 ;Action: Call: grdepentry ; Action:Alter:depentry ;[#Object:ledger] ; grdepamount : $grdepamount [Function: grdepentry] ;; Procedural Block ;Parameter:inputnumber:Number Variable : grpDate : Date Variable : grpCrLedgerName : String Variable : grpDrLedgerName : String Variable : grpAmount : Amount Variable: grpdepnarra :String ;Return: Number Variable : Counter : Number: 1 10 : START PROGRESS : ($$NumItems:FSDepcollection01) : "Creating Vouchers" : @@CmpMailName : "Creating Depriciation Vouchers ..." 20:WALK COLLECTION :FSDepcollection01 30 : SET : grpDate :$grdepdate:Company:##SVCurrentCompany 40 : SET : grpCrLedgerName : $Name 50 : SET : grpDrLedgerName :$deledgerselect:Company:##SVCurrentCompany;$$LocaleString:"Depriciation Exp" 60 : SET : grpAmount :$grdepamount;$$Value:#FSDepDepreciation 65 :Set:grpdepnarra :"Depriciation For " + $$String:$Name + " @ " + $$String:$DepRate +" %" 70 : NEW OBJECT : Voucher 80 : SET VALUE : Date : ##grpDate 90 : SET VALUE : VoucherTypeName : $$VchTypeJournal 100 : Set Value: Narration : ##grpdepnarra 120 : SET VALUE : Ledger Name : ##grpDrLedgerName 140 : SET VALUE : IsDeemedPositive : "Yes" 141 : SET VALUE : Amount : ##grpAmount * (-1) ;---------------------------------------------------------------------------- ;;Credit Entry 160 : INSERT COLLECTION OBJECT : AllLedgerEntries 170 : SET VALUE : Ledger Name :##grpCrLedgerName 180 : SET VALUE : Amount : ##grpAmount 190 : SET VALUE : IsDeemedPositive : "No" 200 : SET TARGET : .. 210 : SET VALUE : PersistedView : ##SVViewName 220 : CREATE TARGET 240 : END WALK 260 : END PROGRESS [Collection: grpdepCollection] Title : "Bulk dep Entry" Type : grpdep BulkEntry : Company Child Of : ##SVCurrentCompany Fetch: ;;;;;entry form dep chart;;;; [Report: depentry] Form: depentry Object:company Title: $$LocaleString:"Dericiation entry" [Form:depentry] Part:depentry ;Background:blackthemes Width:35% page Height: 35% page Horizontal Align: Center Vertical Align: Center Background:Sky Blue Lighter On: Form Accept: Yes: Form Accept On: Form Accept :Yes: Call:grdepentry [Part:depentry] Lines:depentry,deledgerselect ;Local:Line: Simple Prompt: Set as:"dates" ;Background:blackthemes Space Bottom: 2 cm [Line:depentry] Field:medium Prompt,depentry Local: Field: medium Prompt : Set as: $$LocaleString:"Enter Depriciation Date.:" Local: Field: medium Prompt : Width: 40 Space Top : 1 Space Bottom: 1 [Field:depentry] Use:Short Date Field ;Type: Date Set as: $grdepdate ;Format: Universal Date Width :35 Storage:grdepdate Border: thin box Background: white ;Set Always: Yes [Line:deledgerselect] Field:medium Prompt,deledgerselect Local: Field: medium Prompt : Set as: $$LocaleString:"Select Depriciation Ledger.:" Local: Field: medium Prompt : Width: 40 Space Top : 1 Space Bottom: 1 [Field:deledgerselect] Use:name field ;Type: Date Set as: $deledgerselect ;Format: Universal Date Width :35 Storage:deledgerselect Table: deselectledger Border: thin box Background: white Key: Create Ledger,Alter Ledger ;Set Always: Yes
Change following 60 : SET : grpAmount :#FSDepDepreciation ;$grdepamount:Ledger:$Name ;$$Value:#FSDepDepreciation you will get depreciation amount , but there is two problem will arise. 1. it will get total amount in each entry. 2. entry done will get reflected in Sale / Transfer.