Sales order analysis
The client required faster Sales pending order report from
tally using analytics for its entire Tally data over 15 years.
Filter Parameters-
The report is filtered by Item Name, Party Name, and Date. These are
report level filter and page level filter is Vouchertypeparent= Sales order
Field-
Order Number
Item Name
Party Name
Sales Order Quantity
Preclosed Quantity
Sales Invoiced Quantity
Pending Quantity
Rate
Sales Invoice Order
Pending Sales quantity:
DAX Code
Preclosed_qty
=
This shows the preclosed order quantity
by partyname, companyname, orderno and stockitemname. We have used the row
level and filter level contexts for the same. The analysis has been done at
stockitem batch inventory movement details
/*This shows the total purchase
quantity per orderno*/
vAR PARTYNAME=Stockitembatchinventorydetails[partyname]
vAR COMPANYNAME=Stockitembatchinventorydetails[Company_Name]
VAR ORDER_NO=Stockitembatchinventorydetails[OrderNo]
VAR STOCKITEMNAME=Stockitembatchinventorydetails[StockItemName]
VAR Purchase_order=Calculate(sum(Stockitembatchinventorydetails[Billedqty]),FILTER(ALL(Stockitembatchinventorydetails),Stockitembatchinventorydetails[partyname]=PARTYNAME
&& Stockitembatchinventorydetails[Company_Name]=COMPANYNAME
&&Stockitembatchinventorydetails[StockItemName]=STOCKITEMNAME
&& Stockitembatchinventorydetails[OrderNo]=ORDER_NO
&& Stockitembatchinventorydetails[VoucherTypeParent]="Purchase
Order"))
VAR Purchase_qty=Calculate(sum(Stockitembatchinventorydetails[Billedqty]),FILTER(ALL(Stockitembatchinventorydetails),Stockitembatchinventorydetails[partyname]=PARTYNAME
&& Stockitembatchinventorydetails[Company_Name]=COMPANYNAME
&&Stockitembatchinventorydetails[StockItemName]=STOCKITEMNAME
&& Stockitembatchinventorydetails[OrderNo]=ORDER_NO
&& Stockitembatchinventorydetails[VoucherTypeParent]="Purchase"))
VAR PREORDER_CLOSE=Calculate(sum(Stockitembatchinventorydetails[Orderpreclosureqty_num]),FILTER(ALL(Stockitembatchinventorydetails),Stockitembatchinventorydetails[partyname]=PARTYNAME
&& Stockitembatchinventorydetails[Company_Name]=COMPANYNAME
&&Stockitembatchinventorydetails[StockItemName]=STOCKITEMNAME
&& Stockitembatchinventorydetails[OrderNo]=ORDER_NO))
RETURN
IF(PURCHASE_QTY>PURCHASE_ORDER,-PURCHASE_QTY+PURCHASE_ORDER,PREORDER_CLOSE)
net
qty for pending sales = Here we calculate the quantity which
are pending for sale. This is calculated by difference between billed quantity
and preclosed quantity
var a
= Stockitembatchinventorydetails[Billedqty_credit]
var b
= Stockitembatchinventorydetails[Preclosed_qty]
var c=
a-b
return
c
Sales
order pending =
This shows the sales order pending
quantity by partyname, companyname, orderno and stockitemname. We have used the
row level and filter level contexts for the same. The analysis has been done at
stockitem batch inventory movement details
var orderno=Stockitembatchinventorydetails[Orderno]
var company=
Stockitembatchinventorydetails[Company_Name]
var itemname=
Stockitembatchinventorydetails[STOCKITEMNAME]
var ledger=
Stockitembatchinventorydetails[partyname]
Var salesorder=Calculate(sum(Stockitembatchinventorydetails[Billedqty]),Filter(all(Stockitembatchinventorydetails),orderno=Stockitembatchinventorydetails[Orderno]
&&
Stockitembatchinventorydetails[partyname]=ledger
&& Stockitembatchinventorydetails[VoucherTypeParent]="Sales
Order" && itemname=Stockitembatchinventorydetails[StockItemName]))
Var sales_var=Calculate(sum(Stockitembatchinventorydetails[Billedqty]),Filter(all(Stockitembatchinventorydetails),orderno=Stockitembatchinventorydetails[Orderno]
&&
Stockitembatchinventorydetails[partyname]=ledger
&& Stockitembatchinventorydetails[VoucherTypeParent]="Sales"
&& itemname=Stockitembatchinventorydetails[StockItemName]))
VAR PREORDER_CLOSE=Calculate(sum(Stockitembatchinventorydetails[Orderpreclosureqty_num]),FILTER(ALL(Stockitembatchinventorydetails),Stockitembatchinventorydetails[partyname]=ledger
&& Stockitembatchinventorydetails[Company_Name]=company
&&Stockitembatchinventorydetails[StockItemName]=itemname
&& Stockitembatchinventorydetails[OrderNo]=orderno
&& itemname=Stockitembatchinventorydetails[StockItemName]))
return
(salesorder-sales_var+PREORDER_CLOSE)*-1
Salesinvoice_order
=
vAR
PARTYNAME=Stockitembatchinventorydetails[partyname]
vAR COMPANYNAME=Stockitembatchinventorydetails[Company_Name]
VAR ORDER_NO=Stockitembatchinventorydetails[OrderNo]
VAR STOCKITEMNAME=Stockitembatchinventorydetails[StockItemName]
Var Trackingnumber=Stockitembatchinventorydetails[Trackingnumber_voucherinventory]
var Sale_qty=Calculate(sum(Stockitembatchinventorydetails[Billedqty]),FILTER(ALL(Stockitembatchinventorydetails),
Stockitembatchinventorydetails[Company_Name]=COMPANYNAME
&&Stockitembatchinventorydetails[StockItemName]=STOCKITEMNAME
&& Stockitembatchinventorydetails[Trackingnumber_voucherinventory]=Trackingnumber
&& Stockitembatchinventorydetails[VoucherTypeParent]="Sales"))
VAR Sale_rate=Calculate(AVERAGE(Stockitembatchinventorydetails[Rate]),FILTER(ALL(Stockitembatchinventorydetails),
Stockitembatchinventorydetails[Company_Name]=COMPANYNAME
&&Stockitembatchinventorydetails[StockItemName]=STOCKITEMNAME
&& Stockitembatchinventorydetails[Trackingnumber_voucherinventory]=Trackingnumber
&& Stockitembatchinventorydetails[VoucherTypeParent]="Sales"))
Return
abs(Sale_qty)
Tally development language code
Collections
;; Sri Ganeshji : Sri Balaji : Sri
Pitreshwarji : Sri Durgaji : Sri Venkateshwara
<DefType: Collection>
/*
collection
PendingStkGrpSalesOrderExtractSrc
used
in Sale Order Stock Group/Category outstanding report
to
calculate Opening, Inward, Outward and Closing Orders
*/
[Collection:
PendingStkGrpSalesOrderExtractSrc]
Source
Collection :
PendingStkGrpSalesOrderDetailsSrc, OpeningStkGrpPendingSalesOrderDetailsSrc
Source
Var : svOpeningBalance : Quantity : If $IsOpeningColl Then $OpeningBalance
Else $$InitValue:"Quantity"
Source
Var : svOpeningValue : Amount : If $IsOpeningColl Then $OpeningValue
Else $$InitValue:"Amount"
Source
Var : svInwardQty : Quantity : If $IsOpeningColl Then $$InitValue:"Quantity"
Else $InwardQty
Source
Var : svInwardValue : Amount : If $IsOpeningColl Then
$$InitValue:"Amount" Else $InwardValue
Source
Var : svClosingBalance : Quantity : If $IsOpeningColl Then
$$InitValue:"Quantity" Else $ClosingBalance
Source
Var : svClosingValue : Amount : If $IsOpeningColl Then
$$InitValue:"Amount" Else
$ClosingValue
Source
Var : svOutwardQty : Quantity :
$$NettQty:($$NettQty:##svOpeningBalance:##svInwardQty):$$Negative:##svClosingBalance
Source
Var : svOutwardValue : Amount :
$$NettAmount:($$NettAmount:##svOpeningValue:##svInwardValue):$$Negative:##svClosingValue
By : Parent : $Parent
Aggr
Compute : OpeningBalance : Sum : ##svOpeningBalance
Aggr
Compute : OpeningValue : Sum : ##svOpeningValue
Aggr
Compute : InwardQty : Sum : ##svInwardQty
Aggr
Compute : InwardValue : Sum : ##svInwardValue
Aggr
Compute : OutwardQty : Sum : ##svOutwardQty
Aggr
Compute : OutwardValue : Sum : ##svOutwardValue
Aggr
Compute : ClosingBalance : Sum : ##svClosingBalance
Aggr
Compute : ClosingValue : Sum : ##svClosingValue
Search
Key : $Parent
/*
The
Collections
1.
PendingStkGrpSalesOrderDetailsSrc
2.
PendingStkGrpSalesOrdersSrc
3.
PendingStkGrpSalesPendingOrderDetails
4.
PendingStkGrpSalesClearedOrderDetails
used
in Sale Order Stock Group/Category outstanding report
to
calculate Inward and Closing Orders
*/
[Collection:
PendingStkGrpSalesOrderDetailsSrc]
Source
Collection : PendingStkGrpSalesOrdersSrc
Source
Var : SvInwardQty : Quantity : If $$IsEmpty:$SaleOrderQty then
$$InitValue:"Quantity" Else $SaleOrderQty
Source
Var : SvInwardValue : Amount : If $$IsEmpty:$SaleOpeningActualValue then
$$InitValue:"Amount" Else $SaleOpeningActualValue
Source
Var : SvClBal : Quantity : If
$$IsEmpty:$ClosingBalance then $$InitValue:"Quantity" Else
$ClosingBalance
Source
Var : SvClValue : Amount
: If $$IsEmpty:$ClosingValue then $$InitValue:"Amount" Else
$ClosingValue
By : Parent : $Parent
Compute : IsOpeningColl : No
Aggr
Compute : InwardQty : Sum : If @@ForOrderPeriod Then
##SvInwardQty Else $$InitValue:"Quantity"
Aggr
Compute : InwardValue : Sum : If @@ForOrderPeriod Then ##SvInwardValue
Else $$InitValue:"Amount"
Aggr
Compute : ClosingBalance : Sum : ##SvClBal
Aggr
Compute : ClosingValue : Sum : ##SvClValue
/*
The
Collections
1.
PendingStkGrpSalesOrderDetailsSrc
2.
OpeningStkGrpPendingSalesOrdersSrc
3.
StkGrpSalesPendingOrderDetails
4.
StkGrpSalesClearedOrderDetails
used
in Sale Order Stock Group/Category outstanding report
to
calculate opening Orders
*/
[Collection:
OpeningStkGrpPendingSalesOrderDetailsSrc]
Source
Collection : OpeningStkGrpPendingSalesOrdersSrc
Source
Var : SvOpBal : Quantity : If
$$IsEmpty:$ClosingBalance then $$InitValue:"Quantity" Else
$ClosingBalance
Source
Var : SvOpValue : Amount
: If $$IsEmpty:$ClosingValue then $$InitValue:"Amount" Else
$ClosingValue
By : Parent : $Parent
Compute : IsOpeningColl : Yes
Aggr
Compute : OpeningBalance : Sum : ##SvOpBal
Aggr
Compute : OpeningValue : Sum :
##SvOpValue
[Collection:
PendingStkGrpSalesOrdersSrc]
Collection : PendingStkGrpSalesPendingOrderDetails,
PendingStkGrpSalesClearedOrderDetails
[Collection:
OpeningStkGrpPendingSalesOrdersSrc]
Parm
Var : SVToDate : Date : @@OpeningOrderToDate
Collection : StkGrpSalesPendingOrderDetails
[Collection: PendingStkGrpSalesPendingOrderDetails]
Source
Collection : SalesOrderSourcePnd
Fetch
: Date, Parent, ClosingBalance, ClosingValue, SaleOrderQty,
SaleOpeningActualValue
[Collection:
PendingStkGrpSalesClearedOrderDetails]
Source
Collection : SalesOrderSourceCld
Fetch
: Date, Parent, ClosingBalance, ClosingValue, SaleOrderQty,
SaleOpeningActualValue
[Collection:
StkGrpSalesPendingOrderDetails]
Parm
Var : SVToDate : Date : @@OpeningOrderToDate
Source
Collection : SalesOrderSourceop
Fetch
: Date, Parent, ClosingBalance, ClosingValue, SaleOrderQty,
SaleOpeningActualValue
[Collection: SalesOrderSourcePnd]
Type : Sales Orders
Cleared : No
Filter : IsItemBelongstoSelectedStkGrp,
PositiveClosingBalance
[Collection: SalesOrderSourceCld]
Type : Sales Orders
Cleared : Yes
Filter : IsItemBelongstoSelectedStkGrp,
PositiveClosingBalance
;; @Note : For getting, Sales Order Qty
Method value, it requires sales order voucher walk. Voucher walk happens only
once and
;; it's kept in the memory.
[Collection: SalesOrderSourceOp]
Type : Sales Orders
Parm
Var : SVToDate : Date : @@OpeningOrderToDate
Cleared : No
Filter : IsItemBelongstoSelectedStkGrp,
PositiveClosingBalance
/*
collection
PendingSalesOrderGroupDetailsExtract
used
in Sale Order Group outstanding report
to
calculate Opening, Inward, Outward and Closing Orders
*/
[Collection:
PendingSalesOrderGroupDetailsExtract]
Source
Collection : PendingGroupSalesOrderDetailsSrc,
OpeningGroupPendingSalesOrderDetailsSrc
Source
Var : svOpeningBalance : Quantity : If $IsOpeningColl Then $OpeningBalance
Else $$InitValue:"Quantity"
Source
Var : svOpeningValue : Amount : If $IsOpeningColl Then $OpeningValue
Else $$InitValue:"Amount"
Source
Var : svInwardQty : Quantity : If $IsOpeningColl Then
$$InitValue:"Quantity" Else
$InwardQty
Source
Var : svInwardValue : Amount : If $IsOpeningColl Then
$$InitValue:"Amount" Else $InwardValue
Source
Var : svClosingBalance : Quantity : If $IsOpeningColl Then
$$InitValue:"Quantity" Else $ClosingBalance
Source
Var : svClosingValue : Amount : If $IsOpeningColl Then
$$InitValue:"Amount" Else
$ClosingValue
Source
Var : svOutwardQty : Quantity :
$$NettQty:($$NettQty:##svOpeningBalance:##svInwardQty):$$Negative:##svClosingBalance
Source
Var : svOutwardValue : Amount :
$$NettAmount:($$NettAmount:##svOpeningValue:##svInwardValue):$$Negative:##svClosingValue
By : Parent : $Parent
Aggr
Compute : OpeningBalance : Sum : ##svOpeningBalance
Aggr
Compute : OpeningValue : Sum : ##svOpeningValue
Aggr
Compute : InwardQty : Sum : ##svInwardQty
Aggr
Compute : InwardValue : Sum : ##svInwardValue
Aggr
Compute : OutwardQty : Sum : ##svOutwardQty
Aggr
Compute : OutwardValue : Sum : ##svOutwardValue
Aggr
Compute : ClosingBalance : Sum : ##svClosingBalance
Aggr
Compute : ClosingValue : Sum : ##svClosingValue
Search
Key : $Parent
/*
The
Collections
1.
PendingGroupSalesOrderDetailsSrc
2.
PendingGroupSalesOrdersSrc
3.
PendingGroupSalesPendingOrderDetails
4.
PendingGroupSalesClearedOrderDetails
used
in Sale Order Stock Item Group outstanding report
to
calculate Inward and Closing Orders
*/
[Collection:
PendingGroupSalesOrderDetailsSrc]
Source
Collection : PendingGroupSalesOrdersSrc
By : Parent : $Parent
Compute : IsOpeningColl : No
Aggr
Compute : InwardQty : Sum : If @@ForOrderPeriod Then $SaleOrderQty Else $$InitValue:"Quantity"
Aggr
Compute : InwardValue : Sum : If @@ForOrderPeriod Then
($SaleOpeningActualValue) Else $$InitValue:"Amount"
Aggr
Compute : ClosingBalance : Sum : $ClosingBalance
Aggr
Compute : ClosingValue : Sum : $ClosingValue
/*
The
Collections
1.
OpeningGroupPendingSalesOrderDetailsSrc
2.
OpeningGroupPendingSalesOrdersSrc
3.
GroupSalesPendingOrderDetails
4.
GroupSalesClearedOrderDetails
used
in Sale Order Stock Item Group outstanding report
to
calculate Opening Orders
*/
[Collection:
OpeningGroupPendingSalesOrderDetailsSrc]
Source
Collection :
OpeningGroupPendingSalesOrdersSrc
By : Parent : $Parent
Compute : IsOpeningColl : Yes
Aggr
Compute : OpeningBalance : Sum : $ClosingBalance
Aggr
Compute : OpeningValue : Sum :
$ClosingValue
[Collection:
PendingGroupSalesOrdersSrc]
Collection : PendingGroupSalesPendingOrderDetails,
PendingGroupSalesClearedOrderDetails
[Collection: OpeningGroupPendingSalesOrdersSrc]
Parm
Var : SVToDate : Date : @@OpeningOrderToDate
Collection : GroupSalesPendingOrderDetails
[Collection:
PendingGroupSalesPendingOrderDetails]
Type : Sales Orders
Cleared : No
Filter : IsItemBelongstoSelectedAccGrp
Filter : PositiveClosingBalance
[Collection:
PendingGroupSalesClearedOrderDetails]
Type : Sales Orders
Cleared : Yes
Filter : IsItemBelongstoSelectedAccGrp
Filter : PositiveClosingBalance
[Collection:
GroupSalesPendingOrderDetails]
Type : Sales Orders
Parm
Var : SVToDate : Date : @@OpeningOrderToDate
Cleared : No
Filter : IsItemBelongstoSelectedAccGrp
Filter : PositiveClosingBalance
;;Calculation Of Sale Order Ledger
Outstanding Report
/*
collection
SalesOrderLedgerDetailsExtract
used
in Sale Order Ledger outstanding report
to
calculate Opening, Inward, Outward and Closing Orders
*/
[Collection:
SalesOrderLedgerDetailsExtract]
Source
Collection :
PendingLedSalesOrderDetailsSrc, OpeningLedPendingSalesOrderDetailsSrc
Source
Var : svOpeningBalance : Quantity : If $IsOpeningColl Then $OpeningBalance
Else $$InitValue:"Quantity"
Source
Var : svOpeningValue : Amount : If $IsOpeningColl Then $OpeningValue
Else $$InitValue:"Amount"
Source
Var : svInwardQty : Quantity : If $IsOpeningColl Then
$$InitValue:"Quantity" Else
$InwardQty
Source
Var : svInwardValue : Amount : If $IsOpeningColl Then
$$InitValue:"Amount" Else $InwardValue
Source
Var : svClosingBalance : Quantity : If $IsOpeningColl Then
$$InitValue:"Quantity" Else $ClosingBalance
Source
Var : svClosingValue : Amount : If $IsOpeningColl Then
$$InitValue:"Amount" Else
$ClosingValue
Source
Var : svOutwardQty : Quantity :
$$NettQty:($$NettQty:##svOpeningBalance:##svInwardQty):$$Negative:##svClosingBalance
Source
Var : svOutwardValue : Amount :
$$NettAmount:($$NettAmount:##svOpeningValue:##svInwardValue):$$Negative:##svClosingValue
By : Parent : $Parent
Aggr
Compute : OpeningBalance : Sum : ##svOpeningBalance
Aggr
Compute : OpeningValue : Sum : ##svOpeningValue
Aggr
Compute : InwardQty : Sum : ##svInwardQty
Aggr
Compute : InwardValue : Sum : ##svInwardValue
Aggr
Compute : OutwardQty : Sum : ##svOutwardQty
Aggr
Compute : OutwardValue : Sum : ##svOutwardValue
Aggr
Compute : ClosingBalance : Sum : ##svClosingBalance
Aggr
Compute : ClosingValue : Sum : ##svClosingValue
Search
Key : $Parent
/*
The
Collections
1.
PendingLedSalesOrderDetailsSrc
2.
PendingLedSalesOrdersSrc
3.
PendingLedSalesPendingOrderDetails
4.
PendingLedSalesClearedOrderDetails
used
in Sale Order Stock Item Ledger outstanding report
to
calculate Inward and Closing Orders
*/
[Collection:
PendingLedSalesOrderDetailsSrc]
Source
Collection : PendingLedSalesOrdersSrc
By : Parent : $Parent
Compute : IsOpeningColl : No
Aggr
Compute : InwardQty : Sum : If @@ForOrderPeriod Then ($SaleOrderQty
) Else $$InitValue:"Quantity"
Aggr
Compute : InwardValue : Sum : If @@ForOrderPeriod Then
($SaleOpeningActualValue) Else $$InitValue:"Amount"
Aggr
Compute : ClosingBalance : Sum : $ClosingBalance
Aggr
Compute : ClosingValue : Sum : $ClosingValue
[Collection: PendingLedSalesOrdersSrc]
Collection : PendingLedSalesPendingOrderDetails,
PendingLedSalesClearedOrderDetails
[Collection:
PendingLedSalesPendingOrderDetails]
Type : Ledger Sales Orders
Child
Of : ##LedgerName
Cleared : No
Filter : PositiveClosingBalance
[Collection:
PendingLedSalesClearedOrderDetails]
Type : Ledger Sales Orders
Child
Of : ##LedgerName
Cleared : Yes
Filter : PositiveClosingBalance
/*
The
Collections
1.
OpeningLedPendingSalesOrderDetailsSrc
2.
OpeningLedPendingSalesOrdersSrc
3.
LedSalesPendingOrderDetails
4.
LedSalesClearedOrderDetails
used
in Sale Order Stock Item Ledger outstanding report
to
calculate Opening Orders
*/
[Collection:
OpeningLedPendingSalesOrderDetailsSrc]
Source
Collection :
OpeningLedPendingSalesOrdersSrc
By : Parent : $Parent
Compute : IsOpeningColl : Yes
Aggr
Compute : OpeningBalance : Sum : $ClosingBalance
Aggr
Compute :
OpeningValue :
Sum : $ClosingValue
[Collection:
OpeningLedPendingSalesOrdersSrc]
Parm
Var : SVToDate : Date : @@OpeningOrderToDate
Collection : LedSalesPendingOrderDetails
[Collection:
LedSalesPendingOrderDetails]
Type : Ledger Sales Orders
Parm
Var : SVToDate : Date : @@OpeningOrderToDate
Child
Of : ##LedgerName
Cleared : No
Filter : PositiveClosingBalance
/*
collection
PendingSalesOrderExtractSrc
used
in Sale Order Stock Group/Category outstanding report
to
calculate Opening, Inward, Outward and Closing Orders
*/
[Collection:
PendingSalesOrderExtractSrc]
Source
Collection :
PendingSalesOrderDetailsSrc, OpeningPendingSalesOrderDetailsSrc
Source
Var : svOpeningBalance : Quantity : If $IsOpeningColl Then $OpeningBalance
Else $$InitValue:"Quantity"
Source
Var : svOpeningValue : Amount : If $IsOpeningColl Then $OpeningValue
Else $$InitValue:"Amount"
Source
Var : svInwardQty : Quantity : If $IsOpeningColl Then
$$InitValue:"Quantity" Else $InwardQty
Source
Var : svInwardValue : Amount : If $IsOpeningColl Then
$$InitValue:"Amount" Else $InwardValue
Source
Var : svClosingBalance : Quantity : If $IsOpeningColl Then $$InitValue:"Quantity"
Else $ClosingBalance
Source
Var : svClosingValue : Amount : If $IsOpeningColl Then
$$InitValue:"Amount" Else
$ClosingValue
Source
Var : svOutwardQty : Quantity :
$$NettQty:($$NettQty:##svOpeningBalance:##svInwardQty):$$Negative:##svClosingBalance
Source
Var : svOutwardValue : Amount :
$$NettAmount:($$NettAmount:##svOpeningValue:##svInwardValue):$$Negative:##svClosingValue
By : Parent : $Parent
Aggr
Compute : OpeningBalance : Sum : ##svOpeningBalance
Aggr
Compute : OpeningValue : Sum : ##svOpeningValue
Aggr
Compute : InwardQty : Sum : ##svInwardQty
Aggr
Compute : InwardValue : Sum : ##svInwardValue
Aggr
Compute : OutwardQty : Sum : ##svOutwardQty
Aggr
Compute : OutwardValue : Sum : ##svOutwardValue
Aggr
Compute : ClosingBalance : Sum : ##svClosingBalance
Aggr
Compute : ClosingValue : Sum : ##svClosingValue
Search
Key : $Parent
/*
The
Collections
1.
PendingSalesOrderDetailsSrc
2.
PendingSalesOrdersSrc
3.
PendingSalesPendingOrderDetails
4.
PendingSalesClearedOrderDetails
used
in Sale Order Stock Item outstanding report
to
calculate Inward and Closing Orders
*/
[Collection:
PendingSalesOrderDetailsSrc]
Source
Collection : PendingSalesOrdersSrc
By : Parent : $Parent
Compute : IsOpeningColl : No
Aggr
Compute : InwardQty : Sum : If @@ForOrderPeriod Then
($SaleOrderQty) Else $$InitValue:"Quantity"
Aggr
Compute : InwardValue : Sum : If @@ForOrderPeriod Then ($SaleOpeningActualValue)
Else $$InitValue:"Amount"
Aggr
Compute : ClosingBalance : Sum : $ClosingBalance
Aggr
Compute : ClosingValue : Sum : $ClosingValue
/*
The
Collections
1.
OpeningPendingSalesOrderDetailsSrc
2.
OpeningPendingSalesOrdersSrc
3.
OpeningPendingSalesPendingOrderDetails
4.
OpeningPendingSalesClearedOrderDetails
used
in Sale Order Stock Item outstanding report
to
calculate opening Orders
*/
[Collection:
OpeningPendingSalesOrderDetailsSrc]
Source
Collection :
OpeningPendingSalesOrdersSrc
By : Parent : $Parent
Compute : IsOpeningColl : Yes
Aggr
Compute : OpeningBalance : Sum : $ClosingBalance
Aggr
Compute : OpeningValue : Sum : $ClosingValue
[Collection: PendingSalesOrdersSrc]
Collection : PendingSalesPendingOrderDetails,
PendingSalesClearedOrderDetails
[Collection:
OpeningPendingSalesOrdersSrc]
Parm
Var : SVToDate : Date : @@OpeningOrderToDate
Collection : OpeningPendingSalesPendingOrderDetails
[Collection: PendingSalesPendingOrderDetails]
Type : Sales Orders
Child
Of : ##StockItemName
Cleared : No
Filter : PositiveClosingBalance
[Collection:
PendingSalesClearedOrderDetails]
Type : Sales Orders
Child
Of : ##StockItemName
Cleared : Yes
Filter : PositiveClosingBalance
[Collection:
OpeningPendingSalesPendingOrderDetails]
Type : Sales Orders
Parm
Var : SVToDate : Date : @@OpeningOrderToDate
Child
Of : ##StockItemName
Cleared : No
Filter :
PositiveClosingBalance
;; End-of-file
Fields
;; Sri Ganeshji : Sri Balaji : Sri
Pitreshwarji : Sri Durgaji : Sri Venkateshwara
<DefType: Field>
[Field : Inv AccGrp Sales Order
Summary]
Set
as : If
$$IsEmpty:$$ReportObject:$$CollectionFieldByKey:$Parent:1:PendingSalesOrderGroupDetailsExtract
Then YES ELSE YES
Invisible : Yes
[Field : Inv Ledger Sales Order
Summary]
Set
as : If
$$IsEmpty:$$ReportObject:$$CollectionFieldByKey:$Parent:1:SalesOrderLedgerDetailsExtract
Then YES ELSE YES
Invisible : Yes
[Field: Order StkInfo]
Use : DSP FieldActions
Option : WithThinLeft : $$NumSets > 1
Option : WithThinRight : ($$NumSets > 1) AND $$InPrintMode
Option : Order StkOp : ##DSPShowOpening
Option : Order StkIn : ##DSPShowInwards
Option : Order StkOut : ##DSPShowOutwards
Option : Order StkCl : ##DSPShowClosing
[!Field: Order StkOp]
Add : Fields : Order OpeningQty
[!Field: Order StkIn]
Add : Fields : Order OrderedQty
[!Field: Order StkOut]
Add : Fields : Order ClearedQty
[!Field: Order StkCl]
Add : Fields : Order ClosingQty
[Field: Order OpeningQty]
Fields : Order OpQty, Order
OpAltQty, Order OpRate, Order OpAmtA
Border : Thin Left : (##DSPShowInwards OR
@@DSPShowOutwards OR ##DSPShowClosing)
Width : @@DSPWithAltQtyWidth +
@@DSPWithQtyWidth + @@DSPWithRateWidth + @@DSPWithAmtWidth
Invisible : NOT ##DSPShowOpening
OR NOT @@OrderOpClInv OR $$NumSets > 1
Local : Field : Order OpAmtA
: Inactive : No
[Field: Order OpQty]
Use : DSP QtyTemplate
Set as : $OrderOpeningQty
[Field: Order OpAltQty]
Use : DSP AltQtyTemplate
Set as : #OrderOpQty
[Field: Order OpRate]
Use : DSP RateTemplate
Set as : $$AsAmount:@AmtAsStr/#OrderOpQty
AmtAsStr:
$$String:#OrderOpAmtA:"NoSymbol"
[Field: Order OpAmtA]
Use : DSP AmtTemplate
Invisible
: NOT ##DSPShowValue
FldValue : If ##DSPOrderCombo =
@@POTotal Then $$AsDrAmt:$OrderOpeningValue
Else $$AsCrAmt:$OrderOpeningValue
[Field: Order OrderedQty]
Fields : Order InQty, Order
InAltQty, Order InRate, Order DrAmtA
Border : Thin Left :
##DSPShowOpening OR @@DSPShowOutwards OR ##DSPShowClosing
Width : @@DSPWithAltQtyWidth
+ @@DSPWithQtyWidth + @@DSPWithRateWidth + @@DSPWithAmtWidth
Invisible : NOT ##DSPShowInwards
OR NOT @@OrderOpClInv OR $$NumSets > 1
Local : Field : Order DrAmtA
: Inactive : No
[Field: Order InQty]
Use : DSP QtyTemplate
Set
as : $OrderInwardQty
[Field: Order InAltQty]
Use : DSP AltQtyTemplate
Set
as : #OrderInQty
[Field: Order InRate]
Use :
DSP RateTemplate
Set
as :
$$AsAmount:@AmtAsStr/ #OrderInQty
AmtAsStr :
$$String:#OrderDrAmtA:"NoSymbol"
[Field: Order DrAmtA]
Use : DSP AmtTemplate
Invisible : NOT ##DSPShowValue
FldValue : If ##DSPOrderCombo = @@POTotal Then
$$AsDrAmt:$OrderInwardValue Else $$AsCrAmt:$OrderInwardValue
[Field: Order ClearedQty]
Fields : Order OutQty, Order
OutAltQty, Order OutRate,Order CrAmtA
Border : Thin Left :
##DSPShowOpening OR ##DSPShowInwards OR ##DSPShowClosing
Width : @@DSPWithAltQtyWidth +
@@DSPWithQtyWidth + @@DSPWithRateWidth + @@DSPWithAmtWidth
Invisible : NOT
##DSPShowOutwards OR NOT @@OrderOpClInv OR $$NumSets > 1
Local : Field : Order CrAmtA : Inactive : No
[Field: Order OutQty]
Use : DSP QtyTemplate
Set as :
$OrderOutwardQty
[Field: Order OutAltQty]
Use : DSP AltQtyTemplate
Set as : #OrderOutQty
[Field: Order OutRate]
Use : DSP RateTemplate
Set as :
$$AsAmount:@AmtAsStr/ #OrderOutQty
AmtAsStr :
$$String:#OrderCrAmtA:"NoSymbol"
[Field: Order CrAmtA]
Use : DSP AmtTemplate
Invisible : NOT ##DSPShowValue
FldValue : If ##DSPOrderCombo =
@@POTotal Then $$AsDrAmt:$OrderOutwardValue Else $$AsCrAmt:$OrderOutwardValue
[Field: Order ClosingQty]
Fields : Order ClQty, Order
ClAltQty, Order ClRate, Order ClAmtA
Border : Thin Left : ##DSPShowOpening OR
##DSPShowInwards OR ##DSPShowOutwards
Width : @@DSPWithAltQtyWidth
+ @@DSPWithQtyWidth + @@DSPWithRateWidth + @@DSPWithAmtWidth
Invisible : NOT ##DSPShowClosing
Local : Field : Order ClAmtA : Inactive : No
[Field: Order ClQty]
Use : DSP QtyTemplate
Set
as :
IF ($$NumSets > 1 OR ##DSPDueOrders OR (NOT (##DSPShowOpening AND
##DSPShowInwards AND ##DSPShowOutwards)AND NOT (##IsOrderLedWise OR
##IsGrpOrderReport ))) Then $OrderQty else $OrderClQty
[Field: Order ClAltQty]
Use : DSP AltQtyTemplate
Set as : #OrderClQty
[Field: Order ClRate]
Use : DSP RateTemplate
Set as
: $$AsAmount:@AmtAsStr/
#OrderClQty
AmtAsStr :
$$String:#OrderClAmtA:"NoSymbol"
[Field: Order ClAmtA]
Use : DSP AmtTemplate
Format : @@ExplodedAmtFmt
Invisible : NOT ##DSPShowValue
FldValue : IF
($$NumSets > 1 OR ##DSPDueOrders OR (NOT (##DSPShowOpening AND ##DSPShowInwards
AND ##DSPShowOutwards)AND NOT (##IsOrderLedWise OR ##IsGrpOrderReport ))) Then
$OrderVal else If ##DSPOrderCombo =
@@POTotal Then $$AsDrAmt:$OrderClValue Else $$AsCrAmt:$OrderClValue
[Field : Inv Sales Order Summary]
Invisible : Yes
Set
as : If
$$IsEmpty:$$ReportObject:$$CollectionFieldByKey:$Parent:1:PendingStkGrpSalesOrderExtractSrc
Then YES ELSE YES
;; End-of-file
Reports tdl
;; Sri Ganeshji : Sri Balaji : Sri
Pitreshwarji : Sri Durgaji : Sri Venkateshwara
<DefType: *>
[Report: Sales Orders]
Use : Browser Common SysFormulae
Use : DSP Template
Title : $$LocaleString:"Order
Details"
Family :
$$Translate:"Order Details"
Help : @@HlpAllSaleOrders
List Name :
$$LocaleString:"Sales Orders"
Form :
Order Details
Print : Sales OrderVch Landing
Variables : SV CurrentCompany,
SV FromDate, SV ToDate, SV SortMethod
Variables : ExplodeFlag,
DSPHasMultiLevel
Variable : DSPNotScaleable,
DSPHasColumnTotal, DSPDueOrders
Variables : SVValuationMethod,
SVCurrency, SVExchange, SVBudget, SVVariance
Variable : ShowBatchLocation
Variable : ShowSaleCld,
ShowSalePos, ShowSaleNeg, ShowBilledQty, ShowAmtOnBilledQty
Variable : ShowPurcCld,
ShowPurcPos, ShowPurcNeg
Variable : IsStockReport,
IsItemReport
Variable : StockItemName
Variable : LedgerName
Variable : ShowBatch, ShowLocation, ShowForex,
EnableForex
Variable : DSPAgeByDueDate, DSPQtyAlternate,
DSPShowTail
Variables : SetVarFullClose, ShowOrderClosure,
ShowPreCloseReason, ShowOnlyOrderClosure, IsPreCloseQtyExists
Variable
: GroupName, IsGrpOrderReport,
OrderOutstanding, IsOrderLedWise
Variable : ShowOpPrevBalance
Variable : OrigBilledQuantity
Variable : CmpHasDiffActualQty : Logical :
$DiffActualQty:Company:##SvCurrentCompany
Variable : SOrderType
Set : SOrderType : Yes
Delete : Repeat : SVCurrentCompany, SVFromDate, SVToDate,
SVValuationMethod
Delete
: Repeat : SVBudget, SVVariance, SVCurrency,
SVExchange
Delete : Repeat : DSPOrderCombo, DSPDueOrders
Repeat : AgeFrom, AgeTo
Column
Var : AgeFrom, AgeTo
Filtered : Yes
Set : ShowBasisOfValues : Yes
Set : SV Sort Method : @@Default
Set :
DSPHasMultiLevel : No
Set : DSPNotScaleable : Yes
Set : DSPHasColumnTotal :
No
Set : SVValuationMethod :
""
Set : SVCurrency : ""
Set : SVExchange : 1
Set : ShowSalePos : Yes
Set : ShowPurcPos : No
Set : ShowSaleCld : No
Set : ShowPurcCld : No
Set : ShowSaleNeg : Yes
Set : ShowPurcNeg : No
Set : ShowBatch : NO
Set : ShowLocation : No
Set : IsStockReport : Yes
Set : IsItemReport : Yes
Set : ShowIndtPIs : No
Set : SetVarFullClose : Yes
Set : GroupName : ##GroupName
PrintSet : ReportTitle : If $$IsSysName:##StockItemName AND
$$IsSysName:##LedgerName Then @@ORDERMainTitle Else @@ITEMMainTitle
PrintSet : ReportSubTitle : If $$IsSysName:##StockItemName AND
$$IsSysName:##LedgerName Then "" Else @@ORDERMainTitle
PrintSet : PrintFileName :
"Sales Orders"
Local : Variable : Stock
Item Name : Table : List of Extract
Stock Items, All Items, Create Master
Local : Variable : Ledger
Name : Table : OrderLedgerColl,
Any, Create Master
Local : Form :
Order Details : Local : Button :
DSP BasisOfValues : Action : Modify Variables : BOV PO and SO AllOrders
Local : Form :
Order Details : Local : Button : Exceptions :
Action : Change View : Sales Orders Exceptions : Display Action
Local : Form :
Order Details : Local
: Button : Change View :
Add : Action : Change View : Sales Orders CV :
Display Action
Goto
Subtitle : @@LedStockItemSubtitle
HTML
Template File : Order Details Stock Item
Template
HTML Data Source :
SalePosOrderOfCompany, SaleNegOrderOfCompany, Unit, List of ExtractStockItems,
All Items, BrSalesOrderDetailsMethods, Currency
HTML Sys Formulae :
CurLangStkItemName, BrDORDate, BrIsDueOnly, BrIsStkItmInvisible
;; used in Ctrl+J exceptions to show
due only orders
[Report: Sales Orders DueOnly]
Use : Sales Orders
Set : DSPDueOrders : Yes
[Report: Sales Orders Exceptions]
Use : Exceptions Template
Local : Field :
Exceptions Template : Add : Table : Exceptions Orders Reports, Exceptions
Actions
[Report: SO Stock Item]
<unitgroup:orderoutstandings>
Use : Browser Common SysFormulae
Use : PO Stock Item
Set : DSPOrderCombo : @@SOTotal
Title : @@OrderStkItemRepTitle
Delete : Help
Add :
Help : @@HlpSOStockItem_Summary
Print
Set : Report Title : "Stock Item
Outstandings"
PrintSet : Report SubTitle : $$LocaleString:"Sales Order Stock
Item Outstandings"
Local : Form :
Order OutStandings : Local : Button : DSP BasisOfValues : Action :
Modify Variables : BOV PO and SO Outstanding Common
Goto
Subtitle : @@StockItemSubtitle
Delete
: HTML Template
File
Delete : HTML Data Source
Add : HTML Template
File : Order Outstandings Template
Add : HTML Data
Source :
StockItemOutstandings,Unit,List of Extract Stock Items, Currency
HTML
Sys Formulae : CurLangStkItemName
Option : Scale Factor Browser :
$$InMobileBrowserExport
[Report: SO Group]
<unitgroup:orderoutstandings>
Use : OrderOutStandings
Family : $$Translate:"Group
Outstandings"
Title : @@OrderAccGrpRepTitle
Help : @@HlpSOGroup_Summary
Repeat : Group Name, Stock Item Name
Set : IsGrpOrderReport : Yes
Set : DSPOrderCombo : @@SOTotal
Print
Set : Report Title :
$$LocaleString:"Group Outstandings"
PrintSet : Report SubTitle :
$$LocaleString:"Sales Order Group Outstandings"
Print : OrdLedOutstanding Landing
Local : Variable : Group Name :
Delete : Table
Local :
Variable : Group Name : Table
: PO Group, Create Master
Local : Form :
Order OutStandings : Local : Part :
Order ColTitles : +
Local :
Line : Order ColTitles : Local : Line : DSP ItemTitle : Add : Field : Inv AccGrp
Sales Order Summary
Local : Form :
Order OutStandings : Local : Button :
DSP BasisOfValues : Action : Modify Variables : BOV Common Scale Factor
Local : Form :
Order OutStandings : Local :
Button : Change View : Add :
Action : Change View : SO Group CV :
Display Action
Local : Form :
Order OutStandings : Local :
Button : Exceptions : Add :
Action : Change View : Group Reports Exceptions : Display Action
Local : Form :
Order OutStandings : Replace : Button : Exceptions Inactive Button : Exceptions
Local : Form :
Order OutStandings : Local :
Button : Change View : Add :
Action : Change View : Group OrderOutstandings CV: Display Action
Goto
Subtitle : @@GroupNameSubtitle
[Report: SO Ledger]
<unitgroup:orderoutstandings>
Use : Browser Common SysFormulae
Use : OrderOutStandings
Family : $$Translate:"Ledger
Outstandings"
Title : @@OrderLedRepTitle
Help : @@HlpSOLedger_Summary
Set : IsOrderLedWise : Yes
Set : DSPOrderCombo : @@SOTotal
Add : Repeat :
LedgerName, StockItemName
Print
Set : Report Title : $$LocaleString:"Ledger
Outstandings"
PrintSet : Report SubTitle : $$LocaleString:"Sales Order Ledger
Outstandings"
Print : OrdLedOutstanding Landing
Local : Variable : Ledger Name :
Table : PO Ledger, Create Master
Local : Form :
Order OutStandings : Local : Part :
Order ColTitles : +
Local :
Line : Order ColTitles : Local : Line : DSP
ItemTitle : Add : Field :
Inv Ledger Sales Order Summary
Local : Form :
Order OutStandings : Local : Button :
DSP BasisOfValues : Action : Modify Variables : BOV Common Scale Factor
Goto
Subtitle : @@LedgerSubtitle
HTML
Template File : Order Outstandings Template
HTML
Data Source : Order Ledger Outstandings,
SO Ledger Browser, Unit, Currency
HTML
Sys Formulae : CurLangLedgerName
Option : Scale Factor Browser :
$$InMobileBrowserExport
[Report: SO Stock Category]
<unitgroup:orderoutstandings>
Use : OrderOutStandings
Family :
$$Translate:"Stock Category Outstandings"
Set : IsCategoryReport : Yes
Set : DSPOrderCombo : @@SOTotal
Repeat : StockCategoryName
Title : @@OrderStkCatRepTitle
Print
Set : ReportTitle : $$LocaleString:"Stock Category
Outstandings"
Print
Set : Report SubTitle : If @@UseStkCatTitle Then
$$LocaleString:"Sales Order Stock Category Outstandings" Else
""
Local : Form :
Order OutStandings : Local :
Part : Order ColTitle : +
Local :
Line : Order ColTitles : Local :
Line : DSP ItemTitle : Add :
Field : Inv Sales Order Summary
Column
Report: OrderStockCategoryColumn
ColumnVar : DSPOrderCombo
Print : OrdStockCatOutstanding Landing
Help : @@HlpSOStockCat_Summary
Local : Form :
Order OutStandings : Replace : Button :
Explode Default : ItemWiseButton
Local : Button: ItemWiseButton : Title : If NOT ##IsItemWise then $$LocaleString:"Stock
Item-wise" else $$LocaleString:"Stock Category-wise"
Local : Form :
Order OutStandings : Local : Button : DSP BasisOfValues : Action :
Modify Variables : BOV PO and SO Outstanding Common
Local : Form :
Order OutStandings : Add : Button : After : Fourth Blank Button :
Add Column, Alter Column, Delete Column, DSP AutoColumns
Goto
Subtitle : @@StockCategoryNameSubtitle
[Report: All Orders Pending]
Use : Sales Orders
Variable : DSPDueOrders, ShowPurcPos, ShowPurcNeg
Set : DSPDueOrders : No
Set : ShowPurcPos : Yes
Set : ShowPurcNeg : Yes
Goto
Subtitle : @@LedStockItemSubtitle
[Report: SO Group CV]
Use : Group Reports Change View
Local : Collection :
Change View Group Reports : Delete : Object :
ViewTitle
Local : Collection :
Change View Group RelReports : Delete : Object :
CV SO Group
[Report: Sales Orders CV]
Use : Change View Template
Local : Field :
Change View Template : Add : Table :
Change View StkItem Orders, ChangeView Actions
[Report: Stock Item Outstandings CV]
Use : Change View Template
Local : Field :
Change View Template : Add : Table :
Change View Stock Item Outstandings, ChangeView Actions
[Report: Stock Cat Outstandings CV]
Use : Change View Template
Local : Field :
Change View Template : Add : Table :
Change View Stock Cat Outstandings, ChangeView Actions
[Report: Ledger OrderOutstandings CV]
Use : Change View Template
Local : Field :
Change View Template : Add : Table :
Change View Ledger Outstandings, ChangeView Actions
[Report: Group OrderOutstandings CV]
Use : Change View Template
Local : Field :
Change View Template : Add : Table :
Change View Group Outstandings, ChangeView Actions
;; End-of-file