कुल पेज दृश्य

बुधवार, 2 फ़रवरी 2022

Tally Chapter 145 TDL to Replace Ledger by Rajiv Mishra Computer class

 





Few lines of this code is missing. Watch the video for full code.




[#Form: Ledger Vouchers]

Add : Button : After : ChangeCompany : RAJIVBTNLD

Set: vRajivOldLedName: #LedgerName

[#Report: Ledger Vouchers]

Variable: vRAJIVSource

[#Form: Stock Vouchers]

Add : Button : After : ChangeCompany : RAJIVBTNST

Set: vRajivOldItemName: #StockItemName

[#Report: Stock Vouchers]

Variable: vRAJIVSource



[Button: RAJIVBTNDB]

Title: "Replace Ledger"

Key: Ctrl+R

Action List : RAJIVDayBk, RAJIVDayBkRep

Scope : Selected Lines


[Key: RAJIVDayBk]

Key: Ctrl + R

Action: Set: vRAJIVSource : "DayBook"

Scope : Selected Lines


[Key: RAJIVDayBkRep]

Key: Ctrl + R

Action: Execute : RajivAlterVoucherReport

Scope : Selected Lines


[Button: RAJIVBTNLD]

Title: "Replace Ledger"

Key: Ctrl+L

Action List : RAJIVLed,RAJIVSetLed, RAJIVLedExe

Scope : Selected Lines


[Key: RAJIVLed]

Key: Ctrl+L

Action: Set: vRAJIVSource : "Ledger"

Scope : Selected Lines


[Key: RAJIVSetLed]

Key: Ctrl+L

Action: Set: vRajivSelectedType : "Ledger"

Scope : Selected Lines



[Key: RAJIVLedExe]

Key: Ctrl+L

Action: Execute : RajivAlterVoucherReport

Scope : Selected Lines


[Report: RajivAlterVoucherReport]


Form : RajivAlterVoucherForm

Variable : SVFromDate, SVToDate

Title : "Replace Selected Ledger Here"


[Form: RajivAlterVoucherForm]


Width : 50% Screen

Height : 40% Screen

Top Part : RAJIVLSELECTPart

Part : RAJIVLEDPart

Bottom Part : RAJIVSTKPart

Local : Field : RAJIVLEDField : Modifies : vRajivOldLedName : Yes

Local : Field : RAJIVLEDField : Variable : vRajivOldLedName

Local : Field : RAJIVNEWLEDField: Modifies : vRajivNewLedName : Yes

Local : Field : RAJIVNEWLEDField: Variable : vRajivNewLedName

Local : Field : RAJIVITEMField : Modifies : vRajivOldItemName : Yes

Local : Field : RAJIVITEMField : Variable : vRajivOldItemName

Local : Field : RAJIVNEWITEMField: Modifies : vRajivNewItemName : Yes

Local : Field : RAJIVNEWITEMField: Variable : vRajivNewItemName

Local : Field : RAJIVSELField : Modifies : vRajivSelectedType : Yes

Local : Field : RAJIVSELField :Variable : vRajivSelectedType


Set : SVFromDate : ##SVFromDate

Set : SVToDate : ##SVToDate

On : Form Accept: Yes: Call: RajivAlterSelectedVchrs


[Part : RAJIVLSELECTPart]

Lines : RAJIVSELLine1

Space Top : 1


[Part : RAJIVLEDPart]

Lines : RAJIVLEDLine1, RAJIVLEDLine2

Space Bottom : 1

Invisible : ##vRajivSelectedType ="Stock Item"


[Part : RAJIVSTKPart]

Lines : RAJIVItemLine1, RAJIVItemLine2

Space Bottom : 1

Invisible : ##vRajivSelectedType = "Ledger" OR $$NumItems:RajivStockItemVouchers <=0


[Line : RAJIVSELLine1]

Field : Long Prompt, RAJIVSELField,

Local : Field : Long Prompt : Info : $$LocaleString:"Replace:"

Space Bottom : 1

Space Top : 1


[Line : RAJIVLEDLine1]

Field : Long Prompt , RAJIVLEDField,

Local : Field : Long Prompt : Info : $$LocaleString:"Select Ledger to be replaced:"

Space Bottom : 1

Space Top : 1


[Line : RAJIVLEDLine2]

Right Fields : Long Prompt , RAJIVNEWLEDField

Local : Field : Long Prompt: Info : $$LocaleString:"New Ledger:"

Space Bottom : 1


[Field :RAJIVSELField]

Use : Short Name Field

Table : ListOfRajivSelect

Set as : ##vRajivSelectedType

Modifies : vRajivSelectedType

Variable : vRajivSelectedType

Set Always : YEs


[Field : RAJIVLEDField]

Use : Name Field

Table : ListOfLedgers,EndOfList

Show Table : Always

Set as : ##vRajivOldLedName

Modifies : vRajivOldLedName

Variable : vRajivOldLedName

Set Always : if #RAJIVSELField = "Ledger" or ##vRajivSelectedType = "" then Yes else No

Width : @@NarrWidth

;Skip : if (##vRAJIVSource = "Ledger") then yes else no

[Field : RAJIVNEWLEDField]

Use : Name Field

Table : ListOfLedgers,EndOfList

Show Table : Always

Set as : ##vRajivNewLedName

Modifies : vRajivNewLedName

Variable : vRajivNewLedName

Width : @@NarrWidth

Set Always : if #RAJIVSELField = "Ledger" or ##vRajivSelectedType = "" then Yes else No


[Line : RAJIVItemLine1]

Field : Long Prompt , RAJIVItemField,

Local : Field : Long Prompt : Info : $$LocaleString:"Select Stock Item to be replaced:"

Space Bottom : 1



[Line : RAJIVItemLine2]

Right Fields : Long Prompt, RAJIVNEWItemField

Local : Field : long Prompt: Info : $$LocaleString:"New Stock Item:"

Space Bottom : 1


[Field : RAJIVItemField]

Use : Name Field

Table : ListOfStockItems, EndOfList

Show Table : Always

Set as : ##vRajivOldItemName

Modifies : vRajivOldItemName

Variable : vRajivOldItemName

Set Always : if #RAJIVSELField = "Stock Item" or ##vRajivSelectedType = "" then Yes else No

Width : @@NarrWidth

;Skip : if (##vRAJIVSource = "Ledger") then yes else no

[Field : RAJIVNEWItemField]

Use : Name Field

Table : ListOfStockItems, EndOfList

Show Table : Always

Set as : ##vRajivNewItemName

Modifies : vRajivNewItemName

Variable : vRajivNewItemName

Width : @@NarrWidth

Set Always : if #RAJIVSELField = "Stock Item" or ##vRajivSelectedType = "" then Yes else No

[Collection: RajivVchCollection]


Switch: RajivOptn : Rajiv SpeciFic Vouchers : ##vRAJIVSource = "DayBook"

Switch: RajivOptn : Rajiv Ledger Vouchers : ##vRAJIVSource = "Ledger"

Switch: RajivOptn : Rajiv StockItem Vouchers : ##vRAJIVSource = "Stock Item"


[!Collection : Rajiv SpeciFic Vouchers]

Source Collection:Vouchers of Company

Fetch : *, AllLedgerEntries.* ;, CategoryAllocations.*, CostCentreAllocations.*


[!Collection: Rajiv Ledger Vouchers]

Type: Vouchers : Ledger

Child of : ##vRajivOldLedName

Fetch : *, AllLedgerEntries.* ;, CategoryAllocations.*, CostCentreAllocations.*

[!Collection: Rajiv Stock Item Vouchers]

Type: Vouchers : StockItem

Child of : ##vRajivOldItemName

Fetch : *, AllLedgerEntries.* , AllInventoryEntries.*;, CategoryAllocations.*, CostCentreAllocations.*

[Collection: ListOfRajivSelect]

List Name: "Ledger"

Title: "To Replace"


[System: Variable]

vRajivOldLedName : ""

vRajivNewLedName : ""

vRajivOldItemName : ""

vRajivNewItemName : ""

vRajivSelectedType : ""


[Variable: vRAJIVSource]

Type: String

Default : ""

Volatile : No


[Variable : vRajivVchPrgCnt]

Type: Number


[Variable: vRajivOldLedName]

Type :String

Default: ""


[Variable: vRajivNewLedName]

Type :String

Default: ""


[Variable: vRajivOldItemName]

Type :String

Default: ""


[Variable: vRajivNewItemName]

Type :String

Default: ""


[Variable: vRajivSelectedType]

Type :String

Default: ""



[Function: RajivAlterSelectedVchrs]

VARIABLE : ProgressCount : Number

VARIABLE : LastStatus : String

Variable : YesToAll : String

Variable : pExlVchId : String


05 : Set File Log On

07 : Log: $$String:##vRAJIVSource

10 : QUERY BOX : "Alter Voucher ? \n Are You Sure?" : Yes: No

20 : IF : NOT $$LastResult

30 : BREAK

40 : ENDIF

50 : SET : ProgressCount : 1

60 : SET : LastStatus : ""

70 : SET : YesToAll : "No"

110 : IF : NOT ($$NumItems:RajivVchCollection > 0)


120 : MSGBOX : "Status" : "No Data to Process!!"

130 : RETURN

140 : END IF


145 : Set: vRajivNewItemName : if #RAJIVSELField = "Ledger" then "" else ##vRajivNewItemName

146 : Set: vRajivOldItemName : if #RAJIVSELField = "Ledger" then "" else ##vRajivOldItemName

147 : Set: vRajivNewLedName : if #RAJIVSELField = "Stock Item" then "" else ##vRajivNewLedName

148 : Set: vRajivOldLedName : if #RAJIVSELField = "Stock Item" then "" else ##vRajivOldLedName


150 : START PROGRESS : ($$NumItems:RajivVchCollection) : "Voucher" : "Alteration"

160 : WALK COLLECTION : RajivVchCollection

165 : Set: pExlVchId : "ID:"+ $$String:$MasterId

190 : SET : LastStatus : ""

195 : Log: $$String:##pExlVchId


210: Call: RNGAlterLedEntries:##pExlVchId



370 : SHOW PROGRESS : ##ProgressCount

380 : Log: $$String:##ProgressCount+ "-Updated Voucher No " + "- " +$$String:##pExlVchId

400 : SET : ProgressCount : ##ProgressCount + 1

410 : END WALK

420 : END PROGRESS

440 : MSGBOX : "Status" : "Process completed !!"


450 : RETURN : TRUE


[Function: RNGAlterLedEntries]


Parameter : ExlVchMasterId : String

Variable : vCountUpdate : Number

Variable : vRateUOM : String

Variable : StrRate : String

Variable : vRate : Number

Variable : vBilledQty : Number

Variable : vActualQty : Number

Variable : strBilledQty : Quantity

Variable : strActualQty : Quantity

Variable : vItemAmount : Amount

Variable : vQtySign : Logical

Variable : vGSTTransType : String


Object : Voucher :##ExlVchMasterId

0120 : SET TARGET

0130 : SET OBJECT

0135 : Set: vCountUpdate : 0


0140 : WALK : LedgerEntries

0160 : SET TARGET : LedgerEntries[$$LoopIndex]

0180 : IF : (Not $$IsEmpty:##vRajivNewLedName) AND ##vRajivOldLedName = $LedgerName

0190 : SET TARGET : LedgerEntries[$$LoopIndex]

0200 : Set: vGSTTransType :$$String:($(Ledger, ##vRajivNewLedName).GSTDetails[1].GSTNatureofTransaction)

0205 : Set Value: LedgerName:$$String:##vRajivNewLedName

0210 : SET VALUE : TaxClassificationName : $TaxClassificationName:ledger:$$String:##vRajivNewLedName

0215 : Log: $$String:##vGSTTransType

0218 : Set Value : GSTOVRDNNATURE :##vGSTTransType

0220 : SET TARGET : ..

0225 : END IF

;0235 : If: $IsBankingEnabled:Ledger:$LedgerName

0240 : WALK : Bank Allocations

0250 : SET TARGET : BankAllocations[$$LoopIndex]

0260 : Set Value: BankPartyName:$$String:##vRajivNewLedName;

;0290 : Set Value: InstrumentDate:##ExlInstDate;@@RajivInsDate

;0300 : Set Value: BankersDate:##ExlBankDate;@@RajivBankDate

0410 : SET TARGET : ..

0420 : END WALK

;0430 : END IF


0520 : END WALK


0540 : Walk : Inventory Entries

0545 : SET TARGET : Inventory Entries[$$LoopIndex]

0550 : IF :(Not $$IsEmpty:##vRajivNewItemName)AND ##vRajivOldItemName = $StockItemName

0555 : SET TARGET : Inventory Entries[$$LoopIndex]

0557 : Set: vQtySign : $$IsInwards:$BilledQty

0558 : Log: $$String:##vQtySign

0560 : Set Value: StockItemName:$$String:##vRajivNewItemName

0565 : SET : vRateUOM : $Baseunits:StockItem:##vRajivNewItemName

0570 : Set : vRate :$$Number:$Rate

0575 : Set : StrRate : $$String:##vRate + "/" + $$String:##vRateUOM

0580 : Set Value: Rate: $$AsRate:##StrRate

0630 : SET : vBilledQty : $$Number:$BilledQty

0640 : SET : vActualQty : $$Number:$ActualQty

0645 : Set : vItemAmount : $Amount

0650 : Set : strBilledQty :$$AsQty:($$String:##VBilledQty+ " "+ $$String:##vRateUOM)

0660 : Set : strActualQty :$$AsQty:($$String:##vActualQty+ " "+ $$String:##vRateUOM)

0681 : SET VALUE : ActualQty :0

0682 : SET VALUE : BilledQty :0

0683 : SET VALUE : Amount :0


0685 : SET VALUE : ActualQty : if ##vQtySign= Yes then $$TgtObject:$$AsQty:##strActualQty *1 else $$TgtObject:$$AsQty:##strActualQty *-1

0690 : SET VALUE : BilledQty : if ##vQtySign= Yes then $$TgtObject:$$AsQty:##strBilledQty *1 else $$TgtObject:$$AsQty:##strBilledQty *-1

0695 : SET VALUE : Amount :##vItemAmount


0700 : Walk : Batch Allocations

0710 : SET TARGET : BatchAllocations[$$LoopIndex]

0730 : SET : vBilledQty : $$Number:$BilledQty

0740 : SET : vActualQty : $$Number:$ActualQty

0745 : Set : vItemAmount : $Amount

0750 : Set : strBilledQty :$$AsQty:($$String:##VBilledQty+ " "+ $$String:##vRateUOM)

0760 : Set : strActualQty :$$AsQty:($$String:##vActualQty+ " "+ $$String:##vRateUOM)

0781 : SET VALUE : ActualQty :0

0782 : SET VALUE : BilledQty :0

0783 : SET VALUE : Amount :0


0785 : SET VALUE : ActualQty :if ##vQtySign = Yes then $$TgtObject:$$AsQty:##strActualQty * 1 else $$TgtObject:$$AsQty:##strActualQty *-1

0790 : SET VALUE : BilledQty :if ##vQtySign = Yes then $$TgtObject:$$AsQty:##strBilledQty * 1 else $$TgtObject:$$AsQty:##strBilledQty *-1

0795 : SET VALUE : Amount :##vItemAmount

0800 : Set Target: ..

0820 : End Walk

0830 : Walk : Accounting Allocations

0840 : IF : (Not $$IsEmpty:##vRajivNewLedName) AND ##vRajivOldLedName= $LedgerName

0850 : SET TARGET : Accounting Allocations[$$LoopIndex]

0860 : Set Value: LedgerName :##vRajivNewLedName

0870 : Set Target: ..

0880 : End If

0890 : End Walk

0900 : END IF

0910 : SET TARGET : ..

0920 : End Walk

0930 : SET TARGET : ..

0940 : ACCEPT ALTER


0945 : Set: vCountUpdate : ##vCountUpdate+1

0950 : SET TARGET : ..


कोई टिप्पणी नहीं:

एक टिप्पणी भेजें

 [#Form: Master Accounting Form] Delete: Bottom Buttons : Master Group, Master Ledger, Master VchType, Blank Button ;, Master Company Operat...