Net sales report

Discussion in 'Tally Developer' started by rajiv jaiswal, Jan 15, 2025.

  1. rajiv jaiswal

    rajiv jaiswal Member


    hello
    i am trying to generate report of total sales ,sales return and Nett sales as shown in image. i am getting
    Total sales but Not Sales Return. Please Help. My code is

    [#Menu: Gateway of Tally]
    Add : Key Item :Before : @@locQuit : "Party Wise Report" : R : Display : SalesReport


    [Report:SalesReport]
    Use : DSP Template
    Title : "Sales Report"
    ;Variable: SVFromDate, SVToDate
    Repeat : PartyName
    Form : SalesReport
    ;Set : SVFromDate : $$MonthStart:##SVCurrentDate
    ;Set : SVToDate : $$MonthEnd:##SVCurrentDate


    [Form:SalesReport]
    Button : PrintButton, ExportButton
    Button : ExplodeFlag,ChangePeriod
    Bottom Toolbar Buttons : EnterToEdit, BottomToolBarBtn8,BottomToolBarBtn9,BottomToolBarBtn10
    Part : SalesTitle,SalesPeriod,SalesDetails
    Bottom Part :SalesTotals
    Width : 100% Page
    Space Left : 2 mms
    Space Right : 2 mms

    [Key: EnterToEdit]
    Key : Enter
    Title : $$LocaleString:"Explode"
    Type : BottomToolBarBtn2
    Action : Explode

    [Part:SalesTitle]
    Line : SalesTitle
    Horizontal Align : Center

    [Part:SalesPeriod]
    Line : SalesPeriod

    [Line:SalesTitle]
    Field : Simple Field
    Local : Field : Simple Field : Style : Large Bold
    Local : Field : Simple Field : Info : "Party Wise Sales Report"
    Local : Field : Simple Field : Border: Thin Bottom
    Local : Field : Simple Field : Align : Center

    [Line:SalesPeriod]
    Right Field : Name Field
    Left Field : Short Prompt,RPTSalesFilter
    Local : Field : Name Field : Info : @@DSPDateStr
    Local : Field : Name Field : Width : 50
    Local : Field : Name Field : Align : Right


    [Field:RPTSalesFilter]
    Inactive : Not $EnableBroker:Company:##SVCurrentCompany
    Use : Simple Field
    Style : Normal Bold
    Set as : @VCHSalesName
    Set Always : Yes



    [Line:SalesHead]
    Use : SalesDetails
    Border : Column Titles
    Local : Field : Default : Type : String
    Local : Field : Default : Align : Center
    Local : Field : Default : Border : Thin Left
    Local : Field : Default : Style : Normal Bold
    Local : Field : SWSno : Set as : "Sno"
    Local : Field : SWSno : Border : Thin Left Right
    Local : Field : SalesPartyName : Set as : "Party Name"
    Local : Field : SalesPartyName : Align : Center
    Local : Field : SalesReturn : Set as : "Sales return"
    Local : Field : SalesReturn : Align : Center
    Local : Field : SalesNett : Set as : "Nett Sales"
    Local : Field : SalesNett : Align : Center
    Local : Field : SalesAmount : Set as : "Total sales"
    Local : Field : SalesAmount : Border : Thin Left Right
    Space Top : 1.5 mms
    Space Bottom: 1.5 mms

    [Part:SalesDetails]
    Line : SalesHead,SalesDetails
    Repeat : SalesDetails:SalesPartyWise:SalesPartyWise2
    Scroll : Vertical
    Total : SalesAmount,SalesReturn,SalesNett
    Common Border : Yes

    [Line:SalesDetails]
    Field : SWSno,SalesPartyName
    Right Field : SalesAmount,SalesReturn,SalesNett
    Option : AlterOnEnter : $$IsVoucher
    Space Bottom: 0.5 mms
    Space Top : 0.5 mms
    Border : Thin Top
    Explode : SalesExplode : ($$KeyExplode OR ##ExplodeFlag)

    [Field:SalesDefault]
    Use : Name Field
    Style : Normal Bold

    [Field:SWSno]
    Use : SalesDefault
    Set as : $$Line
    Width : 1.5 cm
    Align : Center
    Border : Thin Left Right

    [Field:SalesPartyName]
    Use : SalesDefault
    Set as : $PartyName
    Width : 60
    Quick Search: Yes
    Space Left : 2 mms


    [Field:SalesReturn]
    Use : SalesDefault
    Set as : $TotAmount2
    Type : Amount
    Width : @@AmountWidth
    Space Left : 2 mms
    Border : Thin Right

    [Field:SalesNett]
    Use : SalesDefault
    Set as : $TotAmount-$TotAmount2
    Width : 16
    Space Left : 2 mms
    Border : Thin Right

    [Field:SalesAmount]
    Use : SalesDefault
    Set as : $TotAmount
    Type : Amount
    Width : @@AmountWidth
    Format : "No Zero, Symbol," + ##ShowForex
    Align : Right
    Key : Calculator
    Max : @@MaxNumberWidth
    Width : 16
    Space Right : 2 mms
    Border : Thin Right
    Tooltip : "Amount Without TAX"

    [Part:SalesTotals]
    Line : SalesTotal

    [Line:SalesTotal]
    Border : Totals
    Use : SalesDetails
    Local : Field : Default : Type : String
    Local : Field : Default : Align : Right
    Local : Field : Default : Style : Large Bold
    Local : Field : Default : Border : Thin Left
    Local : Field : SWSno : Set as : ""
    Local : Field : SalesPartyName : Set as : "Grand Total"
    Local : Field : SalesReturn : Set as : $$Total:SalesReturn
    Local : Field : SalesNett : Set as : $$Total:SalesNett
    Local : Field : SalesAmount : Set as : $$Total:SalesAmount
    Local : Field : SalesAmount : Border : Thin Left Right
    Local : Field : SalesAmount : Align : Right

    [Part:SalesExplode]
    Line : SalesExplode
    Repeat : SalesExplode:SalesPartyExplode:SalesPartyExplode2
    Border : Thin Bottom

    [Line:SalesExplode]
    Use : SalesDetails
    Delete : Border
    Local : Field : SWSno : Set as : ""
    Local : Field : Default : Style : Normal Italic
    Local : Field : Default :color:Blue
    Local : Field : SalesPartyName : Set as : $ItemName
    Local : Field : SalesPartyName : Align : Right
    Local : Field : SalesAmount : Set as : $SubAmount


    [System:Formula]

    SalesExplodeFilter: $PartyName=#SalesPartyName

    [Collection: Sales Voucher]

    Type : Vouchers : VoucherType
    Child of : $$VchTypeSales
    Belongs to : Yes
    Fetch : Date,VoucherTypeName,PartyLedgerName,BasicPurchaseOrderNo,Amount


    [Collection:SalesPartyWise]
    Source Collection : Sales Voucher
    Walk : Inventory Entries
    By : PartyName : $PartyLedgerName

    ;Aggr Compute: TotAmount3 : Sum : $Amount-$Amount2
    Aggr Compute: TotAmount : Sum : $Amount
    ;Aggr Compute: TotAmount2 : Sum : $Amount
    Sort : Default : $PartyName

    [Collection:SalesPartyExplode]
    Source Collection : Sales Voucher
    Walk : Inventory Entries
    By : PartyName : $PartyLedgerName
    By : ItemName : $StockItemName


    Aggr Compute: SubAmount : Sum : $Amount
    Filter : SalesExplodeFilter


    [Variable: PartyName1]
    Type : String
    Repeat : ##DSPRepeatCollection

    ;;;;;;;;;;;;;============================================================================================================




    [Collection: Sales Voucher2]
    Type : Vouchers : VoucherType
    Child of : $$VchTypeCreditNote
    Belongs to : Yes
    Fetch : Date,VoucherTypeName,PartyLedgerName,BasicPurchaseOrderNo,Amount


    [Collection:SalesPartyWise2]
    Source Collection : Sales Voucher2
    Walk : Inventory Entries
    By : PartyName : $PartyLedgerName
    Aggr Compute: TotAmount2 : Sum : $Amount
    Sort : Default : $PartyName

    [Collection:SalesPartyExplode2]
    Source Collection : Sales Voucher2
    Walk : Inventory Entries
    By : PartyName : $PartyLedgerName
    By : ItemName : $StockItemName

    Aggr Compute: SubAmount2 : Sum : $Amount
     

    Attached Files:



  2. Basha

    Basha Member


    [Field: SalesReturn]
    Use : SalesDefault
    Set as : $TotAmount2
    Type : Amount
    Width : @@AmountWidth
    Space Left : 2 mms
    Border : Thin Right

    [Line: SalesTotal]
    Border : Totals
    Use : SalesDetails
    Local : Field : SalesReturn : Set as : $$Total:SalesReturn


    [Collection: Sales Voucher2] Type : Vouchers : VoucherType Child of : $$VchTypeCreditNote Belongs to : Yes Fetch : Date,VoucherTypeName,PartyLedgerName,BasicPurchaseOrderNo,Amount [Collection: SalesPartyWise2] Source Collection : Sales Voucher2 Walk : Inventory Entries By : PartyName : $PartyLedgerName Aggr Compute: TotAmount2 : Sum : $Amount Sort : Default : $PartyName
     
    rajiv jaiswal likes this.


  3. venkatcn

    venkatcn New Member


    [#Menu: Gateway of Tally]

    Add : Key Item :Before : @@locQuit : "Party Wise Report" : R : Display : SalesReport


    [Report:SalesReport]
    Use : DSP Template
    Title : "Sales Report"
    Repeat : PartyName
    Form : SalesReport
    ;Set : SVFromDate : $$MonthStart:##SVCurrentDate
    ;Set : SVToDate : $$MonthEnd:##SVCurrentDate


    [Form:SalesReport]

    Button : PrintButton, ExportButton
    Button : ExplodeFlag,ChangePeriod
    Bottom Toolbar Buttons : EnterToEdit, BottomToolBarBtn8,BottomToolBarBtn9,BottomToolBarBtn10
    Part : SalesTitle,SalesPeriod,SalesDetails
    Bottom Part : SalesTotals
    Width : 100% Page
    Space Left : 2 mms
    Space Right : 2 mms

    [Key: EnterToEdit]

    Key : Enter
    Title : $$LocaleString:"Explode"
    Type : BottomToolBarBtn2
    Action : Explode

    [Part:SalesTitle]

    Line : SalesTitle
    Horizontal Align : Center

    [Part:SalesPeriod]

    Line : SalesPeriod

    [Line:SalesTitle]

    Field : Simple Field
    Local : Field : Simple Field : Style : Large Bold
    Local : Field : Simple Field : Info : "Party Wise Sales Report"
    Local : Field : Simple Field : Border: Thin Bottom
    Local : Field : Simple Field : Align : Center

    [Line:SalesPeriod]

    Right Field : Name Field
    Left Field : Short Prompt,RPTSalesFilter
    Local : Field : Name Field : Info : @@DSPDateStr
    Local : Field : Name Field : Width : 50
    Local : Field : Name Field : Align : Right


    [Field:RPTSalesFilter]


    Use : Simple Field
    Style : Normal Bold
    Set as : @VCHSalesName
    Set Always : Yes
    Inactive : Not $EnableBroker:Company:##SVCurrentCompany



    [Line:SalesHead]

    Use : SalesDetails
    Border : Column Titles
    Local : Field : Default : Type : String
    Local : Field : Default : Align : Center
    Local : Field : Default : Border : Thin Left
    Local : Field : Default : Style : Normal Bold
    Local : Field : SWSno : Set as : "Sno"
    Local : Field : SWSno : Border : Thin Left Right
    Local : Field : SalesPartyName : Set as : "Party Name"
    Local : Field : SalesPartyName : Align : Center
    Local : Field : SalesReturn : Set as : "Sales return"
    Local : Field : SalesReturn : Align : Center
    Local : Field : SalesNett : Set as : "Nett Sales"
    Local : Field : SalesNett : Align : Center
    Local : Field : SalesAmount : Set as : "Total sales"
    Local : Field : SalesAmount : Border : Thin Left Right
    Space Top : 1.5 mms
    Space Bottom: 1.5 mms

    [Part:SalesDetails]

    Line : SalesHead,SalesDetails
    Repeat : SalesDetails:SalesPartyWise ;; : SalesPartyWise2
    Scroll : Vertical
    Total : SalesAmount,SalesReturn,SalesNett
    Common Border : Yes

    [Line:SalesDetails]

    Field : SWSno,SalesPartyName
    Right Field : SalesAmount,SalesReturn,SalesNett
    Option : AlterOnEnter : $$IsVoucher
    Space Bottom: 0.5 mms
    Space Top : 0.5 mms
    Border : Thin Top
    Explode : SalesExplode : ($$KeyExplode OR ##ExplodeFlag)

    [Field:SalesDefault]

    Use : Name Field
    Style : Normal Bold

    [Field:SWSno]

    Use : Name Field
    Set as : $$Line
    Width : 1.5 cm
    Align : Center
    Border : Thin Left Right

    [Field:SalesPartyName]

    Use : SalesDefault
    Set as : $PartyName
    Width : 60
    Quick Search: Yes
    Space Left : 2 mms


    [Field:SalesNett]

    Use : Amount Field
    Set as : $$AsAmount:mad:xyz
    xyz : $$Number:#SalesAmount-$$Number:#SalesReturn
    Width : 16
    Space Left : 2 mms
    Border : Thin Right

    [Field:SalesAmount]

    Use : Amount Field
    Set as : $TotAmount
    Width : @@AmountWidth
    Format : "No Zero, Symbol," + ##ShowForex
    Align : Right
    Key : Calculator
    Max : @@MaxNumberWidth
    Width : 16
    Space Right : 2 mms
    Border : Thin Right
    Tooltip : "Amount Without TAX"


    [Field: SalesReturn]

    Use : Amount Field
    Set as : $$ReportObject:$$Collectionfieldbykey:$TotAmount2:#SalesPartyName:SalesPartyWise2
    Width : @@AmountWidth
    Space Left : 2 mms
    Border : Thin Right
    Align : Right


    [Part:SalesTotals]

    Line : SalesTotal


    [Line: SalesTotal]

    Border : Totals
    Use : SalesDetails
    Local : Field : SalesReturn : Set as : $$Total:SalesReturn
    Local : Field : SalesAmount : Set as : $$Total:SalesAmount

    [Part:SalesExplode]

    Line : SalesExplode
    Repeat : SalesExplode:SalesPartyExplode:SalesPartyExplode2
    Border : Thin Bottom

    [Line:SalesExplode]

    Use : SalesDetails
    Delete : Border
    Local : Field : SWSno : Set as : ""
    Local : Field : Default : Style : Normal Italic
    Local : Field : Default : color : Blue
    Local : Field : SalesPartyName: Set as : $ItemName
    Local : Field : SalesPartyName: Align : Right
    Local : Field : SalesAmount : Set as : $SubAmount


    [System:Formula]

    SalesExplodeFilter: $PartyName=#SalesPartyName

    [Collection: Sales Voucher]

    Type : Vouchers : VoucherType
    Child of : $$VchTypeSales
    Belongs to : Yes
    Fetch : Date,VoucherTypeName,PartyLedgerName,BasicPurchaseOrderNo,Amount


    [Collection:SalesPartyWise]

    Source Collection : Sales Voucher
    Walk : Inventory Entries
    By : PartyName : $PartyLedgerName
    Aggr Compute : TotAmount : Sum : $Amount
    Sort : Default : $PartyName

    [Collection:SalesPartyExplode]

    Source Collection : Sales Voucher
    Walk : Inventory Entries
    By : PartyName : $PartyLedgerName
    By : ItemName : $StockItemName
    Aggr Compute : SubAmount : Sum : $Amount
    Filter : SalesExplodeFilter



    [Variable: PartyName1]

    Type : String
    Repeat : ##DSPRepeatCollection

    [Collection:SalesPartyExplode2]

    Source Collection : Sales Voucher2
    Walk : Inventory Entries
    By : PartyName : $PartyLedgerName
    By : ItemName : $StockItemName



    [Collection: Sales Voucher2]
    Type : Vouchers : VoucherType
    Child of : $$VchTypeCreditNote
    Belongs to : Yes
    Fetch : Date,VoucherTypeName,PartyLedgerName,BasicPurchaseOrderNo,Amount

    [Collection: SalesPartyWise2]

    Source Collection : Sales Voucher2
    Walk : Inventory Entries
    By : PartyName : $PartyLedgerName
    Aggr Compute: TotAmount2 : Sum : $Amount
    Sort : Default : $PartyName
    Search Key : $PartyName
     
    rajiv jaiswal likes this.


  4. rajiv jaiswal

    rajiv jaiswal Member


    Thank You For Your Help
     


Share This Page