Please Help for Discount auto insert given preset value

Discussion in 'Free Source Codes' started by udaya, Sep 19, 2021.

    
Tags:
  1. udaya

    udaya Active Member


    [#Field: VCH Discount]

    Use : Number Field
    Width : @@VCHDiscountWidth
    Align : Right
    Set As : 5
    Style : Normal Bold
    Storage : Discount
    Set always : Yes
    Format : "NoZero,Percentage"
     


  2. udaya

    udaya Active Member



  3. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Try
    .. As you can see.. If Quantity is non zero.. then only it will show 5 %

    Code:
    [#Field: VCH Discount]
        Delete    : Set as
        Add        : Set As : If $$InCreateMode then 5 Else $$Value
        Delete    : Set By Condition
    
        Add        :    Set By Condition    : @@HasInvSubAlloc             : $$Value
        Add        :    Set By Condition    : $BilledQty= 0              : 0      
        Add        :    Set By Condition    : @IsBilledQtyEdited        : 5
        Add        :    Set By Condition    : ($$IsFieldEdited OR $$InAlterMode OR NOT $$IsEmpty:$$Value): $$Value
        Add        :    Set By Condition    : Yes                    : 5
      
    
     
    Vashisth likes this.


  4. udaya

    udaya Active Member


    Thanks Lot garima..... its working fine. please Guide me below Code how to get the value Discount set item in Item Group....

    [#Part: STKG Details]
    Add: Line: RdGroupDiscount


    [Line: RdGroupDiscount]
    Fields : Long Prompt, RdGDiscount

    Local : Field : Long Prompt : Info : $$LocaleString:"Applicable Discount % "

    [Field: RdGDiscount]
    Use : Number Field
    Storage : RdGDiscount
    Format:"Nozero,percentage"

    [System:UDF]
    RdGDiscount : Number: 100



    [#Field: VCH BatchDiscount]
    Set as : $RdGDiscount:StockGroup:LocFor
    LocFor :$Parent:StockItem:$StockItemName

    [#Field: VCH Discount]
    Set as : $RdGDiscount:StockGroup:LocFor
    LocFor :$Parent:StockItem:$StockItemName
     


  5. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Replace 5 with $RdGDiscount:StockGroup:LocFor in my code.. and It is @LocFor and not just LocFor

    if it doesn't work add

    [#Object :Group]
    RdGDiscount:$RdGDiscount


    and don't forget to give my post a like if it works for you

    Code:
    
    [#Field: VCH Discount]
    LocFor :$Parent:StockItem:$StockItemName
    Delete : Set as
    Add : Set As : If $$InCreateMode then $RdGDiscount:StockGroup:@LocFor Else $$Value
    Delete : Set By Condition
    
    Add : Set By Condition : @@HasInvSubAlloc : $$Value
    Add : Set By Condition : $BilledQty= 0 : 0
    Add : Set By Condition : @IsBilledQtyEdited : $Parent:StockItem:$StockItem
    Add : Set By Condition : ($$IsFieldEdited OR $$InAlterMode OR NOT $$IsEmpty:$$Value): $$Value
    Add : Set By Condition : Yes : $RdGDiscount:StockGroup:@LocFor
    
    
    
     
    Vashisth and love like this.


  6. udaya

    udaya Active Member


    Dear Garima, Its Show storage err... Not Working... please experts assist me......


    [#Part: STKG Details]
    Add: Line: RdGroupDiscount

    [Line: RdGroupDiscount]
    Fields : Long Prompt, RdGDiscount
    Local : Field : Long Prompt : Info : $$LocaleString:"Applicable Discount % "

    [Field: RdGDiscount]
    Use : Number Field
    Storage : RdGDiscount
    Format:"Nozero,percentage"

    [System:UDF]
    RdGDiscount : Number: 100

    [#Object :Group]
    RdGDiscount:$RdGDiscount

    [#Field: VCH Discount]
    LocFor :$Parent:StockItem:$StockItemName
    Delete : Set as
    Add : Set As : If $$InCreateMode then $RdGDiscount:StockGroup:mad:LocFor Else $$Value
    Delete : Set By Condition

    Add : Set By Condition : @@HasInvSubAlloc : $$Value
    Add : Set By Condition : $BilledQty= 0 : 0
    Add : Set By Condition : @IsBilledQtyEdited : $Parent:StockItem:$StockItem
    Add : Set By Condition : ($$IsFieldEdited OR $$InAlterMode OR NOT $$IsEmpty:$$Value): $$Value
    Add : Set By Condition : Yes : $RdGDiscount:StockGroup:mad:LocFor

    upload_2021-9-20_6-55-12.png
     


  7. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Field Name, UDF Name and "Method Name in Collection" should not be same.. change your udfname..

    Code:
    [#Part: STKG Details]
    Add: Line: RdGroupDiscount
    
    [Line: RdGroupDiscount]
    Fields : Long Prompt, RdGDiscount
    Local : Field : Long Prompt : Info : $$LocaleString:"Applicable Discount % "
    
    [Field: RdGDiscount]
    Use : Number Field
    Storage : uRdGDiscount
    Format:"Nozero,percentage"
    
    [System:UDF]
    uRdGDiscount : Number: 2110 ; Keep it above 999
    
    [#Field: VCH Discount]
    LocFor :$Parent:StockItem:$StockItemName
    Delete : Set as
    Add : Set As : If $$InCreateMode then $uRdGDiscount:StockGroup:@LocFor Else $$Value
    Delete : Set By Condition
    
    Add : Set By Condition : @@HasInvSubAlloc : $$Value
    Add : Set By Condition : $BilledQty= 0 : 0
    Add : Set By Condition : @IsBilledQtyEdited : $Parent:StockItem:$StockItem
    Add : Set By Condition : ($$IsFieldEdited OR $$InAlterMode OR NOT $$IsEmpty:$$Value): $$Value
    Add : Set By Condition : Yes : $uRdGDiscount:StockGroup:@LocFor
     
    Vashisth, love and Rohit Khedar like this.


  8. love

    love Member


    Altered a little to fetch discount from party master


    ;

    ;DISCOUNT RECEIVABLE FROM PARTY
    ;
    ;
    ;
    [#Part: MST LED Details]
    ;[#Part: STKG Details]




    Add: Line: RdGroupDiscount

    [Line: RdGroupDiscount]
    Fields : Long Prompt, RdGDiscount
    Local : Field : Long Prompt : Info : $$LocaleString:" DISCOUNT RECEIABLE: % "
    Local: Field: LONG PROMPT: Color: blue
    Invisible : Not ($$IsBelongsTo:$$GroupSundryCreditors)
    [Field: RdGDiscount]
    Use : Number Field
    Storage : uRdGDiscount
    Format:"Nozero,percentage"

    [System:UDF]
    uRdGDiscount : Number: 2110 ; Keep it above 999

    [#Field: VCH Discount]
    ;LocFor :$trans:ledger:$partyledgername
    Delete : Set as
    Add : Set As : If $$InCreateMode then $uRdGDiscount:ledger:$partyledgername Else $$Value
    Delete : Set By Condition

    Add : Set By Condition : @@HasInvSubAlloc : $$Value
    Add : Set By Condition : $BilledQty= 0 : 0
    ;Add : Set By Condition : @IsBilledQtyEdited : $Parent:StockItem:$StockItem
    Add : Set By Condition : ($$IsFieldEdited OR $$InAlterMode OR NOT $$IsEmpty:$$Value): $$Value
    Add : Set By Condition : Yes : $uRdGDiscount:ledger:$partyledgername
    ;Add: Set By Condition: $$IsVoucherType: "PURCHASE"
     
    Last edited: Sep 20, 2021


  9. udaya

    udaya Active Member


    Dear Garima, . Not Working...

    [#Part: STKG Details]
    Add: Line: RdGroupDiscount

    [Line: RdGroupDiscount]
    Fields : Long Prompt, RdGDiscount
    Local : Field : Long Prompt : Info : $$LocaleString:"Applicable Discount % "

    [Field: RdGDiscount]
    Use : Number Field
    Storage : uRdGDiscount
    Format:"Nozero,percentage"

    [System:UDF]
    uRdGDiscount : Number: 2110 ; Keep it above 999

    [#Field: VCH Discount]
    LocFor :$Parent:StockItem:$StockItemName
    Delete : Set as
    Add : Set As : If $$InCreateMode then $uRdGDiscount:StockGroup:mad:LocFor Else $$Value
    Delete : Set By Condition

    Add : Set By Condition : @@HasInvSubAlloc : $$Value
    Add : Set By Condition : $BilledQty= 0 : 0
    Add : Set By Condition : @IsBilledQtyEdited : $Parent:StockItem:$StockItem
    Add : Set By Condition : ($$IsFieldEdited OR $$InAlterMode OR NOT $$IsEmpty:$$Value): $$Value
    Add : Set By Condition : Yes : $uRdGDiscount:StockGroup:mad:LocFor
     


  10. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Sorry.. Nothing can be done..
     


Share This Page