

[System: UDF]
    LastPurchRate : Amount  : 9000
    MarginPct     : Number  : 9001
    MarginAmt     : Amount  : 9002
    UDFSaleRate   : Amount  : 9003

[#Part: STKI Basic Features]
 Add: Part:After:STKI AdvancedOptions:LearnwellItemMargine
[Part:LearnwellItemMargine]
		Line:STKIMargineLogicalLine
[Line:STKIMargineLogicalLine]
		Fields      : Medium Prompt,STKIMarginPct
        Local		: Field	: Medium Prompt	: Set as	: $$LocaleString:"(Learnwells.com)Set Product Margin Percentage:" 

[Field: STKIMarginPct]
    Use      : Number Field
    Storage  : MarginPct



[#Form: Purchase Color]
    On : Form Accept : Yes : Call : FnUpdateStockItemMargin

[Function: FnUpdateStockItemMargin]
    Variable  : VarStkName   : String
    Variable  : VarRate      : Amount

    010 : WALK       : InventoryEntries
    020 : IF          : NOT $$IsEmpty:$StockItemName
    030 : SET          : VarStkName    : $StockItemName
    040 : SET          : VarRate       : $Rate
    080 : NEW OBJECT    : StockItem : ##VarStkName
    090 : SET VALUE     : LastPurchRate : ##VarRate
    130 : ACCEPT ALTER
    140 : ENDIF
    150 : END WALK



[#Line: EI ColumnOne]
    Add :Right Field : Before : VCH QtyTitle : PurchMarginPctEntry,SaleMarginAmtDisp,SalePurchCostDisp, SaleSuggRateDisp
	Local:Field:PurchMarginPctEntry:Info:"Margin %"
	Local:Field:SalePurchCostDisp:Info:"Purch Rate"
	Local:Field:SaleMarginAmtDisp:Info:"Margin Amt"
	Local:Field:SaleSuggRateDisp:Info:"Suggested Sale Rate"
[#Line: EI InvInfo]
    Add : right Field : Before :VCH ActualQty : PurchMarginPctEntry,SaleMarginAmtDisp,SalePurchCostDisp,SaleSuggRateDisp
	Local:Field:PurchMarginPctEntry:Set As:$MarginPct:StockItem:$StockItemName
	Local:Field:SalePurchCostDisp:Set As:$LastPurchRate:StockItem:$StockItemName
	Local:Field:SaleMarginAmtDisp:Set As:(#SalePurchCostDisp*#PurchMarginPctEntry)/100
	Local:Field:SaleSuggRateDisp:Set As:#SalePurchCostDisp+#SaleMarginAmtDisp

	
[Field: PurchMarginPctEntry]
    Use      : Number Field
    Width    : 12
    Skip     : Yes
	Align	:Center
	Style:LWHeight

[Field: SalePurchCostDisp]
    Use      : Amount Field
    Width    : 15
    Skip     : Yes
	Invisible :Not @@IsSales
	Align	:Center
	Style:LWHeight

[Field: SaleMarginAmtDisp]
    Use      : Amount Field
    Width    : 15
    Skip     : Yes
	Invisible : Not @@IsSales
	Align	:Center
	Style:LWHeight

[Field: SaleSuggRateDisp]
    Use      : Amount Field
    Width    : 15
    Skip     : Yes
	Invisible : Not @@IsSales
	Align	:Center
	Background:LWPink
	
[Color:LWPink]
RGB:223, 235, 0
	
[Style:LWHeight]
	Height:12




;;=========================================================================
;; Learnwells.com ..............E2t.in
;;=========================================================================