Item Master value margin.. pls help with code

Discussion in 'Requests' started by dinesh2005, Mar 24, 2022.

    
  1. dinesh2005

    dinesh2005 New Member


    I AM TRYING TO CREATE
    VALUE MARGIN OF ITEM + LAST STANDARD SELLING PRICE = AUTO INVOICE ITEM RATE

    EAXMPLE :- VALUE MAGIN 50 + LAST STD PRICE 150 = AUTO INVOICE ITEM RATE 200
    please guide me with codes


    [#Part: STKI UNITS]
    Add : Lines : After : STKI Conversion : STKI ValueMargin
    [Line : STKI ValueMargin]
    Fields : Medium Prompt, STKI ValueMargin
    Local : Field : MEdium Prompt : Info : $$LocaleString:"Value Margin"
    [Field : STKI ValueMargin]
    Use : Number Field
    Set as : $StkMarginValue
    Storage : StkMarginValue
    width : 10
    Max : 15



    [#Field: VCH NrmlRate]
    Option : VCH NrmlRateSal : @@IsSales
    [!Field : VCH NrmlRateSal]
    Set as : If NOT $$IsEmpty:$VchMargin then $$AsRate:$SalrateFinal else If #VCHBilledQty = 0 OR #VCHBilledQty != 0 then @Setval else @Setval
    Set always : Yes
     

    Attached Files:



  2. gangstar

    gangstar Member


    [#Part: STKI UNITS]
    Add : Lines : After : STKI Conversion : STKI ValueMargin
    [Line : STKI ValueMargin]
    Fields : Medium Prompt, STKI ValueMargin
    Local : Field : MEdium Prompt : Info : $$LocaleString:"Value Margin"
    [Field : STKI ValueMargin]
    Use : number Field
    Storage : StkMarginValue
    width : 10
    Max : 15
    [System:UDF]
    StkMarginValue:number:1458
    [#Field:VCH Rate]
    Option:MarginRateF:mad:@IsSales

    [!Field:MarginRateF]
    Add:Set By Condition:NOT ($$IsEmpty:$$Owner:mad:@MarginStk):($$Owner:mad:@MarginStk)
    Set Always:Yes

    [System:Formula]
    MarginStk:$StkMarginValue:StockItem:$StockItemName + @@StdVchRate
     


  3. dinesh2005

    dinesh2005 New Member






    pls tell this simly codes
     



  4. What u exactly wants to achive. Can u elaborate..With example pls
     


  5. dinesh2005

    dinesh2005 New Member



    STD SELLING PRICE BASED ON EFFECTING DATE

    [Field : Vch LastPurRate]
    Use : Rate Price Field
    set as : $StandardPrice:StockItem:$StockItemName
    Storage : StkLastPurRate
    Set Always : Yes
    Type : RAte : Forced
    Width : 10
    Max : 10


    ITS TAKING ONLY ONE STANDARD SELLING PRICE BUT NOT EFFECT DATE WISE SELLING PRICE

    below i have shared screen shot
     

    Attached Files:



  6. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    [Collection : LastStdRatePrice]
    Type : StandardPriceList : Stock Item
    Childof : $StockItemName

    [System: Formula]
    LastSalePrice : $$FilterValue:$Rate:LastStdRatePrice:Last:LastDate
    LastDate : $Date <= $$ReqObject:$Date

    In your Field ----------
    Set As : @@LastSalePrice
     


  7. dinesh2005

    dinesh2005 New Member


    Thankyou sir .. for reply

    [Field : Vch LastPurRate]
    Use : Rate Price Field
    set as : @@LastSalePrice
    Storage : StkLastPurRate
    Set Always : Yes
    Type : RAte : Forced
    Width : 10
    Max : 10
    Invisible : yes

    [Collection : LastStdRatePrice]
    Type : StandardPriceList : Stock Item
    Childof : $StockItemName

    [System: Formula]
    LastSalePrice : $$FilterValue:$Rate:LastStdRatePrice:Last:LastDate
    LastDate : $Date <= $$ReqObject:$Date



    but its not working
     


  8. dinesh2005

    dinesh2005 New Member



    SIR.. I AM TRYING TO CREATE
    STD SELLING PRICE DATE MENTIONED WISE + VALUE MARGIN * CUSTOMER GRP % = SELLING RATE AUTO IN INVOICE

    EXAMPLE : STD SELLING PRICE + VALUE MARGIN MANUALLY GIVEN IN ITEM MASTER X GRP MARGIN % = SELLING RATE
    1-4-21 900 . + 200 . X 10% . = 1320
    16-6-21 750
    5-8-21 800
    8-12-21 1000

    ONLY PROBLEM IS .. IT IS NOT TAKING DATE MENTIONED WISE RATE OF STD SELLING PRICE AND NOT STORING DATA

    if am using this code set as : $(Stockitem,$Stockitemname).StandardpriceList[-1].Rate
    then its taking last std selling price but not according date wise price
     
    Last edited: Mar 27, 2022



  9. Which date rate u want ?

    If suppose voucher date is today's date.
    And this date is not available in your item master then what to do?
    If found and if not found.

    U r on right track. U can use collectionfieldbykey function to set the value.

    Filter less than voucher date last row will contain your value.

    Now theoretically its done.
     


  10. dinesh2005

    dinesh2005 New Member


    Thank you for reply....

    If found then it will take according to date mention ...

    If not found then it will take latest or last dated mentioned rate .....
     



  11. I think u got the solution.

    Requesting admin to transfer this thread to REQUEST.
     


  12. dinesh2005

    dinesh2005 New Member


    not yet

    look for the solution yet,,, based on the date price rate should apply

    exmaple

    item master date 1-4-21 rate 250 ,,,, then it should take rate from 1-4-21 there after as 250 .... if rate change from 1-6-21 as 300 then it should take 300 after 1-6-21 but previous rate should be 250 from 1-4-21 till 31-5-21 ...
     



  13. [#Object:StockItem] ;;Object Level Alter to add method
    LastStdCPrice : $$FilterValue:$Rate:StandardPriceList:(-1):LessThanToday

    [System: Formula]
    LessThanToday : $Date <= ##SVCurrentDate ;;;;;#PlanVCHDate

    [Collection:TDD]
    Type : StockItem
    Fetch : Name, LastStdCPrice

    ;;select $Name,$LastStdCPrice from TDD ;;;;;;query to check

    Above code is working fine (Tested).
    Now You can use Whereever You want. I have compared with svcurrentdate. Means On gateway of Tally, afetr pressing F2 we are setting the date.

    [Field:Sample Fld]
    Use : Rate Price Field
    Set As : $LastStdCPrice:StockItem:$StockItemName ;; While in voucher context.

    still You have any query pls feel free to write.

    I feel that here we are sharing our achivements here in this thread. And not requesting any help.
    Anyway Thank you...
     


Share This Page