;; Sri Ganeshji : Sri Balaji : Sri Pitreshwarji : Sri Durgaji : Sri Venkateshwara /* - This program illustrates the use of following attributes of Line Border Combine Explode Indent Field Key Local Use Repeat Page Break Next Page On Stripe About this program - The following report generates the Itemwise Partywise Sales Report - When printed, the total column repeats in every page when columns cannot fit in a page */ [#Menu: Gateway of Tally] Add: Item: ($$LocaleString:"Item-wise Sales"): Display: TSPL ItemSales Rep [Report: TSPL ItemSales Rep] Form : TSPL ItemSales Rep Title : ($$LocaleString:"Item-wise Sales") [Form: TSPL ItemSales Rep] Parts : TSPL ItemSales Rep Button : ExplodeFlag Width : 100% Screen Height : 100% Screen [Part: TSPL ItemSales Rep] Lines : TSPL ItemSales Rep Title, TSPL ItemSales Rep Details Repeat : TSPL ItemSales Rep Details : TSPL ItemSales Stock Item Scroll : Vertical CommonBorder: Yes [Line: TSPL ItemSales Rep Title] ;;'TSPL ItemSales Rep Details' line is used here and locally modifications are made using Local attribute Use : TSPL ItemSales Rep Details Local : Field : Default : Type : String Local : Field : Default : Align : Center Local : Field : TSPL ItemSales Rep Name : Set as : $$LocaleString:"Particulars" Local : Field : TSPL ItemSales Rep Name : Widespaced: Yes Local : Field : TSPL ItemSales Rep Party : Set as : $PName Local : Field : TSPL ItemSales Rep Party : Lines : 0 Local : Field : TSPL ItemSales Rep Total : Set as : $$LocaleString:"Total" ;; Border is drawn on the top and bottom of the line Border : Thin Top Bottom [Line: TSPL ItemSales Rep Details] Fields : TSPL ItemSales Rep Name, TSPL ItemSales Rep Party, TSPL ItemSales Rep Total ;; Field 'TSPL ItemSales Rep Party' is repeated over the Collection 'TSPL ItemSales Party' ;; which creates columns for Party Ledgers Repeat : TSPL ItemSales Rep Party : TSPL ItemSales Party ;; Stock item line explodes to show the closing value of stockitem master on line key 'Line Explode'(shift+Enter) or form button 'ExplodeFlag'(Alt+F1) Explode : TSPL Item ClosingBal : $$KeyExplode OR ##ExplodeFlag ;; Key to explode individual line in focus on Shift+Enter is specified Key : Line Explode ;; Repeated Field 'TSPL ItemSales Rep Party' values will be summed up and be available for $$Total function to retrieve Total : TSPL ItemSales Rep Party ;; Closing page break is given to print total column in every page when number of columns cannot fit in a page. Page Break:TSPL ItemSales Rep Total ;; When printing, if the explosion of the line doesnt fit in the page, then its printed in the next page Next Page : NOT $$DoExplosionsFit ;; On focus on the line, the function is called which logs information On : Focus: Yes: Call: TSPLLogs ;; Stripe View is disabled for this report Stripe : No [Field: TSPL ItemSales Rep Name] Use : Name Field Set as : $IName [Field: TSPL ItemSales Rep Party] Use : Amount Forex Field Set as : $$ReportObject:$$CollectionFieldByKey:$Amount:@SKFormula:TSPLItemSalesSummVoucher SKFormula : $PName + #TSPLItemSalesRepName Format : "NoZero" Border : Thin Left [Field: TSPL ItemSales Rep Total] Use : Amount Forex Field Set as : $$Total:TSPLItemSalesRepParty Border : Thin Left [Part: TSPL Item ClosingBal] Line : TSPL Item ClosingBal [Line: TSPL Item ClosingBal] Field : TSPL Item ClosingBal Indent: 1 ;; Line is indented by 1 character [Field: TSPL Item ClosingBal] Use : NameField Set as: "Closing Value: "+$$String:($(StockItem, #TSPLItemSalesRepName).ClosingValue) Style : Small Italic ;; Collection Definition [Collection: TSPL ItemSales Voucher] Type : Voucher Filter : TSPL Smp IsSalesVT [Collection: TSPL ItemSales Stock Item] Source Collection : TSPL ItemSales Voucher Walk : Inventory Entries By : IName : $StockItemName Aggr Compute : BilledQty : SUM : $BilledQty Filter : TSPL Smp NonEmptyQty Keep Source : (). [Collection: TSPL ItemSales Party] Source Collection : TSPL ItemSales Voucher Walk : Inventory Entries By : PName : $PartyLedgerName Aggr Compute : BilledQty : SUM : $BilledQty Keep Source : (). Filter : TSPL Smp NonEmptyQty [Collection: TSPL ItemSales Summ Voucher] Source Collection : TSPL ItemSales Voucher Walk : Inventory Entries By : PName : $PartyLedgerName By : IName : $StockItemName Aggr Compute : BilledQty : SUM : $BilledQty Aggr Compute : Amount : SUM : $Amount Keep Source : (). Search Key : $PName + $IName ;; System Formula [System: Formula] TSPL Smp IsSalesVT : $$IsSales:$VoucherTypeName TSPL Smp NonEmptyQty: NOT $$IsEmpty:$BilledQty ;;Called from the On: focus of the details line [Function: TSPLLogs] 00: Log: $IName ;;End Of Line