hello Experts i want help in sales Voucher where i want to show last sales price to customer as shown in picture. this code only shows last price of item. Set: $LASTSALEPRICE:STOCKITEM:$STOCKITEM
Make 2 Collections...... One collection if for Vouchers and Filtered on Sales Voucher........ 2nd Collection will have source of the first collection....walk the Inventory entries, and fetch the Rate, Date, VoucherTypeName, PartyLedgerName, StockItemName and will be sorted on reverse date....means latest date on top. This should be filtered also based on matching PartyLedgerName and StockITemName Then make a formula to fetch the rate ---- $CollectionField:$Rate:1:{2nd collection name} and use this in your Field.
Code: [Collection : SaleVchColl2] Type : Voucher Filter : VchSales [System : Formulae] VchSales : $$IsSales:$VoucherTypeName [Collection : PartyColl] Source Collection : SaleVchColl2 Walk : InventoryEntries By : Pname : $PartyLedgerName by:item:$stockitemname Aggr Compute : Rate : sum : $Rate [#Field: VCH NrmlRate] Set as : $$FilterValue:$Rate:partyColl:1:partyItemCheck [System: Formula] PartyItemCheck : $Pname=$$ReqObject:($$Owner:$PartyLedgername) and $item=#VCHStockItem this code is working fine in sales voucher to fetch last sale rate to that particular customer but in purchase voucher while entering data Rate Field is showing BLANK
You made collection filtered on Sales Voucher.... So make similar one for Purchase or maybe combine the two. And why are you SUMMING up the rate....rate is Rate...no need to add up.
when removing SUM its not working. i do not want anything change in purchase but getting this in RATE FIELD. [#Field: VCH NrmlRate] is confliting i think sir
[Collection : PartyColl] Source Collection : SaleVchColl2 Walk : InventoryEntries Fetch : Rate, Date, VoucherTypeName, PartyLedgerName, StockItemName Filter : LSPRateFltr Sort : Default : -$Date [System : Formula] LSPRateFltr : $PartyLedgerName = #EIConsignee AND $StockItemName = #VCHStockItem LSP: $$CollectionField:$Rate:1:LPartyColl Now use @@LSP in your field name .......... as per your code it is only for SALES. You need to add Purchase VchType, if you need that too.
[#Field: VCH NrmlRate] Set as : $$FilterValue:$RateartyColl:1:LSPRateFltr by doing this also only getting value in sales voucher but in purchase voucher RATE FIELD , it showing blank. not even last purchase rate or defult rate for tally while entering purchase voucher
I have said it twice ......... please read carefully what I have suggested in the previous 2 posts above.
Amit sir i tried to combine for both sales and Purchase but failed. only getting in single voucher. Give me some more help. Please
From your code above, it is only for SALES .... there is no Purchase........... Show your full code..........
amit sir is it the [#Field: VCH NrmlRate] i am changing in sales is affecting in purchase voucher as both field are same ?
Yes both fields are common........... for Sales/Purchase/DN/CN etc Also unless you understand TDL better, not advisable to change the Tally's default values for important fields ...like .... VCH NrmlRate is one of them. For COMMON fields you should use Condition or OPTION or SWITCH......... Condition is simplest of all....... If SalesVchType then "this" else {default tally's}
This will not serve the purpose of his code. He is trying to put a value (SET AS) as per voucher type.....
[#Field: VCH NrmlRate] Set as : if not $$VchTypejrnl then $$FilterValue:$RateartyColl:1artyItemCheck else ""
Code: Set as : if not $$IsJournal:##SVVoucherType then $$FilterValue:$Rate:partyColl:1:partyItemCheck else ""
Not working amit sir. in journal while doing sales/ purchase entry auto fill rate field not coming as shown in document.
In Your Previous Post You told that You want to exclude it in Journal Voucher Type and This code will remove that from Journal Voucher and Now you are telling it is not coming in journal ? Please be clear with your requirements and the code which amit sir told is very simple and He used a very simple logic which Everyone generally use in daily life So, Study the code and change it accordingly...Just Put Some Efforts
Silpa.. Just try to watch few initial videos of Tally solutions on TDL because your problem is very basic But Due to clarity issues I am not able to solve your problem So, It's always better to do some research Because By This only you can learn TDL
HIMANSHU Ji thanks for response. i tried to go through some tdl on this forum but could not find . where to get video on tdl. i just want the formula to work for sales/ purchase voucher and not for journal. if u can give some hints then i can try more. thank you