Partywise Itemwise Sales Price History

Discussion in 'Tally & TDL Learning HUB' started by Rakesh Bundele, Oct 15, 2021.

    
  1. Rakesh Bundele

    Rakesh Bundele New Member


    Hi Experts,
    Below code is working fine to find last sales price history for particular item. But it is showing sales price history for all customers for particular item.

    Whereas I want it should show sales price history of customer selected during voucher entry.

    Some sort of popup should come to select rate from history else should fetch standard sales price

    Please help...

    I'm not expert in TDL. I have little bit knowledge about TDL

    Thanks in Advance.




    [Collection : ClnSaleInfo]
    Type : Vouchers : Stock Item
    Child Of : $$BaseOwner:#VchStockItem
    Filter : SalesFilt
    Fetch : LedgerEntries.PartyLedgerName, LedgerEntries.LedgerName


    [System : Formula]
    MStk : $StockItemName = $$BaseOwner:#VCHStockItem
    SalesFilt : $$IsSales:$VoucherTypeName



    [#Field : VCH StockItem]
    Key : mKeyF4
    Tooltip : "Press F4 to See Item History"


    [Key : mKeyF4]
    Key : F4
    Action : Display : RptViewHistory

    [Report : RptViewHistory]
    Form : FrmViewHistory

    [Form : FrmViewHistory]
    Part : PrtViewHistory
    Height : 50 % Screen
    Vertical Alignment : Bottom

    [Part : PrtViewHistory]
    Line : LnViewHistoryTitle, LnViewHistoryHD, LnViewHistoryData
    Repeat : LnViewHistoryData : ClnSaleInfo
    Scroll : Vertical

    [Line : LnViewHistoryTitle]
    Field : FldVwStkItem
    Fixed : Yes

    [Field : FldVwStkItem]
    Use : Short Name Field
    Set As : "Sales History For : " + #VCHStockItem
    Full Width : Yes
    Align : Centre


    [Line : LnViewHistoryHD]
    Use : LnViewHistoryData
    Local : Field : Default : Type : String
    Local : Field : Default : Align : Centre
    Local : Field : FldViewHistory0 : Set As : "Voucher Type"
    Local : Field : FldViewHistory1 : Set As : "Invoice No"
    Local : Field : FldViewHistoryDt: Set As : "Date"
    Local : Field : FldViewHistory2 : Set As : "Party Name"
    Local : Field : FldViewHistory3 : Set As : "Qty"
    Local : Field : FldViewHistory4 : Set As : "Rate"
    Local : Field : FldViewHistory5 : Set As : "Discount"
    Local : Field : FldViewHistory6 : Set As : "Amount(Rs.)"
    Border : Column Titles
    Fixed : Yes


    [Line : LnViewHistoryData]
    Field : FldViewHistory1, FldViewHistoryDt, FldViewHistory2 ;;FldViewHistory0,
    Right Field : FldViewHistory3, FldViewHistory4, FldViewHistory5, FldViewHistory6
    Local : Field : FldViewHistory0 : Set As : $VoucherTypeName
    Local : Field : FldViewHistory1 : Set As : $VoucherNumber
    Local : Field : FldViewHistoryDt: Set As : $Date
    Local : Field : FldViewHistory2 : Set As : $PartyLedgerName
    Local : Field : FldViewHistory3 : Set As : $$FilterValue:$BilledQty:InventoryEntries:1:mStk
    Local : Field : FldViewHistory4 : Set As : $$FilterValue:$Rate:InventoryEntries:1:mStk
    Local : Field : FldViewHistory5 : Set As : $$FilterValue:$discount:InventoryEntries:1:mStk
    Local : Field : FldViewHistory6 : Set As : $$FilterValue:$Amount:InventoryEntries:1:mStk
    ;; Empty If : NOT $$IsSalesOrder:$VoucherTypeName
    Explode : PrtViewHistoryData : $$FilterCount:InventoryEntries:mStk -1 > 0

    [Part : PrtViewHistoryData]
    Line : LnViewHistoryData1
    Repeat : LnViewHistoryData1 : InventoryEntries

    [Line : LnViewHistoryData1]
    Field : FldViewHistory0, FldViewHistory1, FldViewHistoryDt, FldViewHistory2
    Right Field : FldViewHistory3, FldViewHistory4, FldViewHistory5, FldViewHistory6
    Local : Field : FldViewHistory0 : Set As : $$Owner:$VoucherTypeName
    Local : Field : FldViewHistory1 : Set As : $$Owner:$VoucherNumber
    Local : Field : FldViewHistoryDt: Set As : $$Owner:$Date
    Local : Field : FldViewHistory2 : Set As : $$Owner:$PartyLedgerName
    Local : Field : FldViewHistory3 : Set As : $BilledQty
    Local : Field : FldViewHistory4 : Set As : $Rate
    Local : Field : FldViewHistory5 : Set As : $Discount
    Local : Field : FldViewHistory6 : Set As : $Amount
    Empty if : NOT @@mStk OR $$ItemSerial=0



    [Field : FldViewHistory0]
    Use : Short Name Field

    [Field : FldViewHistory1]
    Use : Short Name Field

    [Field : FldViewHistoryDt]
    Use : Short Date Field

    [Field : FldViewHistory2]
    Use : Name Field
    Width : 50% Page
    [Field : FldViewHistory3]
    Use : Qty Field

    [Field : FldViewHistory4]
    Use : Rate Field

    [Field : FldViewHistory5]
    Use : Number Field
    Align : Right
    Format : "Percentage"

    [Field : FldViewHistory6]
    Use : Amount Field


    ;; Eof
     
    mukesh1984 likes this.


Share This Page