Item Sales History while Invoicing

Discussion in 'Free Source Codes' started by Nirav Merchant, Jul 11, 2014.

    
  1. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Very well done... congrats.

    now work on the EXPLODE part...........
     
    ankitinfo likes this.


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Also input a column for GST %age...for easy reference. If not column then incorporate in next to the StockItem Name
     


  3. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Your serial Numbers is still not in reverse order..............

    And what about the period................. have you worked on that?

    And why is there COMMA in Invoice Numbers???

    And why GST Numbers in History?? Is it required??

    Focus on relevant details, not redundant ones.
     


  4. Chetan S

    Chetan S New Member



    TDL shows as Expired Amit Sir.
     


  5. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Yes.. It is for demo mode only.
     


  6. Chetan S

    Chetan S New Member


    O
    Ok. Thank you sir...
     


  7. naren1234

    naren1234 Member


    Dear Experts,

    I tried to updated the code to include the following:
    1) Voucher Type
    2) Voucher Date
    3) **Running Serial No/s. from the voucher (1,2,3,4,...) for selected item as it would show up in Invoice Print.
    4) **Item's GST rate from the voucher (Not from the item master)
    5) ^^Multi-line "additional descriptions" for that item entry in the voucher (did Not know how to explode this for all occurances, so I had added 3 columns for now).
    6) ~~Running Serial Number for these Sales & Purchase History report.
    7) Opening the voucher in view mode (Alt+Enter) or Alter mode (Enter) from this report.

    However,
    -The code fails to capture point no.3 Running Sr No. and point no. 4 IGST Rate from the transaction (voucher entry).

    -Regarding point no. 5, trying to capture multi-line "additional descriptions" -the code seems wrong --it only captures the 1st line of description. I was trying to put each line of item description in a separate column.

    -For point no. 6, as pointed by Amit sir, (although ascending order fits for my case) I am not sure how write a function to reverse the running Sr. No. for this report. Logically, a.f.a.i.k., this requires us to determine the total number of records beforehand (which is Not possible) and then reduce line numbers by 1 till the last transaction.
    Secondly, if the selected item is repeated more than once in any voucher, then this report's Sr. No. re-sets to 1 for subsequent (i.e. 2nd to last) occurrences for that voucher, and then picks-up the Sr No. from the 1st occurance to continue numbering from next voucher records. --It will be more intuitive to either skip(blank) the Sr. No. in case of repetitions within the same voucher Or, fill all repetitions with the same Sr. No. , but Not sure how to fix this.

    Your help will be much appreciated.
    Thanks.

    Code:
    ;;=========== Item Sales & Purchase History while Invoicing : Press F6 ================
    
    [Collection : ClnSaleInfo]
        Type     : Vouchers : Stock Item
        Child Of : $$BaseOwner:#VchStockItem
        Filter   : SalesFilter
        Sort     : @@Default : -$Date
        Fetch    : LedgerEntries.PartyLedgerName, LedgerEntries.LedgerName
    
    [System : Formula]
        MStk           : $StockItemName = $$BaseOwner:#VCHStockItem
        SalesFilter    : $$IsSales:$VoucherTypeName
        PurchaseFilter : $$IsPurchase:$VoucherTypeName
    ;   SalesPurFilter : $$IsPurchase:$VoucherTypeName or $$IsSales:$VoucherTypeName
        ExtractYear    : $$FinYearBeg:##SVCurrentDate:$StartingFrom:Company:##SVCurrentCompany
    ; 
        Historybeginyear : ExtractYear - 3  ;<----Change to capture specific number of years
    
    [#Field : VCH StockItem]
        Key : SalesHistory
        Key : PurchaseHistory
        Key : SalesPurHistory
        Tooltip : "Press F5 for Purchase History, F4 for Sales History, F6 for Both"
    
    [Key : SalesHistory]
        Key    : F4
        Action : Display : RptSalesHistory
    
    [Key: ExportButton11]
            Key     : Alt+E
            Title   : $$LocaleString:"Export"
            Type    : ExportButton
            Action  : Export Report
    
    [Report : RptSalesHistory]
        Form : FrmSalesHistory
    ;Use below 3 lines if you want to get report for specific no. of years ste above in system formula
    ;Variable : HistoryFrom, HistoryTo
    ;     Set : HistoryFrom : "01/04" + @@Historybeginyear
    ;     Set : HistoryTo : $$FinYearEnd:##SVCurrentDate:$StartingFrom:Company:##SVCurrentCompany
    
    [Form : FrmSalesHistory]
        Part : PrtSalesHistory
        Height     : if $$InPrintMode then 8.20 else 100% Screen
        Width    : if $$InPrintMode then 5.70 else 75% Screen
        Use        : DSP Template
        Horizontal Align: Right
        ;Vertical Alignment : Bottom
        Buttons: PrintButton, ExportButton
        Background: @@SV_RELEASEDBLUE
    
    [Part : PrtSalesHistory]
        Line   : LnSalesHistoryTitle, LnSalesHistoryHD, LnSalesHistoryData
        Repeat : LnSalesHistoryData : ClnSaleInfo
        Scroll : Vertical
    
    [Line : LnSalesHistoryTitle]
        Field : FldVwStkItem
        Fixed : Yes
    
    [Field : FldVwStkItem]
        Use        : Short Name Field
        Set As     : "Sales History For : " + #VCHStockItem
        Full Width : Yes
        Align      : Centre      
      
    [Line : LnSalesHistoryHD]
        Use : LnSalesHistoryData
        Local : Field : Default : Type : String
        ;Local : Field : Default : Align : Centre  
        Local : Field : FldSalesHistory7 : Set As : "Sl. No"
        Local : Field : FldSalesHistory7 : Align  : Center
        Local : Field : FldSalesHistory0 : Set As : "Voucher Type"
        Local : Field : FldSalesHistory1 : Set As : "Invoice No"
        Local : Field : FldSalesHistoryDt: Set As : "Date"
        Local : Field : FldSalesHistoryDt: Align  : Center
        Local : Field : FldSalesHistory2 : Set As : "Party Name"
        Local : Field : FldSalesHistorySr: Set as : "Inv Sl. No"
        Local : Field : FldSalesHistorySr: Align  : Center
        Local : Field : FldSalesHistory3 : Set As : "Qty"
        Local : Field : FldSalesHistory3 : Align  : Center
        Local : Field : FldSalesHistory4 : Set As : "Rate"
        Local : Field : FldSalesHistory4 : Align  : Left
        Local : Field : FldSalesHistory5 : Set As : "Discount"
        Local : Field : FldSalesHistory6 : Set As : "Amount"
        Local : Field : FldSalesHistory6 : Align  : Right
        Local : Field : FldSalesHistory8 : Set As : "IGST Rate"
        Local : Field : FldSalesHistory8 : Align  : Center
        Local : Field : FldSalesHistory9 : Set As : "Desc1"
        Local : Field : FldSalesHistory10: Set As : "Desc2"
        Local : Field : FldSalesHistory11: Set As : "Desc3"
        Border : Column Titles
        Fixed : Yes
    
    [Line : LnSalesHistoryData]
        Field : FldSalesHistory7, FldSalesHistory1, FldSalesHistoryDt, FldSalesHistory2 ;;FldSalesHistory0,
        Right Field : FldSalesHistorySr, FldSalesHistory3, FldSalesHistory4, FldSalesHistory5, FldSalesHistory6, FldSalesHistory8, FldSalesHistory9, FldSalesHistory10, FldSalesHistory11
            Local : Field : FldSalesHistory7 : Set As : $$Line
        Local : Field : FldSalesHistory0 : Set As : $VoucherTypeName
        Local : Field : FldSalesHistory1 : Set As : $VoucherNumber
        Local : Field : FldSalesHistoryDt: Set As : $Date
        Local : Field : FldSalesHistory2 : Set As : $PartyLedgerName
        Local : Field : FldSalesHistorySr: Set As : $$FilterValue:$Line:InventoryEntries:1:mStk
        Local : Field : FldSalesHistory3 : Set As : $$FilterValue:$BilledQty:InventoryEntries:1:mStk
        Local : Field : FldsalesHistory4 : Set As : $$FilterValue:$Rate:InventoryEntries:1:mStk
        Local : Field : FldSalesHistory5 : Set As : $$FilterValue:$discount:InventoryEntries:1:mStk
        Local : Field : FldSalesHistory6 : Set As : $$FilterValue:$Amount:InventoryEntries:1:mStk
        Local : Field : FldSalesHistory8 : Set As : $$FilterValue:$GSTRate:InventoryEntries:1:mStk ;to be fetched from the voucher, Not from Item Master
        Local : Field : FldSalesHistory9 : Set As : $$FilterValue:$BasicUserDescription:InventoryEntries:1:mStk
        Local : Field : FldSalesHistory10: Set As : $$FilterValue:$BasicUserDescription:BasicUserDescription:2:InventoryEntries:1:mStk
        Local : Field : FldSalesHistory11: Set As : $$FilterValue:$BasicUserDescription:BasicUserDescription:3:InventoryEntries:1:mStk
        ;Empty If : NOT $$IsSalesOrder:$VoucherTypeName
        Explode : PrtsalesHistoryData : $$FilterCount:InventoryEntries:mStk -1 > 0
            Remove If : $$Line > 50  ;to limit the data to 50 transactions each for purchase and sale
        Option : Alter on Enter
        Option: DisplayOnAltEnter
    
    [Part : PrtsalesHistoryData]
        Line : LnsalesHistoryData1
        Repeat : LnsalesHistoryData1 : InventoryEntries
    
    [Line : LnsalesHistoryData1]
        Field : FldSalesHistory7, FldSalesHistory1, FldSalesHistoryDt, FldSalesHistory2
        Right Field : FldSalesHistorySr, FldSalesHistory3, FldSalesHistory4, FldSalesHistory5, FldSalesHistory6, FldSalesHistory8, FldSalesHistory9, FldSalesHistory10, FldSalesHistory11
        Local : Field : FldSalesHistory7 : Set As : $$Line
        Local : Field : FldSalesHistory0 : Set As : $$Owner:$VoucherTypeName
        Local : Field : FldSalesHistory1 : Set As : $$Owner:$VoucherNumber
        Local : Field : FldSalesHistoryDt: Set As : $$Owner:$Date
        Local : Field : FldSalesHistory2 : Set As : $$Owner:$PartyLedgerName
        Local : Field : FldSalesHistorySr: Set As : $Line
        Local : Field : FldSalesHistory3 : Set As : $BilledQty
        Local : Field : FldSalesHistory4 : Set As : $Rate
        Local : Field : FldSalesHistory5 : Set As : $Discount
        Local : Field : FldSalesHistory6 : Set As : $Amount
        Local : Field : FldSalesHistory8 : Set As : $GSTRate  ;to be fetched from the voucher, Not from Item Master
        Local : Field : FldSalesHistory9 : Set As : $BasicUserDescription:1
        Local : Field : FldSalesHistory10: Set As : $BasicUserDescription:BasicUserDescription:2
        Local : Field : FldSalesHistory11: Set As : $BasicUserDescription:BasicUserDescription:3
        Empty if : NOT @@mStk  OR $$ItemSerial=0  
    
    [Field : FldSalesHistory0]
        Use : Short Name Field  
        Style: HistoryBody
        Align: Center
        Alter: Voucher
        Display: Voucher
    
    [Field : FldSalesHistory1]
        Use : Short Name Field  
        Style: HistoryBody
        Align: Center
        Alter: Voucher
        Display: Voucher
    
    [Field : FldSalesHistoryDt]
        Use : Short Date Field  
        Style: HistoryBody
        Alter: Voucher
        Display: Voucher
    
    [Field : FldSalesHistory2]
        Use : Name Field
        Style: HistoryBody
        Width: Full Width
        Indent : 1
        Alter: Voucher
        Display: Voucher
    
    [Field : FldSalesHistorySr]
        Use : Short Name Field
        Style: HistoryBody
        Align : Right
        Alter: Voucher
        Display: Voucher
    
    [Field : FldSalesHistory3]
        Use : Qty Field
        Style: HistoryBody
        Align : Right
        Alter: Voucher
        Display: Voucher
    
    [Field : FldsalesHistory4]
        Use : Rate Price Field
        Style: HistoryBody
        Width: Full Width
        Indent : 2
        Alter: Voucher
        Display: Voucher
    
    [Field : FldsalesHistory5]
        Use : Number Field
        Align : Right
        Format : "Percentage"
        Style: HistoryBody
        Alter: Voucher
        Display: Voucher
    
    [Field : FldsalesHistory6]
        Use : Amount Field
        Style: HistoryBody
        Alter: Voucher
        Display: Voucher
    
    [Field : FldSalesHistory7]
        Use : Short Name Field  
        Style: HistoryBody
        Align: Center
        Alter: Voucher
        Display: Voucher
    
    [Field : FldSalesHistory8]
        Use : Number Field  
        Style: HistoryBody
        Align: Center
        Alter: Voucher
        Display: Voucher
    
    [Field : FldSalesHistory9]
        Use : Short Name Field  
        Style: HistoryBody
        Align: Center
        Alter: Voucher
        Display: Voucher
    
    [Field : FldSalesHistory10]
        Use : Short Name Field  
        Style: HistoryBody
        Align: Center
        Alter: Voucher
        Display: Voucher
    
    [Field : FldSalesHistory11]
        Use : Short Name Field  
        Style: HistoryBody
        Align: Center
        Alter: Voucher
        Display: Voucher
    
    [Style: HistoryBody]
        Use     : Tiny
        Bold    : Yes
    
    [Collection : ClnPurchaseInfo]
        Type     : Vouchers : Stock Item
        Child Of : $$BaseOwner:#VchStockItem
        Filter   : PurchaseFilter
        Sort     : @@Default : -$Date
        Fetch    : LedgerEntries.PartyLedgerName, LedgerEntries.LedgerName
    
    [Key : PurchaseHistory]
        Key    : F5
        Action : Display : RptPurchaseHistory
    
    [Report : RptPurchaseHistory]
        Form : FrmPurchaseHistory
    ;Use below 3 lines if you want to get report for specific no. of years ste above in system formula
    ;Variable : HistoryFrom, HistoryTo
    ;     Set : HistoryFrom : "01/04" + @@Historybeginyear
    ;     Set : HistoryTo : $$FinYearEnd:##SVCurrentDate:$StartingFrom:Company:##SVCurrentCompany
      
    [Form : FrmPurchaseHistory]
        Part : PrtPurchaseHistory
        Height     : if $$InPrintMode then 8.20 else 100% Screen
        Width    : if $$InPrintMode then 5.70 else 50% Screen
        Use    : DSP Template
        Horizontal Align: Left
        Buttons: PrintButton, ExportButton
        Background: @@SV_RELEASEDYELLOW
      
    [Part : PrtPurchaseHistory]
        Line   : LnPurchaseHistoryTitle, LnPurchaseHistoryHD, LnPurchaseHistoryData
        Repeat : LnPurchaseHistoryData : ClnPurchaseInfo
        Scroll : Vertical
    
    
    [Key : SalesPurHistory]
        Key    : F6
        Action : Display : RptSalesPurHistory
    
    [Report : RptSalesPurHistory]
        Form : FrmSalesPurHistory
    ;Use below 3 lines if you want to get report for specific no. of years ste above in system formula
    ;Variable : HistoryFrom, HistoryTo
    ;     Set : HistoryFrom : "01/04" + @@Historybeginyear
    ;     Set : HistoryTo : $$FinYearEnd:##SVCurrentDate:$StartingFrom:Company:##SVCurrentCompany
    
    [Form : FrmSalesPurHistory]
        Part      : PrtPurchaseHistory
        Part      : PrtSalesHistory
        Height    : if $$InPrintMode then 4.10 else 100% Screen
        Width      : if $$InPrintMode then 5.70 else 50% Screen
        Use      : DSP Template
        Horizontal Align: Left
    ;    Vertical Alignment : Bottom
        Background: @@SV_RELEASEDGREEN
        Buttons   : PrintButton, ExportButton
    
    [Line: LnPurchaseHistoryTitle]
    ;    Use   : LnSalesHistoryTitle
        Field : FldVwStkItem2
        Fixed : Yes
    
    [Field : FldVwStkItem2]
        Use        : Short Name Field
        Set As     : "Purchase History For : " + #VCHStockItem
        Full Width : Yes
        Align      : Centre   
    
    [Line: LnPurchaseHistoryHD]
        Use: LnSalesHistoryHD
      
    [Line: LnPurchaseHistoryData]
        Use: LnSalesHistoryData
    
    ;;===================================================================================
    ;;'Books Beginning From' & 'Date of Last Entry'
    ;;Set : SVFRomDate : $Booksfrom:Company:##SVCurrentCompany
    ;;Set : SVToDate : $LastVoucherDate:Company:##SVCurrentCompany
     

    Attached Files:



  8. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Set As : If ($$NumItems + 1) > 50 Then (51 - $$Line) Else ($$NumItems + 1) - $$Line
     
    naren1234 likes this.


  9. PANKAJ BHONDLE

    PANKAJ BHONDLE Active Member


    upload_2021-8-12_2-3-20.png

    desc1, desc2, desc3 problem solve
     
    naren1234 likes this.


  10. PANKAJ BHONDLE

    PANKAJ BHONDLE Active Member


    inv Sl no, Do Not Understnad, Call me 9822412242
     


  11. naren1234

    naren1234 Member


    Amit ji, thank you.
    So $$NumItems to gets the total count, noted.
     


  12. naren1234

    naren1234 Member


    Great job, Pankaj ji,
    Invoice Sl No. means the item line number on printed invoice (marked in Red in the attached screenshot). In case of 50/100+ billed items, this helps to quickly locate that item entry on printed invoice or, to scroll(navigate) within the voucher entry -to that item, for corrections.
     

    Attached Files:



  13. PANKAJ BHONDLE

    PANKAJ BHONDLE Active Member


    upload_2021-8-12_16-42-5.png
    Item Serial No. Problem Solve
     
    naren1234 likes this.


  14. naren1234

    naren1234 Member


    Perfect !!
    Thank you.
     


  15. naren1234

    naren1234 Member


    Just realised, in my case me, the code failed to capture purchase/sales transactions entered in voucher mode, is anyone else having this issue?
     


  16. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    In Voucher mode, the Field Name is different, so accommodate your code to account for Voucher mode also.
     
    naren1234 likes this.


  17. sunil agarwal

    sunil agarwal New Member


    REQUIRED SALE INVOICE NO PRINT IN LARGE
     


  18. mpal2311

    mpal2311 Active Member


    Thanks
     


  19. mukesh1984

    mukesh1984 New Member


    Pop up
     


  20. ch ruchitha

    ch ruchitha Member


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







    [System : Formula]
    MStk : $StockItemName = $$BaseOwner:#VCHStockItem
    SalesFilter : $$IsSales:$VoucherTypeName
    PurchaseFilter : $$IsPurchase:$VoucherTypeName



    [Collection: Rama]
    Use : Vouchers of Ledger
    ; Child of : #LedgerName





    [#Field : Vch batch Rate]
    Key : SalesHistory
    Key : PurchaseHistory
    Tooltip : "Press Alt + F9 for Purchase History & Alt + F8 for Sales History"

    [Key : SalesHistory]
    Key : Alt+F8
    Action : Display : RptSalesHistory

    [Report : RptSalesHistory]
    Form : FrmSalesHistory

    [Form : FrmSalesHistory]
    Part : PrtSalesHistory
    Height : if $$InPrintMode then 8.20 else 100% Screen
    Width : if $$InPrintMode then 5.70 else 50% Screen
    Horizontal Align: Right
    Buttons: PrintButton, ExportButton

    [Part : PrtSalesHistory]
    Line : LnSalesHistoryTitle, LnSalesHistoryHD, LnSalesHistoryData
    Repeat : LnSalesHistoryData : ClnSaleInfo
    Scroll : Vertical

    [Line : LnSalesHistoryTitle]
    Field : FldVwStkItem
    Fixed : Yes

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

    [Line : LnSalesHistoryHD]
    Use : LnSalesHistoryData
    Local : Field : Default : Type : String
    ;Local : Field : Default : Align : Centre
    Local : Field : FldSalesHistory0 : Set As : "Voucher Type"
    Local : Field : FldSalesHistory1 : Set As : "Invoice No"
    Local : Field : FldSalesHistoryDt: Set As : "Date"
    Local : Field : FldSalesHistoryDt: Align : Center
    Local : Field : FldSalesHistory2 : Set As : "Party Name"
    Local : Field : FldSalesHistory3 : Set As : "Qty"
    Local : Field : FldSalesHistory3 : Align : Center
    Local : Field : FldSalesHistory4 : Set As : "Rate"
    Local : Field : FldSalesHistory4 : Align : Left
    Local : Field : FldSalesHistory5 : Set As : "Discount"
    Local : Field : FldSalesHistory6 : Set As : "Amount"
    Local : Field : FldSalesHistory6 : Align : Right
    Border : Column Titles
    Fixed : Yes

    [Line : LnSalesHistoryData]
    Field : FldSalesHistory1, FldSalesHistoryDt, FldSalesHistory2 ;;FldSalesHistory0,
    Right Field : FldSalesHistory3, FldSalesHistory4, FldSalesHistory5, FldSalesHistory6
    Local : Field : FldSalesHistory0 : Set As : $VoucherTypeName
    Local : Field : FldSalesHistory1 : Set As : $VoucherNumber
    Local : Field : FldSalesHistoryDt: Set As : $Date
    ;;Local : Field : FldSalesHistory2 : Set As : $PartyLedgerName

    Local : Field : FldSalesHistory2 : Set As :$$Filter:$PartyLedgerName:LedgerEntries:1:rama

    Local : Field : FldSalesHistory3 : Set As : $$FilterValue:$BilledQty:InventoryEntries:1:mStk
    Local : Field : FldSalesHistory4 : Set As : $$FilterValue:$Rate:InventoryEntries:1:mStk
    Local : Field : FldSalesHistory5 : Set As : $$FilterValue:$discount:InventoryEntries:1:mStk
    Local : Field : FldSalesHistory6 : Set As : $$FilterValue:$Amount:InventoryEntries:1:mStk
    ;Empty If : NOT $$IsSalesOrder:$VoucherTypeName
    Explode : PrtSalesHistoryData : $$FilterCount:InventoryEntries:mStk -1 > 0

    [Part : PrtSalesHistoryData]
    Line : LnSalesHistoryData1
    Repeat : LnSalesHistoryData1 : InventoryEntries

    [Line : LnSalesHistoryData1]
    Field : FldSalesHistory1, FldSalesHistoryDt, FldSalesHistory2
    Right Field : FldSalesHistory3, FldSalesHistory4, FldSalesHistory5, FldSalesHistory6
    Local : Field : FldSalesHistory0 : Set As : $$Owner:$VoucherTypeName
    Local : Field : FldSalesHistory1 : Set As : $$Owner:$VoucherNumber
    Local : Field : FldSalesHistoryDt: Set As : $$Owner:$Date
    Local : Field : FldSalesHistory2 : Set As : $$Owner:$PartyLedgerName
    Local : Field : FldSalesHistory3 : Set As : $BilledQty
    Local : Field : FldSalesHistory4 : Set As : $Rate
    Local : Field : FldSalesHistory5 : Set As : $Discount
    Local : Field : FldSalesHistory6 : Set As : $Amount
    Empty if : NOT @@mStk OR $$ItemSerial=0

    [Field : FldSalesHistory0]
    Use : Short Name Field
    Style: HistoryBody
    Align: Center
    [Field : FldSalesHistory1]
    Use : Number Field;Short Name Field
    Style: HistoryBody
    Align: Center
    [Field : FldSalesHistoryDt]
    Use : Short Date Field
    Style: HistoryBody
    [Field : FldSalesHistory2]
    Use : Name Field
    Style: HistoryBody
    Width: Full Width
    Indent : 1
    [Field : FldSalesHistory3]
    Use : Qty Field
    Style: HistoryBody
    Align : Right
    [Field : FldSalesHistory4]
    Use : Rate Price Field
    Style: HistoryBody
    Width: Full Width
    Indent : 2
    [Field : FldSalesHistory5]
    Use : Number Field
    Align : Right
    Format : "Percentage"
    Style: HistoryBody
    [Field : FldSalesHistory6]
    Use : Amount Field
    Style: HistoryBody

    [Style: HistoryBody]
    Use : Tiny
    Bold : Yes



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

    [Key : PurchaseHistory]
    Key : Alt+F9
    Action : Display : RptPurchaseHistory

    [Report : RptPurchaseHistory]
    Form : FrmPurchaseHistory

    [Form : FrmPurchaseHistory]
    Part : PrtPurchaseHistory
    Height : if $$InPrintMode then 8.20 else 100% Screen
    Width : if $$InPrintMode then 5.70 else 50% Screen
    Buttons: PrintButton, ExportButton
    Background: @@SV_RELEASEDYELLOW
    Horizontal Align: Left

    [Part : PrtPurchaseHistory]
    Line : LnPurchaseHistoryTitle, LnPurchaseHistoryHD, LnPurchaseHistoryData
    Repeat : LnPurchaseHistoryData : ClnPurchaseInfo
    Scroll : Vertical

    [Line: LnPurchaseHistoryTitle]
    Use: LnSalesHistoryTitle

    [Line: LnPurchaseHistoryHD]
    Use: LnSalesHistoryHD

    [Line: LnPurchaseHistoryData]
    Use: LnSalesHistoryData
     


  21. ch ruchitha

    ch ruchitha Member



    I get this code in this form sir.Can any One help me for only related party details ?


    Thanks in Advance.
     


  22. Ari Raju

    Ari Raju New Member


    Change the below you can get selected party details only.

    SalesFilter : $PartyLedgerName = #EIConsignee AND $StockItemName = #VCHStockItem
     


  23. ch ruchitha

    ch ruchitha Member


    Thank you very much Raju garu.
     
    Ari Raju likes this.


  24. ch ruchitha

    ch ruchitha Member


    This form for help of main.
    Thank you for every one.
     
    Last edited: May 1, 2022


  25. ch ruchitha

    ch ruchitha Member


    Hellow ! Ari Raju garu
    Can you help on this.
    I get this code from one of the site.Its working fine in tally Erp-9.But not working in tally prime.where is the problem in below code ?
    [#Menu: GatewayofTally]
    Add: Item: Before:Reports: @@locRecyclebin :Display :LW Del :NOT $$IsEmpty:$$SelectedCmps
    Add: Item: After: @@locRecyclebin: Blank
    Control :mad:@locRecyclebin: $$Allow:Create:Vouchers

    [Report: LW Del]
    Use: Voucher Register
    Title : "Recycle Bin"
    Local: Line: DSP Vchdetail: Empty: NOT $fldDeleted
    Set: FamilyVoucherFlag: Yes
    Set: IsRestoreMode: Yes
    Set: SV To Date : $$YearEnd:##SVCurrentDate
    Set: lConfirmation: Yes

    [#Form: Voucher]
    Local: Line : VCH NarrPrompt: Add: Fields: Recycle Bin
    Set Always: RecycleBinFlag: If ##IsRestoreMode then ##RecyclebinFlag else No

    [Field: Recycle Bin]
    Use: Logical field
    Storage: fldDeleted
    Set as: If ##IsRestoreMode then No else ##RecyclebinFlag
    Set Always: Yes
    Type: Logical
    Invisible: Yes

    [#Collection: DayBook Vouchers of Company]
    Fetch : fldDeleted
    [#Key: BottomToolBarBtn3_Delete]
    Title : $$LocaleString:"Delete"
    Option: RbinFormDelete: if ($$IsVoucher AND NOT ##IsRestoreMode) then Yes else No

    [#Key: BottomToolBarBtn3]
    Title : $$LocaleString:"Delete"
    Option: RbinDeleteLineObject: Yes
    [#Key: Delete Line Object]
    Key : Alt+D
    Option: RbinDeleteLineObject: Yes

    [#Key: Delete Line ObjectEx]
    Key : Alt+D
    Option: RbinDeleteLineObject: Yes
    [!Key: RbinFormDelete]
    Key: Alt+D
    Action: Alter: Rpt Confirmation

    [!Key: RbinDeleteLineObject]
    Key: Alt+D
    Action: Alter Object

    [Key: Restore from Bin]
    Key: CTRL+R
    Action: Alter Object

    [Report: Rpt Confirmation]
    Add: Form: frm Confirmation
    Variable: lConfirmation
    Set: lConfirmation: Yes
    Title: "Confirm"

    [Form: frm Confirmation]
    Add: Part: LWhead,LWtt, LWdoubl
    Add: Bottom Part: LWlower
    Full Width : No
    No Confirm : Yes
    Space Left : 5
    Space Right : 5
    Space Top : 2
    Space Bottom: 1
    Width: 25% screen
    Height: 25% screen

    [Part: LWhead]
    Horizontal Align: Centre
    Lines : ln Heading

    [Part: LWtt]
    Horizontal Align: Centre
    Lines : Form SubTitle
    Local : Field : Form SubTitle : Info : $$LocaleString:"Delete?? [Yes/No]"

    [Part: LWdoubl]
    Horizontal Align: Centre
    Lines : ln Confirmation

    [Part: LWlower]
    Horizontal Align: Centre
    Lines : ln Caption1

    [Line: ln Heading]
    Add: Field : fldHeading

    [Line: ln Confirmation]
    Add: Field: LearnWellC,LearnWellR,LearnWellO

    [Line: ln Caption1]
    Add: Field: fldCaption1

    [Field: LearnWellC]
    Use: Logical Field
    Set as: ##lConfirmation
    Modifies: lConfirmation

    [Field: LearnWellR]
    Use: Logical Field
    Set as: #LearnWellC
    Set Always: Yes
    Modifies: RecycleBinFlag
    Skip: Yes
    Invisible: Yes

    [Field: LearnWellO]
    Use: Logical Field
    Set as: #LearnWellC
    Set Always: Yes
    Modifies: OptionalFlag
    Skip: Yes
    Invisible: Yes

    [Field: fldHeading]
    Info: "Tally-RECYCLE BIN"
    Color:Blue
    Style:Bold

    [Field: fldCaption1]
    Info: "www.Learnwells.com"
    Color:Red
    Style:Bold

    [#Report: Daybook]
    Local: Line: DSP VchDetail: Empty : $fldDeleted
    Set: IsRestoreMode: No

    [#Report: Ledger Vouchers]
    Local: Line: DSP VchDetail: Empty : $fldDeleted
    Set: IsRestoreMode: No

    [#Line: DSP VchDetail]
    Add: Option: DSP VchDetail Restore: $fldDeleted

    [!Line: DSP VchDetail Restore]
    Add: Keys: Restore from Bin

    [#Field: VCH Optional]
    Option: Rbin VCH Delete: ##OptionalFlag and NOT ##IsRestoreMode
    Option: Rbin VCH Restore: ##OptionalFlag and ##IsRestoreMode

    [!Field: Rbin VCH Delete]

    Style: My Style
    Set as: if #Recyclebin then "PRESS ENTER to DELETE" else @UseOptStr
    Skip: if #Recyclebin then No else Yes
    Color:Red
    [Style: My Style]
    Font: Verdana
    Height: 18
    Bold: Yes

    [!Field: Rbin VCH Restore]


    Add: Fields: Long Prompt,LearnWellC,FlgLWr,FlgLWrf,FlgLWop,FlgLWfld
    Local: Field: Long Prompt: Info: "PRESS ENTER to RESTORE"
    Local: Field: Long Prompt: Full Width: Yes
    Local: Field: Long Prompt: Align: Right
    Local: Field: Long Prompt: Style: My Style
    Color: Red
    [Field: FlgLWr]
    Use: Logical field
    Type: Logical : Forced
    Modifies: RecyclebinFlag
    Set as: NOT #LearnWellC
    Set Always: Yes
    Invisible: Yes
    Skip: Yes

    [Field: FlgLWrf]
    Use: Logical field
    Type: Logical
    Storage: fldDeleted
    Set as: #FlgLWr
    Set Always: Yes
    Invisible: Yes
    Skip: Yes

    [Field: FlgLWop]
    Use: Logical field
    Type: Logical
    Modifies: OptionalFlag
    Set as: #FlgLWr
    Set Always: Yes
    Invisible: Yes
    Skip: Yes

    [Field: FlgLWfld]
    Use : Logical Field
    Storage : Is Optional
    Set as : #FlgLWop
    Set always : Yes
    Invisible : Yes
    Skip : Yes

    [#Form: Voucher]
    Option: RbinVoucher: ##OptionalFlag

    [!Form: RbinVoucher]
    Key: SaveVoucher

    [Key: SaveVoucher]
    Key: Enter
    Action: Form Accept

    [#Field: Plain VCH Date]
    Option: Rbin Plain VCH Date: ##OptionalFlag

    [!Field: RBin Plain VCH Date]
    Skip: if #RecycleBin then Yes else No
    [System: Variable]
    RecycleBinFlag: "No"
    IsRestoreMode: "No"
    lConfirmation: "No"

    [System: Formula]
    locRecyclebin : $$LocaleString:"Recycle Bin"

    [System: UDF]
    fldDeleted: Logical : 1

    [Variable: RecycleBinFlag]
    Type: Logical
    Volatile: Yes
    Persistent: No

    [Variable: IsRestoreMode]
    Type: Logical
    Volatile: No
    Persistent: no

    [Variable: lConfirmation]
    Type: Logical
    Persistent: No
    Volatile : Yes
    Default: No

    Thank you in advance.
     


Share This Page