Dear Experts, i want to get last purchase cost while entering a new purchase invoice in purchase voucher. but my code is not working in creation mode but working in alteration mode(saved purchase bill) [#Line: EI COLUMNONE] ADD:Right Field:At Beginning:LPURCOST Local:Field:LPURCOST:INFO:LPUR [#Line:EI invinfo] Add:Right Field:At Beginning:LPURCOST [Field:LPURCOST] Use:number field Set:$lastpurcprice:stockitem:$stockitem Width: 9 Color: BLUE Style: NORMAL BOLD Skip : YES Set Always: Yes
thank you very sir for the help but still code is not working. [#Line: EI COLUMNONE] ADD:Right Field:At Beginning:LPURCOST Local:Field:LPURCOST:INFO:LPUR [#Line:EI invinfo] Add:Right Field:At Beginning:LPURCOST [Field:LPURCOST] Use:number field Set as:$LastPurcPrice:StockItem:$StockItemName Width: 9 Color: BLUE Style: NORMAL BOLD Skip : YES Set Always: Yes
dear experts, now my tdl is working fine but how to remove units field (/nos) in my udf. [#Line: EI COLUMNONE] ADD:Right Field:At Beginning:LPURCOST Local:Field:LPURCOST:INFO:LPUR [#Line:EI invinfo] Add:Right Field:At Beginning:LPURCOST [Field:LPURCOST] Use:rate field Set As:$LastpurcPrice:StockItem:$StockItemName Width: 14 Color: red Style: NORMAL BOLD Skip : YES Set Always: Yes but if iuse number field, code is not working
Field:LPURCOST] Use : Rate Field Set : $lastpurcprice:stockitem:$stockitem Skip : Yes Color : Red Style : Large Bold Width : 13
[#Line: EI COLUMNONE] ADD:Right Field:At Beginning:LPURCOST, LPURCOST1 Local:Field:LPURCOST:INFO:LPUR Local:Field:LPURCOST1:INFO:LPUR [#Line:EI invinfo] Add:Right Field:At Beginning:LPURCOST, LPURCOST1 [Field:LPURCOST] Use:rate field Set As:$LastpurcPrice:StockItem:$StockItemName Width: 14 Color: red Style: NORMAL BOLD Skip : YES Set Always: Yes Invisible : yes [Field:LPURCOST1] Use: number field Set As: $$Number:#LPURCOST Width: 14 Color: red Style: NORMAL BOLD Skip : YES Set Always: Yes
Make a new collection of purchase voucher........ do 2 things in that... Compute the number of items i.e. number of purchase vouchers. Aggregate compute the discount "as amount" in all purchase vouchers and divide this total by the number of purchase vouchers and you get your average. Show this value in a Field in your voucher. On a personal note - do not understand the requirement for a "avg purchase discount" as that computed value has no bearing to the reality of changing business deals.
si sir, party give discount on what they get from supplier...thats why they need , i had tried as you say , thats type work on report but on voucher not getting value below is the code. [Field:AVG_PUR_DIS] Inactive:Not @@IsOrder Use : Amount Field Width : 25 mm;@@VCHDiscountWidth Align : Center Style : Normal Bold Set as:$$Number:$Discount;/$$Number:$ActualQty Set always : Yes Border : Thin Right Storage: Avgpurdis [Collection : MySalesSummaryCollection] Title : "List of Sales vouchers" Type : Vouchers : VoucherType Child of : $$VchTypePurchase Belongs to : Yes [Collection : MySalesItems] Source Collection : MySalesSummaryCollection Walk : Inventory Entries By : StockItemName : $StockItemName:StockItem:#VCHStockItem Sort : StockItemName : $StockItemName:StockItem:#VCHStockItem Aggr Compute : ActualQty : Sum : $ActualQty Aggr Compute : Rate : Sum : $Rate Aggr Compute : Amount : Sum : $Amount Aggr Compute iscount : Sum : $Discount;$Amount Keep Source : ().
Define the computed values in Object: Voucher Object : Voucher myvalue1: thisone myvalue2 : thisone2 ............... Then use the above in your code.
i try like this sir, but didn't work [Collection : MySalesItems] Source Collection : MySalesSummaryCollection Walk : Inventory Entries By : StockItemName : $StockItemName;:StockItem:#VCHStockItem Sort : StockItemName : $StockItemName;:StockItem:#VCHStockItem Object:Voucher Aggr Compute : ActualQty : Sum : $ActualQty Aggr Compute : Rate : Sum : $Rate Aggr Compute : Amount : Sum : $Amount Aggr Compute : Discount : Sum : $Discount;$Amount Keep Source : ().
[#Object : voucher] myActQty : $$ReportObject:$$FilterAmtTotal:MySalesItems:StkItmExists:$ActualQty [System: Formulae] StkItmExists : $StockItemName = $$ReqObject:$Name In your explode collection.... Compute : myActQty : $myActQty And so on............
li like this sir ? [#Object : voucher] myActQty : $$ReportObject:$$FilterAmtTotal:MySalesItems:StkItmExists:$ActualQty [System: Formulae] StkItmExists : $StockItemName = $$ReqObject:$Name [Collection : MySalesItems] Source Collection : MySalesSummaryCollection Walk : Inventory Entries By : StockItemName : $StockItemName;:StockItem:#VCHStockItem Sort : StockItemName : $StockItemName;:StockItem:#VCHStockItem Aggr Compute : myActQty : Sum:$myActQty Aggr Compute : ActualQty : Sum : $ActualQty Aggr Compute : Rate : Sum : $Rate Aggr Compute : Amount : Sum : $Amount Aggr Compute : Discount : Sum : $Discount;$Amount Keep Source : ().
SIR Still Not working, here i share the whole code ,kindly suggest [System:Formula] IsOrder: $$IsSalesOrder:##SVVoucherType [#Line: EI ColumnOne] Left Fields : VCH ItemTitle,Partcode_L,AVG_PUR_DIS_L Local : Field artcode_L : Space Left : 18 [Fieldartcode_L] Use:Name Field Width: 25 mm Info:"Part Code" Align:Center Inactive:Not @@IsOrder [Field:AVG_PUR_DIS_L] Use:Name Field Width: 25 mm Info:"AVG PUR DISC" Align:Center Inactive:Not @@IsOrder [#Line : EI InvInfo] Left Fields : EI DeemedPos, VCH StockItem,PartCode,AVG_PUR_DIS [FieldartCode] Inactive:Not @@IsOrder Use : Name Field Width : 25 mm;@@VCHDiscountWidth Align : Center Style : Normal Bold ; Set always : Yes Border : Thin Right Storageartcode Set as:$partno:StockItem:$StockItemName [Field:AVG_PUR_DIS] Inactive:Not @@IsOrder Use : Amount Field Width : 25 mm;@@VCHDiscountWidth Align : Center Style : Normal Bold Set as:$$Number:$myActQty;$Discount;/$$Number:$ActualQty Set always : Yes Border : Thin Right Storage: Avgpurdis [Collectionroduct ] Use : Alias Collection ;Title : $$LocaleString:"List of Stock Items" Type : Stock Item Fetch : Name FetchartNo ;Report : Stock Item ;Variable : SStockItem ;Trigger : SStockItem ;IsODBCTable : Yes [System:UDF] Partcode :String: 20001 Avgpurdis :Amount: 28 [Collection : MySalesSummaryCollection] Title : "List of Sales vouchers" Type : Vouchers : VoucherType Child of : $$VchTypePurchase Belongs to : Yes Format : $VoucherNumber, 20 Fetch : VoucherNumber Fetch : Inventory Entries ;Filter : EBFIsOfSelectedVchNo ;Sort : @@InvoiceNumberIncr :$VoucherNumber ;[Collection : MySalesSummaryCollection] ;Title : "List of Sales vouchers" ;Type : Vouchers : Stock Item;VoucherType ;Child of :$$BaseOwner:#VchStockItem; $$VchTypePurchase ;FilterOnly ;Belongs to : Yes ;Format : $VoucherNumber, 20 ;Fetch : VoucherNumber ;Fetch : Inventory Entries ;Filter : EBFIsOfSelectedVchNo ;Sort : @@InvoiceNumberIncr :$VoucherNumber [#Object : voucher] myActQty : $$ReportObject:$$FilterAmtTotal:MySalesItems:StkItmExists:$ActualQty [System: Formulae] StkItmExists : $StockItemName = $$ReqObject:$Name [Collection : MySalesItems] Source Collection : MySalesSummaryCollection Walk : Inventory Entries By : StockItemName : $StockItemName;:StockItem:#VCHStockItem Sort : StockItemName : $StockItemName;:StockItem:#VCHStockItem Aggr Compute : myActQty : Sum:$myActQty Aggr Compute : ActualQty : Sum : $ActualQty Aggr Compute : Rate : Sum : $Rate Aggr Compute : Amount : Sum : $Amount Aggr Compute : Discount : Sum : $Discount;$Amount Keep Source : ().
i do not have relevant tally data to try the code. Post the same ... I will try it on weekend if possible.